import { AutoUpdateDataView, ChainData, VpnDeviceCredentials, VpnDevice, HostDiagnoseItem, EthClientFallback, Eth2ClientTarget, EthicalMetricsConfig, CoreUpdateData, DirectoryItem, RequestedDnp, UserActionLog, HttpsPortalMapping, ExposableServiceMapping, IpfsRepository, LocalProxyingStatus, HostHardDisk, HostVolumeGroup, HostLogicalVolume, MountpointData, NewFeatureId, NewFeatureStatus, PackageNotificationDb, PackageNotification, UserSettingsAllDnps, InstalledPackageDetailData, InstalledPackageDataApiReturn, PortMapping, PortToOpen, UpnpTablePortStatus, ApiTablePortStatus, RebootRequiredScript, HostStatCpu, HostStatMemory, HostStatDisk, ShhStatus, SystemInfo, VolumeData, PublicIpResponse, CurrentWifiCredentials, WifiReport, WireguardDeviceCredentials, DockerUpgradeRequirements } from "./calls.js"; import { PackageEnvs } from "./compose.js"; import { PackageBackup } from "./manifest.js"; import { TrustedReleaseKey } from "./pkg.js"; import { OptimismConfigSet, OptimismConfigGet } from "./rollups.js"; import { Network, StakerConfigGet, StakerConfigSet } from "./stakers.js"; export interface Routes { /** * Returns formated auto-update data */ autoUpdateDataGet: () => Promise; /** * Edits the auto-update settings * @param id = "my-packages", "system-packages" or "bitcoin.dnp.dappnode.eth" * @param enabled Auto update is enabled for ID */ autoUpdateSettingsEdit: (kwargs: { id: string; enabled: boolean; }) => Promise; /** * Generates a backup of a package and sends it to the client for download. * @returns fileId = "64020f6e8d2d02aa2324dab9cd68a8ccb186e192232814f79f35d4c2fbf2d1cc" */ backupGet: (kwargs: { dnpName: string; backup: PackageBackup[]; }) => Promise; /** * Restores a backup of a package from the dataUri provided by the user * @returns fileId = "64020f6e8d2d02aa2324dab9cd68a8ccb186e192232814f79f35d4c2fbf2d1cc" */ backupRestore: (kwargs: { dnpName: string; backup: PackageBackup[]; fileId: string; }) => Promise; /** * Returns chain data for all installed packages declared as chains * Result is cached for 5 seconds across all consumers */ chainDataGet(): Promise; /** * Used to test different IPFS timeout parameters live from the ADMIN UI. * @param timeout new IPFS timeout in ms */ changeIpfsTimeout: (kwargs: { timeout: number; }) => Promise; /** * Cleans the cache files of the DAPPMANAGER: */ cleanCache: () => Promise; /** * Cleans the main database of the DAPPMANAGER: */ cleanDb: () => Promise; /** * Copy file to a DNP: * @param containerName Name of a docker container * @param dataUri = "data:application/zip;base64,UEsDBBQAAAg..." * @param filename name of the uploaded file. * - MUST NOT be a path: "/app", "app/", "app/file.txt" * @param toPath path to copy a file to * - If path = path to a file: "/usr/src/app/config.json". * Copies the contents of dataUri to that file, overwritting it if necessary * - If path = path to a directory: "/usr/src/app". * Copies the contents of dataUri to ${dir}/${filename} * - If path = relative path: "config.json". * Path becomes $WORKDIR/config.json, then copies the contents of dataUri there * Same for relative paths to directories. * - If empty, defaults to $WORKDIR */ copyFileToDockerContainer: (kwargs: { containerName: string; dataUri: string; filename: string; toPath: string; }) => Promise; /** Gets the staker configuration for a given network */ stakerConfigGet: (network: T) => Promise>; /** Sets the staker configuration for a given network */ stakerConfigSet: (kwargs: { stakerConfig: StakerConfigSet; }) => Promise; /** Set the dappnodeWebNameSet */ dappnodeWebNameSet: (kwargs: { dappnodeWebName: string; }) => Promise; /** * Creates a new device with the provided id. * Generates certificates and keys needed for OpenVPN. * @param id Device id name */ deviceAdd: (kwargs: { id: string; }) => Promise; /** * Creates a new OpenVPN credentials file, encrypted. * The filename is the (16 chars short) result of hashing the generated salt in the db, * concatenated with the device id. * @param id Device id name */ deviceCredentialsGet: (kwargs: { id: string; }) => Promise; /** * Removes the device with the provided id, if exists. * @param id Device id name */ deviceRemove: (kwargs: { id: string; }) => Promise; /** * Resets the device credentials with the provided id, if exists. * @param id Device id name */ deviceReset: (kwargs: { id: string; }) => Promise; /** * Gives/removes admin rights to the provided device id. * @param id Device id name * @param isAdmin new admin status */ deviceAdminToggle: (kwargs: { id: string; isAdmin: boolean; }) => Promise; /** * Returns true if a password has been created for this device * @param id Device id name */ devicePasswordHas: (kwargs: { id: string; }) => Promise; /** * Returns the login token of this device, creating it if necessary * If the password has been changed and is no longer a login token, throws * @param id Device id name */ devicePasswordGet: (kwargs: { id: string; }) => Promise; /** * Returns a list of the existing devices, with the admin property */ devicesList: () => Promise; /** * Collect host info for support */ diagnose: () => Promise; /** * Updates docker engine */ dockerUpgrade: () => Promise; /** * Checks requirements to update docker */ dockerUpgradeCheck: () => Promise; /** * Sets if a fallback should be used */ ethClientFallbackSet: (kwargs: { fallback: EthClientFallback; }) => Promise; /** * Changes the ethereum client used to fetch package data */ ethClientTargetSet: (kwargs: { target: Eth2ClientTarget; ethRemoteRpc: string; sync?: boolean; useCheckpointSync?: boolean; deletePrevExecClient?: boolean; deletePrevExecClientVolumes?: boolean; deletePrevConsClient?: boolean; deletePrevConsClientVolumes?: boolean; }) => Promise; /** * Enables ethical metrics notifications * @param mail * @param tgChannelId * @param sync */ enableEthicalMetrics: (kwargs: { mail: string | null; tgChannelId: string | null; sync: boolean; }) => Promise; /** * Disables ethical metrics notifications */ disableEthicalMetrics: () => Promise; /** * Returns current core version in string if core was installed, else returns empty string */ getCoreVersion: () => Promise; /** * Returns the current ethical metrics config */ getEthicalMetricsConfig: () => Promise; /** * Returns true if dappnode connected to internet */ getIsConnectedToInternet: () => Promise; /** * Return formated core update data */ fetchCoreUpdateData: (kwarg: { version?: string; }) => Promise; /** * Fetch directory summary */ fetchDirectory: () => Promise; /** * Fetch registry summary */ fetchRegistry: () => Promise; /** * Fetch extended info about a new DNP */ fetchDnpRequest: (kwargs: { id: string; }) => Promise; /** * Returns the user action logs. This logs are stored in a different * file and format, and are meant to ease user support * The list is ordered from newest to oldest. Newest log has index = 0 * @param first for pagination * @param after for pagination */ getUserActionLogs: (kwargs: { first?: number; after?: number; }) => Promise; /** * Returns the host uptime * in format: up 3 weeks, 2 days, 8 hours, 40 minutes * Use the command "uptime --pretty" */ getHostUptime: () => Promise; /** HTTPs Portal: map a subdomain */ httpsPortalMappingAdd(kwargs: { mapping: HttpsPortalMapping; }): Promise; /** HTTPs Portal: remove an existing mapping */ httpsPortalMappingRemove(kwargs: { mapping: HttpsPortalMapping; }): Promise; /** HTTPs Portal: get all mappings */ httpsPortalMappingsGet(): Promise; /** HTTPs Portal: get exposable services with metadata */ httpsPortalExposableServicesGet(): Promise; /** HTTPs Portal: recreate mappings */ httpsPortalMappingsRecreate(): Promise; /** * Attempts to cat a common IPFS hash. resolves if all OK, throws otherwise */ ipfsTest(): Promise; /** * Sets the ipfs client target: local | remote */ ipfsClientTargetSet(kwargs: { ipfsRepository: IpfsRepository; }): Promise; /** * Gets the Ipfs client target */ ipfsClientTargetGet(): Promise; /** * Local proxying allows to access the admin UI through dappnode.local. * When disabling this feature: * - Remove NGINX logic in HTTPs Portal to route .local domains * - Stop exposing the port 80 to the local network * - Stop broadcasting .local domains to mDNS */ localProxyingEnableDisable: (enable: boolean) => Promise; /** * Local proxying allows to access the admin UI through dappnode.local. * Return current status of: * - NGINX is routing .local domains * - Port 80 is exposed * - Is broadcasting to mDNS */ localProxyingStatusGet: () => Promise; /** LVM: get hard disks */ lvmhardDisksGet: () => Promise; /** LVM: get Volume Groups */ lvmVolumeGroupsGet: () => Promise; /** LVM: get Logical Volumes */ lvmLogicalVolumesGet: () => Promise; /** LVM: extend host disk space */ lvmDiskSpaceExtend: (kwargs: { disk: string; volumeGroup: string; logicalVolume: string; }) => Promise; /** * Returns the list of current mountpoints in the host, * by running a pre-written script in the host */ mountpointsGet: () => Promise; /** * Flag the UI welcome flow as completed */ newFeatureStatusSet: (kwargs: { featureId: NewFeatureId; status: NewFeatureStatus; }) => Promise; /** * Returns not viewed notifications. * Use an array as the keys are not known in advance and the array form * is okay for RPC transport, as uniqueness is guaranteed */ notificationsGet: () => Promise; /** * Marks notifications as view by deleting them from the db * @param ids Array of ids to be marked as read [ "n-id-1", "n-id-2" ] */ notificationsRemove: (kwargs: { ids: string[]; }) => Promise; /** * Adds a notification to be shown the UI. * Set the notification param to null for a random notification */ notificationsTest: (kwargs: { notification?: PackageNotification; }) => Promise; /** * Enables Optimism with the given config */ optimismConfigSet: (kwargs: OptimismConfigSet) => Promise; /** * Returns the current Optimism configuration */ optimismConfigGet: () => Promise; /** * Installs a DAppNode Package. * Resolves dependencies, downloads release assets, loads the images to docker, * sets userSettings and starts the docker container for each package. * * The logId is the requested id. It is used for the UI to track the progress * of the installation in real time and prevent double installs * * Options * - BYPASS_RESOLVER {bool}: Skips dappGet to only fetche first level dependencies * - BYPASS_CORE_RESTRICTION {bool}: Allows unverified core DNPs (from IPFS) */ packageInstall: (kwargs: { name: string; version?: string; userSettings?: UserSettingsAllDnps; options?: { /** * Forwarded option to dappGet * If true, uses the dappGetBasic, which only fetches first level deps */ BYPASS_RESOLVER?: boolean; BYPASS_CORE_RESTRICTION?: boolean; BYPASS_SIGNED_RESTRICTION?: boolean; }; }) => Promise; /** * Get package detail information */ packageGet: (kwargs: { dnpName: string; }) => Promise; /** * Returns the list of current containers associated to packages */ packagesGet: () => Promise; /** * Toggles the visibility of a getting started block * @param show Should be shown on hidden */ packageGettingStartedToggle: (kwargs: { dnpName: string; show: boolean; }) => Promise; /** * Returns the logs of the docker container of a package * @param containerName Name of a docker container * @param options log options * - timestamps: Show timestamps * - tail: Number of lines to return from bottom: 200 * @returns String with escape codes */ packageLog: (kwargs: { containerName: string; options?: { timestamps?: boolean; tail?: number; }; }) => Promise; /** * Remove a package and its data * @param id DNP .eth name * @param deleteVolumes flag to also clear permanent package data */ packageRemove: (kwarg: { dnpName: string; deleteVolumes?: boolean; timeout?: number; }) => Promise; /** * Recreates a package containers */ packageRestart: (kwargs: { dnpName: string; serviceNames?: string[]; }) => Promise; /** * Removes a package volumes. The re-ups the package */ packageRestartVolumes: (kwargs: { dnpName: string; volumeId?: string; }) => Promise; /** Delete package sent data key */ packageSentDataDelete: (kwargs: { dnpName: string; key?: string; }) => Promise; /** * Updates the .env file of a package. If requested, also re-ups it */ packageSetEnvironment: (kwargs: { dnpName: string; environmentByService: { [serviceName: string]: PackageEnvs; }; }) => Promise; /** * Updates a package port mappings */ packageSetPortMappings: (kwargs: { dnpName: string; portMappingsByService: { [serviceName: string]: PortMapping[]; }; options?: { merge: boolean; }; }) => Promise; /** * Stops or starts a package containers * @param timeout seconds to stop the package */ packageStartStop: (kwargs: { dnpName: string; serviceNames?: string[]; options?: { timeout?: number; }; }) => Promise; /** * Changes the user `dappnode`'s password in the host machine * Only allows it if the current password has the salt `insecur3` */ passwordChange: (kwargs: { newPassword: string; }) => Promise; /** * Checks if the user `dappnode`'s password in the host machine * is NOT the insecure default set at installation time. * It does so by checking if the current salt is `insecur3` * * - This check will be run every time this node app is started * - If the password is SECURE it will NOT be run anymore * and this call will return true always * - If the password is INSECURE this check will be run every * time the admin requests it (on page load) * * @returns true = is secure / false = is not */ passwordIsSecure: () => Promise; /** * Shuts down the host machine via the DBus socket */ poweroffHost: () => Promise; /** * Returns ports to open */ portsToOpenGet: () => Promise; /** * Returns ports status from upnp scanning */ portsUpnpStatusGet: (kwargs: { portsToOpen: PortToOpen[]; }) => Promise; /** * Returns ports status from API scanning */ portsApiStatusGet: (kwargs: { portsToOpen: PortToOpen[]; }) => Promise; /** * Reboots the host machine via the DBus socket */ rebootHost: () => Promise; /** * Returns true if a reboot is required */ rebootHostIsRequiredGet: () => Promise; /** Add a release key to trusted keys db */ releaseTrustedKeyAdd(newTrustedKey: TrustedReleaseKey): Promise; /** List all keys from trusted keys db */ releaseTrustedKeyList(): Promise; /** Remove a release key from trusted keys db, by name */ releaseTrustedKeyRemove(keyName: string): Promise; /** * Returns weather or not should show the smooth modal */ getShouldShowSmooth: () => Promise; /** * Sets the status of the smooth modal */ setShouldShownSmooth: (kwargs: { isShown: boolean; }) => Promise; /** * Sets the static IP * @param staticIp New static IP. To enable: "85.84.83.82", disable: "" */ setStaticIp: (kwargs: { staticIp: string; }) => Promise; statsCpuGet: () => Promise; statsMemoryGet: () => Promise; statsDiskGet: () => Promise; /** * Gets bot telegram status */ telegramStatusGet: () => Promise; /** * Sets the status of the telegram bot * @param telegramStatus new status of the bot */ telegramStatusSet: (kwarg: { telegramStatus: boolean; }) => Promise; /** * Get telegram configuration: token and user ID */ telegramConfigGet: () => Promise<{ token: string | null; userId: string | null; }>; /** * Set telegram configuration: token and user ID */ telegramConfigSet: (kwargs: { token: string; userId: string; }) => Promise; /** * Updates and upgrades the host machine */ updateUpgrade: () => Promise; /** * Return the current SSH port from sshd */ sshPortGet: () => Promise; /** * Change the SHH port on the DAppNode host */ sshPortSet: (kwargs: { port: number; }) => Promise; /** * Disable or enable SSH on the DAppNode host */ sshStatusSet: (kwargs: { status: ShhStatus; }) => Promise; /** * Check if SSH is enabled of disabled in the DAppNode host */ sshStatusGet: () => Promise; /** * Returns the current DAppNode system info */ systemInfoGet: () => Promise; /** * Attemps to open ports using UPnP */ natRenewalEnable: (kwargs: { enableNatRenewal: boolean; }) => Promise; /** Returns nat renewal status */ natRenewalIsEnabled: () => Promise; /** * Removes a docker volume by name * @param name Full volume name: "bitcoindnpdappnodeeth_bitcoin_data" */ volumeRemove: (kwargs: { name: string; }) => Promise; /** * Returns volume data */ volumesGet: () => Promise; /** * Returns public Ip in real time */ ipPublicGet: () => Promise; /**Get wifi credentials */ wifiCredentialsGet(): Promise; /** Get wifi report */ wifiReportGet(): Promise; /** Add a device to Wireguard DNP ENVs */ wireguardDeviceAdd(device: string): Promise; /** Remove a device from Wireguard DNP ENVs */ wireguardDeviceRemove(device: string): Promise; /** Get credentials for a single Wireguard device */ wireguardDeviceGet(device: string): Promise; /** Get URLs to a single Wireguard credentials */ wireguardDevicesGet(): Promise; } interface RouteData { /** * If true, all actions will be registered as userActionLogs * Also, each action will be logged at an INFO level */ log?: boolean; } export declare const routesData: { [P in keyof Routes]: RouteData; }; export type RoutesArguments = { [K in keyof Routes]: Parameters; }; export type RoutesReturn = { [K in keyof Routes]: ReplaceVoidWithNull>; }; /** * Returns the return resolved type of a function type */ export type ResolvedType Promise> = T extends (...args: any) => Promise ? R : never; export type ReplaceVoidWithNull = T extends void ? null : T; export {}; //# sourceMappingURL=routes.d.ts.map