UNPKG

bit-bin

Version:

<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b

70 lines (69 loc) 3.84 kB
import SSH2 from 'ssh2'; import ComponentObjects from '../../component-objects'; import { RemoteScopeNotFound, UnexpectedNetworkError, PermissionDenied, OldClientVersion } from '../exceptions'; import { BitIds, BitId } from '../../../bit-id'; import ComponentNotFound from '../../../scope/exceptions/component-not-found'; import { ScopeDescriptor } from '../../scope'; import ConsumerComponent from '../../../consumer/component'; import { Network } from '../network'; import RemovedObjects from '../../removed-components'; import MergeConflictOnRemote from '../../exceptions/merge-conflict-on-remote'; import { ListScopeResult } from '../../../consumer/component/components-list'; import CustomError from '../../../error/custom-error'; import ExportAnotherOwnerPrivate from '../exceptions/export-another-owner-private'; import DependencyGraph from '../../graph/scope-graph'; import { ComponentLogs } from '../../models/model-component'; export declare type SSHProps = { path: string; username: string; port: number; host: string; }; export declare type SSHConnectionStrategyName = 'token' | 'ssh-agent' | 'ssh-key' | 'user-password' | 'anonymous'; export declare const DEFAULT_STRATEGIES: SSHConnectionStrategyName[]; export declare const DEFAULT_READ_STRATEGIES: SSHConnectionStrategyName[]; export default class SSH implements Network { connection: SSH2 | null | undefined; path: string; username: string; port: number; host: string; _sshUsername?: string; constructor({ path, username, port, host }: SSHProps); connect(strategiesNames?: SSHConnectionStrategyName[]): Promise<SSH>; _tokenAuthentication(): Promise<SSH>; _anonymousAuthentication(): Promise<SSH>; _sshAgentAuthentication(): Promise<SSH>; _sshKeyAuthentication(): Promise<SSH>; _userPassAuthentication(): Promise<SSH>; close(): this; _composeBaseObject(passphrase?: string): { username: string; host: string; port: number; passphrase: string | undefined; readyTimeout: number; }; _composeTokenAuthObject(): Record<string, any> | null | undefined; _composeAnonymousAuthObject(): Record<string, any> | null | undefined; _composeUserPassObject(): Promise<any>; _hasAgentSocket(): boolean; _connectWithConfig(sshConfig: Record<string, any>, authenticationType: string, authFailedMsg: string): Promise<SSH>; buildCmd(commandName: string, path: string, payload: any, context: any): string; exec(commandName: string, payload?: any, context?: Record<string, any>): Promise<any>; errorHandler(code: number, err: string): MergeConflictOnRemote | ComponentNotFound | CustomError | RemoteScopeNotFound | PermissionDenied | UnexpectedNetworkError | OldClientVersion | ExportAnotherOwnerPrivate; _unpack(data: any, base64?: boolean): any; pushMany(manyComponentObjects: ComponentObjects[], context?: Record<string, any>): Promise<string[]>; deleteMany(ids: string[], force: boolean, context?: Record<string, any>): Promise<ComponentObjects[] | RemovedObjects>; deprecateMany(ids: string[], context?: Record<string, any>): Promise<ComponentObjects[]>; undeprecateMany(ids: string[], context?: Record<string, any>): Promise<ComponentObjects[]>; push(componentObjects: ComponentObjects): Promise<string[]>; describeScope(): Promise<ScopeDescriptor>; list(namespacesUsingWildcards?: string): Promise<ListScopeResult[]>; latestVersions(componentIds: BitId[]): Promise<string[]>; search(query: string, reindex: boolean): Promise<any>; show(id: BitId): Promise<ConsumerComponent | null | undefined>; log(id: BitId): Promise<ComponentLogs>; graph(bitId?: BitId): Promise<DependencyGraph>; fetch(ids: BitIds, noDeps?: boolean, context?: Record<string, any>): Promise<ComponentObjects[]>; }