UNPKG

balena-cli

Version:

The official balena Command Line Interface

43 lines (42 loc) 2.1 kB
import * as _ from 'lodash'; import { ExpectedError } from '../errors'; export declare class SshPermissionDeniedError extends ExpectedError { } export declare class RemoteCommandError extends ExpectedError { cmd: string; exitCode?: number; exitSignal?: NodeJS.Signals; constructor(cmd: string, exitCode?: number, exitSignal?: NodeJS.Signals); } export interface SshRemoteCommandOpts { cmd?: string; hostname: string; ignoreStdin?: boolean; port?: number | 'cloud' | 'local'; proxyCommand?: string[]; username?: string; verbose?: boolean; } export declare const stdioIgnore: { stdin: 'ignore'; stdout: 'ignore'; stderr: 'ignore'; }; export declare function sshArgsForRemoteCommand({ cmd, hostname, ignoreStdin, port, proxyCommand, username, verbose, }: SshRemoteCommandOpts): string[]; export declare function runRemoteCommand({ cmd, hostname, port, proxyCommand, stdin, stdout, stderr, username, verbose, }: SshRemoteCommandOpts & { stdin?: 'ignore' | 'inherit' | NodeJS.ReadableStream; stdout?: 'ignore' | 'inherit' | NodeJS.WritableStream; stderr?: 'ignore' | 'inherit' | NodeJS.WritableStream; }): Promise<void>; export declare function getRemoteCommandOutput({ cmd, hostname, port, proxyCommand, stdin, stdout, stderr, username, verbose, }: SshRemoteCommandOpts & { stdin?: 'ignore' | 'inherit' | NodeJS.ReadableStream; stdout?: 'capture' | 'ignore' | 'inherit' | NodeJS.WritableStream; stderr?: 'capture' | 'ignore' | 'inherit' | NodeJS.WritableStream; }): Promise<{ stdout: Buffer; stderr: Buffer; }>; export declare function getLocalDeviceCmdStdout(hostname: string, cmd: string, stdout?: 'capture' | 'ignore' | 'inherit' | NodeJS.WritableStream): Promise<Buffer>; export declare const isRootUserGood: ((hostname: string, port: any) => Promise<boolean>) & _.MemoizedFunction; export declare const findBestUsernameForDevice: ((hostname: string, port: any) => Promise<string>) & _.MemoizedFunction; export declare const getDeviceOsRelease: ((hostname: string) => Promise<string>) & _.MemoizedFunction;