import { Uploader , Downloader } from 'teleport/Console/services/fileTransfer' ; import StoreFiles from './storeFiles' ; export class Scp { store = new StoreFiles ( ) ; constructor ( { clusterId , serverId , login } ) { this . store = new StoreFiles ( { clusterId , serverId , login , } ) ; } removeFile ( id ) { this . store . remove ( id ) ; } updateFile ( partial ) { this . store . update ( partial ) ; } addDownload ( location ) { this . store . add ( { location , name : location , isUpload : false , blob : [ ] , } ) ; } addUpload ( location , filename , blob ) { this . store . add ( { location , name : filename , isUpload : true , blob , } ) ; } isTransfering ( ) { return this . store . state . files . some ( f => f . status === 'processing' ) ; } createUploader ( ) { return new Uploader ( ) ; } createDownloader ( ) { return new Downloader ( ) ; } } type ScpParams = { clusterId : string ; serverId : string ; login : string ; } ;