diff --git a/dist/index.js b/dist/index.js index b74fba0..b5595e5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -609,9 +609,42 @@ var Application = class { } }; +// src/functions/createClientCall.ts +var import_axios2 = __toESM(require("axios")); +async function ClientAPICall(options) { + const url = `${options.panel}/api/client/${options.endpoint}`; + const headers = { + "Accept": "application/json", + "Content-Type": "application/json", + "Authorization": `Bearer ${options.apiKey}` + }; + try { + if (["POST", "PUT", "PATCH"].includes(options.method)) { + const response = await (0, import_axios2.default)({ + method: options.method, + url, + headers, + data: options.body ? JSON.stringify(options.body) : void 0 + }); + return response.data; + } else { + const response = await fetch(url, { + method: options.method, + headers + }); + if (!response.ok) { + throw new Error(`API call failed with status ${response.status}: ${await response.text()}`); + } + return await response.json(); + } + } catch (error) { + throw new Error(`Error in API call: ${error instanceof Error ? error.message : String(error)}`); + } +} + // src/class/source/client/account/accountDetails.ts async function accountDetails(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -621,7 +654,7 @@ async function accountDetails(options) { // src/class/source/client/account/2faEnable.ts async function twoFactorEnable(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -632,7 +665,7 @@ async function twoFactorEnable(options) { // src/class/source/client/account/2faDisable.ts async function twoFactorDisable(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "DELETE", @@ -643,7 +676,7 @@ async function twoFactorDisable(options) { // src/class/source/client/account/updateEmail.ts async function updateEmail(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", @@ -657,7 +690,7 @@ async function updateEmail(options) { // src/class/source/client/account/updatePassword.ts async function updatePassword(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", @@ -671,7 +704,7 @@ async function updatePassword(options) { // src/class/source/client/account/createApiKey.ts async function createApiKey(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -685,7 +718,7 @@ async function createApiKey(options) { // src/class/source/client/account/deleteApiKey.ts async function deleteApiKey(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "DELETE", @@ -695,7 +728,7 @@ async function deleteApiKey(options) { // src/class/source/client/account/listApiKeys.ts async function listApiKeys(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -715,7 +748,7 @@ async function listServers2(options) { // src/class/source/client/showPermissions.ts async function showPermissions(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -802,7 +835,7 @@ async function serverDetails2(options) { // src/class/source/client/servers/backups/listBackups.ts async function listBackups(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -812,7 +845,7 @@ async function listBackups(options) { // src/class/source/client/servers/backups/backupDetails.ts async function backupDetails(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -822,7 +855,7 @@ async function backupDetails(options) { // src/class/source/client/servers/backups/createBackup.ts async function createBackup(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -833,7 +866,7 @@ async function createBackup(options) { // src/class/source/client/servers/backups/deleteBackup.ts async function deleteBackup(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "DELETE", @@ -843,7 +876,7 @@ async function deleteBackup(options) { // src/class/source/client/servers/backups/downloadBackup.ts async function downloadBackup(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -853,7 +886,7 @@ async function downloadBackup(options) { // src/class/source/client/servers/files/listFiles.ts async function listFiles(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -863,7 +896,7 @@ async function listFiles(options) { // src/class/source/client/servers/files/getFileContent.ts async function getFileContent(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -873,7 +906,7 @@ async function getFileContent(options) { // src/class/source/client/servers/files/downloadFile.ts async function downloadFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -883,7 +916,7 @@ async function downloadFile(options) { // src/class/source/client/servers/files/renameFile.ts async function renameFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", @@ -894,7 +927,7 @@ async function renameFile(options) { // src/class/source/client/servers/files/copyFile.ts async function copyFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -905,21 +938,18 @@ async function copyFile(options) { // src/class/source/client/servers/files/writeFile.ts async function writeFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", - endpoint: `servers/${options.server_id}/files/write`, - body: JSON.stringify({ - file: options.file_path, - contents: options.content - }) + endpoint: `servers/${options.server_id}/files/write?file=${options.file_path}`, + body: options.content }); } // src/class/source/client/servers/files/compressFile.ts async function compressFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -930,7 +960,7 @@ async function compressFile(options) { // src/class/source/client/servers/files/decompressFile.ts async function decompressFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -941,7 +971,7 @@ async function decompressFile(options) { // src/class/source/client/servers/files/deleteFile.ts async function deleteFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -952,7 +982,7 @@ async function deleteFile(options) { // src/class/source/client/servers/files/createFolder.ts async function createFolder(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -962,9 +992,9 @@ async function createFolder(options) { } // src/class/source/client/servers/files/uploadFile.ts -var import_axios2 = __toESM(require("axios")); +var import_axios3 = __toESM(require("axios")); async function uploadFile(options) { - const response = await import_axios2.default.post( + const response = await import_axios3.default.post( `${options.panel}/api/client/servers/${options.server_id}/files/upload`, options.file_data, { @@ -979,7 +1009,7 @@ async function uploadFile(options) { // src/class/source/client/servers/network/listAllocations.ts async function listAllocations2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -989,7 +1019,7 @@ async function listAllocations2(options) { // src/class/source/client/servers/network/assignAllocations.ts async function assignAllocations(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -1000,7 +1030,7 @@ async function assignAllocations(options) { // src/class/source/client/servers/network/setAllocationNote.ts async function setAllocationNote(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", @@ -1011,7 +1041,7 @@ async function setAllocationNote(options) { // src/class/source/client/servers/network/setPrimaryAllocation.ts async function setPrimaryAllocation(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -1021,7 +1051,7 @@ async function setPrimaryAllocation(options) { // src/class/source/client/servers/network/unassignAllocation.ts async function unassignAllocation(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "DELETE", @@ -1158,7 +1188,7 @@ async function deleteTask(options) { // src/class/source/client/servers/settings/renameServer.ts async function renameServer(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PATCH", @@ -1169,7 +1199,7 @@ async function renameServer(options) { // src/class/source/client/servers/settings/reinstallServer.ts async function reinstallServer2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -1179,7 +1209,7 @@ async function reinstallServer2(options) { // src/class/source/client/servers/startup/listVariables.ts async function listVariables(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -1189,7 +1219,7 @@ async function listVariables(options) { // src/class/source/client/servers/startup/updateVariable.ts async function updateVariable(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", @@ -1200,7 +1230,7 @@ async function updateVariable(options) { // src/class/source/client/servers/users/listUsers.ts async function listUsers2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -1210,7 +1240,7 @@ async function listUsers2(options) { // src/class/source/client/servers/users/createUser.ts async function createUser2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -1225,7 +1255,7 @@ async function createUser2(options) { // src/class/source/client/servers/users/updateUser.ts async function updateUser2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", @@ -1236,7 +1266,7 @@ async function updateUser2(options) { // src/class/source/client/servers/users/deleteUser.ts async function deleteUser2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "DELETE", @@ -1246,7 +1276,7 @@ async function deleteUser2(options) { // src/class/source/client/servers/users/userDetails.ts async function userDetails2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", diff --git a/dist/index.js.map b/dist/index.js.map index 4b3a929..01b83a6 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/index.ts","../src/class/main/Setup.ts","../src/functions/createAppCall.ts","../src/class/source/app/users/listUsers.ts","../src/class/source/app/users/userDetails.ts","../src/class/source/app/users/userDetails_externalId.ts","../src/class/source/app/users/createUser.ts","../src/class/source/app/users/updateUser.ts","../src/class/source/app/users/deleteUser.ts","../src/class/source/app/nodes/listNodes.ts","../src/class/source/app/nodes/nodeDetails.ts","../src/class/source/app/nodes/nodeConfiguration.ts","../src/class/source/app/nodes/createNode.ts","../src/class/source/app/nodes/updateNode.ts","../src/class/source/app/nodes/deleteNode.ts","../src/class/source/app/locations/listLocations.ts","../src/class/source/app/locations/locationDetails.ts","../src/class/source/app/locations/createLocation.ts","../src/class/source/app/locations/updateLocation.ts","../src/class/source/app/locations/deleteLocation.ts","../src/class/source/app/servers/listServers.ts","../src/class/source/app/servers/serverDetails.ts","../src/class/source/app/servers/serverDetails_externalId.ts","../src/class/source/app/servers/updateDetails.ts","../src/class/source/app/servers/updateServerBuild.ts","../src/class/source/app/servers/updateServerStartup.ts","../src/class/source/app/servers/createServer.ts","../src/class/source/app/servers/suspendServer.ts","../src/class/source/app/servers/unsuspendServer.ts","../src/class/source/app/servers/reinstallServer.ts","../src/class/source/app/servers/deleteServer.ts","../src/class/source/app/servers/forceDeleteServer.ts","../src/class/source/app/servers/databases/listDatabases.ts","../src/class/source/app/servers/databases/databaseDetails.ts","../src/class/source/app/servers/databases/createDatabase.ts","../src/class/source/app/servers/databases/resetDatabasePassword.ts","../src/class/source/app/servers/databases/deleteDatabase.ts","../src/class/source/app/nests/eggs/listEggs.ts","../src/class/source/app/nests/eggs/eggDetails.ts","../src/class/source/app/nests/listNests.ts","../src/class/source/app/nests/nestDetails.ts","../src/class/source/app/nodes/allocations/listAllocations.ts","../src/class/source/app/nodes/allocations/createAllocations.ts","../src/class/source/app/nodes/allocations/deleteAllocation.ts","../src/class/main/Application.ts","../src/class/source/client/account/accountDetails.ts","../src/class/source/client/account/2faEnable.ts","../src/class/source/client/account/2faDisable.ts","../src/class/source/client/account/updateEmail.ts","../src/class/source/client/account/updatePassword.ts","../src/class/source/client/account/createApiKey.ts","../src/class/source/client/account/deleteApiKey.ts","../src/class/source/client/account/listApiKeys.ts","../src/class/source/client/listServers.ts","../src/class/source/client/showPermissions.ts","../src/class/source/client/servers/command.ts","../src/class/source/client/servers/power.ts","../src/class/source/client/servers/consoleDetails.ts","../src/class/source/client/servers/resources.ts","../src/class/source/client/servers/serverDetails.ts","../src/class/source/client/servers/backups/listBackups.ts","../src/class/source/client/servers/backups/backupDetails.ts","../src/class/source/client/servers/backups/createBackup.ts","../src/class/source/client/servers/backups/deleteBackup.ts","../src/class/source/client/servers/backups/downloadBackup.ts","../src/class/source/client/servers/files/listFiles.ts","../src/class/source/client/servers/files/getFileContent.ts","../src/class/source/client/servers/files/downloadFile.ts","../src/class/source/client/servers/files/renameFile.ts","../src/class/source/client/servers/files/copyFile.ts","../src/class/source/client/servers/files/writeFile.ts","../src/class/source/client/servers/files/compressFile.ts","../src/class/source/client/servers/files/decompressFile.ts","../src/class/source/client/servers/files/deleteFile.ts","../src/class/source/client/servers/files/createFolder.ts","../src/class/source/client/servers/files/uploadFile.ts","../src/class/source/client/servers/network/listAllocations.ts","../src/class/source/client/servers/network/assignAllocations.ts","../src/class/source/client/servers/network/setAllocationNote.ts","../src/class/source/client/servers/network/setPrimaryAllocation.ts","../src/class/source/client/servers/network/unassignAllocation.ts","../src/class/source/client/servers/schedules/listSchedules.ts","../src/class/source/client/servers/schedules/createSchedule.ts","../src/class/source/client/servers/schedules/scheduleDetails.ts","../src/class/source/client/servers/schedules/updateSchedule.ts","../src/class/source/client/servers/schedules/deleteSchedule.ts","../src/class/source/client/servers/schedules/createTask.ts","../src/class/source/client/servers/schedules/updateTask.ts","../src/class/source/client/servers/schedules/deleteTask.ts","../src/class/source/client/servers/settings/renameServer.ts","../src/class/source/client/servers/settings/reinstallServer.ts","../src/class/source/client/servers/startup/listVariables.ts","../src/class/source/client/servers/startup/updateVariable.ts","../src/class/source/client/servers/users/listUsers.ts","../src/class/source/client/servers/users/createUser.ts","../src/class/source/client/servers/users/updateUser.ts","../src/class/source/client/servers/users/deleteUser.ts","../src/class/source/client/servers/users/userDetails.ts","../src/class/main/Client.ts","../src/class/main/WSConnection.ts"],"sourcesContent":["import Application from \"./class/main/Application\";\nimport Client from \"./class/main/Client\";\nimport Setup from \"./class/main/Setup\";\nimport AdvancedWebSocket from \"./class/main/WSConnection\";\n\nexport default {\n Application,\n Client,\n Setup,\n WebSocket: AdvancedWebSocket,\n};","/**\n * The Setup class provides a way to configure global settings for the Pterodactyl API Wrapper.\n * The primary use is to set the panel URL, which is then used in all API requests.\n *\n * @example\n * Setup.setPanel(\"https://panel.example.com\");\n * const panelUrl = Setup.getPanel();\n */\nexport default class Setup {\n private static panelUrl: string;\n\n /**\n * Sets the global panel URL.\n * @param url - The URL of the Pterodactyl panel.\n */\n public static setPanel(url: string): void {\n this.panelUrl = url;\n }\n\n /**\n * Gets the globally set panel URL.\n * @returns The panel URL.\n * @throws If the panel URL has not been set.\n */\n public static getPanel(): string {\n if (!this.panelUrl) {\n throw new Error(\"Panel URL is not set. Use Setup.setPanel(url) before making API calls.\");\n }\n return this.panelUrl;\n }\n}\n","import axios from \"axios\";\n\n/**\n * Creates an API Call to the Application API of your Pterodactyl panel.\n *\n * @param {Object} options - API call options.\n * @param {string} options.panel - Your panel's URL.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.endpoint - The API endpoint to call.\n * @param {\"GET\" | \"DELETE\" | \"POST\" | \"PATCH\" | \"PUT\"} options.method - HTTP method.\n * @param {any} [options.body] - Request body (for POST and PATCH requests).\n * @returns {Promise} - The data fetched from the API.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const data = await ApplicationAPICall({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * endpoint: \"users\",\n * method: \"GET\"\n * });\n * console.log(\"API Response:\", data);\n * } catch (error) {\n * console.error(\"Error:\", error);\n * }\n * })();\n */\nexport default async function ApplicationAPICall(options: {\n panel: string;\n apiKey: string;\n endpoint: string;\n method: \"GET\" | \"DELETE\" | \"POST\" | \"PATCH\" | \"PUT\";\n body?: any;\n}): Promise {\n const url = `${options.panel}/api/application/${options.endpoint}`;\n const headers = {\n 'Accept': \"application/json\",\n 'Content-Type': \"application/json\",\n 'Authorization': `Bearer ${options.apiKey}`\n };\n\n let body: string | undefined = undefined;\n\n if (options.body && options.method !== \"GET\" && options.method !== \"DELETE\") {\n body = typeof options.body === \"string\" ? options.body : JSON.stringify(options.body);\n }\n\n try {\n if (options.method === \"PATCH\") {\n const response = await axios.patch(url, options.body, { headers });\n return response.data;\n } else {\n const response = await fetch(url, {\n method: options.method,\n headers,\n body\n });\n\n if (!response.ok) {\n throw new Error(`API call failed with status ${response.status}: ${await response.text()}`);\n }\n\n return await response.json();\n }\n } catch (error) {\n throw new Error(`Error in API call: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: boolean,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_page: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of users from the Pterodactyl panel API, with optional filters and sorting.\n * This function makes a `GET` request and includes the request body if required.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {boolean} [options.showLinkedServers=false] - Whether to include linked servers in the response.\n * @param {Object} [options.filters] - Filters to apply when retrieving users.\n * @param {string} [options.filters.email] - Filter users by their email address.\n * @param {string} [options.filters.uuid] - Filter users by their UUID.\n * @param {string} [options.filters.username] - Filter users by their username.\n * @param {string} [options.filters.external_id] - Filter users by their external ID.\n * @param {Object} [options.sortBy] - Sorting preferences for the response.\n * @param {boolean} [options.sortBy.id=false] - Sort users by ID.\n * @param {boolean} [options.sortBy.uuid=false] - Sort users by UUID.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\n\nexport default async function listUsers(options: { \n apiKey: string, \n panel: string, \n showLinkedServers?: boolean, \n filters?: { \n email?: string, \n uuid?: string, \n username?: string, \n external_id?: string\n },\n sortBy?: {\n id?: boolean,\n uuid?: boolean\n }\n}): Promise {\n const body = {\n servers: options.showLinkedServers ?? false,\n filters: {\n email: options.filters?.email ?? null,\n uuid: options.filters?.uuid ?? null,\n username: options.filters?.username ?? null,\n external_id: options.filters?.external_id ?? null\n },\n sortBy: {\n id: options.sortBy?.id ?? false,\n uuid: options.sortBy?.uuid ?? false\n }\n };\n\n return ApplicationAPICall({\n panel: options.panel,\n apiKey: options.apiKey,\n endpoint: \"users\",\n method: \"GET\",\n body: JSON.stringify(body) \n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves details of a specific user from the Pterodactyl panel API.\n * Optionally, it can include the list of servers associated with the user.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.user_id - The unique ID of the user to retrieve.\n * @param {boolean} [options.listServers=false] - Whether to include the user's linked servers in the response.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function userDetails(options: { \n apiKey: string, \n panel: string, \n user_id: string, \n listServers?: boolean \n}): Promise {\n return ApplicationAPICall({\n panel: options.panel,\n apiKey: options.apiKey,\n endpoint: `user/${options.user_id}`,\n method: \"GET\",\n body: JSON.stringify({ servers: options.listServers ?? false }) // Ensuring body is a string\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves user details from the Pterodactyl panel API using an external identifier.\n * Optionally, it can include the list of servers associated with the user.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.external_id - The external identifier of the user to retrieve.\n * @param {boolean} [options.listServers=false] - Whether to include the user's linked servers in the response.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const userData = await userDetailsByExternalIdentifier({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * external_id: \"external-user-1234\",\n * listServers: true\n * });\n * console.log(\"User Details:\", userData);\n * } catch (error) {\n * console.error(\"Error:\", error);\n * }\n * })();\n */\nexport default async function userDetailsByExternalIdentifier(options: { \n apiKey: string, \n panel: string, \n external_id: string, \n listServers?: boolean \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `users/external/${options.external_id}`,\n body: JSON.stringify({ servers: options.listServers ?? false }) // Ensuring body is a JSON string\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Creates a new user in the Pterodactyl panel using the provided user details.\n * If `first_name` or `last_name` are not provided, they default to `\"Pterodactyl\"` and `\"User\"`, respectively.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.user_details - The details of the user to be created.\n * @param {string} options.user_details.email - The email address of the user.\n * @param {string} options.user_details.username - The username of the user.\n * @param {string} [options.user_details.first_name=\"Pterodactyl\"] - The first name of the user (optional).\n * @param {string} [options.user_details.last_name=\"User\"] - The last name of the user (optional).\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const newUser = await createUser({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * user_details: {\n * email: \"newuser@example.com\",\n * username: \"newUser123\",\n * first_name: \"John\",\n * last_name: \"Doe\"\n * }\n * });\n * console.log(\"User Created:\", newUser);\n * } catch (error) {\n * console.error(\"Error creating user:\", error);\n * }\n * })();\n */\nexport default async function createUser(options: {\n apiKey: string;\n panel: string;\n user_details: {\n email: string;\n username: string;\n first_name?: string;\n last_name?: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"users\",\n body: JSON.stringify({\n email: options.user_details.email,\n username: options.user_details.username,\n first_name: options.user_details.first_name ?? \"Pterodactyl\",\n last_name: options.user_details.last_name ?? \"User\"\n }) \n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Updates a user's details on the Pterodactyl panel.\n * You can update the user's email, username, first name, last name, language, or password.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.user_id - The ID of the user to update.\n * @param {Object} options.data - The data to update for the user.\n * @param {string} [options.data.email] - The new email of the user (optional).\n * @param {string} [options.data.username] - The new username of the user (optional).\n * @param {string} [options.data.first_name] - The new first name of the user (optional).\n * @param {string} [options.data.last_name] - The new last name of the user (optional).\n * @param {string} [options.data.language] - The new language preference for the user (optional).\n * @param {string} [options.data.password] - The new password for the user (optional).\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const updatedUser = await updateUser({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * user_id: 1234,\n * data: {\n * email: \"newemail@example.com\",\n * username: \"UpdatedUsername\",\n * first_name: \"John\",\n * last_name: \"Doe\"\n * }\n * });\n * console.log(\"User Updated:\", updatedUser);\n * } catch (error) {\n * console.error(\"Error updating user:\", error);\n * }\n * })();\n */\nexport default async function updateUser(options: {\n apiKey: string;\n panel: string;\n user_id: number;\n data: {\n email?: string;\n username?: string;\n first_name?: string;\n last_name?: string;\n language?: string;\n password?: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n endpoint: `users/${options.user_id}`, // Fixed endpoint (removed extra \"/\")\n method: \"PATCH\",\n body: JSON.stringify(options.data) // Ensured the body is stringified\n });\n}","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a user from the Pterodactyl panel using the given identifier.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.identifier - The unique identifier (ID) of the user to be deleted.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const response = await deleteUser({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * identifier: 1234\n * });\n * console.log(\"User Deleted:\", response);\n * } catch (error) {\n * console.error(\"Error deleting user:\", error);\n * }\n * })();\n */\nexport default async function deleteUser(options: { \n apiKey: string; \n panel: string; \n identifier: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `users/${options.identifier}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean,\n name: string,\n description: string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: string,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_sftp: number,\n daemon_base: string,\n created_at: string,\n updated_at: string\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of all nodes on the Pterodactyl panel.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing all nodes.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listNodes(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"nodes\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean,\n name: string,\n description: string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: boolean,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_base: string,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves details of a specific node.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node whose details are requested.\n * @returns {Promise} - API response containing node details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function nodeDetails(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nodes/${options.node_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n debug: boolean,\n uuid: string,\n token_id: string,\n token: string,\n api: {\n host: string,\n ssl: {\n enabled: boolean,\n cert: string,\n key: string\n },\n upload_limit: string,\n },\n system: {\n data: string,\n sftp: {\n bind_port: number\n }\n },\n remote: string\n}\n\n/**\n * Retrieves the configuration settings of a specific node.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node whose configuration is requested.\n * @returns {Promise} - API response containing the node configuration.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function nodeConfiguration(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nodes/${options.node_id}/configuration`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean,\n name: string,\n description: null | string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: boolean,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_sftp: number,\n daemon_base: string,\n created_at: string,\n updated_at: string,\n allocated_resources: {\n memory: number,\n disk: number\n }\n },\n meta: {\n resource: string\n }\n}\n\n/**\n * Creates a new node on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.node_data - Node details for creation.\n * @param {string} options.node_data.name - The name of the node.\n * @param {string} [options.node_data.description] - Optional description of the node.\n * @param {number} options.node_data.location_id - The ID of the location where the node should be created.\n * @param {string} options.node_data.fqdn - The fully qualified domain name of the node.\n * @param {\"http\" | \"https\"} options.node_data.scheme - The scheme (HTTP or HTTPS) for the node.\n * @param {number} options.node_data.memory - The amount of memory allocated to the node (in MB).\n * @param {number} options.node_data.disk - The amount of disk space allocated to the node (in MB).\n * @param {number[]} [options.node_data.ports] - Optional list of ports assigned to the node.\n * @param {number} options.node_data.daemon_sftp - The SFTP port of the node.\n * @param {number} options.node_data.daemon_listen - The daemon listen port of the node.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createNode(options: { \n apiKey: string; \n panel: string; \n node_data: {\n name: string;\n description?: string;\n location_id: number;\n fqdn: string;\n scheme: \"http\" | \"https\";\n memory: number;\n disk: number;\n ports?: number[];\n daemon_sftp: number;\n daemon_listen: number;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"nodes\",\n body: JSON.stringify(options.node_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean, \n name: string,\n description: string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: boolean,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_sftp: number,\n daemon_base: string,\n created_at: string,\n updated_at: string,\n mounts: [],\n allocated_resources: {\n memory: number,\n disk: number\n }\n }\n}\n\n/**\n * Updates an existing node with new settings.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node to update.\n * @param {Object} options.update_data - The new data for the node update.\n * @param {string} [options.update_data.name] - The new name for the node (optional).\n * @param {string} [options.update_data.description] - The new description for the node (optional).\n * @param {number} [options.update_data.location_id] - The new location ID for the node (optional).\n * @param {number} [options.update_data.memory] - The new memory allocation for the node (optional, in MB).\n * @param {number} [options.update_data.disk] - The new disk allocation for the node (optional, in MB).\n * @param {number} [options.update_data.daemon_sftp] - The new SFTP port for the node (optional).\n * @param {number} [options.update_data.daemon_listen] - The new daemon listen port for the node (optional).\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateNode(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n update_data: {\n name?: string;\n description?: string;\n location_id?: number;\n memory?: number;\n disk?: number;\n daemon_sftp?: number;\n daemon_listen?: number;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `nodes/${options.node_id}`,\n body: JSON.stringify(options.update_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a node from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node to delete.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteNode(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `nodes/${options.node_id}`\n });\n}","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: {\n object: string;\n attributes: {\n id: number;\n short: string;\n long: string;\n updated_at: string;\n created_at: string;\n };\n }[];\n meta: {\n pagination: {\n total: number;\n count: number;\n per_page: number;\n current_page: number;\n total_pages: number;\n links: object;\n };\n };\n }\n \n\n/**\n * Retrieves a list of all locations from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing all locations.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listLocations(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"locations\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n short: string,\n long: string,\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Retrieves details of a specific location from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.location_id - The ID of the location to retrieve.\n * @returns {Promise} - API response containing location details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function locationDetails(options: { \n apiKey: string; \n panel: string; \n location_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `locations/${options.location_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n short: string,\n long: string,\n updates_at: string,\n created_at: string\n },\n meta: {\n resource: string\n }\n}\n\n/**\n * Creates a new location on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.location_data - The data required to create a new location.\n * @param {string} options.location_data.short - A short identifier for the location (e.g., \"us-east\").\n * @param {string} options.location_data.long - A long description of the location (e.g., \"US East Coast Datacenter\").\n * @returns {Promise} - API response containing the created location details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createLocation(options: { \n apiKey: string; \n panel: string; \n location_data: {\n short: string;\n long: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"locations\",\n body: JSON.stringify(options.location_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n short: string,\n long: string,\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Updates an existing location on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.location_id - The ID of the location to update.\n * @param {Object} options.update_data - The new data for updating the location.\n * @param {string} [options.update_data.short] - The new short identifier for the location (optional).\n * @param {string} [options.update_data.long] - The new long description of the location (optional).\n * @returns {Promise} - API response confirming the update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateLocation(options: { \n apiKey: string; \n panel: string; \n location_id: number; \n update_data: {\n short?: string;\n long?: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `locations/${options.location_id}`,\n body: JSON.stringify(options.update_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a location from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.location_id - The ID of the location to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteLocation(options: { \n apiKey: string; \n panel: string; \n location_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `locations/${options.location_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[]\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n pack: any,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: object\n },\n updated_at: string,\n created_at: string,\n relationship: {\n databases: {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number, \n database: string,\n username: string,\n remote: string,\n max_connections: number,\n created_at: string,\n updated_at: string\n }\n }[]\n }[]\n }\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of all servers from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing the list of servers.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listServers(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"servers\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[]\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n pack: boolean,\n container: {\n startup_commands: string,\n image: string,\n installed: boolean,\n environment: object\n }\n updated_at: number,\n created_at: number\n }\n}\n\n/**\n * Retrieves details of a specific server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing server details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function serverDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[]\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n pack: boolean,\n container: {\n startup_commands: string,\n image: string,\n installed: boolean,\n environment: object\n }\n updated_at: number,\n created_at: number\n }\n}\n\n/**\n * Retrieves details of a specific server using an external identifier.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.external_id - The external identifier of the server.\n * @returns {Promise} - API response containing server details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function serverDetailsExternalIdentifier(options: { \n apiKey: string; \n panel: string; \n external_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/external/${options.external_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n descriptions: string,\n suspendes: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: number[] | null\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: [],\n },\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Updates details of a specific server (name or description).\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} options.update_data - The new server details.\n * @returns {Promise} - API response confirming the update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n update_data: any;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/details`,\n body: JSON.stringify(options.update_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n descriptions: string,\n suspendes: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: number[] | null\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: [],\n },\n updated_at: string,\n created_at: string\n }\n}\n\n\n/**\n * Updates the build configuration of a server, including CPU, memory, disk, and other limits.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} options.build_data - The new build configuration.\n * @param {number} [options.build_data.cpu] - The CPU limit (in percentage, 100% = 1 core).\n * @param {number} [options.build_data.memory] - The memory limit (in MB).\n * @param {number} [options.build_data.disk] - The disk space limit (in MB).\n * @param {number} [options.build_data.swap] - The swap memory limit (in MB).\n * @param {number} [options.build_data.io] - The block I/O weight (10-1000).\n * @param {number} [options.build_data.threads] - The CPU threads allowed for the server.\n * @param {boolean} [options.build_data.oom_disabled] - Whether to disable Out-of-Memory (OOM) killer.\n * @returns {Promise} - API response confirming the build update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateServerBuild(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n build_data: {\n cpu?: number;\n memory?: number;\n disk?: number;\n swap?: number;\n io?: number;\n threads?: number;\n oom_disabled?: boolean;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/build`,\n body: JSON.stringify(options.build_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n descriptions: string,\n suspendes: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: number[] | null\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: [],\n },\n updated_at: string,\n created_at: string\n }\n}\n\n\n/**\n * Updates the startup configuration of a server, including environment variables and startup command.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} options.startup_data - The new startup configuration.\n * @param {string} [options.startup_data.startup] - The new startup command.\n * @param {number} [options.startup_data.egg] - The new egg ID for the server.\n * @param {number} [options.startup_data.image] - The new Docker image for the server.\n * @param {Object} [options.startup_data.environment] - The environment variables for the server.\n * @returns {Promise} - API response confirming the startup update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateServerStartup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n startup_data: {\n startup?: string;\n egg?: number;\n image?: string;\n environment?: Record;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/startup`,\n body: JSON.stringify(options.startup_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: null | string | number,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[],\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: object\n },\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Creates a new server on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.server_data - The data required to create the server.\n * @returns {Promise} - API response containing the created server details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createServer(options: { \n apiKey: string; \n panel: string; \n server_data: any;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"servers\",\n body: JSON.stringify(options.server_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Suspends a server, preventing it from starting.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to suspend.\n * @returns {Promise} - API response confirming the suspension.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function suspendServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/suspend`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Unsuspends a server, allowing it to start again.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to unsuspend.\n * @returns {Promise} - API response confirming the unsuspension.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function unsuspendServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/unsuspend`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Reinstalls a server, resetting its files and configuration.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to reinstall.\n * @returns {Promise} - API response confirming the reinstallation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function reinstallServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/reinstall`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a server from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Forcefully deletes a server from the Pterodactyl panel, bypassing standard checks.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function forceDeleteServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/force`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number,\n database: string,\n username: string,\n remote: string,\n max_connections: number,\n created_at: string,\n updated_at: string,\n relationships: {\n password: {\n object: string,\n attributes: {\n password: string\n }\n }\n host: {\n object: string,\n attributes: {\n id: number,\n name: string,\n host: string,\n port: number,\n username: string,\n node: number,\n created_at: string,\n updated_at: string\n }\n }\n }\n }\n }[]\n}\n\n/**\n * Retrieves a list of all databases for a specific server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing all databases.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listDatabases(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/databases`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number,\n database: string,\n username: string,\n remote: string,\n max_connections: number,\n created_at: string,\n updated_at: string\n }\n}\n/**\n * Retrieves details of a specific database.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.database_id - The ID of the database.\n * @returns {Promise} - API response containing database details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function databaseDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/databases/${options.database_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number,\n database: string,\n username: string,\n remote: string,\n max_connections: number | null,\n created_at: string,\n updated_at: string\n },\n meta: {\n resource: string\n }\n}\n\n/**\n * Creates a new database for a specific server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to create the database for.\n * @param {Object} options.database_data - The data for the new database.\n * @param {string} options.database_data.database - The name of the database.\n * @param {string} options.database_data.remote - The remote access setting (e.g., `%` for any IP).\n * @returns {Promise} - API response containing the created database details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createDatabase(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_data: {\n database: string;\n remote: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/databases`,\n body: JSON.stringify(options.database_data)\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Resets the password for a specific database.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.database_id - The ID of the database.\n * @returns {Promise} - API response confirming the password reset.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function resetDatabasePassword(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/databases/${options.database_id}/reset-password`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Deletes a database from a server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.database_id - The ID of the database to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteDatabase(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/databases/${options.database_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n uuid: string;\n name: string;\n nest: number;\n author: string;\n description: string;\n docker_image: string;\n config: {\n files: {\n [filename: string]: {\n parser: string;\n find: {\n [key: string]: any;\n };\n };\n };\n };\n startup: {\n done: string;\n userInteraction: string[];\n };\n stop: string;\n logs: {\n custom: boolean;\n location: string;\n };\n script: {\n privileged: boolean;\n install: string;\n entry: string;\n container: string;\n extends: any;\n };\n created_at: string;\n updated_at: string;\n relationships: {\n nest: {\n object: string;\n attributes: {\n id: number;\n uuid: string;\n author: string;\n name: string;\n description: string;\n created_at: string;\n updated_at: string;\n };\n };\n servers: {\n object: string;\n data: any[];\n };\n };\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all eggs within a specific nest.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.nest_id - The ID of the nest.\n * @returns {Promise} - API response containing the list of eggs.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listEggs(options: { \n apiKey: string; \n panel: string; \n nest_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nests/${options.nest_id}/eggs`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n name: string,\n nest: number,\n author: string,\n description: string,\n docker_image: string,\n config: {\n files: object,\n startup: {\n done: string,\n userInteraction: []\n },\n stop: string,\n logs: {\n custom: boolean,\n location: string\n },\n extends: any\n },\n startup: string,\n script: {\n privileged: boolean,\n install: string,\n entry: string,\n container: string,\n extends: any\n },\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves details of a specific egg from a nest.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.nest_id - The ID of the nest.\n * @param {number} options.egg_id - The ID of the egg to retrieve.\n * @returns {Promise} - API response containing egg details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function eggDetails(options: { \n apiKey: string; \n panel: string; \n nest_id: number;\n egg_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nests/${options.nest_id}/eggs/${options.egg_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n author: string,\n name: string,\n description: string,\n created_at: string,\n updated_at: string\n }\n }[],\n meta: {\n pagination: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n}\n/**\n * Retrieves a list of all nests available on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing the list of nests.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listNests(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"nests\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n author: string,\n name: string,\n description: string,\n created_at: string,\n updated_at: string\n }\n}\n/**\n * Retrieves details of a specific nest.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.nest_id - The ID of the nest.\n * @returns {Promise} - API response containing nest details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function nestDetails(options: { \n apiKey: string; \n panel: string; \n nest_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nests/${options.nest_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n ip: string,\n alias: any,\n port: number,\n notes: any,\n assigned: boolean\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of all allocations on a specific node.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node whose allocations should be retrieved.\n * @returns {Promise} - API response containing the list of allocations.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listAllocations(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nodes/${options.node_id}/allocations`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Creates a new allocation on a specific node.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node where the allocation should be created.\n * @param {string} options.ip - The IP address to allocate.\n * @param {number[]} options.ports - An array of ports to allocate.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createAllocation(options: { \n apiKey: string; \n panel: string; \n node_id: number;\n ip: string;\n ports: number[];\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `nodes/${options.node_id}/allocations`,\n body: JSON.stringify({\n ip: options.ip,\n ports: options.ports\n })\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Deletes an allocation from a specific node.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node where the allocation exists.\n * @param {number} options.allocation_id - The ID of the allocation to delete.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteAllocation(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n allocation_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `nodes/${options.node_id}/allocations/${options.allocation_id}`\n });\n}\n","import Setup from \"./Setup\";\n\n// Import Application API - User Management\nimport listUsers from \"../source/app/users/listUsers\";\nimport userDetails from \"../source/app/users/userDetails\";\nimport userDetails_externalId from \"../source/app/users/userDetails_externalId\";\nimport createUser from \"../source/app/users/createUser\";\nimport updateUser from \"../source/app/users/updateUser\";\nimport deleteUser from \"../source/app/users/deleteUser\";\n\n// Import Application API - Node Management\nimport listNodes from \"../source/app/nodes/listNodes\";\nimport nodeDetails from \"../source/app/nodes/nodeDetails\";\nimport nodeConfiguration from \"../source/app/nodes/nodeConfiguration\";\nimport createNode from \"../source/app/nodes/createNode\";\nimport updateNode from \"../source/app/nodes/updateNode\";\nimport deleteNode from \"../source/app/nodes/deleteNode\";\n\n// Import Application API - Location Management\nimport listLocations from \"../source/app/locations/listLocations\";\nimport locationDetails from \"../source/app/locations/locationDetails\";\nimport createLocation from \"../source/app/locations/createLocation\";\nimport updateLocation from \"../source/app/locations/updateLocation\";\nimport deleteLocation from \"../source/app/locations/deleteLocation\";\n\n// Import Application API - Server Management\nimport listServers from \"../source/app/servers/listServers\";\nimport serverDetails from \"../source/app/servers/serverDetails\";\nimport serverDetails_externalId from \"../source/app/servers/serverDetails_externalId\";\nimport updateDetails from \"../source/app/servers/updateDetails\";\nimport updateServerBuild from \"../source/app/servers/updateServerBuild\";\nimport updateServerStartup from \"../source/app/servers/updateServerStartup\";\nimport createServer from \"../source/app/servers/createServer\";\nimport suspendServer from \"../source/app/servers/suspendServer\";\nimport unsuspendServer from \"../source/app/servers/unsuspendServer\";\nimport reinstallServer from \"../source/app/servers/reinstallServer\";\nimport deleteServer from \"../source/app/servers/deleteServer\";\nimport forceDeleteServer from \"../source/app/servers/forceDeleteServer\";\n\n// Import Application API - Database Management\nimport listDatabases from \"../source/app/servers/databases/listDatabases\";\nimport databaseDetails from \"../source/app/servers/databases/databaseDetails\";\nimport createDatabase from \"../source/app/servers/databases/createDatabase\";\nimport resetDatabasePassword from \"../source/app/servers/databases/resetDatabasePassword\";\nimport deleteDatabase from \"../source/app/servers/databases/deleteDatabase\";\n\n// Import Application API - Nest & Egg Management\nimport listEggs from \"../source/app/nests/eggs/listEggs\";\nimport eggDetails from \"../source/app/nests/eggs/eggDetails\";\nimport listNests from \"../source/app/nests/listNests\";\nimport nestDetails from \"../source/app/nests/nestDetails\";\n\n// Import Application API - Allocations Management\nimport listAllocations from \"../source/app/nodes/allocations/listAllocations\";\nimport createAllocations from \"../source/app/nodes/allocations/createAllocations\";\nimport deleteAllocation from \"../source/app/nodes/allocations/deleteAllocation\";\n\n/**\n * The Application class provides an interface for interacting with the\n * Pterodactyl Application API. This class gives full control over the panel,\n * including user, node, location, server, database, nest, and allocation management.\n *\n * @example\n * const app = new Application(\"YOUR_API_KEY\");\n * const users = await app.users.list();\n */\nexport default class Application {\n private apiKey: string;\n private panel: string;\n\n constructor(apiKey: string) {\n this.apiKey = apiKey;\n this.panel = Setup.getPanel();\n }\n\n /** User Management */\n public users = {\n list: () => listUsers({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (user_id: string) =>\n userDetails({ apiKey: this.apiKey, panel: this.panel, user_id }),\n getDetailsByExternalId: (external_id: string) =>\n userDetails_externalId({ apiKey: this.apiKey, panel: this.panel, external_id }),\n create: (user_details: { email: string; username: string; first_name?: string; last_name?: string }) =>\n createUser({ apiKey: this.apiKey, panel: this.panel, user_details }),\n update: (user_id: string, user_data: any) =>\n updateUser({ apiKey: this.apiKey, panel: this.panel, user_id: parseInt(user_id), data: user_data }),\n delete: (user_id: string) =>\n deleteUser({ apiKey: this.apiKey, panel: this.panel, identifier: parseInt(user_id) }),\n };\n\n /** Node Management */\n public nodes = {\n list: () => listNodes({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (node_id: string) =>\n nodeDetails({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n getConfiguration: (node_id: string) =>\n nodeConfiguration({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n create: (node_data: any) =>\n createNode({ apiKey: this.apiKey, panel: this.panel, node_data }),\n update: (node_id: string, node_data: any) =>\n updateNode({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id), update_data: node_data }),\n delete: (node_id: string) =>\n deleteNode({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n };\n\n /** Location Management */\n public locations = {\n list: () => listLocations({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (location_id: string) =>\n locationDetails({ apiKey: this.apiKey, panel: this.panel, location_id: parseInt(location_id) }),\n create: (location_data: { short: string; long: string }) =>\n createLocation({ apiKey: this.apiKey, panel: this.panel, location_data }),\n update: (location_id: string, location_data: any) =>\n updateLocation({ apiKey: this.apiKey, panel: this.panel, location_id: parseInt(location_id), update_data: location_data }),\n delete: (location_id: string) =>\n deleteLocation({ apiKey: this.apiKey, panel: this.panel, location_id: parseInt(location_id) }),\n };\n\n /** Server Management */\n public servers = {\n list: () => listServers({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (server_id: string) =>\n serverDetails({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetailsByExternalId: (external_id: string) =>\n serverDetails_externalId({ apiKey: this.apiKey, panel: this.panel, external_id }),\n updateDetails: (server_id: string, update_data: any) =>\n updateDetails({ apiKey: this.apiKey, panel: this.panel, server_id, update_data }),\n updateBuild: (server_id: string, build_data: any) =>\n updateServerBuild({ apiKey: this.apiKey, panel: this.panel, server_id, build_data }),\n updateStartup: (server_id: string, startup_data: any) =>\n updateServerStartup({ apiKey: this.apiKey, panel: this.panel, server_id, startup_data }),\n create: (server_data: any) =>\n createServer({ apiKey: this.apiKey, panel: this.panel, server_data }),\n suspend: (server_id: string) =>\n suspendServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n unsuspend: (server_id: string) =>\n unsuspendServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n reinstall: (server_id: string) =>\n reinstallServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n delete: (server_id: string) =>\n deleteServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n forceDelete: (server_id: string) =>\n forceDeleteServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n };\n\n /** Nest & Egg Management */\n public nests = {\n listNests: () => listNests({ apiKey: this.apiKey, panel: this.panel }),\n getNestDetails: (nest_id: string) =>\n nestDetails({ apiKey: this.apiKey, panel: this.panel, nest_id: parseInt(nest_id) }),\n listEggs: (nest_id: string) =>\n listEggs({ apiKey: this.apiKey, panel: this.panel, nest_id: parseInt(nest_id) }),\n getEggDetails: (nest_id: string, egg_id: string) =>\n eggDetails({ apiKey: this.apiKey, panel: this.panel, nest_id: parseInt(nest_id), egg_id: parseInt(egg_id) }),\n };\n\n /** Allocations Management */\n public allocations = {\n list: (node_id: string) => listAllocations({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n create: (node_id: string, ip: string, ports: number[]) => \n createAllocations({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id), ip, ports }),\n delete: (node_id: string, allocation_id: string) => \n deleteAllocation({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id), allocation_id: parseInt(allocation_id) }),\n };\n /** Database Management */\n public databases = {\n list: (server_id: string) => listDatabases({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetails: (server_id: string, database_id: string) => \n databaseDetails({ apiKey: this.apiKey, panel: this.panel, server_id, database_id: parseInt(database_id) }),\n create: (server_id: string, database_data: any) => \n createDatabase({ apiKey: this.apiKey, panel: this.panel, server_id, database_data }),\n resetPassword: (server_id: string, database_id: string) => \n resetDatabasePassword({ apiKey: this.apiKey, panel: this.panel, server_id, database_id: parseInt(database_id) }),\n delete: (server_id: string, database_id: string) => \n deleteDatabase({ apiKey: this.apiKey, panel: this.panel, server_id, database_id: parseInt(database_id) })\n };\n\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n admin: boolean;\n username: string;\n email: string;\n first_name: string;\n last_name: string;\n language: string;\n };\n }\n\n \n/**\n * Retrieves account details for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing account details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function accountDetails(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"account\"\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n tokens: string[];\n };\n }\n \n\n/**\n * Enables Two-Factor Authentication (2FA) for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string[]} options.codes - The TOTP authentication codes for verification.\n * @returns {Promise} - API response confirming 2FA activation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function twoFactorEnable(options: { \n apiKey: string; \n panel: string; \n codes: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"account/two-factor\",\n body: { codes: options.codes }\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Disables Two-Factor Authentication (2FA) for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string[]} options.tokens - An array of 2FA recovery codes to confirm disabling.\n * @returns {Promise} - API response confirming 2FA deactivation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function twoFactorDisable(options: { \n apiKey: string; \n panel: string; \n tokens: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: \"account/two-factor\",\n body: { tokens: options.tokens }\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Updates the email address of the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.email - The new email address.\n * @param {string} options.password - The current password (required for confirmation).\n * @returns {Promise} - API response confirming email update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateEmail(options: { \n apiKey: string; \n panel: string; \n email: string;\n password: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: \"account/email\",\n body: {\n email: options.email,\n password: options.password\n }\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Updates the password of the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.current_password - The current password for confirmation.\n * @param {string} options.new_password - The new password to set.\n * @returns {Promise} - API response confirming password update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updatePassword(options: { \n apiKey: string; \n panel: string; \n current_password: string;\n new_password: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: \"account/password\",\n body: {\n current_password: options.current_password,\n password: options.new_password\n }\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n identifier: string,\n description: string,\n allowed_ips: string[],\n last_used_at: null | string,\n created_at: string\n },\n meta: {\n secret_token: string\n }\n}\n\n/**\n * Creates a new API key for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.description - A description for the API key.\n * @param {string[]} options.allowed_ips - An array of allowed IPs (empty for unrestricted access).\n * @returns {Promise} - API response containing the newly created API key.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createApiKey(options: { \n apiKey: string; \n panel: string; \n description: string;\n allowed_ips: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"account/api-keys\",\n body: {\n description: options.description,\n allowed_ips: options.allowed_ips\n }\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes an API key for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.key_id - The unique identifier of the API key to delete.\n * @returns {Promise} - API response confirming deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteApiKey(options: { \n apiKey: string; \n panel: string; \n key_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `account/api-keys/${options.key_id}`\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n identifier: string,\n description: string,\n allowed_ips: [] | string[],\n last_used_at: string,\n created_at: string\n }\n }[]\n}\n\n/**\n * Retrieves a list of all API keys for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing all API keys.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listApiKeys(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"account/api-keys\"\n });\n}\n","import ClientAPICall from \"../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n server_owner: boolean;\n identifier: string;\n uuid: string;\n name: string;\n node: string;\n sftp_details: {\n ip: string;\n port: number;\n };\n description: string;\n limits: {\n memory: number;\n swap: number;\n disk: number;\n io: number;\n cpu: number;\n };\n feature_limits: {\n databases: number;\n allocations: number;\n backups: number;\n };\n is_suspended: boolean;\n is_installing: boolean;\n relationships: {\n allocations: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }>;\n };\n };\n };\n }>;\n meta: {\n pagination: {\n total: number;\n count: number;\n per_page: number;\n current_page: number;\n total_pages: number;\n links: Record;\n };\n };\n }\n \n/**\n * Retrieves a list of all servers the authenticated user has access to.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing the list of servers.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listServers(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"servers\"\n });\n}\n","import ClientAPICall from \"../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n permissions: {\n websocket: {\n description: string;\n keys: {\n connect: string;\n };\n };\n control: {\n description: string;\n keys: {\n console: string;\n start: string;\n stop: string;\n restart: string;\n };\n };\n user: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n };\n };\n file: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n archive: string;\n sftp: string;\n };\n };\n backup: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n download: string;\n };\n };\n allocation: {\n description: string;\n keys: {\n read: string;\n create: string;\n update: string;\n delete: string;\n };\n };\n startup: {\n description: string;\n keys: {\n read: string;\n update: string;\n };\n };\n database: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n view_password: string;\n };\n };\n schedule: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n };\n };\n settings: {\n description: string;\n keys: {\n rename: string;\n reinstall: string;\n };\n };\n };\n };\n }\n \n\n/**\n * Retrieves the permissions the authenticated user has for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of permissions for the user.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function showPermissions(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/permissions`\n });\n}\n","/**\n * Sends a command to a server's console.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.command - The command to execute.\n * @returns {Promise} - A promise that resolves when the command is sent.\n */\nexport default async function command(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n command: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/command`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify({ command: options.command })\n });\n\n if (!response.ok) {\n throw new Error(`Failed to send command: ${await response.text()}`);\n }\n}\n","/**\n * Sends a power action to a server (start, stop, restart, kill).\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.signal - The power action (start, stop, restart, kill).\n * @returns {Promise} - A promise that resolves when the power action is sent.\n */\nexport default async function power(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n signal: \"start\" | \"stop\" | \"restart\" | \"kill\"; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/power`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify({ signal: options.signal })\n });\n\n if (!response.ok) {\n throw new Error(`Failed to send power action: ${await response.text()}`);\n }\n}\n","export interface Response {\n data: {\n token: string;\n socket: string;\n };\n }\n \n/**\n * Retrieves real-time console details for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with console details.\n */\nexport default async function consoleDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/websocket`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch console details: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n current_state: string;\n is_suspended: boolean;\n resources: {\n memory_bytes: number;\n cpu_absolute: number;\n disk_bytes: number;\n network_rx_bytes: number;\n network_tx_bytes: number;\n };\n };\n }\n \n\n/**\n * Fetches resource usage (CPU, RAM, disk) for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with server resource usage details.\n */\nexport default async function resources(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/resources`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch server resources: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n server_owner: boolean;\n identifier: string;\n uuid: string;\n name: string;\n node: string;\n sftp_details: {\n ip: string;\n port: number;\n };\n description: string;\n limits: {\n memory: number;\n swap: number;\n disk: number;\n io: number;\n cpu: number;\n };\n feature_limits: {\n databases: number;\n allocations: number;\n backups: number;\n };\n is_suspended: boolean;\n is_installing: boolean;\n relationships: {\n allocations: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }>;\n };\n };\n };\n meta: {\n is_server_owner: boolean;\n user_permissions: string[];\n };\n }\n \n\n\n/**\n * Retrieves details for a specific server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with server details.\n */\nexport default async function serverDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch server details: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n uuid: string;\n name: string;\n ignored_files: string[];\n sha256_hash: string;\n bytes: number;\n created_at: string;\n completed_at: string;\n };\n }>;\n meta: {\n pagination: {\n total: number;\n count: number;\n per_page: number;\n current_page: number;\n total_pages: number;\n links: Record;\n };\n };\n }\n \n\n/**\n * Retrieves a list of all backups for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing a list of backups.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listBackups(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/backups`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n name: string;\n ignored_files: string[];\n sha256_hash: string;\n bytes: number;\n created_at: string;\n completed_at: string;\n };\n }\n \n\n/**\n * Retrieves details of a specific backup for a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.backup_id - The ID of the backup.\n * @returns {Promise} - API response containing backup details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function backupDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/backups/${options.backup_id}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n name: string;\n ignored_files: string[];\n sha256_hash: string | null;\n bytes: number;\n created_at: string;\n completed_at: string | null;\n };\n }\n \n\n/**\n * Creates a new backup for a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} [options.backup_data] - Optional backup settings.\n * @param {string} [options.backup_data.name] - Name for the backup.\n * @param {boolean} [options.backup_data.locked] - Whether the backup is locked.\n * @returns {Promise} - API response confirming backup creation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createBackup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_data?: {\n name?: string;\n locked?: boolean;\n };\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/backups`,\n body: options.backup_data ? JSON.stringify(options.backup_data) : undefined\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Deletes a backup from a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.backup_id - The ID of the backup.\n * @returns {Promise} - API response confirming backup deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteBackup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/backups/${options.backup_id}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n url: string;\n };\n}\n \n\n/**\n * Retrieves a download link for a backup file.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.backup_id - The ID of the backup.\n * @returns {Promise} - API response containing the download URL.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function downloadBackup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/backups/${options.backup_id}/download`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n name: string;\n mode: string;\n size: number;\n is_file: boolean;\n is_symlink: boolean;\n is_editable: boolean;\n mimetype: string;\n created_at: string;\n modified_at: string;\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all files and directories for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} [options.directory] - The directory path to list files from (optional).\n * @returns {Promise} - API response containing the list of files.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listFiles(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n directory?: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/files/list${options.directory ? `?directory=${options.directory}` : \"\"}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Retrieves the content of a specific file on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to retrieve.\n * @returns {Promise} - API response containing file content.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function getFileContent(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/files/contents?file=${encodeURIComponent(options.file_path)}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n url: string;\n };\n }\n \n\n/**\n * Retrieves a download link for a file.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to download.\n * @returns {Promise} - API response containing the download URL.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function downloadFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/files/download?file=${encodeURIComponent(options.file_path)}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Renames a file or folder on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object[]} options.files - An array of objects containing old and new file names.\n * @returns {Promise} - API response confirming file/folder rename.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function renameFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n files: { from: string; to: string }[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/files/rename`,\n body: JSON.stringify({ files: options.files })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Copies a file to a new location on the server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to copy.\n * @returns {Promise} - API response confirming the file copy.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function copyFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/copy`,\n body: JSON.stringify({ location: options.file_path })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Writes content to a file on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to write.\n * @param {string} options.content - The content to write to the file.\n * @returns {Promise} - API response confirming file write operation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function writeFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n content: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/write`,\n body: JSON.stringify({\n file: options.file_path,\n contents: options.content\n })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n name: string;\n mode: string;\n size: number;\n is_file: boolean;\n is_symlink: boolean;\n is_editable: boolean;\n mimetype: string;\n created_at: string;\n modified_at: string;\n };\n }\n \n\n/**\n * Compresses files or directories on a server into a ZIP archive.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string[]} options.files - An array of files or directories to compress.\n * @returns {Promise} - API response confirming compression.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function compressFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n files: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/compress`,\n body: JSON.stringify({ files: options.files })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Decompresses a ZIP file on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the ZIP file to decompress.\n * @returns {Promise} - API response confirming decompression.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function decompressFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/decompress`,\n body: JSON.stringify({ file: options.file_path })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Deletes a file or folder on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string[]} options.files - An array of files or folders to delete.\n * @returns {Promise} - API response confirming file deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n files: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/delete`,\n body: JSON.stringify({ files: options.files })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Creates a new folder on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.folder_path - The path of the folder to create.\n * @returns {Promise} - API response confirming folder creation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createFolder(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n folder_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/create-folder`,\n body: JSON.stringify({ name: options.folder_path })\n });\n}\n","import axios from \"axios\";\n\nexport interface Response {\n object: string;\n attributes: {\n url: string;\n };\n}\n\n/**\n * Uploads a file to a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {FormData} options.file_data - The file data to upload.\n * @returns {Promise} - API response confirming file upload.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function uploadFile(options: {\n apiKey: string;\n panel: string;\n server_id: string;\n file_data: FormData;\n}): Promise {\n const response = await axios.post(\n `${options.panel}/api/client/servers/${options.server_id}/files/upload`,\n options.file_data,\n {\n headers: {\n \"Authorization\": `Bearer ${options.apiKey}`,\n \"Content-Type\": \"multipart/form-data\",\n },\n }\n );\n return response.data;\n}\n\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all network allocations for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of allocations.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listAllocations(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/network/allocations`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }\n\n \n/**\n * Assigns a new allocation to a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to assign.\n * @returns {Promise} - API response confirming allocation assignment.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function assignAllocations(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/network/allocations`,\n body: JSON.stringify({ allocation_id: options.allocation_id })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }\n\n \n/**\n * Updates the note for a specific allocation on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to update.\n * @param {string} options.note - The new note for the allocation.\n * @returns {Promise} - API response confirming the note update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function setAllocationNote(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n note: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/network/allocations/${options.allocation_id}`,\n body: JSON.stringify({ notes: options.note })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }\n\n \n/**\n * Sets a specific allocation as the primary allocation for a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to set as primary.\n * @returns {Promise} - API response confirming primary allocation change.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function setPrimaryAllocation(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/network/allocations/${options.allocation_id}/primary`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Unassigns a network allocation from a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to remove.\n * @returns {Promise} - API response confirming allocation removal.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function unassignAllocation(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/network/allocations/${options.allocation_id}`\n });\n}\n","export interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }>;\n };\n };\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all schedules for a specified server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with the list of schedules.\n */\nexport default async function listSchedules(options: { apiKey: string; panel: string; server_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch schedules: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: any[];\n };\n };\n };\n }\n \n\n/**\n * Creates a new schedule for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {Object} options.schedule_data - The schedule details.\n * @returns {Promise} - A promise resolving with the created schedule details.\n */\nexport default async function createSchedule(options: { apiKey: string; panel: string; server_id: string; schedule_data: any }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify(options.schedule_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to create schedule: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }>;\n };\n };\n };\n }\n \n\n/**\n * Retrieves details of a specific schedule for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @returns {Promise} - A promise resolving with the schedule details.\n */\nexport default async function scheduleDetails(options: { apiKey: string; panel: string; server_id: string; schedule_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch schedule details: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: any[];\n };\n };\n };\n }\n \n\n/**\n * Updates an existing schedule for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {Object} options.schedule_data - The updated schedule details.\n * @returns {Promise} - A promise resolving with the updated schedule.\n */\nexport default async function updateSchedule(options: { apiKey: string; panel: string; server_id: string; schedule_id: string; schedule_data: any }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}`, {\n method: \"PATCH\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify(options.schedule_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to update schedule: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","/**\n * Deletes a schedule from a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @returns {Promise} - A promise that resolves when the schedule is deleted.\n */\nexport default async function deleteSchedule(options: { apiKey: string; panel: string; server_id: string; schedule_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}`, {\n method: \"DELETE\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to delete schedule: ${await response.text()}`);\n }\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }\n \n\n/**\n * Creates a task inside a specific schedule.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {Object} options.task_data - The task details.\n * @returns {Promise} - A promise resolving with the created task details.\n */\nexport default async function createTask(options: { apiKey: string; panel: string; server_id: string; schedule_id: string; task_data: any }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}/tasks`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify(options.task_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to create task: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }\n \n\n/**\n * Updates an existing task inside a specific schedule.\n *\n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {string} options.task_id - The task identifier.\n * @param {Object} options.task_data - The updated task details.\n * @returns {Promise} - A promise resolving with the updated task details.\n */\nexport default async function updateTask(options: {\n apiKey: string;\n panel: string;\n server_id: string;\n schedule_id: string;\n task_id: string;\n} & Record): Promise {\n const { apiKey, panel, server_id, schedule_id, task_id, ...task_data } = options;\n\n const response = await fetch(`${panel}/api/client/servers/${server_id}/schedules/${schedule_id}/tasks/${task_id}`, {\n method: \"PATCH\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${apiKey}`\n },\n body: JSON.stringify(task_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to update task: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","/**\n * Deletes a specific task inside a schedule.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {string} options.task_id - The task identifier.\n * @returns {Promise} - A promise that resolves when the task is deleted.\n */\nexport default async function deleteTask(options: { apiKey: string; panel: string; server_id: string; schedule_id: string; task_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}/tasks/${options.task_id}`, {\n method: \"DELETE\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to delete task: ${await response.text()}`);\n }\n}\n\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Renames a server on the panel.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.new_name - The new name for the server.\n * @returns {Promise} - API response confirming the server rename.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function renameServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n new_name: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/settings/rename`,\n body: JSON.stringify({ name: options.new_name })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Reinstalls a server, resetting its configuration while preserving files.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to reinstall.\n * @returns {Promise} - API response confirming the reinstallation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function reinstallServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/settings/reinstall`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n name: string;\n description: string;\n env_variable: string;\n default_value: string;\n server_value: string;\n is_editable: boolean;\n rules: string;\n };\n }>;\n meta: {\n startup_command: string;\n raw_startup_command: string;\n };\n }\n\n \n/**\n * Retrieves a list of all startup variables for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of startup variables.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listVariables(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/startup/variables`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n name: string;\n description: string;\n env_variable: string;\n default_value: string;\n server_value: string;\n is_editable: boolean;\n rules: string;\n };\n }\n \n\n/**\n * Updates a startup variable for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.variable_id - The ID of the startup variable.\n * @param {string} options.value - The new value for the variable.\n * @returns {Promise} - API response confirming variable update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateVariable(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n variable_id: number;\n value: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/startup/variables/${options.variable_id}`,\n body: JSON.stringify({ value: options.value })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all users assigned to a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of users.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listUsers(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/users`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: \"server_subuser\";\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }\n \n\n/**\n * Assigns a new user to a server with specific permissions.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.email - The email address of the user.\n * @param {string} options.username - The username of the user.\n * @param {string[]} options.permissions - An array of permissions for the user.\n * @returns {Promise} - API response confirming user creation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createUser(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n email: string;\n username: string;\n permissions: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/users`,\n body: JSON.stringify({\n email: options.email,\n username: options.username,\n permissions: options.permissions\n })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }\n \n\n/**\n * Updates an existing user's permissions for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.user_id - The ID of the user.\n * @param {string[]} options.permissions - The new set of permissions for the user.\n * @returns {Promise} - API response confirming user update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateUser(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n user_id: string;\n permissions: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/users/${options.user_id}`,\n body: JSON.stringify({ permissions: options.permissions })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Removes a user from a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.user_id - The ID of the user to remove.\n * @returns {Promise} - API response confirming user removal.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteUser(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n user_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/users/${options.user_id}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }\n\n \n/**\n * Retrieves details of a specific user assigned to a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.user_id - The ID of the user.\n * @returns {Promise} - API response containing user details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function userDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n user_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/users/${options.user_id}`\n });\n}\n","import Setup from \"./Setup\";\n\n// Import account functions\nimport accountDetails from \"../source/client/account/accountDetails\";\nimport twoFactorEnable from \"../source/client/account/2faEnable\";\nimport twoFactorDisable from \"../source/client/account/2faDisable\";\nimport updateEmail from \"../source/client/account/updateEmail\";\nimport updatePassword from \"../source/client/account/updatePassword\";\nimport createApiKey from \"../source/client/account/createApiKey\";\nimport deleteApiKey from \"../source/client/account/deleteApiKey\";\nimport listApiKeys from \"../source/client/account/listApiKeys\";\n\n// Import general server functions\nimport listServers from \"../source/client/listServers\";\nimport showPermissions from \"../source/client/showPermissions\";\nimport command from \"../source/client/servers/command\";\nimport power from \"../source/client/servers/power\";\nimport consoleDetails from \"../source/client/servers/consoleDetails\";\nimport resources from \"../source/client/servers/resources\";\nimport serverDetails from \"../source/client/servers/serverDetails\";\n\n// Import backup functions\nimport listBackups from \"../source/client/servers/backups/listBackups\";\nimport backupDetails from \"../source/client/servers/backups/backupDetails\";\nimport createBackup from \"../source/client/servers/backups/createBackup\";\nimport deleteBackup from \"../source/client/servers/backups/deleteBackup\";\nimport downloadBackup from \"../source/client/servers/backups/downloadBackup\";\n\n// Import database functions\nimport listDatabases from \"../source/client/servers/databases/listDatabases\";\nimport createDatabase from \"../source/client/servers/databases/createDatabase\";\nimport deleteDatabase from \"../source/client/servers/databases/deleteDatabase\";\nimport rotatePassword from \"../source/client/servers/databases/rotatePassword\";\n\n// Import file management functions\nimport listFiles from \"../source/client/servers/files/listFiles\";\nimport getFileContent from \"../source/client/servers/files/getFileContent\";\nimport downloadFile from \"../source/client/servers/files/downloadFile\";\nimport renameFile from \"../source/client/servers/files/renameFile\";\nimport copyFile from \"../source/client/servers/files/copyFile\";\nimport writeFile from \"../source/client/servers/files/writeFile\";\nimport compressFile from \"../source/client/servers/files/compressFile\";\nimport decompressFile from \"../source/client/servers/files/decompressFile\";\nimport deleteFile from \"../source/client/servers/files/deleteFile\";\nimport createFolder from \"../source/client/servers/files/createFolder\";\nimport uploadFile from \"../source/client/servers/files/uploadFile\";\n\n// Import network management functions\nimport listAllocations from \"../source/client/servers/network/listAllocations\";\nimport assignAllocations from \"../source/client/servers/network/assignAllocations\";\nimport setAllocationNote from \"../source/client/servers/network/setAllocationNote\";\nimport setPrimaryAllocation from \"../source/client/servers/network/setPrimaryAllocation\";\nimport unassignAllocation from \"../source/client/servers/network/unassignAllocation\";\n\n// Import schedule functions\nimport listSchedules from \"../source/client/servers/schedules/listSchedules\";\nimport createSchedule from \"../source/client/servers/schedules/createSchedule\";\nimport scheduleDetails from \"../source/client/servers/schedules/scheduleDetails\";\nimport updateSchedule from \"../source/client/servers/schedules/updateSchedule\";\nimport deleteSchedule from \"../source/client/servers/schedules/deleteSchedule\";\nimport createTask from \"../source/client/servers/schedules/createTask\";\nimport updateTask from \"../source/client/servers/schedules/updateTask\";\nimport deleteTask from \"../source/client/servers/schedules/deleteTask\";\n\n// Import settings functions\nimport renameServer from \"../source/client/servers/settings/renameServer\";\nimport reinstallServer from \"../source/client/servers/settings/reinstallServer\";\n\n// Import startup functions\nimport listVariables from \"../source/client/servers/startup/listVariables\";\nimport updateVariable from \"../source/client/servers/startup/updateVariable\";\n\n// Import user management functions\nimport listUsers from \"../source/client/servers/users/listUsers\";\nimport createUser from \"../source/client/servers/users/createUser\";\nimport updateUser from \"../source/client/servers/users/updateUser\";\nimport deleteUser from \"../source/client/servers/users/deleteUser\";\nimport userDetails from \"../source/client/servers/users/userDetails\";\n\n/**\n * The `Client` class provides an interface for interacting with the Pterodactyl Client API.\n * It supports **account management, server control, file operations, backups, networking, schedules, settings, startup variables, and more**.\n */\nexport default class Client {\n private apiKey: string;\n private panel: string;\n\n constructor(apiKey: string) {\n this.apiKey = apiKey;\n this.panel = Setup.getPanel();\n }\n\n /** Account Management */\n public account = {\n getDetails: () => accountDetails({ apiKey: this.apiKey, panel: this.panel }),\n enable2FA: (codes: string[]) => twoFactorEnable({ apiKey: this.apiKey, panel: this.panel, codes }),\n disable2FA: (tokens: string[]) => twoFactorDisable({ apiKey: this.apiKey, panel: this.panel, tokens }),\n updateEmail: (email: string, password: string) => updateEmail({ apiKey: this.apiKey, panel: this.panel, email, password }),\n updatePassword: (current_password: string, new_password: string) => updatePassword({ apiKey: this.apiKey, panel: this.panel, current_password, new_password }),\n createApiKey: (description: string, allowed_ips: string[]) => createApiKey({ apiKey: this.apiKey, panel: this.panel, description, allowed_ips }),\n deleteApiKey: (key_id: string) => deleteApiKey({ apiKey: this.apiKey, panel: this.panel, key_id }),\n listApiKeys: () => listApiKeys({ apiKey: this.apiKey, panel: this.panel }),\n };\n\n /** Server Management */\n public servers = {\n list: () => listServers({ apiKey: this.apiKey, panel: this.panel }),\n showPermissions: (server_id: string) => showPermissions({ apiKey: this.apiKey, panel: this.panel, server_id }),\n sendCommand: (server_id: string, commandStr: string) => command({ apiKey: this.apiKey, panel: this.panel, server_id, command: commandStr }),\n powerAction: (server_id: string, signal: \"start\" | \"stop\" | \"restart\" | \"kill\") => power({ apiKey: this.apiKey, panel: this.panel, server_id, signal }),\n getConsoleDetails: (server_id: string) => consoleDetails({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getResources: (server_id: string) => resources({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetails: (server_id: string) => serverDetails({ apiKey: this.apiKey, panel: this.panel, server_id }),\n };\n\n /** Backup Management */\n public backups = {\n list: (server_id: string) => listBackups({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetails: (server_id: string, backup_id: string) => backupDetails({ apiKey: this.apiKey, panel: this.panel, server_id, backup_id }),\n create: (server_id: string, backup_data: any) => createBackup({ apiKey: this.apiKey, panel: this.panel, server_id, backup_data }),\n delete: (server_id: string, backup_id: string) => deleteBackup({ apiKey: this.apiKey, panel: this.panel, server_id, backup_id }),\n download: (server_id: string, backup_id: string) => downloadBackup({ apiKey: this.apiKey, panel: this.panel, server_id, backup_id }),\n };\n\n /** Settings */\n public settings = {\n renameServer: (server_id: string, new_name: string) => renameServer({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n new_name\n }), \n reinstallServer: (server_id: string) => reinstallServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n };\n \n /** Network Management */\n public network = {\n listAllocations: (server_id: string) => listAllocations({ apiKey: this.apiKey, panel: this.panel, server_id }),\n assignAllocations: (server_id: string, allocation_id: number) => assignAllocations({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id\n }), \n setAllocationNote: (server_id: string, allocation_id: string, note: string) => setAllocationNote({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id: parseInt(allocation_id), \n note \n }),\n \n setPrimaryAllocation: (server_id: string, allocation_id: string) => setPrimaryAllocation({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id: parseInt(allocation_id) \n }),\n \n unassignAllocation: (server_id: string, allocation_id: string) => unassignAllocation({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id: parseInt(allocation_id) \n }), \n };\n \n /** Schedule Management */\n public schedules = {\n list: (server_id: string) => listSchedules({ apiKey: this.apiKey, panel: this.panel, server_id }),\n createSchedule: (server_id: string, schedule_data: any) => createSchedule({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_data }),\n scheduleDetails: (server_id: string, schedule_id: string) => scheduleDetails({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id }),\n updateSchedule: (server_id: string, schedule_id: string, schedule_data: any) => updateSchedule({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, schedule_data }),\n deleteSchedule: (server_id: string, schedule_id: string) => deleteSchedule({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id }),\n createTask: (server_id: string, schedule_id: string, task_data: any) => createTask({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, task_data }),\n updateTask: (server_id: string, schedule_id: string, task_id: string, task_data: any) => updateTask({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, task_id, task_data }),\n deleteTask: (server_id: string, schedule_id: string, task_id: string) => deleteTask({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, task_id }),\n };\n \n /** Startup Management */\n public startup = {\n listVariables: (server_id: string) => listVariables({ apiKey: this.apiKey, panel: this.panel, server_id }),\n updateVariable: (server_id: string, variable_id: string, value: string) => updateVariable({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n variable_id: parseInt(variable_id), \n value \n }), \n };\n \n /** User Management */\n public users = {\n listUsers: (server_id: string) => listUsers({ apiKey: this.apiKey, panel: this.panel, server_id }),\n createUser: (server_id: string, user_data: any) => createUser({ apiKey: this.apiKey, panel: this.panel, server_id, ...user_data }),\n updateUser: (server_id: string, user_id: string, user_data: any) => updateUser({ apiKey: this.apiKey, panel: this.panel, server_id, user_id, ...user_data }),\n deleteUser: (server_id: string, user_id: string) => deleteUser({ apiKey: this.apiKey, panel: this.panel, server_id, user_id }),\n userDetails: (server_id: string, user_id: string) => userDetails({ apiKey: this.apiKey, panel: this.panel, server_id, user_id }),\n };\n \n \n\n\n /** File Management */\n public files = {\n list: (server_id: string, directory?: string) => listFiles({ apiKey: this.apiKey, panel: this.panel, server_id, directory }),\n getContent: (server_id: string, file_path: string) => getFileContent({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n download: (server_id: string, file_path: string) => downloadFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n rename: (server_id: string, from: string, to: string) => renameFile({ apiKey: this.apiKey, panel: this.panel, server_id, files: [{ from, to }] }),\n copy: (server_id: string, file_path: string) => copyFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n write: (server_id: string, file_path: string, content: string) => writeFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path, content }),\n compress: (server_id: string, files: string[]) => compressFile({ apiKey: this.apiKey, panel: this.panel, server_id, files }),\n decompress: (server_id: string, file_path: string) => decompressFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n delete: (server_id: string, files: string[]) => deleteFile({ apiKey: this.apiKey, panel: this.panel, server_id, files }),\n createFolder: (server_id: string, folder_path: string) => createFolder({ apiKey: this.apiKey, panel: this.panel, server_id, folder_path }),\n upload: (server_id: string, file_data: FormData) => uploadFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_data }),\n };\n}\n","// WSConnection.ts\n\ntype ReconnectStrategy = \"fixed\" | \"exponential\" | \"exponential-jitter\";\n\ntype EventType =\n | \"open\"\n | \"message\"\n | \"close\"\n | \"error\"\n | \"reconnectAttempt\"\n | \"reconnectSuccess\"\n | \"reconnect\"\n | \"ping\"\n | \"pong\"\n | \"custom\";\n\nexport interface WSConnectionOptions {\n /** Primary WebSocket URL (required) */\n url: string;\n /** Optional fallback URLs if the primary fails */\n fallbackUrls?: string[];\n /** Optional subprotocol(s) to use during the handshake */\n protocols?: string | string[];\n\n /** Automatically reconnect on connection loss */\n autoReconnect?: boolean;\n /** Reconnect strategy: fixed, exponential, or exponential with jitter */\n reconnectStrategy?: ReconnectStrategy;\n /** Base delay (ms) for reconnect attempts */\n reconnectInterval?: number;\n /** Maximum number of reconnect attempts */\n maxReconnectAttempts?: number;\n /** Maximum delay (ms) allowed for exponential backoff */\n maxReconnectInterval?: number;\n /** Additional random jitter (ms) to add when using jitter strategy */\n jitter?: number;\n\n /** Connection timeout (ms) for establishing the connection */\n connectionTimeout?: number;\n\n /** Enable heartbeat (ping/pong) mechanism; set interval in ms */\n heartbeatInterval?: number;\n /** Heartbeat ping message (default \"ping\") */\n heartbeatMessage?: string;\n /** Expected pong message (default \"pong\") */\n expectedPongMessage?: string;\n /** How long (ms) to wait for a pong before closing the connection */\n heartbeatTimeout?: number;\n\n /** If true, queue outgoing messages if the connection is not open */\n queueMessages?: boolean;\n /** Maximum number of messages to queue */\n messageQueueLimit?: number;\n\n /** Automatically JSON‑stringify outgoing objects and parse incoming JSON strings */\n autoJson?: boolean;\n\n /** Custom logger callback; if not provided, uses console */\n logger?: (\n level: \"debug\" | \"info\" | \"warn\" | \"error\",\n ...args: any[]\n ) => void;\n /** Outgoing message interceptors (middleware) */\n outgoingMessageInterceptors?: Array<(message: any) => any>;\n /** Incoming message interceptors (middleware) */\n incomingMessageInterceptors?: Array<(message: any) => any>;\n\n /** Hook called before reconnecting; return false to cancel reconnect */\n onBeforeReconnect?: (attempt: number, lastCloseEvent: CloseEvent) => boolean;\n /** Hook called before sending a message; can modify or cancel the send */\n onBeforeSend?: (message: any) => any;\n /** Hook called after a message is sent */\n onAfterSend?: (message: any) => void;\n\n /** Standard event callbacks (optional) */\n onOpen?: (event: Event) => void;\n onMessage?: (event: MessageEvent) => void;\n onClose?: (event: CloseEvent) => void;\n onError?: (event: Event) => void;\n}\n\nexport interface WSMetrics {\n messagesSent: number;\n messagesReceived: number;\n lastLatency: number;\n reconnectAttempts: number;\n currentUrl: string;\n}\n\nclass AdvancedWebSocket {\n private socket: WebSocket | null = null;\n private currentUrl: string;\n private fallbackUrls: string[];\n private reconnectAttempts: number = 0;\n private messageQueue: Array = [];\n private heartbeatIntervalId: number | null = null;\n private pongTimeoutId: number | null = null;\n private connectionTimeoutId: number | null = null;\n private destroyed: boolean = false;\n\n // Metrics\n private messagesSent: number = 0;\n private messagesReceived: number = 0;\n private lastPingTimestamp: number = 0;\n private lastLatency: number = 0;\n\n // Custom event listeners\n private eventListeners: Record void>> = {\n open: [],\n message: [],\n close: [],\n error: [],\n reconnectAttempt: [],\n reconnect: [],\n reconnectSuccess: [],\n ping: [],\n pong: [],\n custom: [],\n };\n\n private options: WSConnectionOptions;\n\n constructor(options: WSConnectionOptions) {\n if (!options.url) {\n throw new Error(\"A URL is required to establish a WebSocket connection.\");\n }\n this.options = {\n autoReconnect: false,\n reconnectStrategy: \"exponential\",\n reconnectInterval: 1000,\n maxReconnectAttempts: 10,\n maxReconnectInterval: 30000,\n jitter: 300,\n connectionTimeout: 10000,\n heartbeatInterval: 30000,\n heartbeatMessage: \"ping\",\n expectedPongMessage: \"pong\",\n heartbeatTimeout: 5000,\n queueMessages: false,\n autoJson: false,\n ...options,\n };\n this.currentUrl = this.options.url;\n this.fallbackUrls = this.options.fallbackUrls || [];\n }\n\n /** Internal logger */\n private log(level: \"debug\" | \"info\" | \"warn\" | \"error\", ...args: any[]) {\n if (this.options.logger) {\n this.options.logger(level, ...args);\n } else {\n console[level](...args);\n }\n }\n\n /**\n * Establishes the WebSocket connection.\n * Returns a promise that resolves when connected.\n */\n connect(): Promise {\n return new Promise((resolve, reject) => {\n if (this.destroyed) {\n return reject(new Error(\"Instance has been destroyed.\"));\n }\n this.log(\"debug\", `[WS] Connecting to ${this.currentUrl}`);\n this.socket = new WebSocket(this.currentUrl, this.options.protocols);\n\n if (this.options.connectionTimeout) {\n this.connectionTimeoutId = window.setTimeout(() => {\n this.log(\"error\", \"[WS] Connection timeout reached\");\n reject(new Error(\"Connection timeout reached\"));\n this.socket?.close();\n }, this.options.connectionTimeout);\n }\n\n this.socket.onopen = (event) => {\n this.log(\"info\", `[WS] Connected to ${this.currentUrl}`);\n if (this.connectionTimeoutId) {\n clearTimeout(this.connectionTimeoutId);\n this.connectionTimeoutId = null;\n }\n this.reconnectAttempts = 0;\n if (this.options.heartbeatInterval) {\n this.startHeartbeat();\n }\n if (this.options.queueMessages && this.messageQueue.length > 0) {\n this.flushMessageQueue();\n }\n if (this.options.onOpen) this.options.onOpen(event);\n this.dispatchEvent(\"open\", event);\n resolve(this.socket!); // Assert non-null\n };\n\n this.socket.onmessage = (event) => {\n let data: any = event.data;\n if (this.options.incomingMessageInterceptors) {\n this.options.incomingMessageInterceptors.forEach((fn) => {\n data = fn(data);\n });\n }\n if (this.options.autoJson && typeof data === \"string\") {\n try {\n data = JSON.parse(data);\n } catch (e) {\n // fallback to raw data if JSON parsing fails\n }\n }\n this.messagesReceived++;\n // Handle heartbeat pong.\n if (\n this.options.heartbeatInterval &&\n data === this.options.expectedPongMessage\n ) {\n this.log(\"debug\", \"[WS] Received pong\");\n this.dispatchEvent(\"pong\", event);\n if (this.pongTimeoutId) {\n clearTimeout(this.pongTimeoutId);\n this.pongTimeoutId = null;\n }\n this.lastLatency = Date.now() - this.lastPingTimestamp;\n return;\n }\n const modifiedEvent = { ...event, data };\n if (this.options.onMessage) this.options.onMessage(modifiedEvent);\n this.dispatchEvent(\"message\", modifiedEvent);\n };\n\n this.socket.onerror = (event) => {\n this.log(\"error\", \"[WS] Error:\", event);\n if (this.options.onError) this.options.onError(event);\n this.dispatchEvent(\"error\", event);\n };\n\n this.socket.onclose = (event) => {\n this.log(\"warn\", \"[WS] Connection closed:\", event);\n this.stopHeartbeat();\n if (this.options.onClose) this.options.onClose(event);\n this.dispatchEvent(\"close\", event);\n // Attempt auto-reconnect if enabled and not destroyed.\n if (\n this.options.autoReconnect &&\n this.reconnectAttempts < (this.options.maxReconnectAttempts || 0) &&\n !this.destroyed\n ) {\n // Allow hook to cancel reconnect.\n if (\n this.options.onBeforeReconnect &&\n !this.options.onBeforeReconnect(this.reconnectAttempts, event)\n ) {\n this.log(\"info\", \"[WS] Reconnect canceled by onBeforeReconnect hook.\");\n return;\n }\n this.reconnectAttempts++;\n this.dispatchEvent(\"reconnectAttempt\", {\n attempt: this.reconnectAttempts,\n });\n let delay = this.computeReconnectDelay();\n this.log(\n \"info\",\n `[WS] Reconnecting in ${delay}ms... (Attempt ${this.reconnectAttempts})`\n );\n setTimeout(() => {\n // Try fallback URLs if provided.\n if (this.fallbackUrls.length > 0) {\n const nextUrl = this.fallbackUrls.shift();\n if (nextUrl) {\n this.log(\"info\", `[WS] Switching to fallback URL: ${nextUrl}`);\n this.currentUrl = nextUrl;\n }\n }\n this.dispatchEvent(\"reconnect\", { attempt: this.reconnectAttempts });\n this.connect()\n .then((sock) => {\n this.dispatchEvent(\"reconnectSuccess\", {\n attempt: this.reconnectAttempts,\n });\n })\n .catch((err) => {\n this.log(\"error\", \"[WS] Reconnection failed:\", err);\n });\n }, delay);\n }\n };\n });\n }\n\n /**\n * Computes the delay (ms) for the next reconnection attempt based on strategy.\n */\n private computeReconnectDelay(): number {\n let base = this.options.reconnectInterval || 1000;\n let delay: number;\n switch (this.options.reconnectStrategy) {\n case \"fixed\":\n delay = base;\n break;\n case \"exponential\":\n delay = base * Math.pow(2, this.reconnectAttempts - 1);\n break;\n case \"exponential-jitter\":\n delay = base * Math.pow(2, this.reconnectAttempts - 1);\n const jitter = this.options.jitter || 300;\n delay += Math.floor(Math.random() * jitter);\n break;\n default:\n delay = base;\n }\n if (this.options.maxReconnectInterval) {\n delay = Math.min(delay, this.options.maxReconnectInterval);\n }\n return delay;\n }\n\n /**\n * Sends data over the WebSocket.\n * Returns a promise that resolves once the message is sent.\n */\n send(data: any): Promise {\n return new Promise((resolve, reject) => {\n if (!this.socket || this.socket.readyState !== WebSocket.OPEN) {\n if (this.options.queueMessages) {\n if (\n this.options.messageQueueLimit &&\n this.messageQueue.length >= this.options.messageQueueLimit\n ) {\n this.log(\"error\", \"[WS] Message queue full; discarding message.\");\n return reject(new Error(\"Message queue is full.\"));\n }\n this.log(\"debug\", \"[WS] Queuing message (connection not open).\");\n this.messageQueue.push(data);\n return resolve();\n } else {\n this.log(\"error\", \"[WS] Socket not open; cannot send.\");\n return reject(new Error(\"WebSocket is not open.\"));\n }\n }\n // Before-send hook.\n if (this.options.onBeforeSend) {\n data = this.options.onBeforeSend(data);\n }\n // Apply outgoing interceptors.\n if (this.options.outgoingMessageInterceptors) {\n this.options.outgoingMessageInterceptors.forEach((fn) => {\n data = fn(data);\n });\n }\n // Auto‑JSON stringify.\n if (this.options.autoJson && typeof data === \"object\") {\n try {\n data = JSON.stringify(data);\n } catch (err) {\n this.log(\"error\", \"[WS] JSON stringify error:\", err);\n return reject(err);\n }\n }\n try {\n this.socket.send(data);\n this.messagesSent++;\n if (this.options.onAfterSend) {\n this.options.onAfterSend(data);\n }\n resolve();\n } catch (err) {\n reject(err);\n }\n });\n }\n\n /** Flush queued messages */\n private flushMessageQueue(): void {\n this.log(\"debug\", `[WS] Flushing ${this.messageQueue.length} queued message(s).`);\n while (this.messageQueue.length > 0) {\n const msg = this.messageQueue.shift();\n if (msg !== undefined && this.socket && this.socket.readyState === WebSocket.OPEN) {\n this.send(msg).catch((err) => {\n this.log(\"error\", \"[WS] Error sending queued message:\", err);\n });\n }\n }\n }\n\n /** Starts the heartbeat (ping/pong) mechanism */\n private startHeartbeat(): void {\n if (this.options.heartbeatInterval && this.socket) {\n this.log(\"debug\", \"[WS] Starting heartbeat.\");\n this.heartbeatIntervalId = window.setInterval(() => {\n if (this.socket && this.socket.readyState === WebSocket.OPEN) {\n this.log(\"debug\", \"[WS] Sending heartbeat ping.\");\n this.dispatchEvent(\"ping\", { timestamp: Date.now() });\n this.lastPingTimestamp = Date.now();\n this.socket.send(this.options.heartbeatMessage!);\n if (this.options.heartbeatTimeout) {\n this.pongTimeoutId = window.setTimeout(() => {\n this.log(\"error\", \"[WS] Pong timeout; closing connection.\");\n this.socket?.close();\n }, this.options.heartbeatTimeout);\n }\n }\n }, this.options.heartbeatInterval);\n }\n }\n\n /** Stops the heartbeat mechanism */\n private stopHeartbeat(): void {\n if (this.heartbeatIntervalId) {\n clearInterval(this.heartbeatIntervalId);\n this.heartbeatIntervalId = null;\n }\n if (this.pongTimeoutId) {\n clearTimeout(this.pongTimeoutId);\n this.pongTimeoutId = null;\n }\n }\n\n /** Closes the WebSocket connection gracefully */\n close(code?: number, reason?: string): void {\n if (this.socket) {\n this.socket.close(code, reason);\n this.log(\"info\", \"[WS] Connection closed manually.\");\n }\n }\n\n /** Returns whether the connection is currently open */\n isConnected(): boolean {\n return this.socket !== null && this.socket.readyState === WebSocket.OPEN;\n }\n\n /** Returns a human‑readable connection state */\n getConnectionState(): string {\n if (!this.socket) return \"CLOSED\";\n switch (this.socket.readyState) {\n case WebSocket.CONNECTING:\n return \"CONNECTING\";\n case WebSocket.OPEN:\n return \"OPEN\";\n case WebSocket.CLOSING:\n return \"CLOSING\";\n case WebSocket.CLOSED:\n return \"CLOSED\";\n default:\n return \"UNKNOWN\";\n }\n }\n\n /** Forces a manual reconnect */\n manualReconnect(): Promise {\n this.log(\"info\", \"[WS] Manual reconnect initiated.\");\n if (this.socket && this.socket.readyState === WebSocket.OPEN) {\n this.socket.close();\n }\n return this.connect();\n }\n\n /**\n * Sends a message and waits for a response matching the predicate.\n * Useful for request/response patterns.\n */\n sendAndWaitResponse(\n message: any,\n predicate: (msg: any) => boolean,\n timeout: number = 5000\n ): Promise {\n return new Promise((resolve, reject) => {\n const listener = (event: MessageEvent) => {\n if (predicate(event.data)) {\n this.removeEventListener(\"message\", listener);\n resolve(event.data);\n }\n };\n this.addEventListener(\"message\", listener);\n this.send(message).catch((err) => {\n this.removeEventListener(\"message\", listener);\n reject(err);\n });\n setTimeout(() => {\n this.removeEventListener(\"message\", listener);\n reject(new Error(\"Response timeout exceeded.\"));\n }, timeout);\n });\n }\n\n /** Returns metrics on the current connection */\n getMetrics(): WSMetrics {\n return {\n messagesSent: this.messagesSent,\n messagesReceived: this.messagesReceived,\n lastLatency: this.lastLatency,\n reconnectAttempts: this.reconnectAttempts,\n currentUrl: this.currentUrl,\n };\n }\n\n /** Destroys the instance, cleans up timers and listeners */\n destroy(): void {\n this.destroyed = true;\n this.stopHeartbeat();\n if (this.connectionTimeoutId) {\n clearTimeout(this.connectionTimeoutId);\n this.connectionTimeoutId = null;\n }\n this.eventListeners = {\n open: [],\n message: [],\n close: [],\n error: [],\n reconnectAttempt: [],\n reconnect: [],\n reconnectSuccess: [],\n ping: [],\n pong: [],\n custom: [],\n };\n this.messageQueue = [];\n if (this.socket) {\n this.socket.close();\n this.socket = null;\n }\n this.log(\"info\", \"[WS] Connection destroyed.\");\n }\n\n /** Adds an event listener for a given event type */\n addEventListener(eventType: EventType, callback: (event: any) => void): void {\n this.eventListeners[eventType].push(callback);\n }\n\n /** Removes an event listener for a given event type */\n removeEventListener(eventType: EventType, callback: (event: any) => void): void {\n this.eventListeners[eventType] = this.eventListeners[eventType].filter(\n (cb) => cb !== callback\n );\n }\n\n /** Dispatches an event to all registered listeners */\n private dispatchEvent(eventType: EventType, event: any): void {\n this.eventListeners[eventType].forEach((cb) => cb(event));\n }\n\n /** Updates connection options dynamically (effective on next connection) */\n updateOptions(newOptions: Partial): void {\n this.options = { ...this.options, ...newOptions };\n this.log(\"debug\", \"[WS] Options updated:\", this.options);\n }\n\n /** Clears the outgoing message queue */\n clearMessageQueue(): void {\n this.messageQueue = [];\n this.log(\"debug\", \"[WS] Message queue cleared.\");\n }\n}\n\nexport default AdvancedWebSocket;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQA,IAAqB,QAArB,MAA2B;AAAA;AAAA;AAAA;AAAA;AAAA,EAOvB,OAAc,SAAS,KAAmB;AACtC,SAAK,WAAW;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAc,WAAmB;AAC7B,QAAI,CAAC,KAAK,UAAU;AAChB,YAAM,IAAI,MAAM,wEAAwE;AAAA,IAC5F;AACA,WAAO,KAAK;AAAA,EAChB;AACJ;;;AC9BA,mBAAkB;AA8BlB,eAAO,mBAA0C,SAMhC;AACb,QAAM,MAAM,GAAG,QAAQ,KAAK,oBAAoB,QAAQ,QAAQ;AAChE,QAAM,UAAU;AAAA,IACZ,UAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,iBAAiB,UAAU,QAAQ,MAAM;AAAA,EAC7C;AAEA,MAAI,OAA2B;AAE/B,MAAI,QAAQ,QAAQ,QAAQ,WAAW,SAAS,QAAQ,WAAW,UAAU;AACzE,WAAO,OAAO,QAAQ,SAAS,WAAW,QAAQ,OAAO,KAAK,UAAU,QAAQ,IAAI;AAAA,EACxF;AAEA,MAAI;AACA,QAAI,QAAQ,WAAW,SAAS;AAC5B,YAAM,WAAW,MAAM,aAAAA,QAAM,MAAM,KAAK,QAAQ,MAAM,EAAE,QAAQ,CAAC;AACjE,aAAO,SAAS;AAAA,IACpB,OAAO;AACH,YAAM,WAAW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;AAAA,MACP,MAAM,CAAC;AAAA,MACP,QAAQ,CAAC;AAAA,IACX;AACA,SAAK,eAAe,CAAC;AACrB,QAAI,KAAK,QAAQ;AACf,WAAK,OAAO,MAAM;AAClB,WAAK,SAAS;AAAA,IAChB;AACA,SAAK,IAAI,QAAQ,4BAA4B;AAAA,EAC/C;AAAA;AAAA,EAGA,iBAAiB,WAAsB,UAAsC;AAC3E,SAAK,eAAe,SAAS,EAAE,KAAK,QAAQ;AAAA,EAC9C;AAAA;AAAA,EAGA,oBAAoB,WAAsB,UAAsC;AAC9E,SAAK,eAAe,SAAS,IAAI,KAAK,eAAe,SAAS,EAAE;AAAA,MAC9D,CAAC,OAAO,OAAO;AAAA,IACjB;AAAA,EACF;AAAA;AAAA,EAGQ,cAAc,WAAsB,OAAkB;AAC5D,SAAK,eAAe,SAAS,EAAE,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;AAAA,EAC1D;AAAA;AAAA,EAGA,cAAc,YAAgD;AAC5D,SAAK,UAAU,EAAE,GAAG,KAAK,SAAS,GAAG,WAAW;AAChD,SAAK,IAAI,SAAS,yBAAyB,KAAK,OAAO;AAAA,EACzD;AAAA;AAAA,EAGA,oBAA0B;AACxB,SAAK,eAAe,CAAC;AACrB,SAAK,IAAI,SAAS,6BAA6B;AAAA,EACjD;AACF;AAEA,IAAO,uBAAQ;;;AnGjiBf,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AACb;","names":["axios","listServers","serverDetails","import_axios","axios","listAllocations","reinstallServer","listUsers","createUser","updateUser","deleteUser","userDetails","listServers","serverDetails","reinstallServer","listAllocations","listUsers","createUser","updateUser","deleteUser","userDetails"]} \ No newline at end of file +{"version":3,"sources":["../src/index.ts","../src/class/main/Setup.ts","../src/functions/createAppCall.ts","../src/class/source/app/users/listUsers.ts","../src/class/source/app/users/userDetails.ts","../src/class/source/app/users/userDetails_externalId.ts","../src/class/source/app/users/createUser.ts","../src/class/source/app/users/updateUser.ts","../src/class/source/app/users/deleteUser.ts","../src/class/source/app/nodes/listNodes.ts","../src/class/source/app/nodes/nodeDetails.ts","../src/class/source/app/nodes/nodeConfiguration.ts","../src/class/source/app/nodes/createNode.ts","../src/class/source/app/nodes/updateNode.ts","../src/class/source/app/nodes/deleteNode.ts","../src/class/source/app/locations/listLocations.ts","../src/class/source/app/locations/locationDetails.ts","../src/class/source/app/locations/createLocation.ts","../src/class/source/app/locations/updateLocation.ts","../src/class/source/app/locations/deleteLocation.ts","../src/class/source/app/servers/listServers.ts","../src/class/source/app/servers/serverDetails.ts","../src/class/source/app/servers/serverDetails_externalId.ts","../src/class/source/app/servers/updateDetails.ts","../src/class/source/app/servers/updateServerBuild.ts","../src/class/source/app/servers/updateServerStartup.ts","../src/class/source/app/servers/createServer.ts","../src/class/source/app/servers/suspendServer.ts","../src/class/source/app/servers/unsuspendServer.ts","../src/class/source/app/servers/reinstallServer.ts","../src/class/source/app/servers/deleteServer.ts","../src/class/source/app/servers/forceDeleteServer.ts","../src/class/source/app/servers/databases/listDatabases.ts","../src/class/source/app/servers/databases/databaseDetails.ts","../src/class/source/app/servers/databases/createDatabase.ts","../src/class/source/app/servers/databases/resetDatabasePassword.ts","../src/class/source/app/servers/databases/deleteDatabase.ts","../src/class/source/app/nests/eggs/listEggs.ts","../src/class/source/app/nests/eggs/eggDetails.ts","../src/class/source/app/nests/listNests.ts","../src/class/source/app/nests/nestDetails.ts","../src/class/source/app/nodes/allocations/listAllocations.ts","../src/class/source/app/nodes/allocations/createAllocations.ts","../src/class/source/app/nodes/allocations/deleteAllocation.ts","../src/class/main/Application.ts","../src/functions/createClientCall.ts","../src/class/source/client/account/accountDetails.ts","../src/class/source/client/account/2faEnable.ts","../src/class/source/client/account/2faDisable.ts","../src/class/source/client/account/updateEmail.ts","../src/class/source/client/account/updatePassword.ts","../src/class/source/client/account/createApiKey.ts","../src/class/source/client/account/deleteApiKey.ts","../src/class/source/client/account/listApiKeys.ts","../src/class/source/client/listServers.ts","../src/class/source/client/showPermissions.ts","../src/class/source/client/servers/command.ts","../src/class/source/client/servers/power.ts","../src/class/source/client/servers/consoleDetails.ts","../src/class/source/client/servers/resources.ts","../src/class/source/client/servers/serverDetails.ts","../src/class/source/client/servers/backups/listBackups.ts","../src/class/source/client/servers/backups/backupDetails.ts","../src/class/source/client/servers/backups/createBackup.ts","../src/class/source/client/servers/backups/deleteBackup.ts","../src/class/source/client/servers/backups/downloadBackup.ts","../src/class/source/client/servers/files/listFiles.ts","../src/class/source/client/servers/files/getFileContent.ts","../src/class/source/client/servers/files/downloadFile.ts","../src/class/source/client/servers/files/renameFile.ts","../src/class/source/client/servers/files/copyFile.ts","../src/class/source/client/servers/files/writeFile.ts","../src/class/source/client/servers/files/compressFile.ts","../src/class/source/client/servers/files/decompressFile.ts","../src/class/source/client/servers/files/deleteFile.ts","../src/class/source/client/servers/files/createFolder.ts","../src/class/source/client/servers/files/uploadFile.ts","../src/class/source/client/servers/network/listAllocations.ts","../src/class/source/client/servers/network/assignAllocations.ts","../src/class/source/client/servers/network/setAllocationNote.ts","../src/class/source/client/servers/network/setPrimaryAllocation.ts","../src/class/source/client/servers/network/unassignAllocation.ts","../src/class/source/client/servers/schedules/listSchedules.ts","../src/class/source/client/servers/schedules/createSchedule.ts","../src/class/source/client/servers/schedules/scheduleDetails.ts","../src/class/source/client/servers/schedules/updateSchedule.ts","../src/class/source/client/servers/schedules/deleteSchedule.ts","../src/class/source/client/servers/schedules/createTask.ts","../src/class/source/client/servers/schedules/updateTask.ts","../src/class/source/client/servers/schedules/deleteTask.ts","../src/class/source/client/servers/settings/renameServer.ts","../src/class/source/client/servers/settings/reinstallServer.ts","../src/class/source/client/servers/startup/listVariables.ts","../src/class/source/client/servers/startup/updateVariable.ts","../src/class/source/client/servers/users/listUsers.ts","../src/class/source/client/servers/users/createUser.ts","../src/class/source/client/servers/users/updateUser.ts","../src/class/source/client/servers/users/deleteUser.ts","../src/class/source/client/servers/users/userDetails.ts","../src/class/main/Client.ts","../src/class/main/WSConnection.ts"],"sourcesContent":["import Application from \"./class/main/Application\";\nimport Client from \"./class/main/Client\";\nimport Setup from \"./class/main/Setup\";\nimport AdvancedWebSocket from \"./class/main/WSConnection\";\n\nexport default {\n Application,\n Client,\n Setup,\n WebSocket: AdvancedWebSocket,\n};","/**\n * The Setup class provides a way to configure global settings for the Pterodactyl API Wrapper.\n * The primary use is to set the panel URL, which is then used in all API requests.\n *\n * @example\n * Setup.setPanel(\"https://panel.example.com\");\n * const panelUrl = Setup.getPanel();\n */\nexport default class Setup {\n private static panelUrl: string;\n\n /**\n * Sets the global panel URL.\n * @param url - The URL of the Pterodactyl panel.\n */\n public static setPanel(url: string): void {\n this.panelUrl = url;\n }\n\n /**\n * Gets the globally set panel URL.\n * @returns The panel URL.\n * @throws If the panel URL has not been set.\n */\n public static getPanel(): string {\n if (!this.panelUrl) {\n throw new Error(\"Panel URL is not set. Use Setup.setPanel(url) before making API calls.\");\n }\n return this.panelUrl;\n }\n}\n","import axios from \"axios\";\n\n/**\n * Creates an API Call to the Application API of your Pterodactyl panel.\n *\n * @param {Object} options - API call options.\n * @param {string} options.panel - Your panel's URL.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.endpoint - The API endpoint to call.\n * @param {\"GET\" | \"DELETE\" | \"POST\" | \"PATCH\" | \"PUT\"} options.method - HTTP method.\n * @param {any} [options.body] - Request body (for POST and PATCH requests).\n * @returns {Promise} - The data fetched from the API.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const data = await ApplicationAPICall({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * endpoint: \"users\",\n * method: \"GET\"\n * });\n * console.log(\"API Response:\", data);\n * } catch (error) {\n * console.error(\"Error:\", error);\n * }\n * })();\n */\nexport default async function ApplicationAPICall(options: {\n panel: string;\n apiKey: string;\n endpoint: string;\n method: \"GET\" | \"DELETE\" | \"POST\" | \"PATCH\" | \"PUT\";\n body?: any;\n}): Promise {\n const url = `${options.panel}/api/application/${options.endpoint}`;\n const headers = {\n 'Accept': \"application/json\",\n 'Content-Type': \"application/json\",\n 'Authorization': `Bearer ${options.apiKey}`\n };\n\n let body: string | undefined = undefined;\n\n if (options.body && options.method !== \"GET\" && options.method !== \"DELETE\") {\n body = typeof options.body === \"string\" ? options.body : JSON.stringify(options.body);\n }\n\n try {\n if (options.method === \"PATCH\") {\n const response = await axios.patch(url, options.body, { headers });\n return response.data;\n } else {\n const response = await fetch(url, {\n method: options.method,\n headers,\n body\n });\n\n if (!response.ok) {\n throw new Error(`API call failed with status ${response.status}: ${await response.text()}`);\n }\n\n return await response.json();\n }\n } catch (error) {\n throw new Error(`Error in API call: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: boolean,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_page: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of users from the Pterodactyl panel API, with optional filters and sorting.\n * This function makes a `GET` request and includes the request body if required.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {boolean} [options.showLinkedServers=false] - Whether to include linked servers in the response.\n * @param {Object} [options.filters] - Filters to apply when retrieving users.\n * @param {string} [options.filters.email] - Filter users by their email address.\n * @param {string} [options.filters.uuid] - Filter users by their UUID.\n * @param {string} [options.filters.username] - Filter users by their username.\n * @param {string} [options.filters.external_id] - Filter users by their external ID.\n * @param {Object} [options.sortBy] - Sorting preferences for the response.\n * @param {boolean} [options.sortBy.id=false] - Sort users by ID.\n * @param {boolean} [options.sortBy.uuid=false] - Sort users by UUID.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\n\nexport default async function listUsers(options: { \n apiKey: string, \n panel: string, \n showLinkedServers?: boolean, \n filters?: { \n email?: string, \n uuid?: string, \n username?: string, \n external_id?: string\n },\n sortBy?: {\n id?: boolean,\n uuid?: boolean\n }\n}): Promise {\n const body = {\n servers: options.showLinkedServers ?? false,\n filters: {\n email: options.filters?.email ?? null,\n uuid: options.filters?.uuid ?? null,\n username: options.filters?.username ?? null,\n external_id: options.filters?.external_id ?? null\n },\n sortBy: {\n id: options.sortBy?.id ?? false,\n uuid: options.sortBy?.uuid ?? false\n }\n };\n\n return ApplicationAPICall({\n panel: options.panel,\n apiKey: options.apiKey,\n endpoint: \"users\",\n method: \"GET\",\n body: JSON.stringify(body) \n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves details of a specific user from the Pterodactyl panel API.\n * Optionally, it can include the list of servers associated with the user.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.user_id - The unique ID of the user to retrieve.\n * @param {boolean} [options.listServers=false] - Whether to include the user's linked servers in the response.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function userDetails(options: { \n apiKey: string, \n panel: string, \n user_id: string, \n listServers?: boolean \n}): Promise {\n return ApplicationAPICall({\n panel: options.panel,\n apiKey: options.apiKey,\n endpoint: `user/${options.user_id}`,\n method: \"GET\",\n body: JSON.stringify({ servers: options.listServers ?? false }) // Ensuring body is a string\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves user details from the Pterodactyl panel API using an external identifier.\n * Optionally, it can include the list of servers associated with the user.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.external_id - The external identifier of the user to retrieve.\n * @param {boolean} [options.listServers=false] - Whether to include the user's linked servers in the response.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const userData = await userDetailsByExternalIdentifier({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * external_id: \"external-user-1234\",\n * listServers: true\n * });\n * console.log(\"User Details:\", userData);\n * } catch (error) {\n * console.error(\"Error:\", error);\n * }\n * })();\n */\nexport default async function userDetailsByExternalIdentifier(options: { \n apiKey: string, \n panel: string, \n external_id: string, \n listServers?: boolean \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `users/external/${options.external_id}`,\n body: JSON.stringify({ servers: options.listServers ?? false }) // Ensuring body is a JSON string\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Creates a new user in the Pterodactyl panel using the provided user details.\n * If `first_name` or `last_name` are not provided, they default to `\"Pterodactyl\"` and `\"User\"`, respectively.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.user_details - The details of the user to be created.\n * @param {string} options.user_details.email - The email address of the user.\n * @param {string} options.user_details.username - The username of the user.\n * @param {string} [options.user_details.first_name=\"Pterodactyl\"] - The first name of the user (optional).\n * @param {string} [options.user_details.last_name=\"User\"] - The last name of the user (optional).\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const newUser = await createUser({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * user_details: {\n * email: \"newuser@example.com\",\n * username: \"newUser123\",\n * first_name: \"John\",\n * last_name: \"Doe\"\n * }\n * });\n * console.log(\"User Created:\", newUser);\n * } catch (error) {\n * console.error(\"Error creating user:\", error);\n * }\n * })();\n */\nexport default async function createUser(options: {\n apiKey: string;\n panel: string;\n user_details: {\n email: string;\n username: string;\n first_name?: string;\n last_name?: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"users\",\n body: JSON.stringify({\n email: options.user_details.email,\n username: options.user_details.username,\n first_name: options.user_details.first_name ?? \"Pterodactyl\",\n last_name: options.user_details.last_name ?? \"User\"\n }) \n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Updates a user's details on the Pterodactyl panel.\n * You can update the user's email, username, first name, last name, language, or password.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.user_id - The ID of the user to update.\n * @param {Object} options.data - The data to update for the user.\n * @param {string} [options.data.email] - The new email of the user (optional).\n * @param {string} [options.data.username] - The new username of the user (optional).\n * @param {string} [options.data.first_name] - The new first name of the user (optional).\n * @param {string} [options.data.last_name] - The new last name of the user (optional).\n * @param {string} [options.data.language] - The new language preference for the user (optional).\n * @param {string} [options.data.password] - The new password for the user (optional).\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const updatedUser = await updateUser({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * user_id: 1234,\n * data: {\n * email: \"newemail@example.com\",\n * username: \"UpdatedUsername\",\n * first_name: \"John\",\n * last_name: \"Doe\"\n * }\n * });\n * console.log(\"User Updated:\", updatedUser);\n * } catch (error) {\n * console.error(\"Error updating user:\", error);\n * }\n * })();\n */\nexport default async function updateUser(options: {\n apiKey: string;\n panel: string;\n user_id: number;\n data: {\n email?: string;\n username?: string;\n first_name?: string;\n last_name?: string;\n language?: string;\n password?: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n endpoint: `users/${options.user_id}`, // Fixed endpoint (removed extra \"/\")\n method: \"PATCH\",\n body: JSON.stringify(options.data) // Ensured the body is stringified\n });\n}","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a user from the Pterodactyl panel using the given identifier.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.identifier - The unique identifier (ID) of the user to be deleted.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const response = await deleteUser({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * identifier: 1234\n * });\n * console.log(\"User Deleted:\", response);\n * } catch (error) {\n * console.error(\"Error deleting user:\", error);\n * }\n * })();\n */\nexport default async function deleteUser(options: { \n apiKey: string; \n panel: string; \n identifier: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `users/${options.identifier}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean,\n name: string,\n description: string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: string,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_sftp: number,\n daemon_base: string,\n created_at: string,\n updated_at: string\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of all nodes on the Pterodactyl panel.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing all nodes.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listNodes(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"nodes\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean,\n name: string,\n description: string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: boolean,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_base: string,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves details of a specific node.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node whose details are requested.\n * @returns {Promise} - API response containing node details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function nodeDetails(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nodes/${options.node_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n debug: boolean,\n uuid: string,\n token_id: string,\n token: string,\n api: {\n host: string,\n ssl: {\n enabled: boolean,\n cert: string,\n key: string\n },\n upload_limit: string,\n },\n system: {\n data: string,\n sftp: {\n bind_port: number\n }\n },\n remote: string\n}\n\n/**\n * Retrieves the configuration settings of a specific node.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node whose configuration is requested.\n * @returns {Promise} - API response containing the node configuration.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function nodeConfiguration(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nodes/${options.node_id}/configuration`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean,\n name: string,\n description: null | string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: boolean,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_sftp: number,\n daemon_base: string,\n created_at: string,\n updated_at: string,\n allocated_resources: {\n memory: number,\n disk: number\n }\n },\n meta: {\n resource: string\n }\n}\n\n/**\n * Creates a new node on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.node_data - Node details for creation.\n * @param {string} options.node_data.name - The name of the node.\n * @param {string} [options.node_data.description] - Optional description of the node.\n * @param {number} options.node_data.location_id - The ID of the location where the node should be created.\n * @param {string} options.node_data.fqdn - The fully qualified domain name of the node.\n * @param {\"http\" | \"https\"} options.node_data.scheme - The scheme (HTTP or HTTPS) for the node.\n * @param {number} options.node_data.memory - The amount of memory allocated to the node (in MB).\n * @param {number} options.node_data.disk - The amount of disk space allocated to the node (in MB).\n * @param {number[]} [options.node_data.ports] - Optional list of ports assigned to the node.\n * @param {number} options.node_data.daemon_sftp - The SFTP port of the node.\n * @param {number} options.node_data.daemon_listen - The daemon listen port of the node.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createNode(options: { \n apiKey: string; \n panel: string; \n node_data: {\n name: string;\n description?: string;\n location_id: number;\n fqdn: string;\n scheme: \"http\" | \"https\";\n memory: number;\n disk: number;\n ports?: number[];\n daemon_sftp: number;\n daemon_listen: number;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"nodes\",\n body: JSON.stringify(options.node_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean, \n name: string,\n description: string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: boolean,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_sftp: number,\n daemon_base: string,\n created_at: string,\n updated_at: string,\n mounts: [],\n allocated_resources: {\n memory: number,\n disk: number\n }\n }\n}\n\n/**\n * Updates an existing node with new settings.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node to update.\n * @param {Object} options.update_data - The new data for the node update.\n * @param {string} [options.update_data.name] - The new name for the node (optional).\n * @param {string} [options.update_data.description] - The new description for the node (optional).\n * @param {number} [options.update_data.location_id] - The new location ID for the node (optional).\n * @param {number} [options.update_data.memory] - The new memory allocation for the node (optional, in MB).\n * @param {number} [options.update_data.disk] - The new disk allocation for the node (optional, in MB).\n * @param {number} [options.update_data.daemon_sftp] - The new SFTP port for the node (optional).\n * @param {number} [options.update_data.daemon_listen] - The new daemon listen port for the node (optional).\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateNode(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n update_data: {\n name?: string;\n description?: string;\n location_id?: number;\n memory?: number;\n disk?: number;\n daemon_sftp?: number;\n daemon_listen?: number;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `nodes/${options.node_id}`,\n body: JSON.stringify(options.update_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a node from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node to delete.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteNode(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `nodes/${options.node_id}`\n });\n}","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: {\n object: string;\n attributes: {\n id: number;\n short: string;\n long: string;\n updated_at: string;\n created_at: string;\n };\n }[];\n meta: {\n pagination: {\n total: number;\n count: number;\n per_page: number;\n current_page: number;\n total_pages: number;\n links: object;\n };\n };\n }\n \n\n/**\n * Retrieves a list of all locations from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing all locations.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listLocations(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"locations\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n short: string,\n long: string,\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Retrieves details of a specific location from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.location_id - The ID of the location to retrieve.\n * @returns {Promise} - API response containing location details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function locationDetails(options: { \n apiKey: string; \n panel: string; \n location_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `locations/${options.location_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n short: string,\n long: string,\n updates_at: string,\n created_at: string\n },\n meta: {\n resource: string\n }\n}\n\n/**\n * Creates a new location on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.location_data - The data required to create a new location.\n * @param {string} options.location_data.short - A short identifier for the location (e.g., \"us-east\").\n * @param {string} options.location_data.long - A long description of the location (e.g., \"US East Coast Datacenter\").\n * @returns {Promise} - API response containing the created location details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createLocation(options: { \n apiKey: string; \n panel: string; \n location_data: {\n short: string;\n long: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"locations\",\n body: JSON.stringify(options.location_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n short: string,\n long: string,\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Updates an existing location on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.location_id - The ID of the location to update.\n * @param {Object} options.update_data - The new data for updating the location.\n * @param {string} [options.update_data.short] - The new short identifier for the location (optional).\n * @param {string} [options.update_data.long] - The new long description of the location (optional).\n * @returns {Promise} - API response confirming the update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateLocation(options: { \n apiKey: string; \n panel: string; \n location_id: number; \n update_data: {\n short?: string;\n long?: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `locations/${options.location_id}`,\n body: JSON.stringify(options.update_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a location from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.location_id - The ID of the location to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteLocation(options: { \n apiKey: string; \n panel: string; \n location_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `locations/${options.location_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[]\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n pack: any,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: object\n },\n updated_at: string,\n created_at: string,\n relationship: {\n databases: {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number, \n database: string,\n username: string,\n remote: string,\n max_connections: number,\n created_at: string,\n updated_at: string\n }\n }[]\n }[]\n }\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of all servers from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing the list of servers.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listServers(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"servers\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[]\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n pack: boolean,\n container: {\n startup_commands: string,\n image: string,\n installed: boolean,\n environment: object\n }\n updated_at: number,\n created_at: number\n }\n}\n\n/**\n * Retrieves details of a specific server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing server details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function serverDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[]\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n pack: boolean,\n container: {\n startup_commands: string,\n image: string,\n installed: boolean,\n environment: object\n }\n updated_at: number,\n created_at: number\n }\n}\n\n/**\n * Retrieves details of a specific server using an external identifier.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.external_id - The external identifier of the server.\n * @returns {Promise} - API response containing server details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function serverDetailsExternalIdentifier(options: { \n apiKey: string; \n panel: string; \n external_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/external/${options.external_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n descriptions: string,\n suspendes: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: number[] | null\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: [],\n },\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Updates details of a specific server (name or description).\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} options.update_data - The new server details.\n * @returns {Promise} - API response confirming the update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n update_data: any;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/details`,\n body: JSON.stringify(options.update_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n descriptions: string,\n suspendes: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: number[] | null\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: [],\n },\n updated_at: string,\n created_at: string\n }\n}\n\n\n/**\n * Updates the build configuration of a server, including CPU, memory, disk, and other limits.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} options.build_data - The new build configuration.\n * @param {number} [options.build_data.cpu] - The CPU limit (in percentage, 100% = 1 core).\n * @param {number} [options.build_data.memory] - The memory limit (in MB).\n * @param {number} [options.build_data.disk] - The disk space limit (in MB).\n * @param {number} [options.build_data.swap] - The swap memory limit (in MB).\n * @param {number} [options.build_data.io] - The block I/O weight (10-1000).\n * @param {number} [options.build_data.threads] - The CPU threads allowed for the server.\n * @param {boolean} [options.build_data.oom_disabled] - Whether to disable Out-of-Memory (OOM) killer.\n * @returns {Promise} - API response confirming the build update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateServerBuild(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n build_data: {\n cpu?: number;\n memory?: number;\n disk?: number;\n swap?: number;\n io?: number;\n threads?: number;\n oom_disabled?: boolean;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/build`,\n body: JSON.stringify(options.build_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n descriptions: string,\n suspendes: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: number[] | null\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: [],\n },\n updated_at: string,\n created_at: string\n }\n}\n\n\n/**\n * Updates the startup configuration of a server, including environment variables and startup command.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} options.startup_data - The new startup configuration.\n * @param {string} [options.startup_data.startup] - The new startup command.\n * @param {number} [options.startup_data.egg] - The new egg ID for the server.\n * @param {number} [options.startup_data.image] - The new Docker image for the server.\n * @param {Object} [options.startup_data.environment] - The environment variables for the server.\n * @returns {Promise} - API response confirming the startup update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateServerStartup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n startup_data: {\n startup?: string;\n egg?: number;\n image?: string;\n environment?: Record;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/startup`,\n body: JSON.stringify(options.startup_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: null | string | number,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[],\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: object\n },\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Creates a new server on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.server_data - The data required to create the server.\n * @returns {Promise} - API response containing the created server details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createServer(options: { \n apiKey: string; \n panel: string; \n server_data: any;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"servers\",\n body: JSON.stringify(options.server_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Suspends a server, preventing it from starting.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to suspend.\n * @returns {Promise} - API response confirming the suspension.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function suspendServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/suspend`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Unsuspends a server, allowing it to start again.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to unsuspend.\n * @returns {Promise} - API response confirming the unsuspension.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function unsuspendServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/unsuspend`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Reinstalls a server, resetting its files and configuration.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to reinstall.\n * @returns {Promise} - API response confirming the reinstallation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function reinstallServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/reinstall`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a server from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Forcefully deletes a server from the Pterodactyl panel, bypassing standard checks.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function forceDeleteServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/force`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number,\n database: string,\n username: string,\n remote: string,\n max_connections: number,\n created_at: string,\n updated_at: string,\n relationships: {\n password: {\n object: string,\n attributes: {\n password: string\n }\n }\n host: {\n object: string,\n attributes: {\n id: number,\n name: string,\n host: string,\n port: number,\n username: string,\n node: number,\n created_at: string,\n updated_at: string\n }\n }\n }\n }\n }[]\n}\n\n/**\n * Retrieves a list of all databases for a specific server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing all databases.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listDatabases(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/databases`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number,\n database: string,\n username: string,\n remote: string,\n max_connections: number,\n created_at: string,\n updated_at: string\n }\n}\n/**\n * Retrieves details of a specific database.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.database_id - The ID of the database.\n * @returns {Promise} - API response containing database details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function databaseDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/databases/${options.database_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number,\n database: string,\n username: string,\n remote: string,\n max_connections: number | null,\n created_at: string,\n updated_at: string\n },\n meta: {\n resource: string\n }\n}\n\n/**\n * Creates a new database for a specific server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to create the database for.\n * @param {Object} options.database_data - The data for the new database.\n * @param {string} options.database_data.database - The name of the database.\n * @param {string} options.database_data.remote - The remote access setting (e.g., `%` for any IP).\n * @returns {Promise} - API response containing the created database details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createDatabase(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_data: {\n database: string;\n remote: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/databases`,\n body: JSON.stringify(options.database_data)\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Resets the password for a specific database.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.database_id - The ID of the database.\n * @returns {Promise} - API response confirming the password reset.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function resetDatabasePassword(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/databases/${options.database_id}/reset-password`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Deletes a database from a server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.database_id - The ID of the database to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteDatabase(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/databases/${options.database_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n uuid: string;\n name: string;\n nest: number;\n author: string;\n description: string;\n docker_image: string;\n config: {\n files: {\n [filename: string]: {\n parser: string;\n find: {\n [key: string]: any;\n };\n };\n };\n };\n startup: {\n done: string;\n userInteraction: string[];\n };\n stop: string;\n logs: {\n custom: boolean;\n location: string;\n };\n script: {\n privileged: boolean;\n install: string;\n entry: string;\n container: string;\n extends: any;\n };\n created_at: string;\n updated_at: string;\n relationships: {\n nest: {\n object: string;\n attributes: {\n id: number;\n uuid: string;\n author: string;\n name: string;\n description: string;\n created_at: string;\n updated_at: string;\n };\n };\n servers: {\n object: string;\n data: any[];\n };\n };\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all eggs within a specific nest.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.nest_id - The ID of the nest.\n * @returns {Promise} - API response containing the list of eggs.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listEggs(options: { \n apiKey: string; \n panel: string; \n nest_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nests/${options.nest_id}/eggs`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n name: string,\n nest: number,\n author: string,\n description: string,\n docker_image: string,\n config: {\n files: object,\n startup: {\n done: string,\n userInteraction: []\n },\n stop: string,\n logs: {\n custom: boolean,\n location: string\n },\n extends: any\n },\n startup: string,\n script: {\n privileged: boolean,\n install: string,\n entry: string,\n container: string,\n extends: any\n },\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves details of a specific egg from a nest.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.nest_id - The ID of the nest.\n * @param {number} options.egg_id - The ID of the egg to retrieve.\n * @returns {Promise} - API response containing egg details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function eggDetails(options: { \n apiKey: string; \n panel: string; \n nest_id: number;\n egg_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nests/${options.nest_id}/eggs/${options.egg_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n author: string,\n name: string,\n description: string,\n created_at: string,\n updated_at: string\n }\n }[],\n meta: {\n pagination: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n}\n/**\n * Retrieves a list of all nests available on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing the list of nests.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listNests(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"nests\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n author: string,\n name: string,\n description: string,\n created_at: string,\n updated_at: string\n }\n}\n/**\n * Retrieves details of a specific nest.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.nest_id - The ID of the nest.\n * @returns {Promise} - API response containing nest details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function nestDetails(options: { \n apiKey: string; \n panel: string; \n nest_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nests/${options.nest_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n ip: string,\n alias: any,\n port: number,\n notes: any,\n assigned: boolean\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of all allocations on a specific node.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node whose allocations should be retrieved.\n * @returns {Promise} - API response containing the list of allocations.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listAllocations(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nodes/${options.node_id}/allocations`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Creates a new allocation on a specific node.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node where the allocation should be created.\n * @param {string} options.ip - The IP address to allocate.\n * @param {number[]} options.ports - An array of ports to allocate.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createAllocation(options: { \n apiKey: string; \n panel: string; \n node_id: number;\n ip: string;\n ports: number[];\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `nodes/${options.node_id}/allocations`,\n body: JSON.stringify({\n ip: options.ip,\n ports: options.ports\n })\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Deletes an allocation from a specific node.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node where the allocation exists.\n * @param {number} options.allocation_id - The ID of the allocation to delete.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteAllocation(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n allocation_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `nodes/${options.node_id}/allocations/${options.allocation_id}`\n });\n}\n","import Setup from \"./Setup\";\n\n// Import Application API - User Management\nimport listUsers from \"../source/app/users/listUsers\";\nimport userDetails from \"../source/app/users/userDetails\";\nimport userDetails_externalId from \"../source/app/users/userDetails_externalId\";\nimport createUser from \"../source/app/users/createUser\";\nimport updateUser from \"../source/app/users/updateUser\";\nimport deleteUser from \"../source/app/users/deleteUser\";\n\n// Import Application API - Node Management\nimport listNodes from \"../source/app/nodes/listNodes\";\nimport nodeDetails from \"../source/app/nodes/nodeDetails\";\nimport nodeConfiguration from \"../source/app/nodes/nodeConfiguration\";\nimport createNode from \"../source/app/nodes/createNode\";\nimport updateNode from \"../source/app/nodes/updateNode\";\nimport deleteNode from \"../source/app/nodes/deleteNode\";\n\n// Import Application API - Location Management\nimport listLocations from \"../source/app/locations/listLocations\";\nimport locationDetails from \"../source/app/locations/locationDetails\";\nimport createLocation from \"../source/app/locations/createLocation\";\nimport updateLocation from \"../source/app/locations/updateLocation\";\nimport deleteLocation from \"../source/app/locations/deleteLocation\";\n\n// Import Application API - Server Management\nimport listServers from \"../source/app/servers/listServers\";\nimport serverDetails from \"../source/app/servers/serverDetails\";\nimport serverDetails_externalId from \"../source/app/servers/serverDetails_externalId\";\nimport updateDetails from \"../source/app/servers/updateDetails\";\nimport updateServerBuild from \"../source/app/servers/updateServerBuild\";\nimport updateServerStartup from \"../source/app/servers/updateServerStartup\";\nimport createServer from \"../source/app/servers/createServer\";\nimport suspendServer from \"../source/app/servers/suspendServer\";\nimport unsuspendServer from \"../source/app/servers/unsuspendServer\";\nimport reinstallServer from \"../source/app/servers/reinstallServer\";\nimport deleteServer from \"../source/app/servers/deleteServer\";\nimport forceDeleteServer from \"../source/app/servers/forceDeleteServer\";\n\n// Import Application API - Database Management\nimport listDatabases from \"../source/app/servers/databases/listDatabases\";\nimport databaseDetails from \"../source/app/servers/databases/databaseDetails\";\nimport createDatabase from \"../source/app/servers/databases/createDatabase\";\nimport resetDatabasePassword from \"../source/app/servers/databases/resetDatabasePassword\";\nimport deleteDatabase from \"../source/app/servers/databases/deleteDatabase\";\n\n// Import Application API - Nest & Egg Management\nimport listEggs from \"../source/app/nests/eggs/listEggs\";\nimport eggDetails from \"../source/app/nests/eggs/eggDetails\";\nimport listNests from \"../source/app/nests/listNests\";\nimport nestDetails from \"../source/app/nests/nestDetails\";\n\n// Import Application API - Allocations Management\nimport listAllocations from \"../source/app/nodes/allocations/listAllocations\";\nimport createAllocations from \"../source/app/nodes/allocations/createAllocations\";\nimport deleteAllocation from \"../source/app/nodes/allocations/deleteAllocation\";\n\n/**\n * The Application class provides an interface for interacting with the\n * Pterodactyl Application API. This class gives full control over the panel,\n * including user, node, location, server, database, nest, and allocation management.\n *\n * @example\n * const app = new Application(\"YOUR_API_KEY\");\n * const users = await app.users.list();\n */\nexport default class Application {\n private apiKey: string;\n private panel: string;\n\n constructor(apiKey: string) {\n this.apiKey = apiKey;\n this.panel = Setup.getPanel();\n }\n\n /** User Management */\n public users = {\n list: () => listUsers({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (user_id: string) =>\n userDetails({ apiKey: this.apiKey, panel: this.panel, user_id }),\n getDetailsByExternalId: (external_id: string) =>\n userDetails_externalId({ apiKey: this.apiKey, panel: this.panel, external_id }),\n create: (user_details: { email: string; username: string; first_name?: string; last_name?: string }) =>\n createUser({ apiKey: this.apiKey, panel: this.panel, user_details }),\n update: (user_id: string, user_data: any) =>\n updateUser({ apiKey: this.apiKey, panel: this.panel, user_id: parseInt(user_id), data: user_data }),\n delete: (user_id: string) =>\n deleteUser({ apiKey: this.apiKey, panel: this.panel, identifier: parseInt(user_id) }),\n };\n\n /** Node Management */\n public nodes = {\n list: () => listNodes({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (node_id: string) =>\n nodeDetails({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n getConfiguration: (node_id: string) =>\n nodeConfiguration({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n create: (node_data: any) =>\n createNode({ apiKey: this.apiKey, panel: this.panel, node_data }),\n update: (node_id: string, node_data: any) =>\n updateNode({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id), update_data: node_data }),\n delete: (node_id: string) =>\n deleteNode({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n };\n\n /** Location Management */\n public locations = {\n list: () => listLocations({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (location_id: string) =>\n locationDetails({ apiKey: this.apiKey, panel: this.panel, location_id: parseInt(location_id) }),\n create: (location_data: { short: string; long: string }) =>\n createLocation({ apiKey: this.apiKey, panel: this.panel, location_data }),\n update: (location_id: string, location_data: any) =>\n updateLocation({ apiKey: this.apiKey, panel: this.panel, location_id: parseInt(location_id), update_data: location_data }),\n delete: (location_id: string) =>\n deleteLocation({ apiKey: this.apiKey, panel: this.panel, location_id: parseInt(location_id) }),\n };\n\n /** Server Management */\n public servers = {\n list: () => listServers({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (server_id: string) =>\n serverDetails({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetailsByExternalId: (external_id: string) =>\n serverDetails_externalId({ apiKey: this.apiKey, panel: this.panel, external_id }),\n updateDetails: (server_id: string, update_data: any) =>\n updateDetails({ apiKey: this.apiKey, panel: this.panel, server_id, update_data }),\n updateBuild: (server_id: string, build_data: any) =>\n updateServerBuild({ apiKey: this.apiKey, panel: this.panel, server_id, build_data }),\n updateStartup: (server_id: string, startup_data: any) =>\n updateServerStartup({ apiKey: this.apiKey, panel: this.panel, server_id, startup_data }),\n create: (server_data: any) =>\n createServer({ apiKey: this.apiKey, panel: this.panel, server_data }),\n suspend: (server_id: string) =>\n suspendServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n unsuspend: (server_id: string) =>\n unsuspendServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n reinstall: (server_id: string) =>\n reinstallServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n delete: (server_id: string) =>\n deleteServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n forceDelete: (server_id: string) =>\n forceDeleteServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n };\n\n /** Nest & Egg Management */\n public nests = {\n listNests: () => listNests({ apiKey: this.apiKey, panel: this.panel }),\n getNestDetails: (nest_id: string) =>\n nestDetails({ apiKey: this.apiKey, panel: this.panel, nest_id: parseInt(nest_id) }),\n listEggs: (nest_id: string) =>\n listEggs({ apiKey: this.apiKey, panel: this.panel, nest_id: parseInt(nest_id) }),\n getEggDetails: (nest_id: string, egg_id: string) =>\n eggDetails({ apiKey: this.apiKey, panel: this.panel, nest_id: parseInt(nest_id), egg_id: parseInt(egg_id) }),\n };\n\n /** Allocations Management */\n public allocations = {\n list: (node_id: string) => listAllocations({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n create: (node_id: string, ip: string, ports: number[]) => \n createAllocations({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id), ip, ports }),\n delete: (node_id: string, allocation_id: string) => \n deleteAllocation({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id), allocation_id: parseInt(allocation_id) }),\n };\n /** Database Management */\n public databases = {\n list: (server_id: string) => listDatabases({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetails: (server_id: string, database_id: string) => \n databaseDetails({ apiKey: this.apiKey, panel: this.panel, server_id, database_id: parseInt(database_id) }),\n create: (server_id: string, database_data: any) => \n createDatabase({ apiKey: this.apiKey, panel: this.panel, server_id, database_data }),\n resetPassword: (server_id: string, database_id: string) => \n resetDatabasePassword({ apiKey: this.apiKey, panel: this.panel, server_id, database_id: parseInt(database_id) }),\n delete: (server_id: string, database_id: string) => \n deleteDatabase({ apiKey: this.apiKey, panel: this.panel, server_id, database_id: parseInt(database_id) })\n };\n\n}\n","import axios from \"axios\";\n\n/**\n * Creates an API Call to the Client API of your Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.panel - Your panel's URL.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.endpoint - The API endpoint to call.\n * @param {\"GET\" | \"DELETE\" | \"POST\" | \"PUT\" | \"PATCH\"} options.method - HTTP method.\n * @param {any} [options.body] - Request body (for POST, PUT, PATCH requests).\n * @returns {Promise} - The data fetched from the API.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function ClientAPICall(options: {\n panel: string;\n apiKey: string;\n endpoint: string;\n method: \"GET\" | \"DELETE\" | \"POST\" | \"PUT\" | \"PATCH\";\n body?: any;\n}): Promise {\n const url = `${options.panel}/api/client/${options.endpoint}`;\n const headers = {\n 'Accept': \"application/json\",\n 'Content-Type': \"application/json\",\n 'Authorization': `Bearer ${options.apiKey}`\n };\n\n try {\n if ([\"POST\", \"PUT\", \"PATCH\"].includes(options.method)) {\n const response = await axios({\n method: options.method,\n url,\n headers,\n data: options.body ? JSON.stringify(options.body) : undefined\n });\n return response.data;\n } else {\n const response = await fetch(url, {\n method: options.method,\n headers\n });\n\n if (!response.ok) {\n throw new Error(`API call failed with status ${response.status}: ${await response.text()}`);\n }\n\n return await response.json();\n }\n } catch (error) {\n throw new Error(`Error in API call: ${error instanceof Error ? error.message : String(error)}`);\n }\n}","import ClientAPICall from \"../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n admin: boolean;\n username: string;\n email: string;\n first_name: string;\n last_name: string;\n language: string;\n };\n }\n\n \n/**\n * Retrieves account details for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing account details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function accountDetails(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"account\"\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n tokens: string[];\n };\n }\n \n\n/**\n * Enables Two-Factor Authentication (2FA) for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string[]} options.codes - The TOTP authentication codes for verification.\n * @returns {Promise} - API response confirming 2FA activation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function twoFactorEnable(options: { \n apiKey: string; \n panel: string; \n codes: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"account/two-factor\",\n body: { codes: options.codes }\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\n/**\n * Disables Two-Factor Authentication (2FA) for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string[]} options.tokens - An array of 2FA recovery codes to confirm disabling.\n * @returns {Promise} - API response confirming 2FA deactivation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function twoFactorDisable(options: { \n apiKey: string; \n panel: string; \n tokens: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: \"account/two-factor\",\n body: { tokens: options.tokens }\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\n/**\n * Updates the email address of the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.email - The new email address.\n * @param {string} options.password - The current password (required for confirmation).\n * @returns {Promise} - API response confirming email update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateEmail(options: { \n apiKey: string; \n panel: string; \n email: string;\n password: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: \"account/email\",\n body: {\n email: options.email,\n password: options.password\n }\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\n/**\n * Updates the password of the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.current_password - The current password for confirmation.\n * @param {string} options.new_password - The new password to set.\n * @returns {Promise} - API response confirming password update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updatePassword(options: { \n apiKey: string; \n panel: string; \n current_password: string;\n new_password: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: \"account/password\",\n body: {\n current_password: options.current_password,\n password: options.new_password\n }\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n identifier: string,\n description: string,\n allowed_ips: string[],\n last_used_at: null | string,\n created_at: string\n },\n meta: {\n secret_token: string\n }\n}\n\n/**\n * Creates a new API key for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.description - A description for the API key.\n * @param {string[]} options.allowed_ips - An array of allowed IPs (empty for unrestricted access).\n * @returns {Promise} - API response containing the newly created API key.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createApiKey(options: { \n apiKey: string; \n panel: string; \n description: string;\n allowed_ips: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"account/api-keys\",\n body: {\n description: options.description,\n allowed_ips: options.allowed_ips\n }\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\n/**\n * Deletes an API key for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.key_id - The unique identifier of the API key to delete.\n * @returns {Promise} - API response confirming deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteApiKey(options: { \n apiKey: string; \n panel: string; \n key_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `account/api-keys/${options.key_id}`\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n identifier: string,\n description: string,\n allowed_ips: [] | string[],\n last_used_at: string,\n created_at: string\n }\n }[]\n}\n\n/**\n * Retrieves a list of all API keys for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing all API keys.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listApiKeys(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"account/api-keys\"\n });\n}\n","import ClientAPICall from \"../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n server_owner: boolean;\n identifier: string;\n uuid: string;\n name: string;\n node: string;\n sftp_details: {\n ip: string;\n port: number;\n };\n description: string;\n limits: {\n memory: number;\n swap: number;\n disk: number;\n io: number;\n cpu: number;\n };\n feature_limits: {\n databases: number;\n allocations: number;\n backups: number;\n };\n is_suspended: boolean;\n is_installing: boolean;\n relationships: {\n allocations: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }>;\n };\n };\n };\n }>;\n meta: {\n pagination: {\n total: number;\n count: number;\n per_page: number;\n current_page: number;\n total_pages: number;\n links: Record;\n };\n };\n }\n \n/**\n * Retrieves a list of all servers the authenticated user has access to.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing the list of servers.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listServers(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"servers\"\n });\n}\n","import ClientAPICall from \"../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n permissions: {\n websocket: {\n description: string;\n keys: {\n connect: string;\n };\n };\n control: {\n description: string;\n keys: {\n console: string;\n start: string;\n stop: string;\n restart: string;\n };\n };\n user: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n };\n };\n file: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n archive: string;\n sftp: string;\n };\n };\n backup: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n download: string;\n };\n };\n allocation: {\n description: string;\n keys: {\n read: string;\n create: string;\n update: string;\n delete: string;\n };\n };\n startup: {\n description: string;\n keys: {\n read: string;\n update: string;\n };\n };\n database: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n view_password: string;\n };\n };\n schedule: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n };\n };\n settings: {\n description: string;\n keys: {\n rename: string;\n reinstall: string;\n };\n };\n };\n };\n}\n\n/**\n * Retrieves the permissions the authenticated user has for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of permissions for the user.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function showPermissions(options: {\n apiKey: string;\n panel: string;\n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/permissions`,\n });\n}\n","/**\n * Sends a command to a server's console.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.command - The command to execute.\n * @returns {Promise} - A promise that resolves when the command is sent.\n */\nexport default async function command(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n command: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/command`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify({ command: options.command })\n });\n\n if (!response.ok) {\n throw new Error(`Failed to send command: ${await response.text()}`);\n }\n}\n","/**\n * Sends a power action to a server (start, stop, restart, kill).\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.signal - The power action (start, stop, restart, kill).\n * @returns {Promise} - A promise that resolves when the power action is sent.\n */\nexport default async function power(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n signal: \"start\" | \"stop\" | \"restart\" | \"kill\"; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/power`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify({ signal: options.signal })\n });\n\n if (!response.ok) {\n throw new Error(`Failed to send power action: ${await response.text()}`);\n }\n}\n","export interface Response {\n data: {\n token: string;\n socket: string;\n };\n }\n \n/**\n * Retrieves real-time console details for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with console details.\n */\nexport default async function consoleDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/websocket`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch console details: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n current_state: string;\n is_suspended: boolean;\n resources: {\n memory_bytes: number;\n cpu_absolute: number;\n disk_bytes: number;\n network_rx_bytes: number;\n network_tx_bytes: number;\n };\n };\n }\n \n\n/**\n * Fetches resource usage (CPU, RAM, disk) for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with server resource usage details.\n */\nexport default async function resources(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/resources`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch server resources: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n server_owner: boolean;\n identifier: string;\n uuid: string;\n name: string;\n node: string;\n sftp_details: {\n ip: string;\n port: number;\n };\n description: string;\n limits: {\n memory: number;\n swap: number;\n disk: number;\n io: number;\n cpu: number;\n };\n feature_limits: {\n databases: number;\n allocations: number;\n backups: number;\n };\n is_suspended: boolean;\n is_installing: boolean;\n relationships: {\n allocations: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }>;\n };\n };\n };\n meta: {\n is_server_owner: boolean;\n user_permissions: string[];\n };\n }\n \n\n\n/**\n * Retrieves details for a specific server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with server details.\n */\nexport default async function serverDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch server details: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n uuid: string;\n name: string;\n ignored_files: string[];\n sha256_hash: string;\n bytes: number;\n created_at: string;\n completed_at: string;\n };\n }>;\n meta: {\n pagination: {\n total: number;\n count: number;\n per_page: number;\n current_page: number;\n total_pages: number;\n links: Record;\n };\n };\n }\n \n\n/**\n * Retrieves a list of all backups for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing a list of backups.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listBackups(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/backups`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n name: string;\n ignored_files: string[];\n sha256_hash: string;\n bytes: number;\n created_at: string;\n completed_at: string;\n };\n }\n \n\n/**\n * Retrieves details of a specific backup for a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.backup_id - The ID of the backup.\n * @returns {Promise} - API response containing backup details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function backupDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/backups/${options.backup_id}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n name: string;\n ignored_files: string[];\n sha256_hash: string | null;\n bytes: number;\n created_at: string;\n completed_at: string | null;\n };\n }\n \n\n/**\n * Creates a new backup for a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} [options.backup_data] - Optional backup settings.\n * @param {string} [options.backup_data.name] - Name for the backup.\n * @param {boolean} [options.backup_data.locked] - Whether the backup is locked.\n * @returns {Promise} - API response confirming backup creation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createBackup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_data?: {\n name?: string;\n locked?: boolean;\n };\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/backups`,\n body: options.backup_data ? JSON.stringify(options.backup_data) : undefined\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Deletes a backup from a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.backup_id - The ID of the backup.\n * @returns {Promise} - API response confirming backup deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteBackup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/backups/${options.backup_id}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n url: string;\n };\n}\n \n\n/**\n * Retrieves a download link for a backup file.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.backup_id - The ID of the backup.\n * @returns {Promise} - API response containing the download URL.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function downloadBackup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/backups/${options.backup_id}/download`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n name: string;\n mode: string;\n size: number;\n is_file: boolean;\n is_symlink: boolean;\n is_editable: boolean;\n mimetype: string;\n created_at: string;\n modified_at: string;\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all files and directories for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} [options.directory] - The directory path to list files from (optional).\n * @returns {Promise} - API response containing the list of files.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listFiles(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n directory?: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/files/list${options.directory ? `?directory=${options.directory}` : \"\"}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Retrieves the content of a specific file on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to retrieve.\n * @returns {Promise} - API response containing file content.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function getFileContent(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/files/contents?file=${encodeURIComponent(options.file_path)}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n url: string;\n };\n }\n \n\n/**\n * Retrieves a download link for a file.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to download.\n * @returns {Promise} - API response containing the download URL.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function downloadFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/files/download?file=${encodeURIComponent(options.file_path)}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Renames a file or folder on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object[]} options.files - An array of objects containing old and new file names.\n * @returns {Promise} - API response confirming file/folder rename.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function renameFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n files: { from: string; to: string }[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/files/rename`,\n body: JSON.stringify({ files: options.files })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Copies a file to a new location on the server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to copy.\n * @returns {Promise} - API response confirming the file copy.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function copyFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/copy`,\n body: JSON.stringify({ location: options.file_path })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Writes content to a file on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to write.\n * @param {string} options.content - The content to write to the file.\n * @returns {Promise} - API response confirming file write operation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function writeFile(options: {\n apiKey: string;\n panel: string;\n server_id: string;\n file_path: string;\n content: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/write?file=${options.file_path}`,\n body: options.content,\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n name: string;\n mode: string;\n size: number;\n is_file: boolean;\n is_symlink: boolean;\n is_editable: boolean;\n mimetype: string;\n created_at: string;\n modified_at: string;\n };\n }\n \n\n/**\n * Compresses files or directories on a server into a ZIP archive.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string[]} options.files - An array of files or directories to compress.\n * @returns {Promise} - API response confirming compression.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function compressFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n files: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/compress`,\n body: JSON.stringify({ files: options.files })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Decompresses a ZIP file on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the ZIP file to decompress.\n * @returns {Promise} - API response confirming decompression.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function decompressFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/decompress`,\n body: JSON.stringify({ file: options.file_path })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Deletes a file or folder on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string[]} options.files - An array of files or folders to delete.\n * @returns {Promise} - API response confirming file deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n files: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/delete`,\n body: JSON.stringify({ files: options.files })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Creates a new folder on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.folder_path - The path of the folder to create.\n * @returns {Promise} - API response confirming folder creation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createFolder(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n folder_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/create-folder`,\n body: JSON.stringify({ name: options.folder_path })\n });\n}\n","import axios from \"axios\";\n\nexport interface Response {\n object: string;\n attributes: {\n url: string;\n };\n}\n\n/**\n * Uploads a file to a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {FormData} options.file_data - The file data to upload.\n * @returns {Promise} - API response confirming file upload.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function uploadFile(options: {\n apiKey: string;\n panel: string;\n server_id: string;\n file_data: FormData;\n}): Promise {\n const response = await axios.post(\n `${options.panel}/api/client/servers/${options.server_id}/files/upload`,\n options.file_data,\n {\n headers: {\n \"Authorization\": `Bearer ${options.apiKey}`,\n \"Content-Type\": \"multipart/form-data\",\n },\n }\n );\n return response.data;\n}\n\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all network allocations for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of allocations.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listAllocations(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/network/allocations`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }\n\n \n/**\n * Assigns a new allocation to a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to assign.\n * @returns {Promise} - API response confirming allocation assignment.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function assignAllocations(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/network/allocations`,\n body: JSON.stringify({ allocation_id: options.allocation_id })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }\n\n \n/**\n * Updates the note for a specific allocation on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to update.\n * @param {string} options.note - The new note for the allocation.\n * @returns {Promise} - API response confirming the note update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function setAllocationNote(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n note: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/network/allocations/${options.allocation_id}`,\n body: JSON.stringify({ notes: options.note })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }\n\n \n/**\n * Sets a specific allocation as the primary allocation for a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to set as primary.\n * @returns {Promise} - API response confirming primary allocation change.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function setPrimaryAllocation(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/network/allocations/${options.allocation_id}/primary`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Unassigns a network allocation from a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to remove.\n * @returns {Promise} - API response confirming allocation removal.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function unassignAllocation(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/network/allocations/${options.allocation_id}`\n });\n}\n","export interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }>;\n };\n };\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all schedules for a specified server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with the list of schedules.\n */\nexport default async function listSchedules(options: { apiKey: string; panel: string; server_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch schedules: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: any[];\n };\n };\n };\n }\n \n\n/**\n * Creates a new schedule for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {Object} options.schedule_data - The schedule details.\n * @returns {Promise} - A promise resolving with the created schedule details.\n */\nexport default async function createSchedule(options: { apiKey: string; panel: string; server_id: string; schedule_data: any }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify(options.schedule_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to create schedule: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }>;\n };\n };\n };\n }\n \n\n/**\n * Retrieves details of a specific schedule for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @returns {Promise} - A promise resolving with the schedule details.\n */\nexport default async function scheduleDetails(options: { apiKey: string; panel: string; server_id: string; schedule_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch schedule details: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: any[];\n };\n };\n };\n }\n \n\n/**\n * Updates an existing schedule for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {Object} options.schedule_data - The updated schedule details.\n * @returns {Promise} - A promise resolving with the updated schedule.\n */\nexport default async function updateSchedule(options: { apiKey: string; panel: string; server_id: string; schedule_id: string; schedule_data: any }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}`, {\n method: \"PATCH\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify(options.schedule_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to update schedule: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","/**\n * Deletes a schedule from a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @returns {Promise} - A promise that resolves when the schedule is deleted.\n */\nexport default async function deleteSchedule(options: { apiKey: string; panel: string; server_id: string; schedule_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}`, {\n method: \"DELETE\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to delete schedule: ${await response.text()}`);\n }\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }\n \n\n/**\n * Creates a task inside a specific schedule.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {Object} options.task_data - The task details.\n * @returns {Promise} - A promise resolving with the created task details.\n */\nexport default async function createTask(options: { apiKey: string; panel: string; server_id: string; schedule_id: string; task_data: any }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}/tasks`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify(options.task_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to create task: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }\n \n\n/**\n * Updates an existing task inside a specific schedule.\n *\n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {string} options.task_id - The task identifier.\n * @param {Object} options.task_data - The updated task details.\n * @returns {Promise} - A promise resolving with the updated task details.\n */\nexport default async function updateTask(options: {\n apiKey: string;\n panel: string;\n server_id: string;\n schedule_id: string;\n task_id: string;\n} & Record): Promise {\n const { apiKey, panel, server_id, schedule_id, task_id, ...task_data } = options;\n\n const response = await fetch(`${panel}/api/client/servers/${server_id}/schedules/${schedule_id}/tasks/${task_id}`, {\n method: \"PATCH\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${apiKey}`\n },\n body: JSON.stringify(task_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to update task: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","/**\n * Deletes a specific task inside a schedule.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {string} options.task_id - The task identifier.\n * @returns {Promise} - A promise that resolves when the task is deleted.\n */\nexport default async function deleteTask(options: { apiKey: string; panel: string; server_id: string; schedule_id: string; task_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}/tasks/${options.task_id}`, {\n method: \"DELETE\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to delete task: ${await response.text()}`);\n }\n}\n\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Renames a server on the panel.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.new_name - The new name for the server.\n * @returns {Promise} - API response confirming the server rename.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function renameServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n new_name: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/settings/rename`,\n body: JSON.stringify({ name: options.new_name })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Reinstalls a server, resetting its configuration while preserving files.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to reinstall.\n * @returns {Promise} - API response confirming the reinstallation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function reinstallServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/settings/reinstall`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n name: string;\n description: string;\n env_variable: string;\n default_value: string;\n server_value: string;\n is_editable: boolean;\n rules: string;\n };\n }>;\n meta: {\n startup_command: string;\n raw_startup_command: string;\n };\n }\n\n \n/**\n * Retrieves a list of all startup variables for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of startup variables.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listVariables(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/startup/variables`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n name: string;\n description: string;\n env_variable: string;\n default_value: string;\n server_value: string;\n is_editable: boolean;\n rules: string;\n };\n }\n \n\n/**\n * Updates a startup variable for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.variable_id - The ID of the startup variable.\n * @param {string} options.value - The new value for the variable.\n * @returns {Promise} - API response confirming variable update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateVariable(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n variable_id: number;\n value: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/startup/variables/${options.variable_id}`,\n body: JSON.stringify({ value: options.value })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all users assigned to a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of users.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listUsers(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/users`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: \"server_subuser\";\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }\n \n\n/**\n * Assigns a new user to a server with specific permissions.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.email - The email address of the user.\n * @param {string} options.username - The username of the user.\n * @param {string[]} options.permissions - An array of permissions for the user.\n * @returns {Promise} - API response confirming user creation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createUser(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n email: string;\n username: string;\n permissions: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/users`,\n body: JSON.stringify({\n email: options.email,\n username: options.username,\n permissions: options.permissions\n })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }\n \n\n/**\n * Updates an existing user's permissions for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.user_id - The ID of the user.\n * @param {string[]} options.permissions - The new set of permissions for the user.\n * @returns {Promise} - API response confirming user update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateUser(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n user_id: string;\n permissions: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/users/${options.user_id}`,\n body: JSON.stringify({ permissions: options.permissions })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Removes a user from a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.user_id - The ID of the user to remove.\n * @returns {Promise} - API response confirming user removal.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteUser(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n user_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/users/${options.user_id}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }\n\n \n/**\n * Retrieves details of a specific user assigned to a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.user_id - The ID of the user.\n * @returns {Promise} - API response containing user details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function userDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n user_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/users/${options.user_id}`\n });\n}\n","import Setup from \"./Setup\";\n\n// Import account functions\nimport accountDetails from \"../source/client/account/accountDetails\";\nimport twoFactorEnable from \"../source/client/account/2faEnable\";\nimport twoFactorDisable from \"../source/client/account/2faDisable\";\nimport updateEmail from \"../source/client/account/updateEmail\";\nimport updatePassword from \"../source/client/account/updatePassword\";\nimport createApiKey from \"../source/client/account/createApiKey\";\nimport deleteApiKey from \"../source/client/account/deleteApiKey\";\nimport listApiKeys from \"../source/client/account/listApiKeys\";\n\n// Import general server functions\nimport listServers from \"../source/client/listServers\";\nimport showPermissions from \"../source/client/showPermissions\";\nimport command from \"../source/client/servers/command\";\nimport power from \"../source/client/servers/power\";\nimport consoleDetails from \"../source/client/servers/consoleDetails\";\nimport resources from \"../source/client/servers/resources\";\nimport serverDetails from \"../source/client/servers/serverDetails\";\n\n// Import backup functions\nimport listBackups from \"../source/client/servers/backups/listBackups\";\nimport backupDetails from \"../source/client/servers/backups/backupDetails\";\nimport createBackup from \"../source/client/servers/backups/createBackup\";\nimport deleteBackup from \"../source/client/servers/backups/deleteBackup\";\nimport downloadBackup from \"../source/client/servers/backups/downloadBackup\";\n\n// Import database functions\nimport listDatabases from \"../source/client/servers/databases/listDatabases\";\nimport createDatabase from \"../source/client/servers/databases/createDatabase\";\nimport deleteDatabase from \"../source/client/servers/databases/deleteDatabase\";\nimport rotatePassword from \"../source/client/servers/databases/rotatePassword\";\n\n// Import file management functions\nimport listFiles from \"../source/client/servers/files/listFiles\";\nimport getFileContent from \"../source/client/servers/files/getFileContent\";\nimport downloadFile from \"../source/client/servers/files/downloadFile\";\nimport renameFile from \"../source/client/servers/files/renameFile\";\nimport copyFile from \"../source/client/servers/files/copyFile\";\nimport writeFile from \"../source/client/servers/files/writeFile\";\nimport compressFile from \"../source/client/servers/files/compressFile\";\nimport decompressFile from \"../source/client/servers/files/decompressFile\";\nimport deleteFile from \"../source/client/servers/files/deleteFile\";\nimport createFolder from \"../source/client/servers/files/createFolder\";\nimport uploadFile from \"../source/client/servers/files/uploadFile\";\n\n// Import network management functions\nimport listAllocations from \"../source/client/servers/network/listAllocations\";\nimport assignAllocations from \"../source/client/servers/network/assignAllocations\";\nimport setAllocationNote from \"../source/client/servers/network/setAllocationNote\";\nimport setPrimaryAllocation from \"../source/client/servers/network/setPrimaryAllocation\";\nimport unassignAllocation from \"../source/client/servers/network/unassignAllocation\";\n\n// Import schedule functions\nimport listSchedules from \"../source/client/servers/schedules/listSchedules\";\nimport createSchedule from \"../source/client/servers/schedules/createSchedule\";\nimport scheduleDetails from \"../source/client/servers/schedules/scheduleDetails\";\nimport updateSchedule from \"../source/client/servers/schedules/updateSchedule\";\nimport deleteSchedule from \"../source/client/servers/schedules/deleteSchedule\";\nimport createTask from \"../source/client/servers/schedules/createTask\";\nimport updateTask from \"../source/client/servers/schedules/updateTask\";\nimport deleteTask from \"../source/client/servers/schedules/deleteTask\";\n\n// Import settings functions\nimport renameServer from \"../source/client/servers/settings/renameServer\";\nimport reinstallServer from \"../source/client/servers/settings/reinstallServer\";\n\n// Import startup functions\nimport listVariables from \"../source/client/servers/startup/listVariables\";\nimport updateVariable from \"../source/client/servers/startup/updateVariable\";\n\n// Import user management functions\nimport listUsers from \"../source/client/servers/users/listUsers\";\nimport createUser from \"../source/client/servers/users/createUser\";\nimport updateUser from \"../source/client/servers/users/updateUser\";\nimport deleteUser from \"../source/client/servers/users/deleteUser\";\nimport userDetails from \"../source/client/servers/users/userDetails\";\n\n/**\n * The `Client` class provides an interface for interacting with the Pterodactyl Client API.\n * It supports **account management, server control, file operations, backups, networking, schedules, settings, startup variables, and more**.\n */\nexport default class Client {\n private apiKey: string;\n private panel: string;\n\n constructor(apiKey: string) {\n this.apiKey = apiKey;\n this.panel = Setup.getPanel();\n }\n\n /** Account Management */\n public account = {\n getDetails: () => accountDetails({ apiKey: this.apiKey, panel: this.panel }),\n enable2FA: (codes: string[]) => twoFactorEnable({ apiKey: this.apiKey, panel: this.panel, codes }),\n disable2FA: (tokens: string[]) => twoFactorDisable({ apiKey: this.apiKey, panel: this.panel, tokens }),\n updateEmail: (email: string, password: string) => updateEmail({ apiKey: this.apiKey, panel: this.panel, email, password }),\n updatePassword: (current_password: string, new_password: string) => updatePassword({ apiKey: this.apiKey, panel: this.panel, current_password, new_password }),\n createApiKey: (description: string, allowed_ips: string[]) => createApiKey({ apiKey: this.apiKey, panel: this.panel, description, allowed_ips }),\n deleteApiKey: (key_id: string) => deleteApiKey({ apiKey: this.apiKey, panel: this.panel, key_id }),\n listApiKeys: () => listApiKeys({ apiKey: this.apiKey, panel: this.panel }),\n };\n\n /** Server Management */\n public servers = {\n list: () => listServers({ apiKey: this.apiKey, panel: this.panel }),\n showPermissions: (server_id: string) => showPermissions({ apiKey: this.apiKey, panel: this.panel, server_id }),\n sendCommand: (server_id: string, commandStr: string) => command({ apiKey: this.apiKey, panel: this.panel, server_id, command: commandStr }),\n powerAction: (server_id: string, signal: \"start\" | \"stop\" | \"restart\" | \"kill\") => power({ apiKey: this.apiKey, panel: this.panel, server_id, signal }),\n getConsoleDetails: (server_id: string) => consoleDetails({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getResources: (server_id: string) => resources({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetails: (server_id: string) => serverDetails({ apiKey: this.apiKey, panel: this.panel, server_id }),\n };\n\n /** Backup Management */\n public backups = {\n list: (server_id: string) => listBackups({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetails: (server_id: string, backup_id: string) => backupDetails({ apiKey: this.apiKey, panel: this.panel, server_id, backup_id }),\n create: (server_id: string, backup_data: any) => createBackup({ apiKey: this.apiKey, panel: this.panel, server_id, backup_data }),\n delete: (server_id: string, backup_id: string) => deleteBackup({ apiKey: this.apiKey, panel: this.panel, server_id, backup_id }),\n download: (server_id: string, backup_id: string) => downloadBackup({ apiKey: this.apiKey, panel: this.panel, server_id, backup_id }),\n };\n\n /** Settings */\n public settings = {\n renameServer: (server_id: string, new_name: string) => renameServer({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n new_name\n }), \n reinstallServer: (server_id: string) => reinstallServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n };\n \n /** Network Management */\n public network = {\n listAllocations: (server_id: string) => listAllocations({ apiKey: this.apiKey, panel: this.panel, server_id }),\n assignAllocations: (server_id: string, allocation_id: number) => assignAllocations({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id\n }), \n setAllocationNote: (server_id: string, allocation_id: string, note: string) => setAllocationNote({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id: parseInt(allocation_id), \n note \n }),\n \n setPrimaryAllocation: (server_id: string, allocation_id: string) => setPrimaryAllocation({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id: parseInt(allocation_id) \n }),\n \n unassignAllocation: (server_id: string, allocation_id: string) => unassignAllocation({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id: parseInt(allocation_id) \n }), \n };\n \n /** Schedule Management */\n public schedules = {\n list: (server_id: string) => listSchedules({ apiKey: this.apiKey, panel: this.panel, server_id }),\n createSchedule: (server_id: string, schedule_data: any) => createSchedule({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_data }),\n scheduleDetails: (server_id: string, schedule_id: string) => scheduleDetails({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id }),\n updateSchedule: (server_id: string, schedule_id: string, schedule_data: any) => updateSchedule({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, schedule_data }),\n deleteSchedule: (server_id: string, schedule_id: string) => deleteSchedule({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id }),\n createTask: (server_id: string, schedule_id: string, task_data: any) => createTask({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, task_data }),\n updateTask: (server_id: string, schedule_id: string, task_id: string, task_data: any) => updateTask({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, task_id, task_data }),\n deleteTask: (server_id: string, schedule_id: string, task_id: string) => deleteTask({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, task_id }),\n };\n \n /** Startup Management */\n public startup = {\n listVariables: (server_id: string) => listVariables({ apiKey: this.apiKey, panel: this.panel, server_id }),\n updateVariable: (server_id: string, variable_id: string, value: string) => updateVariable({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n variable_id: parseInt(variable_id), \n value \n }), \n };\n \n /** User Management */\n public users = {\n listUsers: (server_id: string) => listUsers({ apiKey: this.apiKey, panel: this.panel, server_id }),\n createUser: (server_id: string, user_data: any) => createUser({ apiKey: this.apiKey, panel: this.panel, server_id, ...user_data }),\n updateUser: (server_id: string, user_id: string, user_data: any) => updateUser({ apiKey: this.apiKey, panel: this.panel, server_id, user_id, ...user_data }),\n deleteUser: (server_id: string, user_id: string) => deleteUser({ apiKey: this.apiKey, panel: this.panel, server_id, user_id }),\n userDetails: (server_id: string, user_id: string) => userDetails({ apiKey: this.apiKey, panel: this.panel, server_id, user_id }),\n };\n \n \n\n\n /** File Management */\n public files = {\n list: (server_id: string, directory?: string) => listFiles({ apiKey: this.apiKey, panel: this.panel, server_id, directory }),\n getContent: (server_id: string, file_path: string) => getFileContent({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n download: (server_id: string, file_path: string) => downloadFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n rename: (server_id: string, from: string, to: string) => renameFile({ apiKey: this.apiKey, panel: this.panel, server_id, files: [{ from, to }] }),\n copy: (server_id: string, file_path: string) => copyFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n write: (server_id: string, file_path: string, content: string) => writeFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path, content }),\n compress: (server_id: string, files: string[]) => compressFile({ apiKey: this.apiKey, panel: this.panel, server_id, files }),\n decompress: (server_id: string, file_path: string) => decompressFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n delete: (server_id: string, files: string[]) => deleteFile({ apiKey: this.apiKey, panel: this.panel, server_id, files }),\n createFolder: (server_id: string, folder_path: string) => createFolder({ apiKey: this.apiKey, panel: this.panel, server_id, folder_path }),\n upload: (server_id: string, file_data: FormData) => uploadFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_data }),\n };\n}\n","// WSConnection.ts\n\ntype ReconnectStrategy = \"fixed\" | \"exponential\" | \"exponential-jitter\";\n\ntype EventType =\n | \"open\"\n | \"message\"\n | \"close\"\n | \"error\"\n | \"reconnectAttempt\"\n | \"reconnectSuccess\"\n | \"reconnect\"\n | \"ping\"\n | \"pong\"\n | \"custom\";\n\nexport interface WSConnectionOptions {\n /** Primary WebSocket URL (required) */\n url: string;\n /** Optional fallback URLs if the primary fails */\n fallbackUrls?: string[];\n /** Optional subprotocol(s) to use during the handshake */\n protocols?: string | string[];\n\n /** Automatically reconnect on connection loss */\n autoReconnect?: boolean;\n /** Reconnect strategy: fixed, exponential, or exponential with jitter */\n reconnectStrategy?: ReconnectStrategy;\n /** Base delay (ms) for reconnect attempts */\n reconnectInterval?: number;\n /** Maximum number of reconnect attempts */\n maxReconnectAttempts?: number;\n /** Maximum delay (ms) allowed for exponential backoff */\n maxReconnectInterval?: number;\n /** Additional random jitter (ms) to add when using jitter strategy */\n jitter?: number;\n\n /** Connection timeout (ms) for establishing the connection */\n connectionTimeout?: number;\n\n /** Enable heartbeat (ping/pong) mechanism; set interval in ms */\n heartbeatInterval?: number;\n /** Heartbeat ping message (default \"ping\") */\n heartbeatMessage?: string;\n /** Expected pong message (default \"pong\") */\n expectedPongMessage?: string;\n /** How long (ms) to wait for a pong before closing the connection */\n heartbeatTimeout?: number;\n\n /** If true, queue outgoing messages if the connection is not open */\n queueMessages?: boolean;\n /** Maximum number of messages to queue */\n messageQueueLimit?: number;\n\n /** Automatically JSON‑stringify outgoing objects and parse incoming JSON strings */\n autoJson?: boolean;\n\n /** Custom logger callback; if not provided, uses console */\n logger?: (\n level: \"debug\" | \"info\" | \"warn\" | \"error\",\n ...args: any[]\n ) => void;\n /** Outgoing message interceptors (middleware) */\n outgoingMessageInterceptors?: Array<(message: any) => any>;\n /** Incoming message interceptors (middleware) */\n incomingMessageInterceptors?: Array<(message: any) => any>;\n\n /** Hook called before reconnecting; return false to cancel reconnect */\n onBeforeReconnect?: (attempt: number, lastCloseEvent: CloseEvent) => boolean;\n /** Hook called before sending a message; can modify or cancel the send */\n onBeforeSend?: (message: any) => any;\n /** Hook called after a message is sent */\n onAfterSend?: (message: any) => void;\n\n /** Standard event callbacks (optional) */\n onOpen?: (event: Event) => void;\n onMessage?: (event: MessageEvent) => void;\n onClose?: (event: CloseEvent) => void;\n onError?: (event: Event) => void;\n}\n\nexport interface WSMetrics {\n messagesSent: number;\n messagesReceived: number;\n lastLatency: number;\n reconnectAttempts: number;\n currentUrl: string;\n}\n\nclass AdvancedWebSocket {\n private socket: WebSocket | null = null;\n private currentUrl: string;\n private fallbackUrls: string[];\n private reconnectAttempts: number = 0;\n private messageQueue: Array = [];\n private heartbeatIntervalId: number | null = null;\n private pongTimeoutId: number | null = null;\n private connectionTimeoutId: number | null = null;\n private destroyed: boolean = false;\n\n // Metrics\n private messagesSent: number = 0;\n private messagesReceived: number = 0;\n private lastPingTimestamp: number = 0;\n private lastLatency: number = 0;\n\n // Custom event listeners\n private eventListeners: Record void>> = {\n open: [],\n message: [],\n close: [],\n error: [],\n reconnectAttempt: [],\n reconnect: [],\n reconnectSuccess: [],\n ping: [],\n pong: [],\n custom: [],\n };\n\n private options: WSConnectionOptions;\n\n constructor(options: WSConnectionOptions) {\n if (!options.url) {\n throw new Error(\"A URL is required to establish a WebSocket connection.\");\n }\n this.options = {\n autoReconnect: false,\n reconnectStrategy: \"exponential\",\n reconnectInterval: 1000,\n maxReconnectAttempts: 10,\n maxReconnectInterval: 30000,\n jitter: 300,\n connectionTimeout: 10000,\n heartbeatInterval: 30000,\n heartbeatMessage: \"ping\",\n expectedPongMessage: \"pong\",\n heartbeatTimeout: 5000,\n queueMessages: false,\n autoJson: false,\n ...options,\n };\n this.currentUrl = this.options.url;\n this.fallbackUrls = this.options.fallbackUrls || [];\n }\n\n /** Internal logger */\n private log(level: \"debug\" | \"info\" | \"warn\" | \"error\", ...args: any[]) {\n if (this.options.logger) {\n this.options.logger(level, ...args);\n } else {\n console[level](...args);\n }\n }\n\n /**\n * Establishes the WebSocket connection.\n * Returns a promise that resolves when connected.\n */\n connect(): Promise {\n return new Promise((resolve, reject) => {\n if (this.destroyed) {\n return reject(new Error(\"Instance has been destroyed.\"));\n }\n this.log(\"debug\", `[WS] Connecting to ${this.currentUrl}`);\n this.socket = new WebSocket(this.currentUrl, this.options.protocols);\n\n if (this.options.connectionTimeout) {\n this.connectionTimeoutId = window.setTimeout(() => {\n this.log(\"error\", \"[WS] Connection timeout reached\");\n reject(new Error(\"Connection timeout reached\"));\n this.socket?.close();\n }, this.options.connectionTimeout);\n }\n\n this.socket.onopen = (event) => {\n this.log(\"info\", `[WS] Connected to ${this.currentUrl}`);\n if (this.connectionTimeoutId) {\n clearTimeout(this.connectionTimeoutId);\n this.connectionTimeoutId = null;\n }\n this.reconnectAttempts = 0;\n if (this.options.heartbeatInterval) {\n this.startHeartbeat();\n }\n if (this.options.queueMessages && this.messageQueue.length > 0) {\n this.flushMessageQueue();\n }\n if (this.options.onOpen) this.options.onOpen(event);\n this.dispatchEvent(\"open\", event);\n resolve(this.socket!); // Assert non-null\n };\n\n this.socket.onmessage = (event) => {\n let data: any = event.data;\n if (this.options.incomingMessageInterceptors) {\n this.options.incomingMessageInterceptors.forEach((fn) => {\n data = fn(data);\n });\n }\n if (this.options.autoJson && typeof data === \"string\") {\n try {\n data = JSON.parse(data);\n } catch (e) {\n // fallback to raw data if JSON parsing fails\n }\n }\n this.messagesReceived++;\n // Handle heartbeat pong.\n if (\n this.options.heartbeatInterval &&\n data === this.options.expectedPongMessage\n ) {\n this.log(\"debug\", \"[WS] Received pong\");\n this.dispatchEvent(\"pong\", event);\n if (this.pongTimeoutId) {\n clearTimeout(this.pongTimeoutId);\n this.pongTimeoutId = null;\n }\n this.lastLatency = Date.now() - this.lastPingTimestamp;\n return;\n }\n const modifiedEvent = { ...event, data };\n if (this.options.onMessage) this.options.onMessage(modifiedEvent);\n this.dispatchEvent(\"message\", modifiedEvent);\n };\n\n this.socket.onerror = (event) => {\n this.log(\"error\", \"[WS] Error:\", event);\n if (this.options.onError) this.options.onError(event);\n this.dispatchEvent(\"error\", event);\n };\n\n this.socket.onclose = (event) => {\n this.log(\"warn\", \"[WS] Connection closed:\", event);\n this.stopHeartbeat();\n if (this.options.onClose) this.options.onClose(event);\n this.dispatchEvent(\"close\", event);\n // Attempt auto-reconnect if enabled and not destroyed.\n if (\n this.options.autoReconnect &&\n this.reconnectAttempts < (this.options.maxReconnectAttempts || 0) &&\n !this.destroyed\n ) {\n // Allow hook to cancel reconnect.\n if (\n this.options.onBeforeReconnect &&\n !this.options.onBeforeReconnect(this.reconnectAttempts, event)\n ) {\n this.log(\"info\", \"[WS] Reconnect canceled by onBeforeReconnect hook.\");\n return;\n }\n this.reconnectAttempts++;\n this.dispatchEvent(\"reconnectAttempt\", {\n attempt: this.reconnectAttempts,\n });\n let delay = this.computeReconnectDelay();\n this.log(\n \"info\",\n `[WS] Reconnecting in ${delay}ms... (Attempt ${this.reconnectAttempts})`\n );\n setTimeout(() => {\n // Try fallback URLs if provided.\n if (this.fallbackUrls.length > 0) {\n const nextUrl = this.fallbackUrls.shift();\n if (nextUrl) {\n this.log(\"info\", `[WS] Switching to fallback URL: ${nextUrl}`);\n this.currentUrl = nextUrl;\n }\n }\n this.dispatchEvent(\"reconnect\", { attempt: this.reconnectAttempts });\n this.connect()\n .then((sock) => {\n this.dispatchEvent(\"reconnectSuccess\", {\n attempt: this.reconnectAttempts,\n });\n })\n .catch((err) => {\n this.log(\"error\", \"[WS] Reconnection failed:\", err);\n });\n }, delay);\n }\n };\n });\n }\n\n /**\n * Computes the delay (ms) for the next reconnection attempt based on strategy.\n */\n private computeReconnectDelay(): number {\n let base = this.options.reconnectInterval || 1000;\n let delay: number;\n switch (this.options.reconnectStrategy) {\n case \"fixed\":\n delay = base;\n break;\n case \"exponential\":\n delay = base * Math.pow(2, this.reconnectAttempts - 1);\n break;\n case \"exponential-jitter\":\n delay = base * Math.pow(2, this.reconnectAttempts - 1);\n const jitter = this.options.jitter || 300;\n delay += Math.floor(Math.random() * jitter);\n break;\n default:\n delay = base;\n }\n if (this.options.maxReconnectInterval) {\n delay = Math.min(delay, this.options.maxReconnectInterval);\n }\n return delay;\n }\n\n /**\n * Sends data over the WebSocket.\n * Returns a promise that resolves once the message is sent.\n */\n send(data: any): Promise {\n return new Promise((resolve, reject) => {\n if (!this.socket || this.socket.readyState !== WebSocket.OPEN) {\n if (this.options.queueMessages) {\n if (\n this.options.messageQueueLimit &&\n this.messageQueue.length >= this.options.messageQueueLimit\n ) {\n this.log(\"error\", \"[WS] Message queue full; discarding message.\");\n return reject(new Error(\"Message queue is full.\"));\n }\n this.log(\"debug\", \"[WS] Queuing message (connection not open).\");\n this.messageQueue.push(data);\n return resolve();\n } else {\n this.log(\"error\", \"[WS] Socket not open; cannot send.\");\n return reject(new Error(\"WebSocket is not open.\"));\n }\n }\n // Before-send hook.\n if (this.options.onBeforeSend) {\n data = this.options.onBeforeSend(data);\n }\n // Apply outgoing interceptors.\n if (this.options.outgoingMessageInterceptors) {\n this.options.outgoingMessageInterceptors.forEach((fn) => {\n data = fn(data);\n });\n }\n // Auto‑JSON stringify.\n if (this.options.autoJson && typeof data === \"object\") {\n try {\n data = JSON.stringify(data);\n } catch (err) {\n this.log(\"error\", \"[WS] JSON stringify error:\", err);\n return reject(err);\n }\n }\n try {\n this.socket.send(data);\n this.messagesSent++;\n if (this.options.onAfterSend) {\n this.options.onAfterSend(data);\n }\n resolve();\n } catch (err) {\n reject(err);\n }\n });\n }\n\n /** Flush queued messages */\n private flushMessageQueue(): void {\n this.log(\"debug\", `[WS] Flushing ${this.messageQueue.length} queued message(s).`);\n while (this.messageQueue.length > 0) {\n const msg = this.messageQueue.shift();\n if (msg !== undefined && this.socket && this.socket.readyState === WebSocket.OPEN) {\n this.send(msg).catch((err) => {\n this.log(\"error\", \"[WS] Error sending queued message:\", err);\n });\n }\n }\n }\n\n /** Starts the heartbeat (ping/pong) mechanism */\n private startHeartbeat(): void {\n if (this.options.heartbeatInterval && this.socket) {\n this.log(\"debug\", \"[WS] Starting heartbeat.\");\n this.heartbeatIntervalId = window.setInterval(() => {\n if (this.socket && this.socket.readyState === WebSocket.OPEN) {\n this.log(\"debug\", \"[WS] Sending heartbeat ping.\");\n this.dispatchEvent(\"ping\", { timestamp: Date.now() });\n this.lastPingTimestamp = Date.now();\n this.socket.send(this.options.heartbeatMessage!);\n if (this.options.heartbeatTimeout) {\n this.pongTimeoutId = window.setTimeout(() => {\n this.log(\"error\", \"[WS] Pong timeout; closing connection.\");\n this.socket?.close();\n }, this.options.heartbeatTimeout);\n }\n }\n }, this.options.heartbeatInterval);\n }\n }\n\n /** Stops the heartbeat mechanism */\n private stopHeartbeat(): void {\n if (this.heartbeatIntervalId) {\n clearInterval(this.heartbeatIntervalId);\n this.heartbeatIntervalId = null;\n }\n if (this.pongTimeoutId) {\n clearTimeout(this.pongTimeoutId);\n this.pongTimeoutId = null;\n }\n }\n\n /** Closes the WebSocket connection gracefully */\n close(code?: number, reason?: string): void {\n if (this.socket) {\n this.socket.close(code, reason);\n this.log(\"info\", \"[WS] Connection closed manually.\");\n }\n }\n\n /** Returns whether the connection is currently open */\n isConnected(): boolean {\n return this.socket !== null && this.socket.readyState === WebSocket.OPEN;\n }\n\n /** Returns a human‑readable connection state */\n getConnectionState(): string {\n if (!this.socket) return \"CLOSED\";\n switch (this.socket.readyState) {\n case WebSocket.CONNECTING:\n return \"CONNECTING\";\n case WebSocket.OPEN:\n return \"OPEN\";\n case WebSocket.CLOSING:\n return \"CLOSING\";\n case WebSocket.CLOSED:\n return \"CLOSED\";\n default:\n return \"UNKNOWN\";\n }\n }\n\n /** Forces a manual reconnect */\n manualReconnect(): Promise {\n this.log(\"info\", \"[WS] Manual reconnect initiated.\");\n if (this.socket && this.socket.readyState === WebSocket.OPEN) {\n this.socket.close();\n }\n return this.connect();\n }\n\n /**\n * Sends a message and waits for a response matching the predicate.\n * Useful for request/response patterns.\n */\n sendAndWaitResponse(\n message: any,\n predicate: (msg: any) => boolean,\n timeout: number = 5000\n ): Promise {\n return new Promise((resolve, reject) => {\n const listener = (event: MessageEvent) => {\n if (predicate(event.data)) {\n this.removeEventListener(\"message\", listener);\n resolve(event.data);\n }\n };\n this.addEventListener(\"message\", listener);\n this.send(message).catch((err) => {\n this.removeEventListener(\"message\", listener);\n reject(err);\n });\n setTimeout(() => {\n this.removeEventListener(\"message\", listener);\n reject(new Error(\"Response timeout exceeded.\"));\n }, timeout);\n });\n }\n\n /** Returns metrics on the current connection */\n getMetrics(): WSMetrics {\n return {\n messagesSent: this.messagesSent,\n messagesReceived: this.messagesReceived,\n lastLatency: this.lastLatency,\n reconnectAttempts: this.reconnectAttempts,\n currentUrl: this.currentUrl,\n };\n }\n\n /** Destroys the instance, cleans up timers and listeners */\n destroy(): void {\n this.destroyed = true;\n this.stopHeartbeat();\n if (this.connectionTimeoutId) {\n clearTimeout(this.connectionTimeoutId);\n this.connectionTimeoutId = null;\n }\n this.eventListeners = {\n open: [],\n message: [],\n close: [],\n error: [],\n reconnectAttempt: [],\n reconnect: [],\n reconnectSuccess: [],\n ping: [],\n pong: [],\n custom: [],\n };\n this.messageQueue = [];\n if (this.socket) {\n this.socket.close();\n this.socket = null;\n }\n this.log(\"info\", \"[WS] Connection destroyed.\");\n }\n\n /** Adds an event listener for a given event type */\n addEventListener(eventType: EventType, callback: (event: any) => void): void {\n this.eventListeners[eventType].push(callback);\n }\n\n /** Removes an event listener for a given event type */\n removeEventListener(eventType: EventType, callback: (event: any) => void): void {\n this.eventListeners[eventType] = this.eventListeners[eventType].filter(\n (cb) => cb !== callback\n );\n }\n\n /** Dispatches an event to all registered listeners */\n private dispatchEvent(eventType: EventType, event: any): void {\n this.eventListeners[eventType].forEach((cb) => cb(event));\n }\n\n /** Updates connection options dynamically (effective on next connection) */\n updateOptions(newOptions: Partial): void {\n this.options = { ...this.options, ...newOptions };\n this.log(\"debug\", \"[WS] Options updated:\", this.options);\n }\n\n /** Clears the outgoing message queue */\n clearMessageQueue(): void {\n this.messageQueue = [];\n this.log(\"debug\", \"[WS] Message queue cleared.\");\n }\n}\n\nexport default AdvancedWebSocket;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;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S,6BAA6B;AAAA,EACjD;AACF;AAEA,IAAO,uBAAQ;;;ApGjiBf,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AACb;","names":["axios","import_axios","axios","listServers","serverDetails","import_axios","axios","listAllocations","reinstallServer","listUsers","createUser","updateUser","deleteUser","userDetails","listServers","serverDetails","reinstallServer","listAllocations","listUsers","createUser","updateUser","deleteUser","userDetails"]} \ No newline at end of file diff --git a/dist/index.mjs b/dist/index.mjs index 17229b5..b0568e9 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -573,9 +573,42 @@ var Application = class { } }; +// src/functions/createClientCall.ts +import axios2 from "axios"; +async function ClientAPICall(options) { + const url = `${options.panel}/api/client/${options.endpoint}`; + const headers = { + "Accept": "application/json", + "Content-Type": "application/json", + "Authorization": `Bearer ${options.apiKey}` + }; + try { + if (["POST", "PUT", "PATCH"].includes(options.method)) { + const response = await axios2({ + method: options.method, + url, + headers, + data: options.body ? JSON.stringify(options.body) : void 0 + }); + return response.data; + } else { + const response = await fetch(url, { + method: options.method, + headers + }); + if (!response.ok) { + throw new Error(`API call failed with status ${response.status}: ${await response.text()}`); + } + return await response.json(); + } + } catch (error) { + throw new Error(`Error in API call: ${error instanceof Error ? error.message : String(error)}`); + } +} + // src/class/source/client/account/accountDetails.ts async function accountDetails(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -585,7 +618,7 @@ async function accountDetails(options) { // src/class/source/client/account/2faEnable.ts async function twoFactorEnable(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -596,7 +629,7 @@ async function twoFactorEnable(options) { // src/class/source/client/account/2faDisable.ts async function twoFactorDisable(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "DELETE", @@ -607,7 +640,7 @@ async function twoFactorDisable(options) { // src/class/source/client/account/updateEmail.ts async function updateEmail(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", @@ -621,7 +654,7 @@ async function updateEmail(options) { // src/class/source/client/account/updatePassword.ts async function updatePassword(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", @@ -635,7 +668,7 @@ async function updatePassword(options) { // src/class/source/client/account/createApiKey.ts async function createApiKey(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -649,7 +682,7 @@ async function createApiKey(options) { // src/class/source/client/account/deleteApiKey.ts async function deleteApiKey(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "DELETE", @@ -659,7 +692,7 @@ async function deleteApiKey(options) { // src/class/source/client/account/listApiKeys.ts async function listApiKeys(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -679,7 +712,7 @@ async function listServers2(options) { // src/class/source/client/showPermissions.ts async function showPermissions(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -766,7 +799,7 @@ async function serverDetails2(options) { // src/class/source/client/servers/backups/listBackups.ts async function listBackups(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -776,7 +809,7 @@ async function listBackups(options) { // src/class/source/client/servers/backups/backupDetails.ts async function backupDetails(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -786,7 +819,7 @@ async function backupDetails(options) { // src/class/source/client/servers/backups/createBackup.ts async function createBackup(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -797,7 +830,7 @@ async function createBackup(options) { // src/class/source/client/servers/backups/deleteBackup.ts async function deleteBackup(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "DELETE", @@ -807,7 +840,7 @@ async function deleteBackup(options) { // src/class/source/client/servers/backups/downloadBackup.ts async function downloadBackup(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -817,7 +850,7 @@ async function downloadBackup(options) { // src/class/source/client/servers/files/listFiles.ts async function listFiles(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -827,7 +860,7 @@ async function listFiles(options) { // src/class/source/client/servers/files/getFileContent.ts async function getFileContent(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -837,7 +870,7 @@ async function getFileContent(options) { // src/class/source/client/servers/files/downloadFile.ts async function downloadFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -847,7 +880,7 @@ async function downloadFile(options) { // src/class/source/client/servers/files/renameFile.ts async function renameFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", @@ -858,7 +891,7 @@ async function renameFile(options) { // src/class/source/client/servers/files/copyFile.ts async function copyFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -869,21 +902,18 @@ async function copyFile(options) { // src/class/source/client/servers/files/writeFile.ts async function writeFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", - endpoint: `servers/${options.server_id}/files/write`, - body: JSON.stringify({ - file: options.file_path, - contents: options.content - }) + endpoint: `servers/${options.server_id}/files/write?file=${options.file_path}`, + body: options.content }); } // src/class/source/client/servers/files/compressFile.ts async function compressFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -894,7 +924,7 @@ async function compressFile(options) { // src/class/source/client/servers/files/decompressFile.ts async function decompressFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -905,7 +935,7 @@ async function decompressFile(options) { // src/class/source/client/servers/files/deleteFile.ts async function deleteFile(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -916,7 +946,7 @@ async function deleteFile(options) { // src/class/source/client/servers/files/createFolder.ts async function createFolder(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -926,9 +956,9 @@ async function createFolder(options) { } // src/class/source/client/servers/files/uploadFile.ts -import axios2 from "axios"; +import axios3 from "axios"; async function uploadFile(options) { - const response = await axios2.post( + const response = await axios3.post( `${options.panel}/api/client/servers/${options.server_id}/files/upload`, options.file_data, { @@ -943,7 +973,7 @@ async function uploadFile(options) { // src/class/source/client/servers/network/listAllocations.ts async function listAllocations2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -953,7 +983,7 @@ async function listAllocations2(options) { // src/class/source/client/servers/network/assignAllocations.ts async function assignAllocations(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -964,7 +994,7 @@ async function assignAllocations(options) { // src/class/source/client/servers/network/setAllocationNote.ts async function setAllocationNote(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", @@ -975,7 +1005,7 @@ async function setAllocationNote(options) { // src/class/source/client/servers/network/setPrimaryAllocation.ts async function setPrimaryAllocation(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -985,7 +1015,7 @@ async function setPrimaryAllocation(options) { // src/class/source/client/servers/network/unassignAllocation.ts async function unassignAllocation(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "DELETE", @@ -1122,7 +1152,7 @@ async function deleteTask(options) { // src/class/source/client/servers/settings/renameServer.ts async function renameServer(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PATCH", @@ -1133,7 +1163,7 @@ async function renameServer(options) { // src/class/source/client/servers/settings/reinstallServer.ts async function reinstallServer2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -1143,7 +1173,7 @@ async function reinstallServer2(options) { // src/class/source/client/servers/startup/listVariables.ts async function listVariables(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -1153,7 +1183,7 @@ async function listVariables(options) { // src/class/source/client/servers/startup/updateVariable.ts async function updateVariable(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", @@ -1164,7 +1194,7 @@ async function updateVariable(options) { // src/class/source/client/servers/users/listUsers.ts async function listUsers2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", @@ -1174,7 +1204,7 @@ async function listUsers2(options) { // src/class/source/client/servers/users/createUser.ts async function createUser2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "POST", @@ -1189,7 +1219,7 @@ async function createUser2(options) { // src/class/source/client/servers/users/updateUser.ts async function updateUser2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", @@ -1200,7 +1230,7 @@ async function updateUser2(options) { // src/class/source/client/servers/users/deleteUser.ts async function deleteUser2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "DELETE", @@ -1210,7 +1240,7 @@ async function deleteUser2(options) { // src/class/source/client/servers/users/userDetails.ts async function userDetails2(options) { - return ApplicationAPICall({ + return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "GET", diff --git a/dist/index.mjs.map b/dist/index.mjs.map index f66ef5f..23c1d86 100644 --- a/dist/index.mjs.map +++ b/dist/index.mjs.map @@ -1 +1 @@ -{"version":3,"sources":["../src/class/main/Setup.ts","../src/functions/createAppCall.ts","../src/class/source/app/users/listUsers.ts","../src/class/source/app/users/userDetails.ts","../src/class/source/app/users/userDetails_externalId.ts","../src/class/source/app/users/createUser.ts","../src/class/source/app/users/updateUser.ts","../src/class/source/app/users/deleteUser.ts","../src/class/source/app/nodes/listNodes.ts","../src/class/source/app/nodes/nodeDetails.ts","../src/class/source/app/nodes/nodeConfiguration.ts","../src/class/source/app/nodes/createNode.ts","../src/class/source/app/nodes/updateNode.ts","../src/class/source/app/nodes/deleteNode.ts","../src/class/source/app/locations/listLocations.ts","../src/class/source/app/locations/locationDetails.ts","../src/class/source/app/locations/createLocation.ts","../src/class/source/app/locations/updateLocation.ts","../src/class/source/app/locations/deleteLocation.ts","../src/class/source/app/servers/listServers.ts","../src/class/source/app/servers/serverDetails.ts","../src/class/source/app/servers/serverDetails_externalId.ts","../src/class/source/app/servers/updateDetails.ts","../src/class/source/app/servers/updateServerBuild.ts","../src/class/source/app/servers/updateServerStartup.ts","../src/class/source/app/servers/createServer.ts","../src/class/source/app/servers/suspendServer.ts","../src/class/source/app/servers/unsuspendServer.ts","../src/class/source/app/servers/reinstallServer.ts","../src/class/source/app/servers/deleteServer.ts","../src/class/source/app/servers/forceDeleteServer.ts","../src/class/source/app/servers/databases/listDatabases.ts","../src/class/source/app/servers/databases/databaseDetails.ts","../src/class/source/app/servers/databases/createDatabase.ts","../src/class/source/app/servers/databases/resetDatabasePassword.ts","../src/class/source/app/servers/databases/deleteDatabase.ts","../src/class/source/app/nests/eggs/listEggs.ts","../src/class/source/app/nests/eggs/eggDetails.ts","../src/class/source/app/nests/listNests.ts","../src/class/source/app/nests/nestDetails.ts","../src/class/source/app/nodes/allocations/listAllocations.ts","../src/class/source/app/nodes/allocations/createAllocations.ts","../src/class/source/app/nodes/allocations/deleteAllocation.ts","../src/class/main/Application.ts","../src/class/source/client/account/accountDetails.ts","../src/class/source/client/account/2faEnable.ts","../src/class/source/client/account/2faDisable.ts","../src/class/source/client/account/updateEmail.ts","../src/class/source/client/account/updatePassword.ts","../src/class/source/client/account/createApiKey.ts","../src/class/source/client/account/deleteApiKey.ts","../src/class/source/client/account/listApiKeys.ts","../src/class/source/client/listServers.ts","../src/class/source/client/showPermissions.ts","../src/class/source/client/servers/command.ts","../src/class/source/client/servers/power.ts","../src/class/source/client/servers/consoleDetails.ts","../src/class/source/client/servers/resources.ts","../src/class/source/client/servers/serverDetails.ts","../src/class/source/client/servers/backups/listBackups.ts","../src/class/source/client/servers/backups/backupDetails.ts","../src/class/source/client/servers/backups/createBackup.ts","../src/class/source/client/servers/backups/deleteBackup.ts","../src/class/source/client/servers/backups/downloadBackup.ts","../src/class/source/client/servers/files/listFiles.ts","../src/class/source/client/servers/files/getFileContent.ts","../src/class/source/client/servers/files/downloadFile.ts","../src/class/source/client/servers/files/renameFile.ts","../src/class/source/client/servers/files/copyFile.ts","../src/class/source/client/servers/files/writeFile.ts","../src/class/source/client/servers/files/compressFile.ts","../src/class/source/client/servers/files/decompressFile.ts","../src/class/source/client/servers/files/deleteFile.ts","../src/class/source/client/servers/files/createFolder.ts","../src/class/source/client/servers/files/uploadFile.ts","../src/class/source/client/servers/network/listAllocations.ts","../src/class/source/client/servers/network/assignAllocations.ts","../src/class/source/client/servers/network/setAllocationNote.ts","../src/class/source/client/servers/network/setPrimaryAllocation.ts","../src/class/source/client/servers/network/unassignAllocation.ts","../src/class/source/client/servers/schedules/listSchedules.ts","../src/class/source/client/servers/schedules/createSchedule.ts","../src/class/source/client/servers/schedules/scheduleDetails.ts","../src/class/source/client/servers/schedules/updateSchedule.ts","../src/class/source/client/servers/schedules/deleteSchedule.ts","../src/class/source/client/servers/schedules/createTask.ts","../src/class/source/client/servers/schedules/updateTask.ts","../src/class/source/client/servers/schedules/deleteTask.ts","../src/class/source/client/servers/settings/renameServer.ts","../src/class/source/client/servers/settings/reinstallServer.ts","../src/class/source/client/servers/startup/listVariables.ts","../src/class/source/client/servers/startup/updateVariable.ts","../src/class/source/client/servers/users/listUsers.ts","../src/class/source/client/servers/users/createUser.ts","../src/class/source/client/servers/users/updateUser.ts","../src/class/source/client/servers/users/deleteUser.ts","../src/class/source/client/servers/users/userDetails.ts","../src/class/main/Client.ts","../src/class/main/WSConnection.ts","../src/index.ts"],"sourcesContent":["/**\n * The Setup class provides a way to configure global settings for the Pterodactyl API Wrapper.\n * The primary use is to set the panel URL, which is then used in all API requests.\n *\n * @example\n * Setup.setPanel(\"https://panel.example.com\");\n * const panelUrl = Setup.getPanel();\n */\nexport default class Setup {\n private static panelUrl: string;\n\n /**\n * Sets the global panel URL.\n * @param url - The URL of the Pterodactyl panel.\n */\n public static setPanel(url: string): void {\n this.panelUrl = url;\n }\n\n /**\n * Gets the globally set panel URL.\n * @returns The panel URL.\n * @throws If the panel URL has not been set.\n */\n public static getPanel(): string {\n if (!this.panelUrl) {\n throw new Error(\"Panel URL is not set. Use Setup.setPanel(url) before making API calls.\");\n }\n return this.panelUrl;\n }\n}\n","import axios from \"axios\";\n\n/**\n * Creates an API Call to the Application API of your Pterodactyl panel.\n *\n * @param {Object} options - API call options.\n * @param {string} options.panel - Your panel's URL.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.endpoint - The API endpoint to call.\n * @param {\"GET\" | \"DELETE\" | \"POST\" | \"PATCH\" | \"PUT\"} options.method - HTTP method.\n * @param {any} [options.body] - Request body (for POST and PATCH requests).\n * @returns {Promise} - The data fetched from the API.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const data = await ApplicationAPICall({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * endpoint: \"users\",\n * method: \"GET\"\n * });\n * console.log(\"API Response:\", data);\n * } catch (error) {\n * console.error(\"Error:\", error);\n * }\n * })();\n */\nexport default async function ApplicationAPICall(options: {\n panel: string;\n apiKey: string;\n endpoint: string;\n method: \"GET\" | \"DELETE\" | \"POST\" | \"PATCH\" | \"PUT\";\n body?: any;\n}): Promise {\n const url = `${options.panel}/api/application/${options.endpoint}`;\n const headers = {\n 'Accept': \"application/json\",\n 'Content-Type': \"application/json\",\n 'Authorization': `Bearer ${options.apiKey}`\n };\n\n let body: string | undefined = undefined;\n\n if (options.body && options.method !== \"GET\" && options.method !== \"DELETE\") {\n body = typeof options.body === \"string\" ? options.body : JSON.stringify(options.body);\n }\n\n try {\n if (options.method === \"PATCH\") {\n const response = await axios.patch(url, options.body, { headers });\n return response.data;\n } else {\n const response = await fetch(url, {\n method: options.method,\n headers,\n body\n });\n\n if (!response.ok) {\n throw new Error(`API call failed with status ${response.status}: ${await response.text()}`);\n }\n\n return await response.json();\n }\n } catch (error) {\n throw new Error(`Error in API call: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: boolean,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_page: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of users from the Pterodactyl panel API, with optional filters and sorting.\n * This function makes a `GET` request and includes the request body if required.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {boolean} [options.showLinkedServers=false] - Whether to include linked servers in the response.\n * @param {Object} [options.filters] - Filters to apply when retrieving users.\n * @param {string} [options.filters.email] - Filter users by their email address.\n * @param {string} [options.filters.uuid] - Filter users by their UUID.\n * @param {string} [options.filters.username] - Filter users by their username.\n * @param {string} [options.filters.external_id] - Filter users by their external ID.\n * @param {Object} [options.sortBy] - Sorting preferences for the response.\n * @param {boolean} [options.sortBy.id=false] - Sort users by ID.\n * @param {boolean} [options.sortBy.uuid=false] - Sort users by UUID.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\n\nexport default async function listUsers(options: { \n apiKey: string, \n panel: string, \n showLinkedServers?: boolean, \n filters?: { \n email?: string, \n uuid?: string, \n username?: string, \n external_id?: string\n },\n sortBy?: {\n id?: boolean,\n uuid?: boolean\n }\n}): Promise {\n const body = {\n servers: options.showLinkedServers ?? false,\n filters: {\n email: options.filters?.email ?? null,\n uuid: options.filters?.uuid ?? null,\n username: options.filters?.username ?? null,\n external_id: options.filters?.external_id ?? null\n },\n sortBy: {\n id: options.sortBy?.id ?? false,\n uuid: options.sortBy?.uuid ?? false\n }\n };\n\n return ApplicationAPICall({\n panel: options.panel,\n apiKey: options.apiKey,\n endpoint: \"users\",\n method: \"GET\",\n body: JSON.stringify(body) \n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves details of a specific user from the Pterodactyl panel API.\n * Optionally, it can include the list of servers associated with the user.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.user_id - The unique ID of the user to retrieve.\n * @param {boolean} [options.listServers=false] - Whether to include the user's linked servers in the response.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function userDetails(options: { \n apiKey: string, \n panel: string, \n user_id: string, \n listServers?: boolean \n}): Promise {\n return ApplicationAPICall({\n panel: options.panel,\n apiKey: options.apiKey,\n endpoint: `user/${options.user_id}`,\n method: \"GET\",\n body: JSON.stringify({ servers: options.listServers ?? false }) // Ensuring body is a string\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves user details from the Pterodactyl panel API using an external identifier.\n * Optionally, it can include the list of servers associated with the user.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.external_id - The external identifier of the user to retrieve.\n * @param {boolean} [options.listServers=false] - Whether to include the user's linked servers in the response.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const userData = await userDetailsByExternalIdentifier({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * external_id: \"external-user-1234\",\n * listServers: true\n * });\n * console.log(\"User Details:\", userData);\n * } catch (error) {\n * console.error(\"Error:\", error);\n * }\n * })();\n */\nexport default async function userDetailsByExternalIdentifier(options: { \n apiKey: string, \n panel: string, \n external_id: string, \n listServers?: boolean \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `users/external/${options.external_id}`,\n body: JSON.stringify({ servers: options.listServers ?? false }) // Ensuring body is a JSON string\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Creates a new user in the Pterodactyl panel using the provided user details.\n * If `first_name` or `last_name` are not provided, they default to `\"Pterodactyl\"` and `\"User\"`, respectively.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.user_details - The details of the user to be created.\n * @param {string} options.user_details.email - The email address of the user.\n * @param {string} options.user_details.username - The username of the user.\n * @param {string} [options.user_details.first_name=\"Pterodactyl\"] - The first name of the user (optional).\n * @param {string} [options.user_details.last_name=\"User\"] - The last name of the user (optional).\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const newUser = await createUser({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * user_details: {\n * email: \"newuser@example.com\",\n * username: \"newUser123\",\n * first_name: \"John\",\n * last_name: \"Doe\"\n * }\n * });\n * console.log(\"User Created:\", newUser);\n * } catch (error) {\n * console.error(\"Error creating user:\", error);\n * }\n * })();\n */\nexport default async function createUser(options: {\n apiKey: string;\n panel: string;\n user_details: {\n email: string;\n username: string;\n first_name?: string;\n last_name?: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"users\",\n body: JSON.stringify({\n email: options.user_details.email,\n username: options.user_details.username,\n first_name: options.user_details.first_name ?? \"Pterodactyl\",\n last_name: options.user_details.last_name ?? \"User\"\n }) \n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Updates a user's details on the Pterodactyl panel.\n * You can update the user's email, username, first name, last name, language, or password.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.user_id - The ID of the user to update.\n * @param {Object} options.data - The data to update for the user.\n * @param {string} [options.data.email] - The new email of the user (optional).\n * @param {string} [options.data.username] - The new username of the user (optional).\n * @param {string} [options.data.first_name] - The new first name of the user (optional).\n * @param {string} [options.data.last_name] - The new last name of the user (optional).\n * @param {string} [options.data.language] - The new language preference for the user (optional).\n * @param {string} [options.data.password] - The new password for the user (optional).\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const updatedUser = await updateUser({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * user_id: 1234,\n * data: {\n * email: \"newemail@example.com\",\n * username: \"UpdatedUsername\",\n * first_name: \"John\",\n * last_name: \"Doe\"\n * }\n * });\n * console.log(\"User Updated:\", updatedUser);\n * } catch (error) {\n * console.error(\"Error updating user:\", error);\n * }\n * })();\n */\nexport default async function updateUser(options: {\n apiKey: string;\n panel: string;\n user_id: number;\n data: {\n email?: string;\n username?: string;\n first_name?: string;\n last_name?: string;\n language?: string;\n password?: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n endpoint: `users/${options.user_id}`, // Fixed endpoint (removed extra \"/\")\n method: \"PATCH\",\n body: JSON.stringify(options.data) // Ensured the body is stringified\n });\n}","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a user from the Pterodactyl panel using the given identifier.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.identifier - The unique identifier (ID) of the user to be deleted.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const response = await deleteUser({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * identifier: 1234\n * });\n * console.log(\"User Deleted:\", response);\n * } catch (error) {\n * console.error(\"Error deleting user:\", error);\n * }\n * })();\n */\nexport default async function deleteUser(options: { \n apiKey: string; \n panel: string; \n identifier: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `users/${options.identifier}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean,\n name: string,\n description: string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: string,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_sftp: number,\n daemon_base: string,\n created_at: string,\n updated_at: string\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of all nodes on the Pterodactyl panel.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing all nodes.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listNodes(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"nodes\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean,\n name: string,\n description: string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: boolean,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_base: string,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves details of a specific node.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node whose details are requested.\n * @returns {Promise} - API response containing node details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function nodeDetails(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nodes/${options.node_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n debug: boolean,\n uuid: string,\n token_id: string,\n token: string,\n api: {\n host: string,\n ssl: {\n enabled: boolean,\n cert: string,\n key: string\n },\n upload_limit: string,\n },\n system: {\n data: string,\n sftp: {\n bind_port: number\n }\n },\n remote: string\n}\n\n/**\n * Retrieves the configuration settings of a specific node.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node whose configuration is requested.\n * @returns {Promise} - API response containing the node configuration.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function nodeConfiguration(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nodes/${options.node_id}/configuration`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean,\n name: string,\n description: null | string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: boolean,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_sftp: number,\n daemon_base: string,\n created_at: string,\n updated_at: string,\n allocated_resources: {\n memory: number,\n disk: number\n }\n },\n meta: {\n resource: string\n }\n}\n\n/**\n * Creates a new node on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.node_data - Node details for creation.\n * @param {string} options.node_data.name - The name of the node.\n * @param {string} [options.node_data.description] - Optional description of the node.\n * @param {number} options.node_data.location_id - The ID of the location where the node should be created.\n * @param {string} options.node_data.fqdn - The fully qualified domain name of the node.\n * @param {\"http\" | \"https\"} options.node_data.scheme - The scheme (HTTP or HTTPS) for the node.\n * @param {number} options.node_data.memory - The amount of memory allocated to the node (in MB).\n * @param {number} options.node_data.disk - The amount of disk space allocated to the node (in MB).\n * @param {number[]} [options.node_data.ports] - Optional list of ports assigned to the node.\n * @param {number} options.node_data.daemon_sftp - The SFTP port of the node.\n * @param {number} options.node_data.daemon_listen - The daemon listen port of the node.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createNode(options: { \n apiKey: string; \n panel: string; \n node_data: {\n name: string;\n description?: string;\n location_id: number;\n fqdn: string;\n scheme: \"http\" | \"https\";\n memory: number;\n disk: number;\n ports?: number[];\n daemon_sftp: number;\n daemon_listen: number;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"nodes\",\n body: JSON.stringify(options.node_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean, \n name: string,\n description: string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: boolean,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_sftp: number,\n daemon_base: string,\n created_at: string,\n updated_at: string,\n mounts: [],\n allocated_resources: {\n memory: number,\n disk: number\n }\n }\n}\n\n/**\n * Updates an existing node with new settings.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node to update.\n * @param {Object} options.update_data - The new data for the node update.\n * @param {string} [options.update_data.name] - The new name for the node (optional).\n * @param {string} [options.update_data.description] - The new description for the node (optional).\n * @param {number} [options.update_data.location_id] - The new location ID for the node (optional).\n * @param {number} [options.update_data.memory] - The new memory allocation for the node (optional, in MB).\n * @param {number} [options.update_data.disk] - The new disk allocation for the node (optional, in MB).\n * @param {number} [options.update_data.daemon_sftp] - The new SFTP port for the node (optional).\n * @param {number} [options.update_data.daemon_listen] - The new daemon listen port for the node (optional).\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateNode(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n update_data: {\n name?: string;\n description?: string;\n location_id?: number;\n memory?: number;\n disk?: number;\n daemon_sftp?: number;\n daemon_listen?: number;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `nodes/${options.node_id}`,\n body: JSON.stringify(options.update_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a node from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node to delete.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteNode(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `nodes/${options.node_id}`\n });\n}","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: {\n object: string;\n attributes: {\n id: number;\n short: string;\n long: string;\n updated_at: string;\n created_at: string;\n };\n }[];\n meta: {\n pagination: {\n total: number;\n count: number;\n per_page: number;\n current_page: number;\n total_pages: number;\n links: object;\n };\n };\n }\n \n\n/**\n * Retrieves a list of all locations from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing all locations.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listLocations(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"locations\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n short: string,\n long: string,\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Retrieves details of a specific location from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.location_id - The ID of the location to retrieve.\n * @returns {Promise} - API response containing location details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function locationDetails(options: { \n apiKey: string; \n panel: string; \n location_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `locations/${options.location_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n short: string,\n long: string,\n updates_at: string,\n created_at: string\n },\n meta: {\n resource: string\n }\n}\n\n/**\n * Creates a new location on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.location_data - The data required to create a new location.\n * @param {string} options.location_data.short - A short identifier for the location (e.g., \"us-east\").\n * @param {string} options.location_data.long - A long description of the location (e.g., \"US East Coast Datacenter\").\n * @returns {Promise} - API response containing the created location details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createLocation(options: { \n apiKey: string; \n panel: string; \n location_data: {\n short: string;\n long: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"locations\",\n body: JSON.stringify(options.location_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n short: string,\n long: string,\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Updates an existing location on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.location_id - The ID of the location to update.\n * @param {Object} options.update_data - The new data for updating the location.\n * @param {string} [options.update_data.short] - The new short identifier for the location (optional).\n * @param {string} [options.update_data.long] - The new long description of the location (optional).\n * @returns {Promise} - API response confirming the update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateLocation(options: { \n apiKey: string; \n panel: string; \n location_id: number; \n update_data: {\n short?: string;\n long?: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `locations/${options.location_id}`,\n body: JSON.stringify(options.update_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a location from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.location_id - The ID of the location to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteLocation(options: { \n apiKey: string; \n panel: string; \n location_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `locations/${options.location_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[]\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n pack: any,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: object\n },\n updated_at: string,\n created_at: string,\n relationship: {\n databases: {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number, \n database: string,\n username: string,\n remote: string,\n max_connections: number,\n created_at: string,\n updated_at: string\n }\n }[]\n }[]\n }\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of all servers from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing the list of servers.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listServers(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"servers\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[]\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n pack: boolean,\n container: {\n startup_commands: string,\n image: string,\n installed: boolean,\n environment: object\n }\n updated_at: number,\n created_at: number\n }\n}\n\n/**\n * Retrieves details of a specific server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing server details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function serverDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[]\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n pack: boolean,\n container: {\n startup_commands: string,\n image: string,\n installed: boolean,\n environment: object\n }\n updated_at: number,\n created_at: number\n }\n}\n\n/**\n * Retrieves details of a specific server using an external identifier.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.external_id - The external identifier of the server.\n * @returns {Promise} - API response containing server details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function serverDetailsExternalIdentifier(options: { \n apiKey: string; \n panel: string; \n external_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/external/${options.external_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n descriptions: string,\n suspendes: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: number[] | null\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: [],\n },\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Updates details of a specific server (name or description).\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} options.update_data - The new server details.\n * @returns {Promise} - API response confirming the update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n update_data: any;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/details`,\n body: JSON.stringify(options.update_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n descriptions: string,\n suspendes: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: number[] | null\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: [],\n },\n updated_at: string,\n created_at: string\n }\n}\n\n\n/**\n * Updates the build configuration of a server, including CPU, memory, disk, and other limits.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} options.build_data - The new build configuration.\n * @param {number} [options.build_data.cpu] - The CPU limit (in percentage, 100% = 1 core).\n * @param {number} [options.build_data.memory] - The memory limit (in MB).\n * @param {number} [options.build_data.disk] - The disk space limit (in MB).\n * @param {number} [options.build_data.swap] - The swap memory limit (in MB).\n * @param {number} [options.build_data.io] - The block I/O weight (10-1000).\n * @param {number} [options.build_data.threads] - The CPU threads allowed for the server.\n * @param {boolean} [options.build_data.oom_disabled] - Whether to disable Out-of-Memory (OOM) killer.\n * @returns {Promise} - API response confirming the build update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateServerBuild(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n build_data: {\n cpu?: number;\n memory?: number;\n disk?: number;\n swap?: number;\n io?: number;\n threads?: number;\n oom_disabled?: boolean;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/build`,\n body: JSON.stringify(options.build_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n descriptions: string,\n suspendes: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: number[] | null\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: [],\n },\n updated_at: string,\n created_at: string\n }\n}\n\n\n/**\n * Updates the startup configuration of a server, including environment variables and startup command.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} options.startup_data - The new startup configuration.\n * @param {string} [options.startup_data.startup] - The new startup command.\n * @param {number} [options.startup_data.egg] - The new egg ID for the server.\n * @param {number} [options.startup_data.image] - The new Docker image for the server.\n * @param {Object} [options.startup_data.environment] - The environment variables for the server.\n * @returns {Promise} - API response confirming the startup update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateServerStartup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n startup_data: {\n startup?: string;\n egg?: number;\n image?: string;\n environment?: Record;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/startup`,\n body: JSON.stringify(options.startup_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: null | string | number,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[],\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: object\n },\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Creates a new server on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.server_data - The data required to create the server.\n * @returns {Promise} - API response containing the created server details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createServer(options: { \n apiKey: string; \n panel: string; \n server_data: any;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"servers\",\n body: JSON.stringify(options.server_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Suspends a server, preventing it from starting.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to suspend.\n * @returns {Promise} - API response confirming the suspension.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function suspendServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/suspend`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Unsuspends a server, allowing it to start again.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to unsuspend.\n * @returns {Promise} - API response confirming the unsuspension.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function unsuspendServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/unsuspend`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Reinstalls a server, resetting its files and configuration.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to reinstall.\n * @returns {Promise} - API response confirming the reinstallation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function reinstallServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/reinstall`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a server from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Forcefully deletes a server from the Pterodactyl panel, bypassing standard checks.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function forceDeleteServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/force`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number,\n database: string,\n username: string,\n remote: string,\n max_connections: number,\n created_at: string,\n updated_at: string,\n relationships: {\n password: {\n object: string,\n attributes: {\n password: string\n }\n }\n host: {\n object: string,\n attributes: {\n id: number,\n name: string,\n host: string,\n port: number,\n username: string,\n node: number,\n created_at: string,\n updated_at: string\n }\n }\n }\n }\n }[]\n}\n\n/**\n * Retrieves a list of all databases for a specific server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing all databases.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listDatabases(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/databases`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number,\n database: string,\n username: string,\n remote: string,\n max_connections: number,\n created_at: string,\n updated_at: string\n }\n}\n/**\n * Retrieves details of a specific database.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.database_id - The ID of the database.\n * @returns {Promise} - API response containing database details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function databaseDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/databases/${options.database_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number,\n database: string,\n username: string,\n remote: string,\n max_connections: number | null,\n created_at: string,\n updated_at: string\n },\n meta: {\n resource: string\n }\n}\n\n/**\n * Creates a new database for a specific server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to create the database for.\n * @param {Object} options.database_data - The data for the new database.\n * @param {string} options.database_data.database - The name of the database.\n * @param {string} options.database_data.remote - The remote access setting (e.g., `%` for any IP).\n * @returns {Promise} - API response containing the created database details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createDatabase(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_data: {\n database: string;\n remote: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/databases`,\n body: JSON.stringify(options.database_data)\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Resets the password for a specific database.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.database_id - The ID of the database.\n * @returns {Promise} - API response confirming the password reset.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function resetDatabasePassword(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/databases/${options.database_id}/reset-password`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Deletes a database from a server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.database_id - The ID of the database to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteDatabase(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/databases/${options.database_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n uuid: string;\n name: string;\n nest: number;\n author: string;\n description: string;\n docker_image: string;\n config: {\n files: {\n [filename: string]: {\n parser: string;\n find: {\n [key: string]: any;\n };\n };\n };\n };\n startup: {\n done: string;\n userInteraction: string[];\n };\n stop: string;\n logs: {\n custom: boolean;\n location: string;\n };\n script: {\n privileged: boolean;\n install: string;\n entry: string;\n container: string;\n extends: any;\n };\n created_at: string;\n updated_at: string;\n relationships: {\n nest: {\n object: string;\n attributes: {\n id: number;\n uuid: string;\n author: string;\n name: string;\n description: string;\n created_at: string;\n updated_at: string;\n };\n };\n servers: {\n object: string;\n data: any[];\n };\n };\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all eggs within a specific nest.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.nest_id - The ID of the nest.\n * @returns {Promise} - API response containing the list of eggs.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listEggs(options: { \n apiKey: string; \n panel: string; \n nest_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nests/${options.nest_id}/eggs`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n name: string,\n nest: number,\n author: string,\n description: string,\n docker_image: string,\n config: {\n files: object,\n startup: {\n done: string,\n userInteraction: []\n },\n stop: string,\n logs: {\n custom: boolean,\n location: string\n },\n extends: any\n },\n startup: string,\n script: {\n privileged: boolean,\n install: string,\n entry: string,\n container: string,\n extends: any\n },\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves details of a specific egg from a nest.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.nest_id - The ID of the nest.\n * @param {number} options.egg_id - The ID of the egg to retrieve.\n * @returns {Promise} - API response containing egg details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function eggDetails(options: { \n apiKey: string; \n panel: string; \n nest_id: number;\n egg_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nests/${options.nest_id}/eggs/${options.egg_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n author: string,\n name: string,\n description: string,\n created_at: string,\n updated_at: string\n }\n }[],\n meta: {\n pagination: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n}\n/**\n * Retrieves a list of all nests available on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing the list of nests.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listNests(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"nests\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n author: string,\n name: string,\n description: string,\n created_at: string,\n updated_at: string\n }\n}\n/**\n * Retrieves details of a specific nest.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.nest_id - The ID of the nest.\n * @returns {Promise} - API response containing nest details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function nestDetails(options: { \n apiKey: string; \n panel: string; \n nest_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nests/${options.nest_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n ip: string,\n alias: any,\n port: number,\n notes: any,\n assigned: boolean\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of all allocations on a specific node.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node whose allocations should be retrieved.\n * @returns {Promise} - API response containing the list of allocations.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listAllocations(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nodes/${options.node_id}/allocations`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Creates a new allocation on a specific node.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node where the allocation should be created.\n * @param {string} options.ip - The IP address to allocate.\n * @param {number[]} options.ports - An array of ports to allocate.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createAllocation(options: { \n apiKey: string; \n panel: string; \n node_id: number;\n ip: string;\n ports: number[];\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `nodes/${options.node_id}/allocations`,\n body: JSON.stringify({\n ip: options.ip,\n ports: options.ports\n })\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Deletes an allocation from a specific node.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node where the allocation exists.\n * @param {number} options.allocation_id - The ID of the allocation to delete.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteAllocation(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n allocation_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `nodes/${options.node_id}/allocations/${options.allocation_id}`\n });\n}\n","import Setup from \"./Setup\";\n\n// Import Application API - User Management\nimport listUsers from \"../source/app/users/listUsers\";\nimport userDetails from \"../source/app/users/userDetails\";\nimport userDetails_externalId from \"../source/app/users/userDetails_externalId\";\nimport createUser from \"../source/app/users/createUser\";\nimport updateUser from \"../source/app/users/updateUser\";\nimport deleteUser from \"../source/app/users/deleteUser\";\n\n// Import Application API - Node Management\nimport listNodes from \"../source/app/nodes/listNodes\";\nimport nodeDetails from \"../source/app/nodes/nodeDetails\";\nimport nodeConfiguration from \"../source/app/nodes/nodeConfiguration\";\nimport createNode from \"../source/app/nodes/createNode\";\nimport updateNode from \"../source/app/nodes/updateNode\";\nimport deleteNode from \"../source/app/nodes/deleteNode\";\n\n// Import Application API - Location Management\nimport listLocations from \"../source/app/locations/listLocations\";\nimport locationDetails from \"../source/app/locations/locationDetails\";\nimport createLocation from \"../source/app/locations/createLocation\";\nimport updateLocation from \"../source/app/locations/updateLocation\";\nimport deleteLocation from \"../source/app/locations/deleteLocation\";\n\n// Import Application API - Server Management\nimport listServers from \"../source/app/servers/listServers\";\nimport serverDetails from \"../source/app/servers/serverDetails\";\nimport serverDetails_externalId from \"../source/app/servers/serverDetails_externalId\";\nimport updateDetails from \"../source/app/servers/updateDetails\";\nimport updateServerBuild from \"../source/app/servers/updateServerBuild\";\nimport updateServerStartup from \"../source/app/servers/updateServerStartup\";\nimport createServer from \"../source/app/servers/createServer\";\nimport suspendServer from \"../source/app/servers/suspendServer\";\nimport unsuspendServer from \"../source/app/servers/unsuspendServer\";\nimport reinstallServer from \"../source/app/servers/reinstallServer\";\nimport deleteServer from \"../source/app/servers/deleteServer\";\nimport forceDeleteServer from \"../source/app/servers/forceDeleteServer\";\n\n// Import Application API - Database Management\nimport listDatabases from \"../source/app/servers/databases/listDatabases\";\nimport databaseDetails from \"../source/app/servers/databases/databaseDetails\";\nimport createDatabase from \"../source/app/servers/databases/createDatabase\";\nimport resetDatabasePassword from \"../source/app/servers/databases/resetDatabasePassword\";\nimport deleteDatabase from \"../source/app/servers/databases/deleteDatabase\";\n\n// Import Application API - Nest & Egg Management\nimport listEggs from \"../source/app/nests/eggs/listEggs\";\nimport eggDetails from \"../source/app/nests/eggs/eggDetails\";\nimport listNests from \"../source/app/nests/listNests\";\nimport nestDetails from \"../source/app/nests/nestDetails\";\n\n// Import Application API - Allocations Management\nimport listAllocations from \"../source/app/nodes/allocations/listAllocations\";\nimport createAllocations from \"../source/app/nodes/allocations/createAllocations\";\nimport deleteAllocation from \"../source/app/nodes/allocations/deleteAllocation\";\n\n/**\n * The Application class provides an interface for interacting with the\n * Pterodactyl Application API. This class gives full control over the panel,\n * including user, node, location, server, database, nest, and allocation management.\n *\n * @example\n * const app = new Application(\"YOUR_API_KEY\");\n * const users = await app.users.list();\n */\nexport default class Application {\n private apiKey: string;\n private panel: string;\n\n constructor(apiKey: string) {\n this.apiKey = apiKey;\n this.panel = Setup.getPanel();\n }\n\n /** User Management */\n public users = {\n list: () => listUsers({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (user_id: string) =>\n userDetails({ apiKey: this.apiKey, panel: this.panel, user_id }),\n getDetailsByExternalId: (external_id: string) =>\n userDetails_externalId({ apiKey: this.apiKey, panel: this.panel, external_id }),\n create: (user_details: { email: string; username: string; first_name?: string; last_name?: string }) =>\n createUser({ apiKey: this.apiKey, panel: this.panel, user_details }),\n update: (user_id: string, user_data: any) =>\n updateUser({ apiKey: this.apiKey, panel: this.panel, user_id: parseInt(user_id), data: user_data }),\n delete: (user_id: string) =>\n deleteUser({ apiKey: this.apiKey, panel: this.panel, identifier: parseInt(user_id) }),\n };\n\n /** Node Management */\n public nodes = {\n list: () => listNodes({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (node_id: string) =>\n nodeDetails({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n getConfiguration: (node_id: string) =>\n nodeConfiguration({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n create: (node_data: any) =>\n createNode({ apiKey: this.apiKey, panel: this.panel, node_data }),\n update: (node_id: string, node_data: any) =>\n updateNode({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id), update_data: node_data }),\n delete: (node_id: string) =>\n deleteNode({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n };\n\n /** Location Management */\n public locations = {\n list: () => listLocations({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (location_id: string) =>\n locationDetails({ apiKey: this.apiKey, panel: this.panel, location_id: parseInt(location_id) }),\n create: (location_data: { short: string; long: string }) =>\n createLocation({ apiKey: this.apiKey, panel: this.panel, location_data }),\n update: (location_id: string, location_data: any) =>\n updateLocation({ apiKey: this.apiKey, panel: this.panel, location_id: parseInt(location_id), update_data: location_data }),\n delete: (location_id: string) =>\n deleteLocation({ apiKey: this.apiKey, panel: this.panel, location_id: parseInt(location_id) }),\n };\n\n /** Server Management */\n public servers = {\n list: () => listServers({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (server_id: string) =>\n serverDetails({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetailsByExternalId: (external_id: string) =>\n serverDetails_externalId({ apiKey: this.apiKey, panel: this.panel, external_id }),\n updateDetails: (server_id: string, update_data: any) =>\n updateDetails({ apiKey: this.apiKey, panel: this.panel, server_id, update_data }),\n updateBuild: (server_id: string, build_data: any) =>\n updateServerBuild({ apiKey: this.apiKey, panel: this.panel, server_id, build_data }),\n updateStartup: (server_id: string, startup_data: any) =>\n updateServerStartup({ apiKey: this.apiKey, panel: this.panel, server_id, startup_data }),\n create: (server_data: any) =>\n createServer({ apiKey: this.apiKey, panel: this.panel, server_data }),\n suspend: (server_id: string) =>\n suspendServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n unsuspend: (server_id: string) =>\n unsuspendServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n reinstall: (server_id: string) =>\n reinstallServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n delete: (server_id: string) =>\n deleteServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n forceDelete: (server_id: string) =>\n forceDeleteServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n };\n\n /** Nest & Egg Management */\n public nests = {\n listNests: () => listNests({ apiKey: this.apiKey, panel: this.panel }),\n getNestDetails: (nest_id: string) =>\n nestDetails({ apiKey: this.apiKey, panel: this.panel, nest_id: parseInt(nest_id) }),\n listEggs: (nest_id: string) =>\n listEggs({ apiKey: this.apiKey, panel: this.panel, nest_id: parseInt(nest_id) }),\n getEggDetails: (nest_id: string, egg_id: string) =>\n eggDetails({ apiKey: this.apiKey, panel: this.panel, nest_id: parseInt(nest_id), egg_id: parseInt(egg_id) }),\n };\n\n /** Allocations Management */\n public allocations = {\n list: (node_id: string) => listAllocations({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n create: (node_id: string, ip: string, ports: number[]) => \n createAllocations({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id), ip, ports }),\n delete: (node_id: string, allocation_id: string) => \n deleteAllocation({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id), allocation_id: parseInt(allocation_id) }),\n };\n /** Database Management */\n public databases = {\n list: (server_id: string) => listDatabases({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetails: (server_id: string, database_id: string) => \n databaseDetails({ apiKey: this.apiKey, panel: this.panel, server_id, database_id: parseInt(database_id) }),\n create: (server_id: string, database_data: any) => \n createDatabase({ apiKey: this.apiKey, panel: this.panel, server_id, database_data }),\n resetPassword: (server_id: string, database_id: string) => \n resetDatabasePassword({ apiKey: this.apiKey, panel: this.panel, server_id, database_id: parseInt(database_id) }),\n delete: (server_id: string, database_id: string) => \n deleteDatabase({ apiKey: this.apiKey, panel: this.panel, server_id, database_id: parseInt(database_id) })\n };\n\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n admin: boolean;\n username: string;\n email: string;\n first_name: string;\n last_name: string;\n language: string;\n };\n }\n\n \n/**\n * Retrieves account details for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing account details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function accountDetails(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"account\"\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n tokens: string[];\n };\n }\n \n\n/**\n * Enables Two-Factor Authentication (2FA) for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string[]} options.codes - The TOTP authentication codes for verification.\n * @returns {Promise} - API response confirming 2FA activation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function twoFactorEnable(options: { \n apiKey: string; \n panel: string; \n codes: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"account/two-factor\",\n body: { codes: options.codes }\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Disables Two-Factor Authentication (2FA) for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string[]} options.tokens - An array of 2FA recovery codes to confirm disabling.\n * @returns {Promise} - API response confirming 2FA deactivation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function twoFactorDisable(options: { \n apiKey: string; \n panel: string; \n tokens: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: \"account/two-factor\",\n body: { tokens: options.tokens }\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Updates the email address of the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.email - The new email address.\n * @param {string} options.password - The current password (required for confirmation).\n * @returns {Promise} - API response confirming email update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateEmail(options: { \n apiKey: string; \n panel: string; \n email: string;\n password: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: \"account/email\",\n body: {\n email: options.email,\n password: options.password\n }\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Updates the password of the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.current_password - The current password for confirmation.\n * @param {string} options.new_password - The new password to set.\n * @returns {Promise} - API response confirming password update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updatePassword(options: { \n apiKey: string; \n panel: string; \n current_password: string;\n new_password: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: \"account/password\",\n body: {\n current_password: options.current_password,\n password: options.new_password\n }\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n identifier: string,\n description: string,\n allowed_ips: string[],\n last_used_at: null | string,\n created_at: string\n },\n meta: {\n secret_token: string\n }\n}\n\n/**\n * Creates a new API key for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.description - A description for the API key.\n * @param {string[]} options.allowed_ips - An array of allowed IPs (empty for unrestricted access).\n * @returns {Promise} - API response containing the newly created API key.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createApiKey(options: { \n apiKey: string; \n panel: string; \n description: string;\n allowed_ips: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"account/api-keys\",\n body: {\n description: options.description,\n allowed_ips: options.allowed_ips\n }\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes an API key for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.key_id - The unique identifier of the API key to delete.\n * @returns {Promise} - API response confirming deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteApiKey(options: { \n apiKey: string; \n panel: string; \n key_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `account/api-keys/${options.key_id}`\n });\n}\n","import ClientAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n identifier: string,\n description: string,\n allowed_ips: [] | string[],\n last_used_at: string,\n created_at: string\n }\n }[]\n}\n\n/**\n * Retrieves a list of all API keys for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing all API keys.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listApiKeys(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"account/api-keys\"\n });\n}\n","import ClientAPICall from \"../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n server_owner: boolean;\n identifier: string;\n uuid: string;\n name: string;\n node: string;\n sftp_details: {\n ip: string;\n port: number;\n };\n description: string;\n limits: {\n memory: number;\n swap: number;\n disk: number;\n io: number;\n cpu: number;\n };\n feature_limits: {\n databases: number;\n allocations: number;\n backups: number;\n };\n is_suspended: boolean;\n is_installing: boolean;\n relationships: {\n allocations: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }>;\n };\n };\n };\n }>;\n meta: {\n pagination: {\n total: number;\n count: number;\n per_page: number;\n current_page: number;\n total_pages: number;\n links: Record;\n };\n };\n }\n \n/**\n * Retrieves a list of all servers the authenticated user has access to.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing the list of servers.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listServers(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"servers\"\n });\n}\n","import ClientAPICall from \"../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n permissions: {\n websocket: {\n description: string;\n keys: {\n connect: string;\n };\n };\n control: {\n description: string;\n keys: {\n console: string;\n start: string;\n stop: string;\n restart: string;\n };\n };\n user: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n };\n };\n file: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n archive: string;\n sftp: string;\n };\n };\n backup: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n download: string;\n };\n };\n allocation: {\n description: string;\n keys: {\n read: string;\n create: string;\n update: string;\n delete: string;\n };\n };\n startup: {\n description: string;\n keys: {\n read: string;\n update: string;\n };\n };\n database: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n view_password: string;\n };\n };\n schedule: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n };\n };\n settings: {\n description: string;\n keys: {\n rename: string;\n reinstall: string;\n };\n };\n };\n };\n }\n \n\n/**\n * Retrieves the permissions the authenticated user has for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of permissions for the user.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function showPermissions(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/permissions`\n });\n}\n","/**\n * Sends a command to a server's console.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.command - The command to execute.\n * @returns {Promise} - A promise that resolves when the command is sent.\n */\nexport default async function command(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n command: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/command`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify({ command: options.command })\n });\n\n if (!response.ok) {\n throw new Error(`Failed to send command: ${await response.text()}`);\n }\n}\n","/**\n * Sends a power action to a server (start, stop, restart, kill).\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.signal - The power action (start, stop, restart, kill).\n * @returns {Promise} - A promise that resolves when the power action is sent.\n */\nexport default async function power(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n signal: \"start\" | \"stop\" | \"restart\" | \"kill\"; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/power`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify({ signal: options.signal })\n });\n\n if (!response.ok) {\n throw new Error(`Failed to send power action: ${await response.text()}`);\n }\n}\n","export interface Response {\n data: {\n token: string;\n socket: string;\n };\n }\n \n/**\n * Retrieves real-time console details for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with console details.\n */\nexport default async function consoleDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/websocket`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch console details: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n current_state: string;\n is_suspended: boolean;\n resources: {\n memory_bytes: number;\n cpu_absolute: number;\n disk_bytes: number;\n network_rx_bytes: number;\n network_tx_bytes: number;\n };\n };\n }\n \n\n/**\n * Fetches resource usage (CPU, RAM, disk) for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with server resource usage details.\n */\nexport default async function resources(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/resources`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch server resources: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n server_owner: boolean;\n identifier: string;\n uuid: string;\n name: string;\n node: string;\n sftp_details: {\n ip: string;\n port: number;\n };\n description: string;\n limits: {\n memory: number;\n swap: number;\n disk: number;\n io: number;\n cpu: number;\n };\n feature_limits: {\n databases: number;\n allocations: number;\n backups: number;\n };\n is_suspended: boolean;\n is_installing: boolean;\n relationships: {\n allocations: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }>;\n };\n };\n };\n meta: {\n is_server_owner: boolean;\n user_permissions: string[];\n };\n }\n \n\n\n/**\n * Retrieves details for a specific server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with server details.\n */\nexport default async function serverDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch server details: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n uuid: string;\n name: string;\n ignored_files: string[];\n sha256_hash: string;\n bytes: number;\n created_at: string;\n completed_at: string;\n };\n }>;\n meta: {\n pagination: {\n total: number;\n count: number;\n per_page: number;\n current_page: number;\n total_pages: number;\n links: Record;\n };\n };\n }\n \n\n/**\n * Retrieves a list of all backups for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing a list of backups.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listBackups(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/backups`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n name: string;\n ignored_files: string[];\n sha256_hash: string;\n bytes: number;\n created_at: string;\n completed_at: string;\n };\n }\n \n\n/**\n * Retrieves details of a specific backup for a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.backup_id - The ID of the backup.\n * @returns {Promise} - API response containing backup details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function backupDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/backups/${options.backup_id}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n name: string;\n ignored_files: string[];\n sha256_hash: string | null;\n bytes: number;\n created_at: string;\n completed_at: string | null;\n };\n }\n \n\n/**\n * Creates a new backup for a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} [options.backup_data] - Optional backup settings.\n * @param {string} [options.backup_data.name] - Name for the backup.\n * @param {boolean} [options.backup_data.locked] - Whether the backup is locked.\n * @returns {Promise} - API response confirming backup creation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createBackup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_data?: {\n name?: string;\n locked?: boolean;\n };\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/backups`,\n body: options.backup_data ? JSON.stringify(options.backup_data) : undefined\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Deletes a backup from a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.backup_id - The ID of the backup.\n * @returns {Promise} - API response confirming backup deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteBackup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/backups/${options.backup_id}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n url: string;\n };\n}\n \n\n/**\n * Retrieves a download link for a backup file.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.backup_id - The ID of the backup.\n * @returns {Promise} - API response containing the download URL.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function downloadBackup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/backups/${options.backup_id}/download`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n name: string;\n mode: string;\n size: number;\n is_file: boolean;\n is_symlink: boolean;\n is_editable: boolean;\n mimetype: string;\n created_at: string;\n modified_at: string;\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all files and directories for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} [options.directory] - The directory path to list files from (optional).\n * @returns {Promise} - API response containing the list of files.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listFiles(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n directory?: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/files/list${options.directory ? `?directory=${options.directory}` : \"\"}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Retrieves the content of a specific file on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to retrieve.\n * @returns {Promise} - API response containing file content.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function getFileContent(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/files/contents?file=${encodeURIComponent(options.file_path)}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n url: string;\n };\n }\n \n\n/**\n * Retrieves a download link for a file.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to download.\n * @returns {Promise} - API response containing the download URL.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function downloadFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/files/download?file=${encodeURIComponent(options.file_path)}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Renames a file or folder on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object[]} options.files - An array of objects containing old and new file names.\n * @returns {Promise} - API response confirming file/folder rename.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function renameFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n files: { from: string; to: string }[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/files/rename`,\n body: JSON.stringify({ files: options.files })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Copies a file to a new location on the server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to copy.\n * @returns {Promise} - API response confirming the file copy.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function copyFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/copy`,\n body: JSON.stringify({ location: options.file_path })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Writes content to a file on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to write.\n * @param {string} options.content - The content to write to the file.\n * @returns {Promise} - API response confirming file write operation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function writeFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n content: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/write`,\n body: JSON.stringify({\n file: options.file_path,\n contents: options.content\n })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n name: string;\n mode: string;\n size: number;\n is_file: boolean;\n is_symlink: boolean;\n is_editable: boolean;\n mimetype: string;\n created_at: string;\n modified_at: string;\n };\n }\n \n\n/**\n * Compresses files or directories on a server into a ZIP archive.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string[]} options.files - An array of files or directories to compress.\n * @returns {Promise} - API response confirming compression.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function compressFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n files: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/compress`,\n body: JSON.stringify({ files: options.files })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Decompresses a ZIP file on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the ZIP file to decompress.\n * @returns {Promise} - API response confirming decompression.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function decompressFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/decompress`,\n body: JSON.stringify({ file: options.file_path })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Deletes a file or folder on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string[]} options.files - An array of files or folders to delete.\n * @returns {Promise} - API response confirming file deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n files: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/delete`,\n body: JSON.stringify({ files: options.files })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Creates a new folder on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.folder_path - The path of the folder to create.\n * @returns {Promise} - API response confirming folder creation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createFolder(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n folder_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/create-folder`,\n body: JSON.stringify({ name: options.folder_path })\n });\n}\n","import axios from \"axios\";\n\nexport interface Response {\n object: string;\n attributes: {\n url: string;\n };\n}\n\n/**\n * Uploads a file to a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {FormData} options.file_data - The file data to upload.\n * @returns {Promise} - API response confirming file upload.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function uploadFile(options: {\n apiKey: string;\n panel: string;\n server_id: string;\n file_data: FormData;\n}): Promise {\n const response = await axios.post(\n `${options.panel}/api/client/servers/${options.server_id}/files/upload`,\n options.file_data,\n {\n headers: {\n \"Authorization\": `Bearer ${options.apiKey}`,\n \"Content-Type\": \"multipart/form-data\",\n },\n }\n );\n return response.data;\n}\n\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all network allocations for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of allocations.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listAllocations(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/network/allocations`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }\n\n \n/**\n * Assigns a new allocation to a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to assign.\n * @returns {Promise} - API response confirming allocation assignment.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function assignAllocations(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/network/allocations`,\n body: JSON.stringify({ allocation_id: options.allocation_id })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }\n\n \n/**\n * Updates the note for a specific allocation on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to update.\n * @param {string} options.note - The new note for the allocation.\n * @returns {Promise} - API response confirming the note update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function setAllocationNote(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n note: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/network/allocations/${options.allocation_id}`,\n body: JSON.stringify({ notes: options.note })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }\n\n \n/**\n * Sets a specific allocation as the primary allocation for a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to set as primary.\n * @returns {Promise} - API response confirming primary allocation change.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function setPrimaryAllocation(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/network/allocations/${options.allocation_id}/primary`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Unassigns a network allocation from a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to remove.\n * @returns {Promise} - API response confirming allocation removal.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function unassignAllocation(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/network/allocations/${options.allocation_id}`\n });\n}\n","export interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }>;\n };\n };\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all schedules for a specified server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with the list of schedules.\n */\nexport default async function listSchedules(options: { apiKey: string; panel: string; server_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch schedules: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: any[];\n };\n };\n };\n }\n \n\n/**\n * Creates a new schedule for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {Object} options.schedule_data - The schedule details.\n * @returns {Promise} - A promise resolving with the created schedule details.\n */\nexport default async function createSchedule(options: { apiKey: string; panel: string; server_id: string; schedule_data: any }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify(options.schedule_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to create schedule: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }>;\n };\n };\n };\n }\n \n\n/**\n * Retrieves details of a specific schedule for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @returns {Promise} - A promise resolving with the schedule details.\n */\nexport default async function scheduleDetails(options: { apiKey: string; panel: string; server_id: string; schedule_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch schedule details: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: any[];\n };\n };\n };\n }\n \n\n/**\n * Updates an existing schedule for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {Object} options.schedule_data - The updated schedule details.\n * @returns {Promise} - A promise resolving with the updated schedule.\n */\nexport default async function updateSchedule(options: { apiKey: string; panel: string; server_id: string; schedule_id: string; schedule_data: any }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}`, {\n method: \"PATCH\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify(options.schedule_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to update schedule: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","/**\n * Deletes a schedule from a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @returns {Promise} - A promise that resolves when the schedule is deleted.\n */\nexport default async function deleteSchedule(options: { apiKey: string; panel: string; server_id: string; schedule_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}`, {\n method: \"DELETE\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to delete schedule: ${await response.text()}`);\n }\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }\n \n\n/**\n * Creates a task inside a specific schedule.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {Object} options.task_data - The task details.\n * @returns {Promise} - A promise resolving with the created task details.\n */\nexport default async function createTask(options: { apiKey: string; panel: string; server_id: string; schedule_id: string; task_data: any }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}/tasks`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify(options.task_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to create task: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }\n \n\n/**\n * Updates an existing task inside a specific schedule.\n *\n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {string} options.task_id - The task identifier.\n * @param {Object} options.task_data - The updated task details.\n * @returns {Promise} - A promise resolving with the updated task details.\n */\nexport default async function updateTask(options: {\n apiKey: string;\n panel: string;\n server_id: string;\n schedule_id: string;\n task_id: string;\n} & Record): Promise {\n const { apiKey, panel, server_id, schedule_id, task_id, ...task_data } = options;\n\n const response = await fetch(`${panel}/api/client/servers/${server_id}/schedules/${schedule_id}/tasks/${task_id}`, {\n method: \"PATCH\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${apiKey}`\n },\n body: JSON.stringify(task_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to update task: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","/**\n * Deletes a specific task inside a schedule.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {string} options.task_id - The task identifier.\n * @returns {Promise} - A promise that resolves when the task is deleted.\n */\nexport default async function deleteTask(options: { apiKey: string; panel: string; server_id: string; schedule_id: string; task_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}/tasks/${options.task_id}`, {\n method: \"DELETE\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to delete task: ${await response.text()}`);\n }\n}\n\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Renames a server on the panel.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.new_name - The new name for the server.\n * @returns {Promise} - API response confirming the server rename.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function renameServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n new_name: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/settings/rename`,\n body: JSON.stringify({ name: options.new_name })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Reinstalls a server, resetting its configuration while preserving files.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to reinstall.\n * @returns {Promise} - API response confirming the reinstallation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function reinstallServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/settings/reinstall`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n name: string;\n description: string;\n env_variable: string;\n default_value: string;\n server_value: string;\n is_editable: boolean;\n rules: string;\n };\n }>;\n meta: {\n startup_command: string;\n raw_startup_command: string;\n };\n }\n\n \n/**\n * Retrieves a list of all startup variables for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of startup variables.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listVariables(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/startup/variables`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n name: string;\n description: string;\n env_variable: string;\n default_value: string;\n server_value: string;\n is_editable: boolean;\n rules: string;\n };\n }\n \n\n/**\n * Updates a startup variable for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.variable_id - The ID of the startup variable.\n * @param {string} options.value - The new value for the variable.\n * @returns {Promise} - API response confirming variable update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateVariable(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n variable_id: number;\n value: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/startup/variables/${options.variable_id}`,\n body: JSON.stringify({ value: options.value })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all users assigned to a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of users.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listUsers(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/users`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: \"server_subuser\";\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }\n \n\n/**\n * Assigns a new user to a server with specific permissions.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.email - The email address of the user.\n * @param {string} options.username - The username of the user.\n * @param {string[]} options.permissions - An array of permissions for the user.\n * @returns {Promise} - API response confirming user creation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createUser(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n email: string;\n username: string;\n permissions: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/users`,\n body: JSON.stringify({\n email: options.email,\n username: options.username,\n permissions: options.permissions\n })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }\n \n\n/**\n * Updates an existing user's permissions for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.user_id - The ID of the user.\n * @param {string[]} options.permissions - The new set of permissions for the user.\n * @returns {Promise} - API response confirming user update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateUser(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n user_id: string;\n permissions: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/users/${options.user_id}`,\n body: JSON.stringify({ permissions: options.permissions })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Removes a user from a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.user_id - The ID of the user to remove.\n * @returns {Promise} - API response confirming user removal.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteUser(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n user_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/users/${options.user_id}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }\n\n \n/**\n * Retrieves details of a specific user assigned to a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.user_id - The ID of the user.\n * @returns {Promise} - API response containing user details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function userDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n user_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/users/${options.user_id}`\n });\n}\n","import Setup from \"./Setup\";\n\n// Import account functions\nimport accountDetails from \"../source/client/account/accountDetails\";\nimport twoFactorEnable from \"../source/client/account/2faEnable\";\nimport twoFactorDisable from \"../source/client/account/2faDisable\";\nimport updateEmail from \"../source/client/account/updateEmail\";\nimport updatePassword from \"../source/client/account/updatePassword\";\nimport createApiKey from \"../source/client/account/createApiKey\";\nimport deleteApiKey from \"../source/client/account/deleteApiKey\";\nimport listApiKeys from \"../source/client/account/listApiKeys\";\n\n// Import general server functions\nimport listServers from \"../source/client/listServers\";\nimport showPermissions from \"../source/client/showPermissions\";\nimport command from \"../source/client/servers/command\";\nimport power from \"../source/client/servers/power\";\nimport consoleDetails from \"../source/client/servers/consoleDetails\";\nimport resources from \"../source/client/servers/resources\";\nimport serverDetails from \"../source/client/servers/serverDetails\";\n\n// Import backup functions\nimport listBackups from \"../source/client/servers/backups/listBackups\";\nimport backupDetails from \"../source/client/servers/backups/backupDetails\";\nimport createBackup from \"../source/client/servers/backups/createBackup\";\nimport deleteBackup from \"../source/client/servers/backups/deleteBackup\";\nimport downloadBackup from \"../source/client/servers/backups/downloadBackup\";\n\n// Import database functions\nimport listDatabases from \"../source/client/servers/databases/listDatabases\";\nimport createDatabase from \"../source/client/servers/databases/createDatabase\";\nimport deleteDatabase from \"../source/client/servers/databases/deleteDatabase\";\nimport rotatePassword from \"../source/client/servers/databases/rotatePassword\";\n\n// Import file management functions\nimport listFiles from \"../source/client/servers/files/listFiles\";\nimport getFileContent from \"../source/client/servers/files/getFileContent\";\nimport downloadFile from \"../source/client/servers/files/downloadFile\";\nimport renameFile from \"../source/client/servers/files/renameFile\";\nimport copyFile from \"../source/client/servers/files/copyFile\";\nimport writeFile from \"../source/client/servers/files/writeFile\";\nimport compressFile from \"../source/client/servers/files/compressFile\";\nimport decompressFile from \"../source/client/servers/files/decompressFile\";\nimport deleteFile from \"../source/client/servers/files/deleteFile\";\nimport createFolder from \"../source/client/servers/files/createFolder\";\nimport uploadFile from \"../source/client/servers/files/uploadFile\";\n\n// Import network management functions\nimport listAllocations from \"../source/client/servers/network/listAllocations\";\nimport assignAllocations from \"../source/client/servers/network/assignAllocations\";\nimport setAllocationNote from \"../source/client/servers/network/setAllocationNote\";\nimport setPrimaryAllocation from \"../source/client/servers/network/setPrimaryAllocation\";\nimport unassignAllocation from \"../source/client/servers/network/unassignAllocation\";\n\n// Import schedule functions\nimport listSchedules from \"../source/client/servers/schedules/listSchedules\";\nimport createSchedule from \"../source/client/servers/schedules/createSchedule\";\nimport scheduleDetails from \"../source/client/servers/schedules/scheduleDetails\";\nimport updateSchedule from \"../source/client/servers/schedules/updateSchedule\";\nimport deleteSchedule from \"../source/client/servers/schedules/deleteSchedule\";\nimport createTask from \"../source/client/servers/schedules/createTask\";\nimport updateTask from \"../source/client/servers/schedules/updateTask\";\nimport deleteTask from \"../source/client/servers/schedules/deleteTask\";\n\n// Import settings functions\nimport renameServer from \"../source/client/servers/settings/renameServer\";\nimport reinstallServer from \"../source/client/servers/settings/reinstallServer\";\n\n// Import startup functions\nimport listVariables from \"../source/client/servers/startup/listVariables\";\nimport updateVariable from \"../source/client/servers/startup/updateVariable\";\n\n// Import user management functions\nimport listUsers from \"../source/client/servers/users/listUsers\";\nimport createUser from \"../source/client/servers/users/createUser\";\nimport updateUser from \"../source/client/servers/users/updateUser\";\nimport deleteUser from \"../source/client/servers/users/deleteUser\";\nimport userDetails from \"../source/client/servers/users/userDetails\";\n\n/**\n * The `Client` class provides an interface for interacting with the Pterodactyl Client API.\n * It supports **account management, server control, file operations, backups, networking, schedules, settings, startup variables, and more**.\n */\nexport default class Client {\n private apiKey: string;\n private panel: string;\n\n constructor(apiKey: string) {\n this.apiKey = apiKey;\n this.panel = Setup.getPanel();\n }\n\n /** Account Management */\n public account = {\n getDetails: () => accountDetails({ apiKey: this.apiKey, panel: this.panel }),\n enable2FA: (codes: string[]) => twoFactorEnable({ apiKey: this.apiKey, panel: this.panel, codes }),\n disable2FA: (tokens: string[]) => twoFactorDisable({ apiKey: this.apiKey, panel: this.panel, tokens }),\n updateEmail: (email: string, password: string) => updateEmail({ apiKey: this.apiKey, panel: this.panel, email, password }),\n updatePassword: (current_password: string, new_password: string) => updatePassword({ apiKey: this.apiKey, panel: this.panel, current_password, new_password }),\n createApiKey: (description: string, allowed_ips: string[]) => createApiKey({ apiKey: this.apiKey, panel: this.panel, description, allowed_ips }),\n deleteApiKey: (key_id: string) => deleteApiKey({ apiKey: this.apiKey, panel: this.panel, key_id }),\n listApiKeys: () => listApiKeys({ apiKey: this.apiKey, panel: this.panel }),\n };\n\n /** Server Management */\n public servers = {\n list: () => listServers({ apiKey: this.apiKey, panel: this.panel }),\n showPermissions: (server_id: string) => showPermissions({ apiKey: this.apiKey, panel: this.panel, server_id }),\n sendCommand: (server_id: string, commandStr: string) => command({ apiKey: this.apiKey, panel: this.panel, server_id, command: commandStr }),\n powerAction: (server_id: string, signal: \"start\" | \"stop\" | \"restart\" | \"kill\") => power({ apiKey: this.apiKey, panel: this.panel, server_id, signal }),\n getConsoleDetails: (server_id: string) => consoleDetails({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getResources: (server_id: string) => resources({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetails: (server_id: string) => serverDetails({ apiKey: this.apiKey, panel: this.panel, server_id }),\n };\n\n /** Backup Management */\n public backups = {\n list: (server_id: string) => listBackups({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetails: (server_id: string, backup_id: string) => backupDetails({ apiKey: this.apiKey, panel: this.panel, server_id, backup_id }),\n create: (server_id: string, backup_data: any) => createBackup({ apiKey: this.apiKey, panel: this.panel, server_id, backup_data }),\n delete: (server_id: string, backup_id: string) => deleteBackup({ apiKey: this.apiKey, panel: this.panel, server_id, backup_id }),\n download: (server_id: string, backup_id: string) => downloadBackup({ apiKey: this.apiKey, panel: this.panel, server_id, backup_id }),\n };\n\n /** Settings */\n public settings = {\n renameServer: (server_id: string, new_name: string) => renameServer({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n new_name\n }), \n reinstallServer: (server_id: string) => reinstallServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n };\n \n /** Network Management */\n public network = {\n listAllocations: (server_id: string) => listAllocations({ apiKey: this.apiKey, panel: this.panel, server_id }),\n assignAllocations: (server_id: string, allocation_id: number) => assignAllocations({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id\n }), \n setAllocationNote: (server_id: string, allocation_id: string, note: string) => setAllocationNote({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id: parseInt(allocation_id), \n note \n }),\n \n setPrimaryAllocation: (server_id: string, allocation_id: string) => setPrimaryAllocation({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id: parseInt(allocation_id) \n }),\n \n unassignAllocation: (server_id: string, allocation_id: string) => unassignAllocation({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id: parseInt(allocation_id) \n }), \n };\n \n /** Schedule Management */\n public schedules = {\n list: (server_id: string) => listSchedules({ apiKey: this.apiKey, panel: this.panel, server_id }),\n createSchedule: (server_id: string, schedule_data: any) => createSchedule({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_data }),\n scheduleDetails: (server_id: string, schedule_id: string) => scheduleDetails({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id }),\n updateSchedule: (server_id: string, schedule_id: string, schedule_data: any) => updateSchedule({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, schedule_data }),\n deleteSchedule: (server_id: string, schedule_id: string) => deleteSchedule({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id }),\n createTask: (server_id: string, schedule_id: string, task_data: any) => createTask({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, task_data }),\n updateTask: (server_id: string, schedule_id: string, task_id: string, task_data: any) => updateTask({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, task_id, task_data }),\n deleteTask: (server_id: string, schedule_id: string, task_id: string) => deleteTask({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, task_id }),\n };\n \n /** Startup Management */\n public startup = {\n listVariables: (server_id: string) => listVariables({ apiKey: this.apiKey, panel: this.panel, server_id }),\n updateVariable: (server_id: string, variable_id: string, value: string) => updateVariable({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n variable_id: parseInt(variable_id), \n value \n }), \n };\n \n /** User Management */\n public users = {\n listUsers: (server_id: string) => listUsers({ apiKey: this.apiKey, panel: this.panel, server_id }),\n createUser: (server_id: string, user_data: any) => createUser({ apiKey: this.apiKey, panel: this.panel, server_id, ...user_data }),\n updateUser: (server_id: string, user_id: string, user_data: any) => updateUser({ apiKey: this.apiKey, panel: this.panel, server_id, user_id, ...user_data }),\n deleteUser: (server_id: string, user_id: string) => deleteUser({ apiKey: this.apiKey, panel: this.panel, server_id, user_id }),\n userDetails: (server_id: string, user_id: string) => userDetails({ apiKey: this.apiKey, panel: this.panel, server_id, user_id }),\n };\n \n \n\n\n /** File Management */\n public files = {\n list: (server_id: string, directory?: string) => listFiles({ apiKey: this.apiKey, panel: this.panel, server_id, directory }),\n getContent: (server_id: string, file_path: string) => getFileContent({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n download: (server_id: string, file_path: string) => downloadFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n rename: (server_id: string, from: string, to: string) => renameFile({ apiKey: this.apiKey, panel: this.panel, server_id, files: [{ from, to }] }),\n copy: (server_id: string, file_path: string) => copyFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n write: (server_id: string, file_path: string, content: string) => writeFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path, content }),\n compress: (server_id: string, files: string[]) => compressFile({ apiKey: this.apiKey, panel: this.panel, server_id, files }),\n decompress: (server_id: string, file_path: string) => decompressFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n delete: (server_id: string, files: string[]) => deleteFile({ apiKey: this.apiKey, panel: this.panel, server_id, files }),\n createFolder: (server_id: string, folder_path: string) => createFolder({ apiKey: this.apiKey, panel: this.panel, server_id, folder_path }),\n upload: (server_id: string, file_data: FormData) => uploadFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_data }),\n };\n}\n","// WSConnection.ts\n\ntype ReconnectStrategy = \"fixed\" | \"exponential\" | \"exponential-jitter\";\n\ntype EventType =\n | \"open\"\n | \"message\"\n | \"close\"\n | \"error\"\n | \"reconnectAttempt\"\n | \"reconnectSuccess\"\n | \"reconnect\"\n | \"ping\"\n | \"pong\"\n | \"custom\";\n\nexport interface WSConnectionOptions {\n /** Primary WebSocket URL (required) */\n url: string;\n /** Optional fallback URLs if the primary fails */\n fallbackUrls?: string[];\n /** Optional subprotocol(s) to use during the handshake */\n protocols?: string | string[];\n\n /** Automatically reconnect on connection loss */\n autoReconnect?: boolean;\n /** Reconnect strategy: fixed, exponential, or exponential with jitter */\n reconnectStrategy?: ReconnectStrategy;\n /** Base delay (ms) for reconnect attempts */\n reconnectInterval?: number;\n /** Maximum number of reconnect attempts */\n maxReconnectAttempts?: number;\n /** Maximum delay (ms) allowed for exponential backoff */\n maxReconnectInterval?: number;\n /** Additional random jitter (ms) to add when using jitter strategy */\n jitter?: number;\n\n /** Connection timeout (ms) for establishing the connection */\n connectionTimeout?: number;\n\n /** Enable heartbeat (ping/pong) mechanism; set interval in ms */\n heartbeatInterval?: number;\n /** Heartbeat ping message (default \"ping\") */\n heartbeatMessage?: string;\n /** Expected pong message (default \"pong\") */\n expectedPongMessage?: string;\n /** How long (ms) to wait for a pong before closing the connection */\n heartbeatTimeout?: number;\n\n /** If true, queue outgoing messages if the connection is not open */\n queueMessages?: boolean;\n /** Maximum number of messages to queue */\n messageQueueLimit?: number;\n\n /** Automatically JSON‑stringify outgoing objects and parse incoming JSON strings */\n autoJson?: boolean;\n\n /** Custom logger callback; if not provided, uses console */\n logger?: (\n level: \"debug\" | \"info\" | \"warn\" | \"error\",\n ...args: any[]\n ) => void;\n /** Outgoing message interceptors (middleware) */\n outgoingMessageInterceptors?: Array<(message: any) => any>;\n /** Incoming message interceptors (middleware) */\n incomingMessageInterceptors?: Array<(message: any) => any>;\n\n /** Hook called before reconnecting; return false to cancel reconnect */\n onBeforeReconnect?: (attempt: number, lastCloseEvent: CloseEvent) => boolean;\n /** Hook called before sending a message; can modify or cancel the send */\n onBeforeSend?: (message: any) => any;\n /** Hook called after a message is sent */\n onAfterSend?: (message: any) => void;\n\n /** Standard event callbacks (optional) */\n onOpen?: (event: Event) => void;\n onMessage?: (event: MessageEvent) => void;\n onClose?: (event: CloseEvent) => void;\n onError?: (event: Event) => void;\n}\n\nexport interface WSMetrics {\n messagesSent: number;\n messagesReceived: number;\n lastLatency: number;\n reconnectAttempts: number;\n currentUrl: string;\n}\n\nclass AdvancedWebSocket {\n private socket: WebSocket | null = null;\n private currentUrl: string;\n private fallbackUrls: string[];\n private reconnectAttempts: number = 0;\n private messageQueue: Array = [];\n private heartbeatIntervalId: number | null = null;\n private pongTimeoutId: number | null = null;\n private connectionTimeoutId: number | null = null;\n private destroyed: boolean = false;\n\n // Metrics\n private messagesSent: number = 0;\n private messagesReceived: number = 0;\n private lastPingTimestamp: number = 0;\n private lastLatency: number = 0;\n\n // Custom event listeners\n private eventListeners: Record void>> = {\n open: [],\n message: [],\n close: [],\n error: [],\n reconnectAttempt: [],\n reconnect: [],\n reconnectSuccess: [],\n ping: [],\n pong: [],\n custom: [],\n };\n\n private options: WSConnectionOptions;\n\n constructor(options: WSConnectionOptions) {\n if (!options.url) {\n throw new Error(\"A URL is required to establish a WebSocket connection.\");\n }\n this.options = {\n autoReconnect: false,\n reconnectStrategy: \"exponential\",\n reconnectInterval: 1000,\n maxReconnectAttempts: 10,\n maxReconnectInterval: 30000,\n jitter: 300,\n connectionTimeout: 10000,\n heartbeatInterval: 30000,\n heartbeatMessage: \"ping\",\n expectedPongMessage: \"pong\",\n heartbeatTimeout: 5000,\n queueMessages: false,\n autoJson: false,\n ...options,\n };\n this.currentUrl = this.options.url;\n this.fallbackUrls = this.options.fallbackUrls || [];\n }\n\n /** Internal logger */\n private log(level: \"debug\" | \"info\" | \"warn\" | \"error\", ...args: any[]) {\n if (this.options.logger) {\n this.options.logger(level, ...args);\n } else {\n console[level](...args);\n }\n }\n\n /**\n * Establishes the WebSocket connection.\n * Returns a promise that resolves when connected.\n */\n connect(): Promise {\n return new Promise((resolve, reject) => {\n if (this.destroyed) {\n return reject(new Error(\"Instance has been destroyed.\"));\n }\n this.log(\"debug\", `[WS] Connecting to ${this.currentUrl}`);\n this.socket = new WebSocket(this.currentUrl, this.options.protocols);\n\n if (this.options.connectionTimeout) {\n this.connectionTimeoutId = window.setTimeout(() => {\n this.log(\"error\", \"[WS] Connection timeout reached\");\n reject(new Error(\"Connection timeout reached\"));\n this.socket?.close();\n }, this.options.connectionTimeout);\n }\n\n this.socket.onopen = (event) => {\n this.log(\"info\", `[WS] Connected to ${this.currentUrl}`);\n if (this.connectionTimeoutId) {\n clearTimeout(this.connectionTimeoutId);\n this.connectionTimeoutId = null;\n }\n this.reconnectAttempts = 0;\n if (this.options.heartbeatInterval) {\n this.startHeartbeat();\n }\n if (this.options.queueMessages && this.messageQueue.length > 0) {\n this.flushMessageQueue();\n }\n if (this.options.onOpen) this.options.onOpen(event);\n this.dispatchEvent(\"open\", event);\n resolve(this.socket!); // Assert non-null\n };\n\n this.socket.onmessage = (event) => {\n let data: any = event.data;\n if (this.options.incomingMessageInterceptors) {\n this.options.incomingMessageInterceptors.forEach((fn) => {\n data = fn(data);\n });\n }\n if (this.options.autoJson && typeof data === \"string\") {\n try {\n data = JSON.parse(data);\n } catch (e) {\n // fallback to raw data if JSON parsing fails\n }\n }\n this.messagesReceived++;\n // Handle heartbeat pong.\n if (\n this.options.heartbeatInterval &&\n data === this.options.expectedPongMessage\n ) {\n this.log(\"debug\", \"[WS] Received pong\");\n this.dispatchEvent(\"pong\", event);\n if (this.pongTimeoutId) {\n clearTimeout(this.pongTimeoutId);\n this.pongTimeoutId = null;\n }\n this.lastLatency = Date.now() - this.lastPingTimestamp;\n return;\n }\n const modifiedEvent = { ...event, data };\n if (this.options.onMessage) this.options.onMessage(modifiedEvent);\n this.dispatchEvent(\"message\", modifiedEvent);\n };\n\n this.socket.onerror = (event) => {\n this.log(\"error\", \"[WS] Error:\", event);\n if (this.options.onError) this.options.onError(event);\n this.dispatchEvent(\"error\", event);\n };\n\n this.socket.onclose = (event) => {\n this.log(\"warn\", \"[WS] Connection closed:\", event);\n this.stopHeartbeat();\n if (this.options.onClose) this.options.onClose(event);\n this.dispatchEvent(\"close\", event);\n // Attempt auto-reconnect if enabled and not destroyed.\n if (\n this.options.autoReconnect &&\n this.reconnectAttempts < (this.options.maxReconnectAttempts || 0) &&\n !this.destroyed\n ) {\n // Allow hook to cancel reconnect.\n if (\n this.options.onBeforeReconnect &&\n !this.options.onBeforeReconnect(this.reconnectAttempts, event)\n ) {\n this.log(\"info\", \"[WS] Reconnect canceled by onBeforeReconnect hook.\");\n return;\n }\n this.reconnectAttempts++;\n this.dispatchEvent(\"reconnectAttempt\", {\n attempt: this.reconnectAttempts,\n });\n let delay = this.computeReconnectDelay();\n this.log(\n \"info\",\n `[WS] Reconnecting in ${delay}ms... (Attempt ${this.reconnectAttempts})`\n );\n setTimeout(() => {\n // Try fallback URLs if provided.\n if (this.fallbackUrls.length > 0) {\n const nextUrl = this.fallbackUrls.shift();\n if (nextUrl) {\n this.log(\"info\", `[WS] Switching to fallback URL: ${nextUrl}`);\n this.currentUrl = nextUrl;\n }\n }\n this.dispatchEvent(\"reconnect\", { attempt: this.reconnectAttempts });\n this.connect()\n .then((sock) => {\n this.dispatchEvent(\"reconnectSuccess\", {\n attempt: this.reconnectAttempts,\n });\n })\n .catch((err) => {\n this.log(\"error\", \"[WS] Reconnection failed:\", err);\n });\n }, delay);\n }\n };\n });\n }\n\n /**\n * Computes the delay (ms) for the next reconnection attempt based on strategy.\n */\n private computeReconnectDelay(): number {\n let base = this.options.reconnectInterval || 1000;\n let delay: number;\n switch (this.options.reconnectStrategy) {\n case \"fixed\":\n delay = base;\n break;\n case \"exponential\":\n delay = base * Math.pow(2, this.reconnectAttempts - 1);\n break;\n case \"exponential-jitter\":\n delay = base * Math.pow(2, this.reconnectAttempts - 1);\n const jitter = this.options.jitter || 300;\n delay += Math.floor(Math.random() * jitter);\n break;\n default:\n delay = base;\n }\n if (this.options.maxReconnectInterval) {\n delay = Math.min(delay, this.options.maxReconnectInterval);\n }\n return delay;\n }\n\n /**\n * Sends data over the WebSocket.\n * Returns a promise that resolves once the message is sent.\n */\n send(data: any): Promise {\n return new Promise((resolve, reject) => {\n if (!this.socket || this.socket.readyState !== WebSocket.OPEN) {\n if (this.options.queueMessages) {\n if (\n this.options.messageQueueLimit &&\n this.messageQueue.length >= this.options.messageQueueLimit\n ) {\n this.log(\"error\", \"[WS] Message queue full; discarding message.\");\n return reject(new Error(\"Message queue is full.\"));\n }\n this.log(\"debug\", \"[WS] Queuing message (connection not open).\");\n this.messageQueue.push(data);\n return resolve();\n } else {\n this.log(\"error\", \"[WS] Socket not open; cannot send.\");\n return reject(new Error(\"WebSocket is not open.\"));\n }\n }\n // Before-send hook.\n if (this.options.onBeforeSend) {\n data = this.options.onBeforeSend(data);\n }\n // Apply outgoing interceptors.\n if (this.options.outgoingMessageInterceptors) {\n this.options.outgoingMessageInterceptors.forEach((fn) => {\n data = fn(data);\n });\n }\n // Auto‑JSON stringify.\n if (this.options.autoJson && typeof data === \"object\") {\n try {\n data = JSON.stringify(data);\n } catch (err) {\n this.log(\"error\", \"[WS] JSON stringify error:\", err);\n return reject(err);\n }\n }\n try {\n this.socket.send(data);\n this.messagesSent++;\n if (this.options.onAfterSend) {\n this.options.onAfterSend(data);\n }\n resolve();\n } catch (err) {\n reject(err);\n }\n });\n }\n\n /** Flush queued messages */\n private flushMessageQueue(): void {\n this.log(\"debug\", `[WS] Flushing ${this.messageQueue.length} queued message(s).`);\n while (this.messageQueue.length > 0) {\n const msg = this.messageQueue.shift();\n if (msg !== undefined && this.socket && this.socket.readyState === WebSocket.OPEN) {\n this.send(msg).catch((err) => {\n this.log(\"error\", \"[WS] Error sending queued message:\", err);\n });\n }\n }\n }\n\n /** Starts the heartbeat (ping/pong) mechanism */\n private startHeartbeat(): void {\n if (this.options.heartbeatInterval && this.socket) {\n this.log(\"debug\", \"[WS] Starting heartbeat.\");\n this.heartbeatIntervalId = window.setInterval(() => {\n if (this.socket && this.socket.readyState === WebSocket.OPEN) {\n this.log(\"debug\", \"[WS] Sending heartbeat ping.\");\n this.dispatchEvent(\"ping\", { timestamp: Date.now() });\n this.lastPingTimestamp = Date.now();\n this.socket.send(this.options.heartbeatMessage!);\n if (this.options.heartbeatTimeout) {\n this.pongTimeoutId = window.setTimeout(() => {\n this.log(\"error\", \"[WS] Pong timeout; closing connection.\");\n this.socket?.close();\n }, this.options.heartbeatTimeout);\n }\n }\n }, this.options.heartbeatInterval);\n }\n }\n\n /** Stops the heartbeat mechanism */\n private stopHeartbeat(): void {\n if (this.heartbeatIntervalId) {\n clearInterval(this.heartbeatIntervalId);\n this.heartbeatIntervalId = null;\n }\n if (this.pongTimeoutId) {\n clearTimeout(this.pongTimeoutId);\n this.pongTimeoutId = null;\n }\n }\n\n /** Closes the WebSocket connection gracefully */\n close(code?: number, reason?: string): void {\n if (this.socket) {\n this.socket.close(code, reason);\n this.log(\"info\", \"[WS] Connection closed manually.\");\n }\n }\n\n /** Returns whether the connection is currently open */\n isConnected(): boolean {\n return this.socket !== null && this.socket.readyState === WebSocket.OPEN;\n }\n\n /** Returns a human‑readable connection state */\n getConnectionState(): string {\n if (!this.socket) return \"CLOSED\";\n switch (this.socket.readyState) {\n case WebSocket.CONNECTING:\n return \"CONNECTING\";\n case WebSocket.OPEN:\n return \"OPEN\";\n case WebSocket.CLOSING:\n return \"CLOSING\";\n case WebSocket.CLOSED:\n return \"CLOSED\";\n default:\n return \"UNKNOWN\";\n }\n }\n\n /** Forces a manual reconnect */\n manualReconnect(): Promise {\n this.log(\"info\", \"[WS] Manual reconnect initiated.\");\n if (this.socket && this.socket.readyState === WebSocket.OPEN) {\n this.socket.close();\n }\n return this.connect();\n }\n\n /**\n * Sends a message and waits for a response matching the predicate.\n * Useful for request/response patterns.\n */\n sendAndWaitResponse(\n message: any,\n predicate: (msg: any) => boolean,\n timeout: number = 5000\n ): Promise {\n return new Promise((resolve, reject) => {\n const listener = (event: MessageEvent) => {\n if (predicate(event.data)) {\n this.removeEventListener(\"message\", listener);\n resolve(event.data);\n }\n };\n this.addEventListener(\"message\", listener);\n this.send(message).catch((err) => {\n this.removeEventListener(\"message\", listener);\n reject(err);\n });\n setTimeout(() => {\n this.removeEventListener(\"message\", listener);\n reject(new Error(\"Response timeout exceeded.\"));\n }, timeout);\n });\n }\n\n /** Returns metrics on the current connection */\n getMetrics(): WSMetrics {\n return {\n messagesSent: this.messagesSent,\n messagesReceived: this.messagesReceived,\n lastLatency: this.lastLatency,\n reconnectAttempts: this.reconnectAttempts,\n currentUrl: this.currentUrl,\n };\n }\n\n /** Destroys the instance, cleans up timers and listeners */\n destroy(): void {\n this.destroyed = true;\n this.stopHeartbeat();\n if (this.connectionTimeoutId) {\n clearTimeout(this.connectionTimeoutId);\n this.connectionTimeoutId = null;\n }\n this.eventListeners = {\n open: [],\n message: [],\n close: [],\n error: [],\n reconnectAttempt: [],\n reconnect: [],\n reconnectSuccess: [],\n ping: [],\n pong: [],\n custom: [],\n };\n this.messageQueue = [];\n if (this.socket) {\n this.socket.close();\n this.socket = null;\n }\n this.log(\"info\", \"[WS] Connection destroyed.\");\n }\n\n /** Adds an event listener for a given event type */\n addEventListener(eventType: EventType, callback: (event: any) => void): void {\n this.eventListeners[eventType].push(callback);\n }\n\n /** Removes an event listener for a given event type */\n removeEventListener(eventType: EventType, callback: (event: any) => void): void {\n this.eventListeners[eventType] = this.eventListeners[eventType].filter(\n (cb) => cb !== callback\n );\n }\n\n /** Dispatches an event to all registered listeners */\n private dispatchEvent(eventType: EventType, event: any): void {\n this.eventListeners[eventType].forEach((cb) => cb(event));\n }\n\n /** Updates connection options dynamically (effective on next connection) */\n updateOptions(newOptions: Partial): void {\n this.options = { ...this.options, ...newOptions };\n this.log(\"debug\", \"[WS] Options updated:\", this.options);\n }\n\n /** Clears the outgoing message queue */\n clearMessageQueue(): void {\n this.messageQueue = [];\n this.log(\"debug\", \"[WS] Message queue cleared.\");\n }\n}\n\nexport default AdvancedWebSocket;","import Application from \"./class/main/Application\";\nimport Client from \"./class/main/Client\";\nimport Setup from \"./class/main/Setup\";\nimport AdvancedWebSocket from \"./class/main/WSConnection\";\n\nexport default {\n Application,\n Client,\n Setup,\n WebSocket: AdvancedWebSocket,\n};"],"mappings":";AAQA,IAAqB,QAArB,MAA2B;AAAA;AAAA;AAAA;AAAA;AAAA,EAOvB,OAAc,SAAS,KAAmB;AACtC,SAAK,WAAW;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAc,WAAmB;AAC7B,QAAI,CAAC,KAAK,UAAU;AAChB,YAAM,IAAI,MAAM,wEAAwE;AAAA,IAC5F;AACA,WAAO,KAAK;AAAA,EAChB;AACJ;;;AC9BA,OAAO,WAAW;AA8BlB,eAAO,mBAA0C,SAMhC;AACb,QAAM,MAAM,GAAG,QAAQ,KAAK,oBAAoB,QAAQ,QAAQ;AAChE,QAAM,UAAU;AAAA,IACZ,UAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,iBAAiB,UAAU,QAAQ,MAAM;AAAA,EAC7C;AAEA,MAAI,OAA2B;AAE/B,MAAI,QAAQ,QAAQ,QAAQ,WAAW,SAAS,QAAQ,WAAW,UAAU;AACzE,WAAO,OAAO,QAAQ,SAAS,WAAW,QAAQ,OAAO,KAAK,UAAU,QAAQ,IAAI;AAA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C;AAAA,MACP,SAAS,CAAC;AAAA,MACV,OAAO,CAAC;AAAA,MACR,OAAO,CAAC;AAAA,MACR,kBAAkB,CAAC;AAAA,MACnB,WAAW,CAAC;AAAA,MACZ,kBAAkB,CAAC;AAAA,MACnB,MAAM,CAAC;AAAA,MACP,MAAM,CAAC;AAAA,MACP,QAAQ,CAAC;AAAA,IACX;AACA,SAAK,eAAe,CAAC;AACrB,QAAI,KAAK,QAAQ;AACf,WAAK,OAAO,MAAM;AAClB,WAAK,SAAS;AAAA,IAChB;AACA,SAAK,IAAI,QAAQ,4BAA4B;AAAA,EAC/C;AAAA;AAAA,EAGA,iBAAiB,WAAsB,UAAsC;AAC3E,SAAK,eAAe,SAAS,EAAE,KAAK,QAAQ;AAAA,EAC9C;AAAA;AAAA,EAGA,oBAAoB,WAAsB,UAAsC;AAC9E,SAAK,eAAe,SAAS,IAAI,KAAK,eAAe,SAAS,EAAE;AAAA,MAC9D,CAAC,OAAO,OAAO;AAAA,IACjB;AAAA,EACF;AAAA;AAAA,EAGQ,cAAc,WAAsB,OAAkB;AAC5D,SAAK,eAAe,SAAS,EAAE,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;AAAA,EAC1D;AAAA;AAAA,EAGA,cAAc,YAAgD;AAC5D,SAAK,UAAU,EAAE,GAAG,KAAK,SAAS,GAAG,WAAW;AAChD,SAAK,IAAI,SAAS,yBAAyB,KAAK,OAAO;AAAA,EACzD;AAAA;AAAA,EAGA,oBAA0B;AACxB,SAAK,eAAe,CAAC;AACrB,SAAK,IAAI,SAAS,6BAA6B;AAAA,EACjD;AACF;AAEA,IAAO,uBAAQ;;;ACjiBf,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AACb;","names":["listServers","serverDetails","axios","listAllocations","reinstallServer","listUsers","createUser","updateUser","deleteUser","userDetails","listServers","serverDetails","reinstallServer","listAllocations","listUsers","createUser","updateUser","deleteUser","userDetails"]} \ No newline at end of file +{"version":3,"sources":["../src/class/main/Setup.ts","../src/functions/createAppCall.ts","../src/class/source/app/users/listUsers.ts","../src/class/source/app/users/userDetails.ts","../src/class/source/app/users/userDetails_externalId.ts","../src/class/source/app/users/createUser.ts","../src/class/source/app/users/updateUser.ts","../src/class/source/app/users/deleteUser.ts","../src/class/source/app/nodes/listNodes.ts","../src/class/source/app/nodes/nodeDetails.ts","../src/class/source/app/nodes/nodeConfiguration.ts","../src/class/source/app/nodes/createNode.ts","../src/class/source/app/nodes/updateNode.ts","../src/class/source/app/nodes/deleteNode.ts","../src/class/source/app/locations/listLocations.ts","../src/class/source/app/locations/locationDetails.ts","../src/class/source/app/locations/createLocation.ts","../src/class/source/app/locations/updateLocation.ts","../src/class/source/app/locations/deleteLocation.ts","../src/class/source/app/servers/listServers.ts","../src/class/source/app/servers/serverDetails.ts","../src/class/source/app/servers/serverDetails_externalId.ts","../src/class/source/app/servers/updateDetails.ts","../src/class/source/app/servers/updateServerBuild.ts","../src/class/source/app/servers/updateServerStartup.ts","../src/class/source/app/servers/createServer.ts","../src/class/source/app/servers/suspendServer.ts","../src/class/source/app/servers/unsuspendServer.ts","../src/class/source/app/servers/reinstallServer.ts","../src/class/source/app/servers/deleteServer.ts","../src/class/source/app/servers/forceDeleteServer.ts","../src/class/source/app/servers/databases/listDatabases.ts","../src/class/source/app/servers/databases/databaseDetails.ts","../src/class/source/app/servers/databases/createDatabase.ts","../src/class/source/app/servers/databases/resetDatabasePassword.ts","../src/class/source/app/servers/databases/deleteDatabase.ts","../src/class/source/app/nests/eggs/listEggs.ts","../src/class/source/app/nests/eggs/eggDetails.ts","../src/class/source/app/nests/listNests.ts","../src/class/source/app/nests/nestDetails.ts","../src/class/source/app/nodes/allocations/listAllocations.ts","../src/class/source/app/nodes/allocations/createAllocations.ts","../src/class/source/app/nodes/allocations/deleteAllocation.ts","../src/class/main/Application.ts","../src/functions/createClientCall.ts","../src/class/source/client/account/accountDetails.ts","../src/class/source/client/account/2faEnable.ts","../src/class/source/client/account/2faDisable.ts","../src/class/source/client/account/updateEmail.ts","../src/class/source/client/account/updatePassword.ts","../src/class/source/client/account/createApiKey.ts","../src/class/source/client/account/deleteApiKey.ts","../src/class/source/client/account/listApiKeys.ts","../src/class/source/client/listServers.ts","../src/class/source/client/showPermissions.ts","../src/class/source/client/servers/command.ts","../src/class/source/client/servers/power.ts","../src/class/source/client/servers/consoleDetails.ts","../src/class/source/client/servers/resources.ts","../src/class/source/client/servers/serverDetails.ts","../src/class/source/client/servers/backups/listBackups.ts","../src/class/source/client/servers/backups/backupDetails.ts","../src/class/source/client/servers/backups/createBackup.ts","../src/class/source/client/servers/backups/deleteBackup.ts","../src/class/source/client/servers/backups/downloadBackup.ts","../src/class/source/client/servers/files/listFiles.ts","../src/class/source/client/servers/files/getFileContent.ts","../src/class/source/client/servers/files/downloadFile.ts","../src/class/source/client/servers/files/renameFile.ts","../src/class/source/client/servers/files/copyFile.ts","../src/class/source/client/servers/files/writeFile.ts","../src/class/source/client/servers/files/compressFile.ts","../src/class/source/client/servers/files/decompressFile.ts","../src/class/source/client/servers/files/deleteFile.ts","../src/class/source/client/servers/files/createFolder.ts","../src/class/source/client/servers/files/uploadFile.ts","../src/class/source/client/servers/network/listAllocations.ts","../src/class/source/client/servers/network/assignAllocations.ts","../src/class/source/client/servers/network/setAllocationNote.ts","../src/class/source/client/servers/network/setPrimaryAllocation.ts","../src/class/source/client/servers/network/unassignAllocation.ts","../src/class/source/client/servers/schedules/listSchedules.ts","../src/class/source/client/servers/schedules/createSchedule.ts","../src/class/source/client/servers/schedules/scheduleDetails.ts","../src/class/source/client/servers/schedules/updateSchedule.ts","../src/class/source/client/servers/schedules/deleteSchedule.ts","../src/class/source/client/servers/schedules/createTask.ts","../src/class/source/client/servers/schedules/updateTask.ts","../src/class/source/client/servers/schedules/deleteTask.ts","../src/class/source/client/servers/settings/renameServer.ts","../src/class/source/client/servers/settings/reinstallServer.ts","../src/class/source/client/servers/startup/listVariables.ts","../src/class/source/client/servers/startup/updateVariable.ts","../src/class/source/client/servers/users/listUsers.ts","../src/class/source/client/servers/users/createUser.ts","../src/class/source/client/servers/users/updateUser.ts","../src/class/source/client/servers/users/deleteUser.ts","../src/class/source/client/servers/users/userDetails.ts","../src/class/main/Client.ts","../src/class/main/WSConnection.ts","../src/index.ts"],"sourcesContent":["/**\n * The Setup class provides a way to configure global settings for the Pterodactyl API Wrapper.\n * The primary use is to set the panel URL, which is then used in all API requests.\n *\n * @example\n * Setup.setPanel(\"https://panel.example.com\");\n * const panelUrl = Setup.getPanel();\n */\nexport default class Setup {\n private static panelUrl: string;\n\n /**\n * Sets the global panel URL.\n * @param url - The URL of the Pterodactyl panel.\n */\n public static setPanel(url: string): void {\n this.panelUrl = url;\n }\n\n /**\n * Gets the globally set panel URL.\n * @returns The panel URL.\n * @throws If the panel URL has not been set.\n */\n public static getPanel(): string {\n if (!this.panelUrl) {\n throw new Error(\"Panel URL is not set. Use Setup.setPanel(url) before making API calls.\");\n }\n return this.panelUrl;\n }\n}\n","import axios from \"axios\";\n\n/**\n * Creates an API Call to the Application API of your Pterodactyl panel.\n *\n * @param {Object} options - API call options.\n * @param {string} options.panel - Your panel's URL.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.endpoint - The API endpoint to call.\n * @param {\"GET\" | \"DELETE\" | \"POST\" | \"PATCH\" | \"PUT\"} options.method - HTTP method.\n * @param {any} [options.body] - Request body (for POST and PATCH requests).\n * @returns {Promise} - The data fetched from the API.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const data = await ApplicationAPICall({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * endpoint: \"users\",\n * method: \"GET\"\n * });\n * console.log(\"API Response:\", data);\n * } catch (error) {\n * console.error(\"Error:\", error);\n * }\n * })();\n */\nexport default async function ApplicationAPICall(options: {\n panel: string;\n apiKey: string;\n endpoint: string;\n method: \"GET\" | \"DELETE\" | \"POST\" | \"PATCH\" | \"PUT\";\n body?: any;\n}): Promise {\n const url = `${options.panel}/api/application/${options.endpoint}`;\n const headers = {\n 'Accept': \"application/json\",\n 'Content-Type': \"application/json\",\n 'Authorization': `Bearer ${options.apiKey}`\n };\n\n let body: string | undefined = undefined;\n\n if (options.body && options.method !== \"GET\" && options.method !== \"DELETE\") {\n body = typeof options.body === \"string\" ? options.body : JSON.stringify(options.body);\n }\n\n try {\n if (options.method === \"PATCH\") {\n const response = await axios.patch(url, options.body, { headers });\n return response.data;\n } else {\n const response = await fetch(url, {\n method: options.method,\n headers,\n body\n });\n\n if (!response.ok) {\n throw new Error(`API call failed with status ${response.status}: ${await response.text()}`);\n }\n\n return await response.json();\n }\n } catch (error) {\n throw new Error(`Error in API call: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: boolean,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_page: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of users from the Pterodactyl panel API, with optional filters and sorting.\n * This function makes a `GET` request and includes the request body if required.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {boolean} [options.showLinkedServers=false] - Whether to include linked servers in the response.\n * @param {Object} [options.filters] - Filters to apply when retrieving users.\n * @param {string} [options.filters.email] - Filter users by their email address.\n * @param {string} [options.filters.uuid] - Filter users by their UUID.\n * @param {string} [options.filters.username] - Filter users by their username.\n * @param {string} [options.filters.external_id] - Filter users by their external ID.\n * @param {Object} [options.sortBy] - Sorting preferences for the response.\n * @param {boolean} [options.sortBy.id=false] - Sort users by ID.\n * @param {boolean} [options.sortBy.uuid=false] - Sort users by UUID.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\n\nexport default async function listUsers(options: { \n apiKey: string, \n panel: string, \n showLinkedServers?: boolean, \n filters?: { \n email?: string, \n uuid?: string, \n username?: string, \n external_id?: string\n },\n sortBy?: {\n id?: boolean,\n uuid?: boolean\n }\n}): Promise {\n const body = {\n servers: options.showLinkedServers ?? false,\n filters: {\n email: options.filters?.email ?? null,\n uuid: options.filters?.uuid ?? null,\n username: options.filters?.username ?? null,\n external_id: options.filters?.external_id ?? null\n },\n sortBy: {\n id: options.sortBy?.id ?? false,\n uuid: options.sortBy?.uuid ?? false\n }\n };\n\n return ApplicationAPICall({\n panel: options.panel,\n apiKey: options.apiKey,\n endpoint: \"users\",\n method: \"GET\",\n body: JSON.stringify(body) \n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves details of a specific user from the Pterodactyl panel API.\n * Optionally, it can include the list of servers associated with the user.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.user_id - The unique ID of the user to retrieve.\n * @param {boolean} [options.listServers=false] - Whether to include the user's linked servers in the response.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function userDetails(options: { \n apiKey: string, \n panel: string, \n user_id: string, \n listServers?: boolean \n}): Promise {\n return ApplicationAPICall({\n panel: options.panel,\n apiKey: options.apiKey,\n endpoint: `user/${options.user_id}`,\n method: \"GET\",\n body: JSON.stringify({ servers: options.listServers ?? false }) // Ensuring body is a string\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves user details from the Pterodactyl panel API using an external identifier.\n * Optionally, it can include the list of servers associated with the user.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.external_id - The external identifier of the user to retrieve.\n * @param {boolean} [options.listServers=false] - Whether to include the user's linked servers in the response.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const userData = await userDetailsByExternalIdentifier({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * external_id: \"external-user-1234\",\n * listServers: true\n * });\n * console.log(\"User Details:\", userData);\n * } catch (error) {\n * console.error(\"Error:\", error);\n * }\n * })();\n */\nexport default async function userDetailsByExternalIdentifier(options: { \n apiKey: string, \n panel: string, \n external_id: string, \n listServers?: boolean \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `users/external/${options.external_id}`,\n body: JSON.stringify({ servers: options.listServers ?? false }) // Ensuring body is a JSON string\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Creates a new user in the Pterodactyl panel using the provided user details.\n * If `first_name` or `last_name` are not provided, they default to `\"Pterodactyl\"` and `\"User\"`, respectively.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.user_details - The details of the user to be created.\n * @param {string} options.user_details.email - The email address of the user.\n * @param {string} options.user_details.username - The username of the user.\n * @param {string} [options.user_details.first_name=\"Pterodactyl\"] - The first name of the user (optional).\n * @param {string} [options.user_details.last_name=\"User\"] - The last name of the user (optional).\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const newUser = await createUser({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * user_details: {\n * email: \"newuser@example.com\",\n * username: \"newUser123\",\n * first_name: \"John\",\n * last_name: \"Doe\"\n * }\n * });\n * console.log(\"User Created:\", newUser);\n * } catch (error) {\n * console.error(\"Error creating user:\", error);\n * }\n * })();\n */\nexport default async function createUser(options: {\n apiKey: string;\n panel: string;\n user_details: {\n email: string;\n username: string;\n first_name?: string;\n last_name?: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"users\",\n body: JSON.stringify({\n email: options.user_details.email,\n username: options.user_details.username,\n first_name: options.user_details.first_name ?? \"Pterodactyl\",\n last_name: options.user_details.last_name ?? \"User\"\n }) \n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string | null,\n uuid: string,\n username: string,\n email: string,\n first_name: string,\n last_name: string,\n language: string,\n root_admin: string,\n \"2fa\": boolean,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Updates a user's details on the Pterodactyl panel.\n * You can update the user's email, username, first name, last name, language, or password.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.user_id - The ID of the user to update.\n * @param {Object} options.data - The data to update for the user.\n * @param {string} [options.data.email] - The new email of the user (optional).\n * @param {string} [options.data.username] - The new username of the user (optional).\n * @param {string} [options.data.first_name] - The new first name of the user (optional).\n * @param {string} [options.data.last_name] - The new last name of the user (optional).\n * @param {string} [options.data.language] - The new language preference for the user (optional).\n * @param {string} [options.data.password] - The new password for the user (optional).\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const updatedUser = await updateUser({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * user_id: 1234,\n * data: {\n * email: \"newemail@example.com\",\n * username: \"UpdatedUsername\",\n * first_name: \"John\",\n * last_name: \"Doe\"\n * }\n * });\n * console.log(\"User Updated:\", updatedUser);\n * } catch (error) {\n * console.error(\"Error updating user:\", error);\n * }\n * })();\n */\nexport default async function updateUser(options: {\n apiKey: string;\n panel: string;\n user_id: number;\n data: {\n email?: string;\n username?: string;\n first_name?: string;\n last_name?: string;\n language?: string;\n password?: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n endpoint: `users/${options.user_id}`, // Fixed endpoint (removed extra \"/\")\n method: \"PATCH\",\n body: JSON.stringify(options.data) // Ensured the body is stringified\n });\n}","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a user from the Pterodactyl panel using the given identifier.\n *\n * @param {Object} options - Configuration options for the API call.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.identifier - The unique identifier (ID) of the user to be deleted.\n * @returns {Promise} - A Promise resolving to the API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n *\n * @example\n * (async () => {\n * try {\n * const response = await deleteUser({\n * panel: \"https://panel.example.com\",\n * apiKey: \"your-api-key\",\n * identifier: 1234\n * });\n * console.log(\"User Deleted:\", response);\n * } catch (error) {\n * console.error(\"Error deleting user:\", error);\n * }\n * })();\n */\nexport default async function deleteUser(options: { \n apiKey: string; \n panel: string; \n identifier: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `users/${options.identifier}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean,\n name: string,\n description: string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: string,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_sftp: number,\n daemon_base: string,\n created_at: string,\n updated_at: string\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of all nodes on the Pterodactyl panel.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing all nodes.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listNodes(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"nodes\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean,\n name: string,\n description: string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: boolean,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_base: string,\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves details of a specific node.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node whose details are requested.\n * @returns {Promise} - API response containing node details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function nodeDetails(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nodes/${options.node_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n debug: boolean,\n uuid: string,\n token_id: string,\n token: string,\n api: {\n host: string,\n ssl: {\n enabled: boolean,\n cert: string,\n key: string\n },\n upload_limit: string,\n },\n system: {\n data: string,\n sftp: {\n bind_port: number\n }\n },\n remote: string\n}\n\n/**\n * Retrieves the configuration settings of a specific node.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node whose configuration is requested.\n * @returns {Promise} - API response containing the node configuration.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function nodeConfiguration(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nodes/${options.node_id}/configuration`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean,\n name: string,\n description: null | string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: boolean,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_sftp: number,\n daemon_base: string,\n created_at: string,\n updated_at: string,\n allocated_resources: {\n memory: number,\n disk: number\n }\n },\n meta: {\n resource: string\n }\n}\n\n/**\n * Creates a new node on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.node_data - Node details for creation.\n * @param {string} options.node_data.name - The name of the node.\n * @param {string} [options.node_data.description] - Optional description of the node.\n * @param {number} options.node_data.location_id - The ID of the location where the node should be created.\n * @param {string} options.node_data.fqdn - The fully qualified domain name of the node.\n * @param {\"http\" | \"https\"} options.node_data.scheme - The scheme (HTTP or HTTPS) for the node.\n * @param {number} options.node_data.memory - The amount of memory allocated to the node (in MB).\n * @param {number} options.node_data.disk - The amount of disk space allocated to the node (in MB).\n * @param {number[]} [options.node_data.ports] - Optional list of ports assigned to the node.\n * @param {number} options.node_data.daemon_sftp - The SFTP port of the node.\n * @param {number} options.node_data.daemon_listen - The daemon listen port of the node.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createNode(options: { \n apiKey: string; \n panel: string; \n node_data: {\n name: string;\n description?: string;\n location_id: number;\n fqdn: string;\n scheme: \"http\" | \"https\";\n memory: number;\n disk: number;\n ports?: number[];\n daemon_sftp: number;\n daemon_listen: number;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"nodes\",\n body: JSON.stringify(options.node_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n public: boolean, \n name: string,\n description: string,\n location_id: number,\n fqdn: string,\n scheme: string,\n behind_proxy: boolean,\n maintenance_mode: boolean,\n memory: number,\n memory_overallocate: number,\n disk: number,\n disk_overallocate: number,\n upload_size: number,\n daemon_listen: number,\n daemon_sftp: number,\n daemon_base: string,\n created_at: string,\n updated_at: string,\n mounts: [],\n allocated_resources: {\n memory: number,\n disk: number\n }\n }\n}\n\n/**\n * Updates an existing node with new settings.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node to update.\n * @param {Object} options.update_data - The new data for the node update.\n * @param {string} [options.update_data.name] - The new name for the node (optional).\n * @param {string} [options.update_data.description] - The new description for the node (optional).\n * @param {number} [options.update_data.location_id] - The new location ID for the node (optional).\n * @param {number} [options.update_data.memory] - The new memory allocation for the node (optional, in MB).\n * @param {number} [options.update_data.disk] - The new disk allocation for the node (optional, in MB).\n * @param {number} [options.update_data.daemon_sftp] - The new SFTP port for the node (optional).\n * @param {number} [options.update_data.daemon_listen] - The new daemon listen port for the node (optional).\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateNode(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n update_data: {\n name?: string;\n description?: string;\n location_id?: number;\n memory?: number;\n disk?: number;\n daemon_sftp?: number;\n daemon_listen?: number;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `nodes/${options.node_id}`,\n body: JSON.stringify(options.update_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a node from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node to delete.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteNode(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `nodes/${options.node_id}`\n });\n}","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: {\n object: string;\n attributes: {\n id: number;\n short: string;\n long: string;\n updated_at: string;\n created_at: string;\n };\n }[];\n meta: {\n pagination: {\n total: number;\n count: number;\n per_page: number;\n current_page: number;\n total_pages: number;\n links: object;\n };\n };\n }\n \n\n/**\n * Retrieves a list of all locations from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing all locations.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listLocations(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"locations\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n short: string,\n long: string,\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Retrieves details of a specific location from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.location_id - The ID of the location to retrieve.\n * @returns {Promise} - API response containing location details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function locationDetails(options: { \n apiKey: string; \n panel: string; \n location_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `locations/${options.location_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n short: string,\n long: string,\n updates_at: string,\n created_at: string\n },\n meta: {\n resource: string\n }\n}\n\n/**\n * Creates a new location on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.location_data - The data required to create a new location.\n * @param {string} options.location_data.short - A short identifier for the location (e.g., \"us-east\").\n * @param {string} options.location_data.long - A long description of the location (e.g., \"US East Coast Datacenter\").\n * @returns {Promise} - API response containing the created location details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createLocation(options: { \n apiKey: string; \n panel: string; \n location_data: {\n short: string;\n long: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"locations\",\n body: JSON.stringify(options.location_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n short: string,\n long: string,\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Updates an existing location on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.location_id - The ID of the location to update.\n * @param {Object} options.update_data - The new data for updating the location.\n * @param {string} [options.update_data.short] - The new short identifier for the location (optional).\n * @param {string} [options.update_data.long] - The new long description of the location (optional).\n * @returns {Promise} - API response confirming the update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateLocation(options: { \n apiKey: string; \n panel: string; \n location_id: number; \n update_data: {\n short?: string;\n long?: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `locations/${options.location_id}`,\n body: JSON.stringify(options.update_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a location from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.location_id - The ID of the location to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteLocation(options: { \n apiKey: string; \n panel: string; \n location_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `locations/${options.location_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[]\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n pack: any,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: object\n },\n updated_at: string,\n created_at: string,\n relationship: {\n databases: {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number, \n database: string,\n username: string,\n remote: string,\n max_connections: number,\n created_at: string,\n updated_at: string\n }\n }[]\n }[]\n }\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of all servers from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing the list of servers.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listServers(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"servers\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[]\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n pack: boolean,\n container: {\n startup_commands: string,\n image: string,\n installed: boolean,\n environment: object\n }\n updated_at: number,\n created_at: number\n }\n}\n\n/**\n * Retrieves details of a specific server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing server details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function serverDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[]\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n pack: boolean,\n container: {\n startup_commands: string,\n image: string,\n installed: boolean,\n environment: object\n }\n updated_at: number,\n created_at: number\n }\n}\n\n/**\n * Retrieves details of a specific server using an external identifier.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.external_id - The external identifier of the server.\n * @returns {Promise} - API response containing server details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function serverDetailsExternalIdentifier(options: { \n apiKey: string; \n panel: string; \n external_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/external/${options.external_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n descriptions: string,\n suspendes: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: number[] | null\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: [],\n },\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Updates details of a specific server (name or description).\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} options.update_data - The new server details.\n * @returns {Promise} - API response confirming the update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n update_data: any;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/details`,\n body: JSON.stringify(options.update_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n descriptions: string,\n suspendes: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: number[] | null\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: [],\n },\n updated_at: string,\n created_at: string\n }\n}\n\n\n/**\n * Updates the build configuration of a server, including CPU, memory, disk, and other limits.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} options.build_data - The new build configuration.\n * @param {number} [options.build_data.cpu] - The CPU limit (in percentage, 100% = 1 core).\n * @param {number} [options.build_data.memory] - The memory limit (in MB).\n * @param {number} [options.build_data.disk] - The disk space limit (in MB).\n * @param {number} [options.build_data.swap] - The swap memory limit (in MB).\n * @param {number} [options.build_data.io] - The block I/O weight (10-1000).\n * @param {number} [options.build_data.threads] - The CPU threads allowed for the server.\n * @param {boolean} [options.build_data.oom_disabled] - Whether to disable Out-of-Memory (OOM) killer.\n * @returns {Promise} - API response confirming the build update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateServerBuild(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n build_data: {\n cpu?: number;\n memory?: number;\n disk?: number;\n swap?: number;\n io?: number;\n threads?: number;\n oom_disabled?: boolean;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/build`,\n body: JSON.stringify(options.build_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: string,\n uuid: string,\n identifier: string,\n name: string,\n descriptions: string,\n suspendes: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: number[] | null\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: [],\n },\n updated_at: string,\n created_at: string\n }\n}\n\n\n/**\n * Updates the startup configuration of a server, including environment variables and startup command.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} options.startup_data - The new startup configuration.\n * @param {string} [options.startup_data.startup] - The new startup command.\n * @param {number} [options.startup_data.egg] - The new egg ID for the server.\n * @param {number} [options.startup_data.image] - The new Docker image for the server.\n * @param {Object} [options.startup_data.environment] - The environment variables for the server.\n * @returns {Promise} - API response confirming the startup update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateServerStartup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n startup_data: {\n startup?: string;\n egg?: number;\n image?: string;\n environment?: Record;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/startup`,\n body: JSON.stringify(options.startup_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n external_id: null | string | number,\n uuid: string,\n identifier: string,\n name: string,\n description: string,\n suspended: boolean,\n limits: {\n memory: number,\n swap: number,\n disk: number,\n io: number,\n cpu: number,\n threads: null | number[],\n },\n feature_limits: {\n databases: number,\n allocations: number,\n backups: number\n },\n user: number,\n node: number,\n allocation: number,\n nest: number,\n egg: number,\n container: {\n startup_command: string,\n image: string,\n installed: boolean,\n environment: object\n },\n updated_at: string,\n created_at: string\n }\n}\n\n/**\n * Creates a new server on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {Object} options.server_data - The data required to create the server.\n * @returns {Promise} - API response containing the created server details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createServer(options: { \n apiKey: string; \n panel: string; \n server_data: any;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"servers\",\n body: JSON.stringify(options.server_data)\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Suspends a server, preventing it from starting.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to suspend.\n * @returns {Promise} - API response confirming the suspension.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function suspendServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/suspend`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Unsuspends a server, allowing it to start again.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to unsuspend.\n * @returns {Promise} - API response confirming the unsuspension.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function unsuspendServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/unsuspend`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Reinstalls a server, resetting its files and configuration.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to reinstall.\n * @returns {Promise} - API response confirming the reinstallation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function reinstallServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/reinstall`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Deletes a server from the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\n/**\n * Forcefully deletes a server from the Pterodactyl panel, bypassing standard checks.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function forceDeleteServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/force`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number,\n database: string,\n username: string,\n remote: string,\n max_connections: number,\n created_at: string,\n updated_at: string,\n relationships: {\n password: {\n object: string,\n attributes: {\n password: string\n }\n }\n host: {\n object: string,\n attributes: {\n id: number,\n name: string,\n host: string,\n port: number,\n username: string,\n node: number,\n created_at: string,\n updated_at: string\n }\n }\n }\n }\n }[]\n}\n\n/**\n * Retrieves a list of all databases for a specific server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing all databases.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listDatabases(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/databases`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number,\n database: string,\n username: string,\n remote: string,\n max_connections: number,\n created_at: string,\n updated_at: string\n }\n}\n/**\n * Retrieves details of a specific database.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.database_id - The ID of the database.\n * @returns {Promise} - API response containing database details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function databaseDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/databases/${options.database_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n server: number,\n host: number,\n database: string,\n username: string,\n remote: string,\n max_connections: number | null,\n created_at: string,\n updated_at: string\n },\n meta: {\n resource: string\n }\n}\n\n/**\n * Creates a new database for a specific server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to create the database for.\n * @param {Object} options.database_data - The data for the new database.\n * @param {string} options.database_data.database - The name of the database.\n * @param {string} options.database_data.remote - The remote access setting (e.g., `%` for any IP).\n * @returns {Promise} - API response containing the created database details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createDatabase(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_data: {\n database: string;\n remote: string;\n };\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/databases`,\n body: JSON.stringify(options.database_data)\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Resets the password for a specific database.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.database_id - The ID of the database.\n * @returns {Promise} - API response confirming the password reset.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function resetDatabasePassword(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/databases/${options.database_id}/reset-password`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Deletes a database from a server.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.database_id - The ID of the database to delete.\n * @returns {Promise} - API response confirming the deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteDatabase(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n database_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/databases/${options.database_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n uuid: string;\n name: string;\n nest: number;\n author: string;\n description: string;\n docker_image: string;\n config: {\n files: {\n [filename: string]: {\n parser: string;\n find: {\n [key: string]: any;\n };\n };\n };\n };\n startup: {\n done: string;\n userInteraction: string[];\n };\n stop: string;\n logs: {\n custom: boolean;\n location: string;\n };\n script: {\n privileged: boolean;\n install: string;\n entry: string;\n container: string;\n extends: any;\n };\n created_at: string;\n updated_at: string;\n relationships: {\n nest: {\n object: string;\n attributes: {\n id: number;\n uuid: string;\n author: string;\n name: string;\n description: string;\n created_at: string;\n updated_at: string;\n };\n };\n servers: {\n object: string;\n data: any[];\n };\n };\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all eggs within a specific nest.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.nest_id - The ID of the nest.\n * @returns {Promise} - API response containing the list of eggs.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listEggs(options: { \n apiKey: string; \n panel: string; \n nest_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nests/${options.nest_id}/eggs`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n name: string,\n nest: number,\n author: string,\n description: string,\n docker_image: string,\n config: {\n files: object,\n startup: {\n done: string,\n userInteraction: []\n },\n stop: string,\n logs: {\n custom: boolean,\n location: string\n },\n extends: any\n },\n startup: string,\n script: {\n privileged: boolean,\n install: string,\n entry: string,\n container: string,\n extends: any\n },\n created_at: string,\n updated_at: string\n }\n}\n\n/**\n * Retrieves details of a specific egg from a nest.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.nest_id - The ID of the nest.\n * @param {number} options.egg_id - The ID of the egg to retrieve.\n * @returns {Promise} - API response containing egg details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function eggDetails(options: { \n apiKey: string; \n panel: string; \n nest_id: number;\n egg_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nests/${options.nest_id}/eggs/${options.egg_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n author: string,\n name: string,\n description: string,\n created_at: string,\n updated_at: string\n }\n }[],\n meta: {\n pagination: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n}\n/**\n * Retrieves a list of all nests available on the Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing the list of nests.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listNests(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"nests\"\n });\n}\n","import ApplicationAPICall from \"../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n id: number,\n uuid: string,\n author: string,\n name: string,\n description: string,\n created_at: string,\n updated_at: string\n }\n}\n/**\n * Retrieves details of a specific nest.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.nest_id - The ID of the nest.\n * @returns {Promise} - API response containing nest details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function nestDetails(options: { \n apiKey: string; \n panel: string; \n nest_id: number;\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nests/${options.nest_id}`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n id: number,\n ip: string,\n alias: any,\n port: number,\n notes: any,\n assigned: boolean\n }\n }[],\n meta: {\n pagination: {\n total: number,\n count: number,\n per_page: number,\n current_page: number,\n total_pages: number,\n links: object\n }\n }\n}\n\n/**\n * Retrieves a list of all allocations on a specific node.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node whose allocations should be retrieved.\n * @returns {Promise} - API response containing the list of allocations.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listAllocations(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `nodes/${options.node_id}/allocations`\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Creates a new allocation on a specific node.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node where the allocation should be created.\n * @param {string} options.ip - The IP address to allocate.\n * @param {number[]} options.ports - An array of ports to allocate.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createAllocation(options: { \n apiKey: string; \n panel: string; \n node_id: number;\n ip: string;\n ports: number[];\n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `nodes/${options.node_id}/allocations`,\n body: JSON.stringify({\n ip: options.ip,\n ports: options.ports\n })\n });\n}\n","import ApplicationAPICall from \"../../../../../functions/createAppCall\";\n\n/**\n * Deletes an allocation from a specific node.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {number} options.node_id - The ID of the node where the allocation exists.\n * @param {number} options.allocation_id - The ID of the allocation to delete.\n * @returns {Promise} - API response.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteAllocation(options: { \n apiKey: string; \n panel: string; \n node_id: number; \n allocation_id: number; \n}): Promise {\n return ApplicationAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `nodes/${options.node_id}/allocations/${options.allocation_id}`\n });\n}\n","import Setup from \"./Setup\";\n\n// Import Application API - User Management\nimport listUsers from \"../source/app/users/listUsers\";\nimport userDetails from \"../source/app/users/userDetails\";\nimport userDetails_externalId from \"../source/app/users/userDetails_externalId\";\nimport createUser from \"../source/app/users/createUser\";\nimport updateUser from \"../source/app/users/updateUser\";\nimport deleteUser from \"../source/app/users/deleteUser\";\n\n// Import Application API - Node Management\nimport listNodes from \"../source/app/nodes/listNodes\";\nimport nodeDetails from \"../source/app/nodes/nodeDetails\";\nimport nodeConfiguration from \"../source/app/nodes/nodeConfiguration\";\nimport createNode from \"../source/app/nodes/createNode\";\nimport updateNode from \"../source/app/nodes/updateNode\";\nimport deleteNode from \"../source/app/nodes/deleteNode\";\n\n// Import Application API - Location Management\nimport listLocations from \"../source/app/locations/listLocations\";\nimport locationDetails from \"../source/app/locations/locationDetails\";\nimport createLocation from \"../source/app/locations/createLocation\";\nimport updateLocation from \"../source/app/locations/updateLocation\";\nimport deleteLocation from \"../source/app/locations/deleteLocation\";\n\n// Import Application API - Server Management\nimport listServers from \"../source/app/servers/listServers\";\nimport serverDetails from \"../source/app/servers/serverDetails\";\nimport serverDetails_externalId from \"../source/app/servers/serverDetails_externalId\";\nimport updateDetails from \"../source/app/servers/updateDetails\";\nimport updateServerBuild from \"../source/app/servers/updateServerBuild\";\nimport updateServerStartup from \"../source/app/servers/updateServerStartup\";\nimport createServer from \"../source/app/servers/createServer\";\nimport suspendServer from \"../source/app/servers/suspendServer\";\nimport unsuspendServer from \"../source/app/servers/unsuspendServer\";\nimport reinstallServer from \"../source/app/servers/reinstallServer\";\nimport deleteServer from \"../source/app/servers/deleteServer\";\nimport forceDeleteServer from \"../source/app/servers/forceDeleteServer\";\n\n// Import Application API - Database Management\nimport listDatabases from \"../source/app/servers/databases/listDatabases\";\nimport databaseDetails from \"../source/app/servers/databases/databaseDetails\";\nimport createDatabase from \"../source/app/servers/databases/createDatabase\";\nimport resetDatabasePassword from \"../source/app/servers/databases/resetDatabasePassword\";\nimport deleteDatabase from \"../source/app/servers/databases/deleteDatabase\";\n\n// Import Application API - Nest & Egg Management\nimport listEggs from \"../source/app/nests/eggs/listEggs\";\nimport eggDetails from \"../source/app/nests/eggs/eggDetails\";\nimport listNests from \"../source/app/nests/listNests\";\nimport nestDetails from \"../source/app/nests/nestDetails\";\n\n// Import Application API - Allocations Management\nimport listAllocations from \"../source/app/nodes/allocations/listAllocations\";\nimport createAllocations from \"../source/app/nodes/allocations/createAllocations\";\nimport deleteAllocation from \"../source/app/nodes/allocations/deleteAllocation\";\n\n/**\n * The Application class provides an interface for interacting with the\n * Pterodactyl Application API. This class gives full control over the panel,\n * including user, node, location, server, database, nest, and allocation management.\n *\n * @example\n * const app = new Application(\"YOUR_API_KEY\");\n * const users = await app.users.list();\n */\nexport default class Application {\n private apiKey: string;\n private panel: string;\n\n constructor(apiKey: string) {\n this.apiKey = apiKey;\n this.panel = Setup.getPanel();\n }\n\n /** User Management */\n public users = {\n list: () => listUsers({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (user_id: string) =>\n userDetails({ apiKey: this.apiKey, panel: this.panel, user_id }),\n getDetailsByExternalId: (external_id: string) =>\n userDetails_externalId({ apiKey: this.apiKey, panel: this.panel, external_id }),\n create: (user_details: { email: string; username: string; first_name?: string; last_name?: string }) =>\n createUser({ apiKey: this.apiKey, panel: this.panel, user_details }),\n update: (user_id: string, user_data: any) =>\n updateUser({ apiKey: this.apiKey, panel: this.panel, user_id: parseInt(user_id), data: user_data }),\n delete: (user_id: string) =>\n deleteUser({ apiKey: this.apiKey, panel: this.panel, identifier: parseInt(user_id) }),\n };\n\n /** Node Management */\n public nodes = {\n list: () => listNodes({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (node_id: string) =>\n nodeDetails({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n getConfiguration: (node_id: string) =>\n nodeConfiguration({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n create: (node_data: any) =>\n createNode({ apiKey: this.apiKey, panel: this.panel, node_data }),\n update: (node_id: string, node_data: any) =>\n updateNode({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id), update_data: node_data }),\n delete: (node_id: string) =>\n deleteNode({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n };\n\n /** Location Management */\n public locations = {\n list: () => listLocations({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (location_id: string) =>\n locationDetails({ apiKey: this.apiKey, panel: this.panel, location_id: parseInt(location_id) }),\n create: (location_data: { short: string; long: string }) =>\n createLocation({ apiKey: this.apiKey, panel: this.panel, location_data }),\n update: (location_id: string, location_data: any) =>\n updateLocation({ apiKey: this.apiKey, panel: this.panel, location_id: parseInt(location_id), update_data: location_data }),\n delete: (location_id: string) =>\n deleteLocation({ apiKey: this.apiKey, panel: this.panel, location_id: parseInt(location_id) }),\n };\n\n /** Server Management */\n public servers = {\n list: () => listServers({ apiKey: this.apiKey, panel: this.panel }),\n getDetails: (server_id: string) =>\n serverDetails({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetailsByExternalId: (external_id: string) =>\n serverDetails_externalId({ apiKey: this.apiKey, panel: this.panel, external_id }),\n updateDetails: (server_id: string, update_data: any) =>\n updateDetails({ apiKey: this.apiKey, panel: this.panel, server_id, update_data }),\n updateBuild: (server_id: string, build_data: any) =>\n updateServerBuild({ apiKey: this.apiKey, panel: this.panel, server_id, build_data }),\n updateStartup: (server_id: string, startup_data: any) =>\n updateServerStartup({ apiKey: this.apiKey, panel: this.panel, server_id, startup_data }),\n create: (server_data: any) =>\n createServer({ apiKey: this.apiKey, panel: this.panel, server_data }),\n suspend: (server_id: string) =>\n suspendServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n unsuspend: (server_id: string) =>\n unsuspendServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n reinstall: (server_id: string) =>\n reinstallServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n delete: (server_id: string) =>\n deleteServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n forceDelete: (server_id: string) =>\n forceDeleteServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n };\n\n /** Nest & Egg Management */\n public nests = {\n listNests: () => listNests({ apiKey: this.apiKey, panel: this.panel }),\n getNestDetails: (nest_id: string) =>\n nestDetails({ apiKey: this.apiKey, panel: this.panel, nest_id: parseInt(nest_id) }),\n listEggs: (nest_id: string) =>\n listEggs({ apiKey: this.apiKey, panel: this.panel, nest_id: parseInt(nest_id) }),\n getEggDetails: (nest_id: string, egg_id: string) =>\n eggDetails({ apiKey: this.apiKey, panel: this.panel, nest_id: parseInt(nest_id), egg_id: parseInt(egg_id) }),\n };\n\n /** Allocations Management */\n public allocations = {\n list: (node_id: string) => listAllocations({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id) }),\n create: (node_id: string, ip: string, ports: number[]) => \n createAllocations({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id), ip, ports }),\n delete: (node_id: string, allocation_id: string) => \n deleteAllocation({ apiKey: this.apiKey, panel: this.panel, node_id: parseInt(node_id), allocation_id: parseInt(allocation_id) }),\n };\n /** Database Management */\n public databases = {\n list: (server_id: string) => listDatabases({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetails: (server_id: string, database_id: string) => \n databaseDetails({ apiKey: this.apiKey, panel: this.panel, server_id, database_id: parseInt(database_id) }),\n create: (server_id: string, database_data: any) => \n createDatabase({ apiKey: this.apiKey, panel: this.panel, server_id, database_data }),\n resetPassword: (server_id: string, database_id: string) => \n resetDatabasePassword({ apiKey: this.apiKey, panel: this.panel, server_id, database_id: parseInt(database_id) }),\n delete: (server_id: string, database_id: string) => \n deleteDatabase({ apiKey: this.apiKey, panel: this.panel, server_id, database_id: parseInt(database_id) })\n };\n\n}\n","import axios from \"axios\";\n\n/**\n * Creates an API Call to the Client API of your Pterodactyl panel.\n * \n * @param {Object} options - API call options.\n * @param {string} options.panel - Your panel's URL.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.endpoint - The API endpoint to call.\n * @param {\"GET\" | \"DELETE\" | \"POST\" | \"PUT\" | \"PATCH\"} options.method - HTTP method.\n * @param {any} [options.body] - Request body (for POST, PUT, PATCH requests).\n * @returns {Promise} - The data fetched from the API.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function ClientAPICall(options: {\n panel: string;\n apiKey: string;\n endpoint: string;\n method: \"GET\" | \"DELETE\" | \"POST\" | \"PUT\" | \"PATCH\";\n body?: any;\n}): Promise {\n const url = `${options.panel}/api/client/${options.endpoint}`;\n const headers = {\n 'Accept': \"application/json\",\n 'Content-Type': \"application/json\",\n 'Authorization': `Bearer ${options.apiKey}`\n };\n\n try {\n if ([\"POST\", \"PUT\", \"PATCH\"].includes(options.method)) {\n const response = await axios({\n method: options.method,\n url,\n headers,\n data: options.body ? JSON.stringify(options.body) : undefined\n });\n return response.data;\n } else {\n const response = await fetch(url, {\n method: options.method,\n headers\n });\n\n if (!response.ok) {\n throw new Error(`API call failed with status ${response.status}: ${await response.text()}`);\n }\n\n return await response.json();\n }\n } catch (error) {\n throw new Error(`Error in API call: ${error instanceof Error ? error.message : String(error)}`);\n }\n}","import ClientAPICall from \"../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n admin: boolean;\n username: string;\n email: string;\n first_name: string;\n last_name: string;\n language: string;\n };\n }\n\n \n/**\n * Retrieves account details for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing account details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function accountDetails(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"account\"\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n tokens: string[];\n };\n }\n \n\n/**\n * Enables Two-Factor Authentication (2FA) for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string[]} options.codes - The TOTP authentication codes for verification.\n * @returns {Promise} - API response confirming 2FA activation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function twoFactorEnable(options: { \n apiKey: string; \n panel: string; \n codes: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"account/two-factor\",\n body: { codes: options.codes }\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\n/**\n * Disables Two-Factor Authentication (2FA) for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string[]} options.tokens - An array of 2FA recovery codes to confirm disabling.\n * @returns {Promise} - API response confirming 2FA deactivation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function twoFactorDisable(options: { \n apiKey: string; \n panel: string; \n tokens: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: \"account/two-factor\",\n body: { tokens: options.tokens }\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\n/**\n * Updates the email address of the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.email - The new email address.\n * @param {string} options.password - The current password (required for confirmation).\n * @returns {Promise} - API response confirming email update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateEmail(options: { \n apiKey: string; \n panel: string; \n email: string;\n password: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: \"account/email\",\n body: {\n email: options.email,\n password: options.password\n }\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\n/**\n * Updates the password of the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.current_password - The current password for confirmation.\n * @param {string} options.new_password - The new password to set.\n * @returns {Promise} - API response confirming password update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updatePassword(options: { \n apiKey: string; \n panel: string; \n current_password: string;\n new_password: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: \"account/password\",\n body: {\n current_password: options.current_password,\n password: options.new_password\n }\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string,\n attributes: {\n identifier: string,\n description: string,\n allowed_ips: string[],\n last_used_at: null | string,\n created_at: string\n },\n meta: {\n secret_token: string\n }\n}\n\n/**\n * Creates a new API key for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.description - A description for the API key.\n * @param {string[]} options.allowed_ips - An array of allowed IPs (empty for unrestricted access).\n * @returns {Promise} - API response containing the newly created API key.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createApiKey(options: { \n apiKey: string; \n panel: string; \n description: string;\n allowed_ips: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: \"account/api-keys\",\n body: {\n description: options.description,\n allowed_ips: options.allowed_ips\n }\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\n/**\n * Deletes an API key for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.key_id - The unique identifier of the API key to delete.\n * @returns {Promise} - API response confirming deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteApiKey(options: { \n apiKey: string; \n panel: string; \n key_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `account/api-keys/${options.key_id}`\n });\n}\n","import ClientAPICall from \"../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string,\n data: {\n object: string,\n attributes: {\n identifier: string,\n description: string,\n allowed_ips: [] | string[],\n last_used_at: string,\n created_at: string\n }\n }[]\n}\n\n/**\n * Retrieves a list of all API keys for the authenticated user.\n * \n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing all API keys.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listApiKeys(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"account/api-keys\"\n });\n}\n","import ClientAPICall from \"../../../functions/createAppCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n server_owner: boolean;\n identifier: string;\n uuid: string;\n name: string;\n node: string;\n sftp_details: {\n ip: string;\n port: number;\n };\n description: string;\n limits: {\n memory: number;\n swap: number;\n disk: number;\n io: number;\n cpu: number;\n };\n feature_limits: {\n databases: number;\n allocations: number;\n backups: number;\n };\n is_suspended: boolean;\n is_installing: boolean;\n relationships: {\n allocations: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }>;\n };\n };\n };\n }>;\n meta: {\n pagination: {\n total: number;\n count: number;\n per_page: number;\n current_page: number;\n total_pages: number;\n links: Record;\n };\n };\n }\n \n/**\n * Retrieves a list of all servers the authenticated user has access to.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @returns {Promise} - API response containing the list of servers.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listServers(options: { \n apiKey: string; \n panel: string; \n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: \"servers\"\n });\n}\n","import ClientAPICall from \"../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n permissions: {\n websocket: {\n description: string;\n keys: {\n connect: string;\n };\n };\n control: {\n description: string;\n keys: {\n console: string;\n start: string;\n stop: string;\n restart: string;\n };\n };\n user: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n };\n };\n file: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n archive: string;\n sftp: string;\n };\n };\n backup: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n download: string;\n };\n };\n allocation: {\n description: string;\n keys: {\n read: string;\n create: string;\n update: string;\n delete: string;\n };\n };\n startup: {\n description: string;\n keys: {\n read: string;\n update: string;\n };\n };\n database: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n view_password: string;\n };\n };\n schedule: {\n description: string;\n keys: {\n create: string;\n read: string;\n update: string;\n delete: string;\n };\n };\n settings: {\n description: string;\n keys: {\n rename: string;\n reinstall: string;\n };\n };\n };\n };\n}\n\n/**\n * Retrieves the permissions the authenticated user has for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of permissions for the user.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function showPermissions(options: {\n apiKey: string;\n panel: string;\n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/permissions`,\n });\n}\n","/**\n * Sends a command to a server's console.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.command - The command to execute.\n * @returns {Promise} - A promise that resolves when the command is sent.\n */\nexport default async function command(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n command: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/command`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify({ command: options.command })\n });\n\n if (!response.ok) {\n throw new Error(`Failed to send command: ${await response.text()}`);\n }\n}\n","/**\n * Sends a power action to a server (start, stop, restart, kill).\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.signal - The power action (start, stop, restart, kill).\n * @returns {Promise} - A promise that resolves when the power action is sent.\n */\nexport default async function power(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n signal: \"start\" | \"stop\" | \"restart\" | \"kill\"; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/power`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify({ signal: options.signal })\n });\n\n if (!response.ok) {\n throw new Error(`Failed to send power action: ${await response.text()}`);\n }\n}\n","export interface Response {\n data: {\n token: string;\n socket: string;\n };\n }\n \n/**\n * Retrieves real-time console details for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with console details.\n */\nexport default async function consoleDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/websocket`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch console details: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n current_state: string;\n is_suspended: boolean;\n resources: {\n memory_bytes: number;\n cpu_absolute: number;\n disk_bytes: number;\n network_rx_bytes: number;\n network_tx_bytes: number;\n };\n };\n }\n \n\n/**\n * Fetches resource usage (CPU, RAM, disk) for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with server resource usage details.\n */\nexport default async function resources(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/resources`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch server resources: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n server_owner: boolean;\n identifier: string;\n uuid: string;\n name: string;\n node: string;\n sftp_details: {\n ip: string;\n port: number;\n };\n description: string;\n limits: {\n memory: number;\n swap: number;\n disk: number;\n io: number;\n cpu: number;\n };\n feature_limits: {\n databases: number;\n allocations: number;\n backups: number;\n };\n is_suspended: boolean;\n is_installing: boolean;\n relationships: {\n allocations: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }>;\n };\n };\n };\n meta: {\n is_server_owner: boolean;\n user_permissions: string[];\n };\n }\n \n\n\n/**\n * Retrieves details for a specific server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with server details.\n */\nexport default async function serverDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string; \n}): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch server details: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n uuid: string;\n name: string;\n ignored_files: string[];\n sha256_hash: string;\n bytes: number;\n created_at: string;\n completed_at: string;\n };\n }>;\n meta: {\n pagination: {\n total: number;\n count: number;\n per_page: number;\n current_page: number;\n total_pages: number;\n links: Record;\n };\n };\n }\n \n\n/**\n * Retrieves a list of all backups for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing a list of backups.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listBackups(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/backups`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n name: string;\n ignored_files: string[];\n sha256_hash: string;\n bytes: number;\n created_at: string;\n completed_at: string;\n };\n }\n \n\n/**\n * Retrieves details of a specific backup for a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.backup_id - The ID of the backup.\n * @returns {Promise} - API response containing backup details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function backupDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/backups/${options.backup_id}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n name: string;\n ignored_files: string[];\n sha256_hash: string | null;\n bytes: number;\n created_at: string;\n completed_at: string | null;\n };\n }\n \n\n/**\n * Creates a new backup for a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object} [options.backup_data] - Optional backup settings.\n * @param {string} [options.backup_data.name] - Name for the backup.\n * @param {boolean} [options.backup_data.locked] - Whether the backup is locked.\n * @returns {Promise} - API response confirming backup creation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createBackup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_data?: {\n name?: string;\n locked?: boolean;\n };\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/backups`,\n body: options.backup_data ? JSON.stringify(options.backup_data) : undefined\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Deletes a backup from a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.backup_id - The ID of the backup.\n * @returns {Promise} - API response confirming backup deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteBackup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/backups/${options.backup_id}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n url: string;\n };\n}\n \n\n/**\n * Retrieves a download link for a backup file.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.backup_id - The ID of the backup.\n * @returns {Promise} - API response containing the download URL.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function downloadBackup(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n backup_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/backups/${options.backup_id}/download`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n name: string;\n mode: string;\n size: number;\n is_file: boolean;\n is_symlink: boolean;\n is_editable: boolean;\n mimetype: string;\n created_at: string;\n modified_at: string;\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all files and directories for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} [options.directory] - The directory path to list files from (optional).\n * @returns {Promise} - API response containing the list of files.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listFiles(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n directory?: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/files/list${options.directory ? `?directory=${options.directory}` : \"\"}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Retrieves the content of a specific file on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to retrieve.\n * @returns {Promise} - API response containing file content.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function getFileContent(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/files/contents?file=${encodeURIComponent(options.file_path)}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n url: string;\n };\n }\n \n\n/**\n * Retrieves a download link for a file.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to download.\n * @returns {Promise} - API response containing the download URL.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function downloadFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/files/download?file=${encodeURIComponent(options.file_path)}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Renames a file or folder on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {Object[]} options.files - An array of objects containing old and new file names.\n * @returns {Promise} - API response confirming file/folder rename.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function renameFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n files: { from: string; to: string }[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/files/rename`,\n body: JSON.stringify({ files: options.files })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Copies a file to a new location on the server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to copy.\n * @returns {Promise} - API response confirming the file copy.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function copyFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/copy`,\n body: JSON.stringify({ location: options.file_path })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Writes content to a file on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the file to write.\n * @param {string} options.content - The content to write to the file.\n * @returns {Promise} - API response confirming file write operation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function writeFile(options: {\n apiKey: string;\n panel: string;\n server_id: string;\n file_path: string;\n content: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/write?file=${options.file_path}`,\n body: options.content,\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n name: string;\n mode: string;\n size: number;\n is_file: boolean;\n is_symlink: boolean;\n is_editable: boolean;\n mimetype: string;\n created_at: string;\n modified_at: string;\n };\n }\n \n\n/**\n * Compresses files or directories on a server into a ZIP archive.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string[]} options.files - An array of files or directories to compress.\n * @returns {Promise} - API response confirming compression.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function compressFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n files: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/compress`,\n body: JSON.stringify({ files: options.files })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Decompresses a ZIP file on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.file_path - The path of the ZIP file to decompress.\n * @returns {Promise} - API response confirming decompression.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function decompressFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n file_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/decompress`,\n body: JSON.stringify({ file: options.file_path })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Deletes a file or folder on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string[]} options.files - An array of files or folders to delete.\n * @returns {Promise} - API response confirming file deletion.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteFile(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n files: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/delete`,\n body: JSON.stringify({ files: options.files })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Creates a new folder on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.folder_path - The path of the folder to create.\n * @returns {Promise} - API response confirming folder creation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createFolder(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n folder_path: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/files/create-folder`,\n body: JSON.stringify({ name: options.folder_path })\n });\n}\n","import axios from \"axios\";\n\nexport interface Response {\n object: string;\n attributes: {\n url: string;\n };\n}\n\n/**\n * Uploads a file to a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {FormData} options.file_data - The file data to upload.\n * @returns {Promise} - API response confirming file upload.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function uploadFile(options: {\n apiKey: string;\n panel: string;\n server_id: string;\n file_data: FormData;\n}): Promise {\n const response = await axios.post(\n `${options.panel}/api/client/servers/${options.server_id}/files/upload`,\n options.file_data,\n {\n headers: {\n \"Authorization\": `Bearer ${options.apiKey}`,\n \"Content-Type\": \"multipart/form-data\",\n },\n }\n );\n return response.data;\n}\n\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all network allocations for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of allocations.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listAllocations(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/network/allocations`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }\n\n \n/**\n * Assigns a new allocation to a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to assign.\n * @returns {Promise} - API response confirming allocation assignment.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function assignAllocations(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/network/allocations`,\n body: JSON.stringify({ allocation_id: options.allocation_id })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }\n\n \n/**\n * Updates the note for a specific allocation on a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to update.\n * @param {string} options.note - The new note for the allocation.\n * @returns {Promise} - API response confirming the note update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function setAllocationNote(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n note: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/network/allocations/${options.allocation_id}`,\n body: JSON.stringify({ notes: options.note })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n id: number;\n ip: string;\n ip_alias: string | null;\n port: number;\n notes: string | null;\n is_default: boolean;\n };\n }\n\n \n/**\n * Sets a specific allocation as the primary allocation for a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to set as primary.\n * @returns {Promise} - API response confirming primary allocation change.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function setPrimaryAllocation(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/network/allocations/${options.allocation_id}/primary`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Unassigns a network allocation from a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.allocation_id - The ID of the allocation to remove.\n * @returns {Promise} - API response confirming allocation removal.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function unassignAllocation(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n allocation_id: number;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/network/allocations/${options.allocation_id}`\n });\n}\n","export interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }>;\n };\n };\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all schedules for a specified server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @returns {Promise} - A promise resolving with the list of schedules.\n */\nexport default async function listSchedules(options: { apiKey: string; panel: string; server_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch schedules: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: any[];\n };\n };\n };\n }\n \n\n/**\n * Creates a new schedule for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {Object} options.schedule_data - The schedule details.\n * @returns {Promise} - A promise resolving with the created schedule details.\n */\nexport default async function createSchedule(options: { apiKey: string; panel: string; server_id: string; schedule_data: any }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify(options.schedule_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to create schedule: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }>;\n };\n };\n };\n }\n \n\n/**\n * Retrieves details of a specific schedule for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @returns {Promise} - A promise resolving with the schedule details.\n */\nexport default async function scheduleDetails(options: { apiKey: string; panel: string; server_id: string; schedule_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch schedule details: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n name: string;\n cron: {\n day_of_week: string;\n day_of_month: string;\n hour: string;\n minute: string;\n };\n is_active: boolean;\n is_processing: boolean;\n last_run_at: string | null;\n next_run_at: string;\n created_at: string;\n updated_at: string;\n relationships: {\n tasks: {\n object: string;\n data: any[];\n };\n };\n };\n }\n \n\n/**\n * Updates an existing schedule for a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {Object} options.schedule_data - The updated schedule details.\n * @returns {Promise} - A promise resolving with the updated schedule.\n */\nexport default async function updateSchedule(options: { apiKey: string; panel: string; server_id: string; schedule_id: string; schedule_data: any }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}`, {\n method: \"PATCH\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify(options.schedule_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to update schedule: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","/**\n * Deletes a schedule from a server.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @returns {Promise} - A promise that resolves when the schedule is deleted.\n */\nexport default async function deleteSchedule(options: { apiKey: string; panel: string; server_id: string; schedule_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}`, {\n method: \"DELETE\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to delete schedule: ${await response.text()}`);\n }\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }\n \n\n/**\n * Creates a task inside a specific schedule.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {Object} options.task_data - The task details.\n * @returns {Promise} - A promise resolving with the created task details.\n */\nexport default async function createTask(options: { apiKey: string; panel: string; server_id: string; schedule_id: string; task_data: any }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}/tasks`, {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n },\n body: JSON.stringify(options.task_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to create task: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","export interface Response {\n object: string;\n attributes: {\n id: number;\n sequence_id: number;\n action: string;\n payload: string;\n time_offset: number;\n is_queued: boolean;\n created_at: string;\n updated_at: string;\n };\n }\n \n\n/**\n * Updates an existing task inside a specific schedule.\n *\n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {string} options.task_id - The task identifier.\n * @param {Object} options.task_data - The updated task details.\n * @returns {Promise} - A promise resolving with the updated task details.\n */\nexport default async function updateTask(options: {\n apiKey: string;\n panel: string;\n server_id: string;\n schedule_id: string;\n task_id: string;\n} & Record): Promise {\n const { apiKey, panel, server_id, schedule_id, task_id, ...task_data } = options;\n\n const response = await fetch(`${panel}/api/client/servers/${server_id}/schedules/${schedule_id}/tasks/${task_id}`, {\n method: \"PATCH\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${apiKey}`\n },\n body: JSON.stringify(task_data)\n });\n\n if (!response.ok) {\n throw new Error(`Failed to update task: ${await response.text()}`);\n }\n\n return await response.json();\n}\n","/**\n * Deletes a specific task inside a schedule.\n * \n * @param {Object} options - API options.\n * @param {string} options.apiKey - The API key.\n * @param {string} options.panel - The panel URL.\n * @param {string} options.server_id - The server identifier.\n * @param {string} options.schedule_id - The schedule identifier.\n * @param {string} options.task_id - The task identifier.\n * @returns {Promise} - A promise that resolves when the task is deleted.\n */\nexport default async function deleteTask(options: { apiKey: string; panel: string; server_id: string; schedule_id: string; task_id: string }): Promise {\n const response = await fetch(`${options.panel}/api/client/servers/${options.server_id}/schedules/${options.schedule_id}/tasks/${options.task_id}`, {\n method: \"DELETE\",\n headers: {\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options.apiKey}`\n }\n });\n\n if (!response.ok) {\n throw new Error(`Failed to delete task: ${await response.text()}`);\n }\n}\n\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Renames a server on the panel.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.new_name - The new name for the server.\n * @returns {Promise} - API response confirming the server rename.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function renameServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n new_name: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PATCH\",\n endpoint: `servers/${options.server_id}/settings/rename`,\n body: JSON.stringify({ name: options.new_name })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Reinstalls a server, resetting its configuration while preserving files.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server to reinstall.\n * @returns {Promise} - API response confirming the reinstallation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function reinstallServer(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/settings/reinstall`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n name: string;\n description: string;\n env_variable: string;\n default_value: string;\n server_value: string;\n is_editable: boolean;\n rules: string;\n };\n }>;\n meta: {\n startup_command: string;\n raw_startup_command: string;\n };\n }\n\n \n/**\n * Retrieves a list of all startup variables for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of startup variables.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listVariables(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/startup/variables`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n name: string;\n description: string;\n env_variable: string;\n default_value: string;\n server_value: string;\n is_editable: boolean;\n rules: string;\n };\n }\n \n\n/**\n * Updates a startup variable for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {number} options.variable_id - The ID of the startup variable.\n * @param {string} options.value - The new value for the variable.\n * @returns {Promise} - API response confirming variable update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateVariable(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n variable_id: number;\n value: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/startup/variables/${options.variable_id}`,\n body: JSON.stringify({ value: options.value })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n data: Array<{\n object: string;\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }>;\n }\n \n\n/**\n * Retrieves a list of all users assigned to a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @returns {Promise} - API response containing the list of users.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function listUsers(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/users`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: \"server_subuser\";\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }\n \n\n/**\n * Assigns a new user to a server with specific permissions.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.email - The email address of the user.\n * @param {string} options.username - The username of the user.\n * @param {string[]} options.permissions - An array of permissions for the user.\n * @returns {Promise} - API response confirming user creation.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function createUser(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n email: string;\n username: string;\n permissions: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"POST\",\n endpoint: `servers/${options.server_id}/users`,\n body: JSON.stringify({\n email: options.email,\n username: options.username,\n permissions: options.permissions\n })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }\n \n\n/**\n * Updates an existing user's permissions for a specific server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.user_id - The ID of the user.\n * @param {string[]} options.permissions - The new set of permissions for the user.\n * @returns {Promise} - API response confirming user update.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function updateUser(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n user_id: string;\n permissions: string[];\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"PUT\",\n endpoint: `servers/${options.server_id}/users/${options.user_id}`,\n body: JSON.stringify({ permissions: options.permissions })\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\n/**\n * Removes a user from a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.user_id - The ID of the user to remove.\n * @returns {Promise} - API response confirming user removal.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function deleteUser(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n user_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"DELETE\",\n endpoint: `servers/${options.server_id}/users/${options.user_id}`\n });\n}\n","import ClientAPICall from \"../../../../../functions/createClientCall\";\n\nexport interface Response {\n object: string;\n attributes: {\n uuid: string;\n username: string;\n email: string;\n image: string;\n \"2fa_enabled\": boolean;\n created_at: string;\n permissions: string[];\n };\n }\n\n \n/**\n * Retrieves details of a specific user assigned to a server.\n *\n * @param {Object} options - API call options.\n * @param {string} options.apiKey - The API key for authentication.\n * @param {string} options.panel - The base URL of the Pterodactyl panel.\n * @param {string} options.server_id - The ID of the server.\n * @param {string} options.user_id - The ID of the user.\n * @returns {Promise} - API response containing user details.\n *\n * @throws {Error} - Throws an error if the API request fails.\n */\nexport default async function userDetails(options: { \n apiKey: string; \n panel: string; \n server_id: string;\n user_id: string;\n}): Promise {\n return ClientAPICall({\n apiKey: options.apiKey,\n panel: options.panel,\n method: \"GET\",\n endpoint: `servers/${options.server_id}/users/${options.user_id}`\n });\n}\n","import Setup from \"./Setup\";\n\n// Import account functions\nimport accountDetails from \"../source/client/account/accountDetails\";\nimport twoFactorEnable from \"../source/client/account/2faEnable\";\nimport twoFactorDisable from \"../source/client/account/2faDisable\";\nimport updateEmail from \"../source/client/account/updateEmail\";\nimport updatePassword from \"../source/client/account/updatePassword\";\nimport createApiKey from \"../source/client/account/createApiKey\";\nimport deleteApiKey from \"../source/client/account/deleteApiKey\";\nimport listApiKeys from \"../source/client/account/listApiKeys\";\n\n// Import general server functions\nimport listServers from \"../source/client/listServers\";\nimport showPermissions from \"../source/client/showPermissions\";\nimport command from \"../source/client/servers/command\";\nimport power from \"../source/client/servers/power\";\nimport consoleDetails from \"../source/client/servers/consoleDetails\";\nimport resources from \"../source/client/servers/resources\";\nimport serverDetails from \"../source/client/servers/serverDetails\";\n\n// Import backup functions\nimport listBackups from \"../source/client/servers/backups/listBackups\";\nimport backupDetails from \"../source/client/servers/backups/backupDetails\";\nimport createBackup from \"../source/client/servers/backups/createBackup\";\nimport deleteBackup from \"../source/client/servers/backups/deleteBackup\";\nimport downloadBackup from \"../source/client/servers/backups/downloadBackup\";\n\n// Import database functions\nimport listDatabases from \"../source/client/servers/databases/listDatabases\";\nimport createDatabase from \"../source/client/servers/databases/createDatabase\";\nimport deleteDatabase from \"../source/client/servers/databases/deleteDatabase\";\nimport rotatePassword from \"../source/client/servers/databases/rotatePassword\";\n\n// Import file management functions\nimport listFiles from \"../source/client/servers/files/listFiles\";\nimport getFileContent from \"../source/client/servers/files/getFileContent\";\nimport downloadFile from \"../source/client/servers/files/downloadFile\";\nimport renameFile from \"../source/client/servers/files/renameFile\";\nimport copyFile from \"../source/client/servers/files/copyFile\";\nimport writeFile from \"../source/client/servers/files/writeFile\";\nimport compressFile from \"../source/client/servers/files/compressFile\";\nimport decompressFile from \"../source/client/servers/files/decompressFile\";\nimport deleteFile from \"../source/client/servers/files/deleteFile\";\nimport createFolder from \"../source/client/servers/files/createFolder\";\nimport uploadFile from \"../source/client/servers/files/uploadFile\";\n\n// Import network management functions\nimport listAllocations from \"../source/client/servers/network/listAllocations\";\nimport assignAllocations from \"../source/client/servers/network/assignAllocations\";\nimport setAllocationNote from \"../source/client/servers/network/setAllocationNote\";\nimport setPrimaryAllocation from \"../source/client/servers/network/setPrimaryAllocation\";\nimport unassignAllocation from \"../source/client/servers/network/unassignAllocation\";\n\n// Import schedule functions\nimport listSchedules from \"../source/client/servers/schedules/listSchedules\";\nimport createSchedule from \"../source/client/servers/schedules/createSchedule\";\nimport scheduleDetails from \"../source/client/servers/schedules/scheduleDetails\";\nimport updateSchedule from \"../source/client/servers/schedules/updateSchedule\";\nimport deleteSchedule from \"../source/client/servers/schedules/deleteSchedule\";\nimport createTask from \"../source/client/servers/schedules/createTask\";\nimport updateTask from \"../source/client/servers/schedules/updateTask\";\nimport deleteTask from \"../source/client/servers/schedules/deleteTask\";\n\n// Import settings functions\nimport renameServer from \"../source/client/servers/settings/renameServer\";\nimport reinstallServer from \"../source/client/servers/settings/reinstallServer\";\n\n// Import startup functions\nimport listVariables from \"../source/client/servers/startup/listVariables\";\nimport updateVariable from \"../source/client/servers/startup/updateVariable\";\n\n// Import user management functions\nimport listUsers from \"../source/client/servers/users/listUsers\";\nimport createUser from \"../source/client/servers/users/createUser\";\nimport updateUser from \"../source/client/servers/users/updateUser\";\nimport deleteUser from \"../source/client/servers/users/deleteUser\";\nimport userDetails from \"../source/client/servers/users/userDetails\";\n\n/**\n * The `Client` class provides an interface for interacting with the Pterodactyl Client API.\n * It supports **account management, server control, file operations, backups, networking, schedules, settings, startup variables, and more**.\n */\nexport default class Client {\n private apiKey: string;\n private panel: string;\n\n constructor(apiKey: string) {\n this.apiKey = apiKey;\n this.panel = Setup.getPanel();\n }\n\n /** Account Management */\n public account = {\n getDetails: () => accountDetails({ apiKey: this.apiKey, panel: this.panel }),\n enable2FA: (codes: string[]) => twoFactorEnable({ apiKey: this.apiKey, panel: this.panel, codes }),\n disable2FA: (tokens: string[]) => twoFactorDisable({ apiKey: this.apiKey, panel: this.panel, tokens }),\n updateEmail: (email: string, password: string) => updateEmail({ apiKey: this.apiKey, panel: this.panel, email, password }),\n updatePassword: (current_password: string, new_password: string) => updatePassword({ apiKey: this.apiKey, panel: this.panel, current_password, new_password }),\n createApiKey: (description: string, allowed_ips: string[]) => createApiKey({ apiKey: this.apiKey, panel: this.panel, description, allowed_ips }),\n deleteApiKey: (key_id: string) => deleteApiKey({ apiKey: this.apiKey, panel: this.panel, key_id }),\n listApiKeys: () => listApiKeys({ apiKey: this.apiKey, panel: this.panel }),\n };\n\n /** Server Management */\n public servers = {\n list: () => listServers({ apiKey: this.apiKey, panel: this.panel }),\n showPermissions: (server_id: string) => showPermissions({ apiKey: this.apiKey, panel: this.panel, server_id }),\n sendCommand: (server_id: string, commandStr: string) => command({ apiKey: this.apiKey, panel: this.panel, server_id, command: commandStr }),\n powerAction: (server_id: string, signal: \"start\" | \"stop\" | \"restart\" | \"kill\") => power({ apiKey: this.apiKey, panel: this.panel, server_id, signal }),\n getConsoleDetails: (server_id: string) => consoleDetails({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getResources: (server_id: string) => resources({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetails: (server_id: string) => serverDetails({ apiKey: this.apiKey, panel: this.panel, server_id }),\n };\n\n /** Backup Management */\n public backups = {\n list: (server_id: string) => listBackups({ apiKey: this.apiKey, panel: this.panel, server_id }),\n getDetails: (server_id: string, backup_id: string) => backupDetails({ apiKey: this.apiKey, panel: this.panel, server_id, backup_id }),\n create: (server_id: string, backup_data: any) => createBackup({ apiKey: this.apiKey, panel: this.panel, server_id, backup_data }),\n delete: (server_id: string, backup_id: string) => deleteBackup({ apiKey: this.apiKey, panel: this.panel, server_id, backup_id }),\n download: (server_id: string, backup_id: string) => downloadBackup({ apiKey: this.apiKey, panel: this.panel, server_id, backup_id }),\n };\n\n /** Settings */\n public settings = {\n renameServer: (server_id: string, new_name: string) => renameServer({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n new_name\n }), \n reinstallServer: (server_id: string) => reinstallServer({ apiKey: this.apiKey, panel: this.panel, server_id }),\n };\n \n /** Network Management */\n public network = {\n listAllocations: (server_id: string) => listAllocations({ apiKey: this.apiKey, panel: this.panel, server_id }),\n assignAllocations: (server_id: string, allocation_id: number) => assignAllocations({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id\n }), \n setAllocationNote: (server_id: string, allocation_id: string, note: string) => setAllocationNote({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id: parseInt(allocation_id), \n note \n }),\n \n setPrimaryAllocation: (server_id: string, allocation_id: string) => setPrimaryAllocation({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id: parseInt(allocation_id) \n }),\n \n unassignAllocation: (server_id: string, allocation_id: string) => unassignAllocation({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n allocation_id: parseInt(allocation_id) \n }), \n };\n \n /** Schedule Management */\n public schedules = {\n list: (server_id: string) => listSchedules({ apiKey: this.apiKey, panel: this.panel, server_id }),\n createSchedule: (server_id: string, schedule_data: any) => createSchedule({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_data }),\n scheduleDetails: (server_id: string, schedule_id: string) => scheduleDetails({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id }),\n updateSchedule: (server_id: string, schedule_id: string, schedule_data: any) => updateSchedule({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, schedule_data }),\n deleteSchedule: (server_id: string, schedule_id: string) => deleteSchedule({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id }),\n createTask: (server_id: string, schedule_id: string, task_data: any) => createTask({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, task_data }),\n updateTask: (server_id: string, schedule_id: string, task_id: string, task_data: any) => updateTask({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, task_id, task_data }),\n deleteTask: (server_id: string, schedule_id: string, task_id: string) => deleteTask({ apiKey: this.apiKey, panel: this.panel, server_id, schedule_id, task_id }),\n };\n \n /** Startup Management */\n public startup = {\n listVariables: (server_id: string) => listVariables({ apiKey: this.apiKey, panel: this.panel, server_id }),\n updateVariable: (server_id: string, variable_id: string, value: string) => updateVariable({ \n apiKey: this.apiKey, \n panel: this.panel, \n server_id, \n variable_id: parseInt(variable_id), \n value \n }), \n };\n \n /** User Management */\n public users = {\n listUsers: (server_id: string) => listUsers({ apiKey: this.apiKey, panel: this.panel, server_id }),\n createUser: (server_id: string, user_data: any) => createUser({ apiKey: this.apiKey, panel: this.panel, server_id, ...user_data }),\n updateUser: (server_id: string, user_id: string, user_data: any) => updateUser({ apiKey: this.apiKey, panel: this.panel, server_id, user_id, ...user_data }),\n deleteUser: (server_id: string, user_id: string) => deleteUser({ apiKey: this.apiKey, panel: this.panel, server_id, user_id }),\n userDetails: (server_id: string, user_id: string) => userDetails({ apiKey: this.apiKey, panel: this.panel, server_id, user_id }),\n };\n \n \n\n\n /** File Management */\n public files = {\n list: (server_id: string, directory?: string) => listFiles({ apiKey: this.apiKey, panel: this.panel, server_id, directory }),\n getContent: (server_id: string, file_path: string) => getFileContent({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n download: (server_id: string, file_path: string) => downloadFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n rename: (server_id: string, from: string, to: string) => renameFile({ apiKey: this.apiKey, panel: this.panel, server_id, files: [{ from, to }] }),\n copy: (server_id: string, file_path: string) => copyFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n write: (server_id: string, file_path: string, content: string) => writeFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path, content }),\n compress: (server_id: string, files: string[]) => compressFile({ apiKey: this.apiKey, panel: this.panel, server_id, files }),\n decompress: (server_id: string, file_path: string) => decompressFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_path }),\n delete: (server_id: string, files: string[]) => deleteFile({ apiKey: this.apiKey, panel: this.panel, server_id, files }),\n createFolder: (server_id: string, folder_path: string) => createFolder({ apiKey: this.apiKey, panel: this.panel, server_id, folder_path }),\n upload: (server_id: string, file_data: FormData) => uploadFile({ apiKey: this.apiKey, panel: this.panel, server_id, file_data }),\n };\n}\n","// WSConnection.ts\n\ntype ReconnectStrategy = \"fixed\" | \"exponential\" | \"exponential-jitter\";\n\ntype EventType =\n | \"open\"\n | \"message\"\n | \"close\"\n | \"error\"\n | \"reconnectAttempt\"\n | \"reconnectSuccess\"\n | \"reconnect\"\n | \"ping\"\n | \"pong\"\n | \"custom\";\n\nexport interface WSConnectionOptions {\n /** Primary WebSocket URL (required) */\n url: string;\n /** Optional fallback URLs if the primary fails */\n fallbackUrls?: string[];\n /** Optional subprotocol(s) to use during the handshake */\n protocols?: string | string[];\n\n /** Automatically reconnect on connection loss */\n autoReconnect?: boolean;\n /** Reconnect strategy: fixed, exponential, or exponential with jitter */\n reconnectStrategy?: ReconnectStrategy;\n /** Base delay (ms) for reconnect attempts */\n reconnectInterval?: number;\n /** Maximum number of reconnect attempts */\n maxReconnectAttempts?: number;\n /** Maximum delay (ms) allowed for exponential backoff */\n maxReconnectInterval?: number;\n /** Additional random jitter (ms) to add when using jitter strategy */\n jitter?: number;\n\n /** Connection timeout (ms) for establishing the connection */\n connectionTimeout?: number;\n\n /** Enable heartbeat (ping/pong) mechanism; set interval in ms */\n heartbeatInterval?: number;\n /** Heartbeat ping message (default \"ping\") */\n heartbeatMessage?: string;\n /** Expected pong message (default \"pong\") */\n expectedPongMessage?: string;\n /** How long (ms) to wait for a pong before closing the connection */\n heartbeatTimeout?: number;\n\n /** If true, queue outgoing messages if the connection is not open */\n queueMessages?: boolean;\n /** Maximum number of messages to queue */\n messageQueueLimit?: number;\n\n /** Automatically JSON‑stringify outgoing objects and parse incoming JSON strings */\n autoJson?: boolean;\n\n /** Custom logger callback; if not provided, uses console */\n logger?: (\n level: \"debug\" | \"info\" | \"warn\" | \"error\",\n ...args: any[]\n ) => void;\n /** Outgoing message interceptors (middleware) */\n outgoingMessageInterceptors?: Array<(message: any) => any>;\n /** Incoming message interceptors (middleware) */\n incomingMessageInterceptors?: Array<(message: any) => any>;\n\n /** Hook called before reconnecting; return false to cancel reconnect */\n onBeforeReconnect?: (attempt: number, lastCloseEvent: CloseEvent) => boolean;\n /** Hook called before sending a message; can modify or cancel the send */\n onBeforeSend?: (message: any) => any;\n /** Hook called after a message is sent */\n onAfterSend?: (message: any) => void;\n\n /** Standard event callbacks (optional) */\n onOpen?: (event: Event) => void;\n onMessage?: (event: MessageEvent) => void;\n onClose?: (event: CloseEvent) => void;\n onError?: (event: Event) => void;\n}\n\nexport interface WSMetrics {\n messagesSent: number;\n messagesReceived: number;\n lastLatency: number;\n reconnectAttempts: number;\n currentUrl: string;\n}\n\nclass AdvancedWebSocket {\n private socket: WebSocket | null = null;\n private currentUrl: string;\n private fallbackUrls: string[];\n private reconnectAttempts: number = 0;\n private messageQueue: Array = [];\n private heartbeatIntervalId: number | null = null;\n private pongTimeoutId: number | null = null;\n private connectionTimeoutId: number | null = null;\n private destroyed: boolean = false;\n\n // Metrics\n private messagesSent: number = 0;\n private messagesReceived: number = 0;\n private lastPingTimestamp: number = 0;\n private lastLatency: number = 0;\n\n // Custom event listeners\n private eventListeners: Record void>> = {\n open: [],\n message: [],\n close: [],\n error: [],\n reconnectAttempt: [],\n reconnect: [],\n reconnectSuccess: [],\n ping: [],\n pong: [],\n custom: [],\n };\n\n private options: WSConnectionOptions;\n\n constructor(options: WSConnectionOptions) {\n if (!options.url) {\n throw new Error(\"A URL is required to establish a WebSocket connection.\");\n }\n this.options = {\n autoReconnect: false,\n reconnectStrategy: \"exponential\",\n reconnectInterval: 1000,\n maxReconnectAttempts: 10,\n maxReconnectInterval: 30000,\n jitter: 300,\n connectionTimeout: 10000,\n heartbeatInterval: 30000,\n heartbeatMessage: \"ping\",\n expectedPongMessage: \"pong\",\n heartbeatTimeout: 5000,\n queueMessages: false,\n autoJson: false,\n ...options,\n };\n this.currentUrl = this.options.url;\n this.fallbackUrls = this.options.fallbackUrls || [];\n }\n\n /** Internal logger */\n private log(level: \"debug\" | \"info\" | \"warn\" | \"error\", ...args: any[]) {\n if (this.options.logger) {\n this.options.logger(level, ...args);\n } else {\n console[level](...args);\n }\n }\n\n /**\n * Establishes the WebSocket connection.\n * Returns a promise that resolves when connected.\n */\n connect(): Promise {\n return new Promise((resolve, reject) => {\n if (this.destroyed) {\n return reject(new Error(\"Instance has been destroyed.\"));\n }\n this.log(\"debug\", `[WS] Connecting to ${this.currentUrl}`);\n this.socket = new WebSocket(this.currentUrl, this.options.protocols);\n\n if (this.options.connectionTimeout) {\n this.connectionTimeoutId = window.setTimeout(() => {\n this.log(\"error\", \"[WS] Connection timeout reached\");\n reject(new Error(\"Connection timeout reached\"));\n this.socket?.close();\n }, this.options.connectionTimeout);\n }\n\n this.socket.onopen = (event) => {\n this.log(\"info\", `[WS] Connected to ${this.currentUrl}`);\n if (this.connectionTimeoutId) {\n clearTimeout(this.connectionTimeoutId);\n this.connectionTimeoutId = null;\n }\n this.reconnectAttempts = 0;\n if (this.options.heartbeatInterval) {\n this.startHeartbeat();\n }\n if (this.options.queueMessages && this.messageQueue.length > 0) {\n this.flushMessageQueue();\n }\n if (this.options.onOpen) this.options.onOpen(event);\n this.dispatchEvent(\"open\", event);\n resolve(this.socket!); // Assert non-null\n };\n\n this.socket.onmessage = (event) => {\n let data: any = event.data;\n if (this.options.incomingMessageInterceptors) {\n this.options.incomingMessageInterceptors.forEach((fn) => {\n data = fn(data);\n });\n }\n if (this.options.autoJson && typeof data === \"string\") {\n try {\n data = JSON.parse(data);\n } catch (e) {\n // fallback to raw data if JSON parsing fails\n }\n }\n this.messagesReceived++;\n // Handle heartbeat pong.\n if (\n this.options.heartbeatInterval &&\n data === this.options.expectedPongMessage\n ) {\n this.log(\"debug\", \"[WS] Received pong\");\n this.dispatchEvent(\"pong\", event);\n if (this.pongTimeoutId) {\n clearTimeout(this.pongTimeoutId);\n this.pongTimeoutId = null;\n }\n this.lastLatency = Date.now() - this.lastPingTimestamp;\n return;\n }\n const modifiedEvent = { ...event, data };\n if (this.options.onMessage) this.options.onMessage(modifiedEvent);\n this.dispatchEvent(\"message\", modifiedEvent);\n };\n\n this.socket.onerror = (event) => {\n this.log(\"error\", \"[WS] Error:\", event);\n if (this.options.onError) this.options.onError(event);\n this.dispatchEvent(\"error\", event);\n };\n\n this.socket.onclose = (event) => {\n this.log(\"warn\", \"[WS] Connection closed:\", event);\n this.stopHeartbeat();\n if (this.options.onClose) this.options.onClose(event);\n this.dispatchEvent(\"close\", event);\n // Attempt auto-reconnect if enabled and not destroyed.\n if (\n this.options.autoReconnect &&\n this.reconnectAttempts < (this.options.maxReconnectAttempts || 0) &&\n !this.destroyed\n ) {\n // Allow hook to cancel reconnect.\n if (\n this.options.onBeforeReconnect &&\n !this.options.onBeforeReconnect(this.reconnectAttempts, event)\n ) {\n this.log(\"info\", \"[WS] Reconnect canceled by onBeforeReconnect hook.\");\n return;\n }\n this.reconnectAttempts++;\n this.dispatchEvent(\"reconnectAttempt\", {\n attempt: this.reconnectAttempts,\n });\n let delay = this.computeReconnectDelay();\n this.log(\n \"info\",\n `[WS] Reconnecting in ${delay}ms... (Attempt ${this.reconnectAttempts})`\n );\n setTimeout(() => {\n // Try fallback URLs if provided.\n if (this.fallbackUrls.length > 0) {\n const nextUrl = this.fallbackUrls.shift();\n if (nextUrl) {\n this.log(\"info\", `[WS] Switching to fallback URL: ${nextUrl}`);\n this.currentUrl = nextUrl;\n }\n }\n this.dispatchEvent(\"reconnect\", { attempt: this.reconnectAttempts });\n this.connect()\n .then((sock) => {\n this.dispatchEvent(\"reconnectSuccess\", {\n attempt: this.reconnectAttempts,\n });\n })\n .catch((err) => {\n this.log(\"error\", \"[WS] Reconnection failed:\", err);\n });\n }, delay);\n }\n };\n });\n }\n\n /**\n * Computes the delay (ms) for the next reconnection attempt based on strategy.\n */\n private computeReconnectDelay(): number {\n let base = this.options.reconnectInterval || 1000;\n let delay: number;\n switch (this.options.reconnectStrategy) {\n case \"fixed\":\n delay = base;\n break;\n case \"exponential\":\n delay = base * Math.pow(2, this.reconnectAttempts - 1);\n break;\n case \"exponential-jitter\":\n delay = base * Math.pow(2, this.reconnectAttempts - 1);\n const jitter = this.options.jitter || 300;\n delay += Math.floor(Math.random() * jitter);\n break;\n default:\n delay = base;\n }\n if (this.options.maxReconnectInterval) {\n delay = Math.min(delay, this.options.maxReconnectInterval);\n }\n return delay;\n }\n\n /**\n * Sends data over the WebSocket.\n * Returns a promise that resolves once the message is sent.\n */\n send(data: any): Promise {\n return new Promise((resolve, reject) => {\n if (!this.socket || this.socket.readyState !== WebSocket.OPEN) {\n if (this.options.queueMessages) {\n if (\n this.options.messageQueueLimit &&\n this.messageQueue.length >= this.options.messageQueueLimit\n ) {\n this.log(\"error\", \"[WS] Message queue full; discarding message.\");\n return reject(new Error(\"Message queue is full.\"));\n }\n this.log(\"debug\", \"[WS] Queuing message (connection not open).\");\n this.messageQueue.push(data);\n return resolve();\n } else {\n this.log(\"error\", \"[WS] Socket not open; cannot send.\");\n return reject(new Error(\"WebSocket is not open.\"));\n }\n }\n // Before-send hook.\n if (this.options.onBeforeSend) {\n data = this.options.onBeforeSend(data);\n }\n // Apply outgoing interceptors.\n if (this.options.outgoingMessageInterceptors) {\n this.options.outgoingMessageInterceptors.forEach((fn) => {\n data = fn(data);\n });\n }\n // Auto‑JSON stringify.\n if (this.options.autoJson && typeof data === \"object\") {\n try {\n data = JSON.stringify(data);\n } catch (err) {\n this.log(\"error\", \"[WS] JSON stringify error:\", err);\n return reject(err);\n }\n }\n try {\n this.socket.send(data);\n this.messagesSent++;\n if (this.options.onAfterSend) {\n this.options.onAfterSend(data);\n }\n resolve();\n } catch (err) {\n reject(err);\n }\n });\n }\n\n /** Flush queued messages */\n private flushMessageQueue(): void {\n this.log(\"debug\", `[WS] Flushing ${this.messageQueue.length} queued message(s).`);\n while (this.messageQueue.length > 0) {\n const msg = this.messageQueue.shift();\n if (msg !== undefined && this.socket && this.socket.readyState === WebSocket.OPEN) {\n this.send(msg).catch((err) => {\n this.log(\"error\", \"[WS] Error sending queued message:\", err);\n });\n }\n }\n }\n\n /** Starts the heartbeat (ping/pong) mechanism */\n private startHeartbeat(): void {\n if (this.options.heartbeatInterval && this.socket) {\n this.log(\"debug\", \"[WS] Starting heartbeat.\");\n this.heartbeatIntervalId = window.setInterval(() => {\n if (this.socket && this.socket.readyState === WebSocket.OPEN) {\n this.log(\"debug\", \"[WS] Sending heartbeat ping.\");\n this.dispatchEvent(\"ping\", { timestamp: Date.now() });\n this.lastPingTimestamp = Date.now();\n this.socket.send(this.options.heartbeatMessage!);\n if (this.options.heartbeatTimeout) {\n this.pongTimeoutId = window.setTimeout(() => {\n this.log(\"error\", \"[WS] Pong timeout; closing connection.\");\n this.socket?.close();\n }, this.options.heartbeatTimeout);\n }\n }\n }, this.options.heartbeatInterval);\n }\n }\n\n /** Stops the heartbeat mechanism */\n private stopHeartbeat(): void {\n if (this.heartbeatIntervalId) {\n clearInterval(this.heartbeatIntervalId);\n this.heartbeatIntervalId = null;\n }\n if (this.pongTimeoutId) {\n clearTimeout(this.pongTimeoutId);\n this.pongTimeoutId = null;\n }\n }\n\n /** Closes the WebSocket connection gracefully */\n close(code?: number, reason?: string): void {\n if (this.socket) {\n this.socket.close(code, reason);\n this.log(\"info\", \"[WS] Connection closed manually.\");\n }\n }\n\n /** Returns whether the connection is currently open */\n isConnected(): boolean {\n return this.socket !== null && this.socket.readyState === WebSocket.OPEN;\n }\n\n /** Returns a human‑readable connection state */\n getConnectionState(): string {\n if (!this.socket) return \"CLOSED\";\n switch (this.socket.readyState) {\n case WebSocket.CONNECTING:\n return \"CONNECTING\";\n case WebSocket.OPEN:\n return \"OPEN\";\n case WebSocket.CLOSING:\n return \"CLOSING\";\n case WebSocket.CLOSED:\n return \"CLOSED\";\n default:\n return \"UNKNOWN\";\n }\n }\n\n /** Forces a manual reconnect */\n manualReconnect(): Promise {\n this.log(\"info\", \"[WS] Manual reconnect initiated.\");\n if (this.socket && this.socket.readyState === WebSocket.OPEN) {\n this.socket.close();\n }\n return this.connect();\n }\n\n /**\n * Sends a message and waits for a response matching the predicate.\n * Useful for request/response patterns.\n */\n sendAndWaitResponse(\n message: any,\n predicate: (msg: any) => boolean,\n timeout: number = 5000\n ): Promise {\n return new Promise((resolve, reject) => {\n const listener = (event: MessageEvent) => {\n if (predicate(event.data)) {\n this.removeEventListener(\"message\", listener);\n resolve(event.data);\n }\n };\n this.addEventListener(\"message\", listener);\n this.send(message).catch((err) => {\n this.removeEventListener(\"message\", listener);\n reject(err);\n });\n setTimeout(() => {\n this.removeEventListener(\"message\", listener);\n reject(new Error(\"Response timeout exceeded.\"));\n }, timeout);\n });\n }\n\n /** Returns metrics on the current connection */\n getMetrics(): WSMetrics {\n return {\n messagesSent: this.messagesSent,\n messagesReceived: this.messagesReceived,\n lastLatency: this.lastLatency,\n reconnectAttempts: this.reconnectAttempts,\n currentUrl: this.currentUrl,\n };\n }\n\n /** Destroys the instance, cleans up timers and listeners */\n destroy(): void {\n this.destroyed = true;\n this.stopHeartbeat();\n if (this.connectionTimeoutId) {\n clearTimeout(this.connectionTimeoutId);\n this.connectionTimeoutId = null;\n }\n this.eventListeners = {\n open: [],\n message: [],\n close: [],\n error: [],\n reconnectAttempt: [],\n reconnect: [],\n reconnectSuccess: [],\n ping: [],\n pong: [],\n custom: [],\n };\n this.messageQueue = [];\n if (this.socket) {\n this.socket.close();\n this.socket = null;\n }\n this.log(\"info\", \"[WS] Connection destroyed.\");\n }\n\n /** Adds an event listener for a given event type */\n addEventListener(eventType: EventType, callback: (event: any) => void): void {\n this.eventListeners[eventType].push(callback);\n }\n\n /** Removes an event listener for a given event type */\n removeEventListener(eventType: EventType, callback: (event: any) => void): void {\n this.eventListeners[eventType] = this.eventListeners[eventType].filter(\n (cb) => cb !== callback\n );\n }\n\n /** Dispatches an event to all registered listeners */\n private dispatchEvent(eventType: EventType, event: any): void {\n this.eventListeners[eventType].forEach((cb) => cb(event));\n }\n\n /** Updates connection options dynamically (effective on next connection) */\n updateOptions(newOptions: Partial): void {\n this.options = { ...this.options, ...newOptions };\n this.log(\"debug\", \"[WS] Options updated:\", this.options);\n }\n\n /** Clears the outgoing message queue */\n clearMessageQueue(): void {\n this.messageQueue = [];\n this.log(\"debug\", \"[WS] Message queue cleared.\");\n }\n}\n\nexport default AdvancedWebSocket;","import Application from \"./class/main/Application\";\nimport Client from \"./class/main/Client\";\nimport Setup from \"./class/main/Setup\";\nimport AdvancedWebSocket from \"./class/main/WSConnection\";\n\nexport default {\n Application,\n Client,\n Setup,\n WebSocket: AdvancedWebSocket,\n};"],"mappings":";AAQA,IAAqB,QAArB,MAA2B;AAAA;AAAA;AAAA;AAAA;AAAA,EAOvB,OAAc,SAAS,KAAmB;AACtC,SAAK,WAAW;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAc,WAAmB;AAC7B,QAAI,CAAC,KAAK,UAAU;AAChB,YAAM,IAAI,MAAM,wEAAwE;AAAA,IAC5F;AACA,WAAO,KAAK;AAAA,EAChB;AACJ;;;AC9BA,OAAO,WAAW;AA8BlB,eAAO,mBAA0C,SAMhC;AACb,QAAM,MAAM,GAAG,QAAQ,KAAK,oBAAoB,QAAQ,QAAQ;AAChE,QAAM,UAAU;AAAA,IACZ,UAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,iBAAiB,UAAU,QAAQ,MAAM;AAAA,EAC7C;AAEA,MAAI,OAA2B;AAE/B,MAAI,QAAQ,QAAQ,QAAQ,WAAW,SAAS,QAAQ,WAAW,UAAU;AACzE,WAAO,OAAO,QAAQ,SAAS,WAAW,QAAQ,OAAO,KAAK,UAAU,QAAQ,IAAI;AAAA,EACxF;AAEA,MAAI;AACA,QAAI,QAAQ,WAAW,SAAS;AAC5B,YAAM,WAAW,MAAM,MAAM,MAAM,KAAK,QAAQ,MAAM,EAAE,QAAQ,CAAC;AACjE,aAAO,SAAS;AAAA,IACpB,OAAO;AACH,YAAM,WAAW,MAAM,MAAM,KAAK;AAAA,QAC9B,QAAQ,QAAQ;AAAA,QAChB;AAAA,QACA;AAAA,MACJ,CAAC;AAED,UAAI,CAAC,SAAS,IAAI;AACd,cAAM,IAAI,MAAM,+BAA+B,SAAS,MAAM,KAAK,MAAM,SAAS,KAAK,CAAC,EAAE;AAAA,MAC9F;AAEA,aAAO,MAAM,SAAS,KAAK;AAAA,IAC/B;AAAA,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AAA;AAAA,EAGA,oBAA0B;AACxB,SAAK,eAAe,CAAC;AACrB,SAAK,IAAI,SAAS,6BAA6B;AAAA,EACjD;AACF;AAEA,IAAO,uBAAQ;;;ACjiBf,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AACb;","names":["axios","listServers","serverDetails","axios","listAllocations","reinstallServer","listUsers","createUser","updateUser","deleteUser","userDetails","listServers","serverDetails","reinstallServer","listAllocations","listUsers","createUser","updateUser","deleteUser","userDetails"]} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 669fa4c..0a865e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pterodactyl-api-wrapper", - "version": "2.0.7", + "version": "2.0.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pterodactyl-api-wrapper", - "version": "2.0.7", + "version": "2.0.10", "license": "Apache-2.0", "dependencies": { "@types/axios": "^0.9.36", diff --git a/package.json b/package.json index 60ad844..1efef84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pterodactyl-api-wrapper", - "version": "2.0.7", + "version": "2.0.10", "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { diff --git a/src/class/source/client/account/2faDetails.ts b/src/class/source/client/account/2faDetails.ts index a2cfb7f..3c252b3 100644 --- a/src/class/source/client/account/2faDetails.ts +++ b/src/class/source/client/account/2faDetails.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../functions/createAppCall"; +import ClientAPICall from "../../../../functions/createClientCall"; export interface Response { data: { diff --git a/src/class/source/client/account/2faDisable.ts b/src/class/source/client/account/2faDisable.ts index edc0207..d926792 100644 --- a/src/class/source/client/account/2faDisable.ts +++ b/src/class/source/client/account/2faDisable.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../functions/createAppCall"; +import ClientAPICall from "../../../../functions/createClientCall"; /** * Disables Two-Factor Authentication (2FA) for the authenticated user. diff --git a/src/class/source/client/account/2faEnable.ts b/src/class/source/client/account/2faEnable.ts index 97c4172..1c51080 100644 --- a/src/class/source/client/account/2faEnable.ts +++ b/src/class/source/client/account/2faEnable.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../functions/createAppCall"; +import ClientAPICall from "../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/account/accountDetails.ts b/src/class/source/client/account/accountDetails.ts index 9b9c745..ce78557 100644 --- a/src/class/source/client/account/accountDetails.ts +++ b/src/class/source/client/account/accountDetails.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../functions/createAppCall"; +import ClientAPICall from "../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/account/createApiKey.ts b/src/class/source/client/account/createApiKey.ts index 675e3d0..f41c8b6 100644 --- a/src/class/source/client/account/createApiKey.ts +++ b/src/class/source/client/account/createApiKey.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../functions/createAppCall"; +import ClientAPICall from "../../../../functions/createClientCall"; export interface Response { object: string, diff --git a/src/class/source/client/account/deleteApiKey.ts b/src/class/source/client/account/deleteApiKey.ts index 0533a10..7929be7 100644 --- a/src/class/source/client/account/deleteApiKey.ts +++ b/src/class/source/client/account/deleteApiKey.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../functions/createAppCall"; +import ClientAPICall from "../../../../functions/createClientCall"; /** * Deletes an API key for the authenticated user. diff --git a/src/class/source/client/account/listApiKeys.ts b/src/class/source/client/account/listApiKeys.ts index 6472cd1..7f66cfa 100644 --- a/src/class/source/client/account/listApiKeys.ts +++ b/src/class/source/client/account/listApiKeys.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../functions/createAppCall"; +import ClientAPICall from "../../../../functions/createClientCall"; export interface Response { object: string, diff --git a/src/class/source/client/account/updateEmail.ts b/src/class/source/client/account/updateEmail.ts index 8fe079e..c891f86 100644 --- a/src/class/source/client/account/updateEmail.ts +++ b/src/class/source/client/account/updateEmail.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../functions/createAppCall"; +import ClientAPICall from "../../../../functions/createClientCall"; /** * Updates the email address of the authenticated user. diff --git a/src/class/source/client/account/updatePassword.ts b/src/class/source/client/account/updatePassword.ts index 9deda33..63f82e8 100644 --- a/src/class/source/client/account/updatePassword.ts +++ b/src/class/source/client/account/updatePassword.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../functions/createAppCall"; +import ClientAPICall from "../../../../functions/createClientCall"; /** * Updates the password of the authenticated user. diff --git a/src/class/source/client/servers/backups/backupDetails.ts b/src/class/source/client/servers/backups/backupDetails.ts index cd685ec..ddd635d 100644 --- a/src/class/source/client/servers/backups/backupDetails.ts +++ b/src/class/source/client/servers/backups/backupDetails.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/backups/createBackup.ts b/src/class/source/client/servers/backups/createBackup.ts index a732dbf..5d35e7d 100644 --- a/src/class/source/client/servers/backups/createBackup.ts +++ b/src/class/source/client/servers/backups/createBackup.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/backups/deleteBackup.ts b/src/class/source/client/servers/backups/deleteBackup.ts index fefb742..5008d0b 100644 --- a/src/class/source/client/servers/backups/deleteBackup.ts +++ b/src/class/source/client/servers/backups/deleteBackup.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Deletes a backup from a server. diff --git a/src/class/source/client/servers/backups/downloadBackup.ts b/src/class/source/client/servers/backups/downloadBackup.ts index 8ee00fc..73f46fb 100644 --- a/src/class/source/client/servers/backups/downloadBackup.ts +++ b/src/class/source/client/servers/backups/downloadBackup.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/backups/listBackups.ts b/src/class/source/client/servers/backups/listBackups.ts index cc19878..382d91c 100644 --- a/src/class/source/client/servers/backups/listBackups.ts +++ b/src/class/source/client/servers/backups/listBackups.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/databases/createDatabase.ts b/src/class/source/client/servers/databases/createDatabase.ts index f3006ab..64801c4 100644 --- a/src/class/source/client/servers/databases/createDatabase.ts +++ b/src/class/source/client/servers/databases/createDatabase.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/databases/deleteDatabase.ts b/src/class/source/client/servers/databases/deleteDatabase.ts index 0ffcb4c..f554af1 100644 --- a/src/class/source/client/servers/databases/deleteDatabase.ts +++ b/src/class/source/client/servers/databases/deleteDatabase.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Deletes a database from a server. diff --git a/src/class/source/client/servers/databases/listDatabases.ts b/src/class/source/client/servers/databases/listDatabases.ts index b04d54c..80ba9a4 100644 --- a/src/class/source/client/servers/databases/listDatabases.ts +++ b/src/class/source/client/servers/databases/listDatabases.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/databases/rotatePassword.ts b/src/class/source/client/servers/databases/rotatePassword.ts index a3473e7..1e7cc6d 100644 --- a/src/class/source/client/servers/databases/rotatePassword.ts +++ b/src/class/source/client/servers/databases/rotatePassword.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/files/compressFile.ts b/src/class/source/client/servers/files/compressFile.ts index 68f1a82..bc6b4b0 100644 --- a/src/class/source/client/servers/files/compressFile.ts +++ b/src/class/source/client/servers/files/compressFile.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/files/copyFile.ts b/src/class/source/client/servers/files/copyFile.ts index d511949..8b30845 100644 --- a/src/class/source/client/servers/files/copyFile.ts +++ b/src/class/source/client/servers/files/copyFile.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Copies a file to a new location on the server. diff --git a/src/class/source/client/servers/files/createFolder.ts b/src/class/source/client/servers/files/createFolder.ts index 6e2bb98..aac5414 100644 --- a/src/class/source/client/servers/files/createFolder.ts +++ b/src/class/source/client/servers/files/createFolder.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Creates a new folder on a server. diff --git a/src/class/source/client/servers/files/decompressFile.ts b/src/class/source/client/servers/files/decompressFile.ts index 66b2671..814cb4e 100644 --- a/src/class/source/client/servers/files/decompressFile.ts +++ b/src/class/source/client/servers/files/decompressFile.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Decompresses a ZIP file on a server. diff --git a/src/class/source/client/servers/files/deleteFile.ts b/src/class/source/client/servers/files/deleteFile.ts index 5d689b8..d5382e4 100644 --- a/src/class/source/client/servers/files/deleteFile.ts +++ b/src/class/source/client/servers/files/deleteFile.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Deletes a file or folder on a server. diff --git a/src/class/source/client/servers/files/downloadFile.ts b/src/class/source/client/servers/files/downloadFile.ts index 1318560..1e7e8c8 100644 --- a/src/class/source/client/servers/files/downloadFile.ts +++ b/src/class/source/client/servers/files/downloadFile.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/files/getFileContent.ts b/src/class/source/client/servers/files/getFileContent.ts index 9fc60f4..acc513b 100644 --- a/src/class/source/client/servers/files/getFileContent.ts +++ b/src/class/source/client/servers/files/getFileContent.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Retrieves the content of a specific file on a server. diff --git a/src/class/source/client/servers/files/listFiles.ts b/src/class/source/client/servers/files/listFiles.ts index d8ffc35..ba76c88 100644 --- a/src/class/source/client/servers/files/listFiles.ts +++ b/src/class/source/client/servers/files/listFiles.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/files/renameFile.ts b/src/class/source/client/servers/files/renameFile.ts index f7706ed..37a37a2 100644 --- a/src/class/source/client/servers/files/renameFile.ts +++ b/src/class/source/client/servers/files/renameFile.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Renames a file or folder on a server. diff --git a/src/class/source/client/servers/files/writeFile.ts b/src/class/source/client/servers/files/writeFile.ts index 9d70ba8..62d6e82 100644 --- a/src/class/source/client/servers/files/writeFile.ts +++ b/src/class/source/client/servers/files/writeFile.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Writes content to a file on a server. @@ -13,21 +13,18 @@ import ClientAPICall from "../../../../../functions/createAppCall"; * * @throws {Error} - Throws an error if the API request fails. */ -export default async function writeFile(options: { - apiKey: string; - panel: string; - server_id: string; - file_path: string; - content: string; +export default async function writeFile(options: { + apiKey: string; + panel: string; + server_id: string; + file_path: string; + content: string; }): Promise { - return ClientAPICall({ - apiKey: options.apiKey, - panel: options.panel, - method: "POST", - endpoint: `servers/${options.server_id}/files/write`, - body: JSON.stringify({ - file: options.file_path, - contents: options.content - }) - }); + return ClientAPICall({ + apiKey: options.apiKey, + panel: options.panel, + method: "POST", + endpoint: `servers/${options.server_id}/files/write?file=${options.file_path}`, + body: options.content, + }); } diff --git a/src/class/source/client/servers/network/assignAllocations.ts b/src/class/source/client/servers/network/assignAllocations.ts index dd7a708..0bc7851 100644 --- a/src/class/source/client/servers/network/assignAllocations.ts +++ b/src/class/source/client/servers/network/assignAllocations.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/network/listAllocations.ts b/src/class/source/client/servers/network/listAllocations.ts index b58205a..ec3c7a3 100644 --- a/src/class/source/client/servers/network/listAllocations.ts +++ b/src/class/source/client/servers/network/listAllocations.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/network/setAllocationNote.ts b/src/class/source/client/servers/network/setAllocationNote.ts index 3e4d5fb..ec442be 100644 --- a/src/class/source/client/servers/network/setAllocationNote.ts +++ b/src/class/source/client/servers/network/setAllocationNote.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/network/setPrimaryAllocation.ts b/src/class/source/client/servers/network/setPrimaryAllocation.ts index 18ceabf..50832ec 100644 --- a/src/class/source/client/servers/network/setPrimaryAllocation.ts +++ b/src/class/source/client/servers/network/setPrimaryAllocation.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/network/unassignAllocation.ts b/src/class/source/client/servers/network/unassignAllocation.ts index d84705a..4b6ecf4 100644 --- a/src/class/source/client/servers/network/unassignAllocation.ts +++ b/src/class/source/client/servers/network/unassignAllocation.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Unassigns a network allocation from a server. diff --git a/src/class/source/client/servers/settings/reinstallServer.ts b/src/class/source/client/servers/settings/reinstallServer.ts index f0d0324..cee2362 100644 --- a/src/class/source/client/servers/settings/reinstallServer.ts +++ b/src/class/source/client/servers/settings/reinstallServer.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Reinstalls a server, resetting its configuration while preserving files. diff --git a/src/class/source/client/servers/settings/renameServer.ts b/src/class/source/client/servers/settings/renameServer.ts index 079b6c2..ca8a40a 100644 --- a/src/class/source/client/servers/settings/renameServer.ts +++ b/src/class/source/client/servers/settings/renameServer.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Renames a server on the panel. diff --git a/src/class/source/client/servers/startup/listVariables.ts b/src/class/source/client/servers/startup/listVariables.ts index ff14bc4..3faca4a 100644 --- a/src/class/source/client/servers/startup/listVariables.ts +++ b/src/class/source/client/servers/startup/listVariables.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/startup/updateVariable.ts b/src/class/source/client/servers/startup/updateVariable.ts index 564fb02..018ac83 100644 --- a/src/class/source/client/servers/startup/updateVariable.ts +++ b/src/class/source/client/servers/startup/updateVariable.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/users/createUser.ts b/src/class/source/client/servers/users/createUser.ts index f9d674b..6e81043 100644 --- a/src/class/source/client/servers/users/createUser.ts +++ b/src/class/source/client/servers/users/createUser.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: "server_subuser"; diff --git a/src/class/source/client/servers/users/deleteUser.ts b/src/class/source/client/servers/users/deleteUser.ts index aa6cf69..bd83bac 100644 --- a/src/class/source/client/servers/users/deleteUser.ts +++ b/src/class/source/client/servers/users/deleteUser.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; /** * Removes a user from a server. diff --git a/src/class/source/client/servers/users/listUsers.ts b/src/class/source/client/servers/users/listUsers.ts index dfc1b54..9fe7a84 100644 --- a/src/class/source/client/servers/users/listUsers.ts +++ b/src/class/source/client/servers/users/listUsers.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/users/updateUser.ts b/src/class/source/client/servers/users/updateUser.ts index 9202c30..b0a7602 100644 --- a/src/class/source/client/servers/users/updateUser.ts +++ b/src/class/source/client/servers/users/updateUser.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/servers/users/userDetails.ts b/src/class/source/client/servers/users/userDetails.ts index f90e753..df210d6 100644 --- a/src/class/source/client/servers/users/userDetails.ts +++ b/src/class/source/client/servers/users/userDetails.ts @@ -1,4 +1,4 @@ -import ClientAPICall from "../../../../../functions/createAppCall"; +import ClientAPICall from "../../../../../functions/createClientCall"; export interface Response { object: string; diff --git a/src/class/source/client/showPermissions.ts b/src/class/source/client/showPermissions.ts index 60d22d8..08acdd4 100644 --- a/src/class/source/client/showPermissions.ts +++ b/src/class/source/client/showPermissions.ts @@ -1,100 +1,99 @@ -import ClientAPICall from "../../../functions/createAppCall"; +import ClientAPICall from "../../../functions/createClientCall"; export interface Response { - object: string; - attributes: { - permissions: { - websocket: { - description: string; - keys: { - connect: string; - }; + object: string; + attributes: { + permissions: { + websocket: { + description: string; + keys: { + connect: string; }; - control: { - description: string; - keys: { - console: string; - start: string; - stop: string; - restart: string; - }; + }; + control: { + description: string; + keys: { + console: string; + start: string; + stop: string; + restart: string; }; - user: { - description: string; - keys: { - create: string; - read: string; - update: string; - delete: string; - }; + }; + user: { + description: string; + keys: { + create: string; + read: string; + update: string; + delete: string; }; - file: { - description: string; - keys: { - create: string; - read: string; - update: string; - delete: string; - archive: string; - sftp: string; - }; + }; + file: { + description: string; + keys: { + create: string; + read: string; + update: string; + delete: string; + archive: string; + sftp: string; }; - backup: { - description: string; - keys: { - create: string; - read: string; - update: string; - delete: string; - download: string; - }; + }; + backup: { + description: string; + keys: { + create: string; + read: string; + update: string; + delete: string; + download: string; }; - allocation: { - description: string; - keys: { - read: string; - create: string; - update: string; - delete: string; - }; + }; + allocation: { + description: string; + keys: { + read: string; + create: string; + update: string; + delete: string; }; - startup: { - description: string; - keys: { - read: string; - update: string; - }; + }; + startup: { + description: string; + keys: { + read: string; + update: string; }; - database: { - description: string; - keys: { - create: string; - read: string; - update: string; - delete: string; - view_password: string; - }; + }; + database: { + description: string; + keys: { + create: string; + read: string; + update: string; + delete: string; + view_password: string; }; - schedule: { - description: string; - keys: { - create: string; - read: string; - update: string; - delete: string; - }; + }; + schedule: { + description: string; + keys: { + create: string; + read: string; + update: string; + delete: string; }; - settings: { - description: string; - keys: { - rename: string; - reinstall: string; - }; + }; + settings: { + description: string; + keys: { + rename: string; + reinstall: string; }; }; }; - } - + }; +} /** * Retrieves the permissions the authenticated user has for a specific server. @@ -107,15 +106,15 @@ export interface Response { * * @throws {Error} - Throws an error if the API request fails. */ -export default async function showPermissions(options: { - apiKey: string; - panel: string; - server_id: string; +export default async function showPermissions(options: { + apiKey: string; + panel: string; + server_id: string; }): Promise { - return ClientAPICall({ - apiKey: options.apiKey, - panel: options.panel, - method: "GET", - endpoint: `servers/${options.server_id}/permissions` - }); + return ClientAPICall({ + apiKey: options.apiKey, + panel: options.panel, + method: "GET", + endpoint: `servers/${options.server_id}/permissions`, + }); } diff --git a/src/functions/createClientCall.ts b/src/functions/createClientCall.ts index 3558087..6de8d6e 100644 --- a/src/functions/createClientCall.ts +++ b/src/functions/createClientCall.ts @@ -2,7 +2,7 @@ import axios from "axios"; /** * Creates an API Call to the Client API of your Pterodactyl panel. - * + * * @param {Object} options - API call options. * @param {string} options.panel - Your panel's URL. * @param {string} options.apiKey - The API key for authentication. @@ -14,41 +14,56 @@ import axios from "axios"; * @throws {Error} - Throws an error if the API request fails. */ export default async function ClientAPICall(options: { - panel: string; - apiKey: string; - endpoint: string; - method: "GET" | "DELETE" | "POST" | "PUT" | "PATCH"; - body?: any; + panel: string; + apiKey: string; + endpoint: string; + method: "GET" | "DELETE" | "POST" | "PUT" | "PATCH"; + body?: any; }): Promise { - const url = `${options.panel}/api/client/${options.endpoint}`; - const headers = { - 'Accept': "application/json", - 'Content-Type': "application/json", - 'Authorization': `Bearer ${options.apiKey}` - }; + const url = `${options.panel}/api/client/${options.endpoint}`; + + const isFileWrite = options.endpoint.includes("/files/write"); + + const headers = { + Accept: "application/json", + "Content-Type": isFileWrite ? "text/plain" : "application/json", + Authorization: `Bearer ${options.apiKey}`, + }; - try { - if (["POST", "PUT", "PATCH"].includes(options.method)) { - const response = await axios({ - method: options.method, - url, - headers, - data: options.body ? JSON.stringify(options.body) : undefined - }); - return response.data; - } else { - const response = await fetch(url, { - method: options.method, - headers - }); + try { + if (["POST", "PUT", "PATCH"].includes(options.method)) { + const response = await axios({ + method: options.method, + url, + headers, + data: isFileWrite + ? options.body + : options.body + ? JSON.stringify(options.body) + : undefined, + }); + return response.data; + } else { + const response = await fetch(url, { + method: options.method, + headers, + }); - if (!response.ok) { - throw new Error(`API call failed with status ${response.status}: ${await response.text()}`); - } + if (!response.ok) { + throw new Error( + `API call failed with status ${ + response.status + }: ${await response.text()}` + ); + } - return await response.json(); - } - } catch (error) { - throw new Error(`Error in API call: ${error instanceof Error ? error.message : String(error)}`); + return await response.json(); } -} \ No newline at end of file + } catch (error) { + throw new Error( + `Error in API call: ${ + error instanceof Error ? error.message : String(error) + }` + ); + } +}