@cumulus/ingest
Version:
Ingest utilities
94 lines • 3.34 kB
TypeScript
export = SftpProviderClient;
/**
* @typedef {import('./recursion').RecursionFile} RecursionFile
*/
declare class SftpProviderClient {
/**
*
* @param {Object} providerConfig
* @param {string} providerConfig.username
* @param {string} providerConfig.password
* @param {string} providerConfig.plaintextProviderKey
* @param {string} providerConfig.host
* @param {string} providerConfig.privateKey
* @param {string} providerConfig.cmKeyId
*/
constructor(providerConfig: {
username: string;
password: string;
plaintextProviderKey: string;
host: string;
privateKey: string;
cmKeyId: string;
});
providerConfig: {
username: string;
password: string;
plaintextProviderKey: string;
host: string;
privateKey: string;
cmKeyId: string;
};
plaintextUsername: string | undefined;
plaintextPassword: string | undefined;
plaintextPrivateKey: string | undefined;
connected: boolean;
privateSftpClient: SftpClient | undefined;
connect(): Promise<void>;
end(): Promise<void>;
get host(): string;
getUsername(): Promise<string | undefined>;
getPassword(): Promise<string | undefined>;
getPrivateKey(): Promise<string | undefined>;
plaintextProviderKey: string | undefined;
/** @private
* @returns {SftpClient}
*/
private getSftpClient;
/**
* Download a remote file to disk
* @param {Object} params - parameter object
* @param {string} params.remotePath - the full path to the remote file to be fetched
* @param {string} params.localPath - the full local destination file path
* @param {boolean} params.fastDownload - whether fast download is performed using parallel reads
* @returns {Promise<void>} - the path that the file was saved to
*/
download(params: {
remotePath: string;
localPath: string;
fastDownload: boolean;
}): Promise<void>;
/**
* List all files from a given endpoint
*
* @param {string} path - the path to list
* @returns {Promise<Array<Pick<RecursionFile, "name">>>}
*/
list(path: string): Promise<Array<Pick<RecursionFile, "name">>>;
/**
* Transfer the remote file to a given s3 location
*
* @param {Object} params
* @param {string} params.fileRemotePath - the full path to the remote file to be fetched
* @param {string} params.destinationBucket - destination s3 bucket of the file
* @param {string} params.destinationKey - destination s3 key of the file
* @param {boolean} params.fastDownload - whether fast download is performed using parallel reads
* @returns {Promise<{ s3uri: string, etag?: string }>} an object containing
* the S3 URI and ETag of the destination file
*/
sync(params: {
fileRemotePath: string;
destinationBucket: string;
destinationKey: string;
fastDownload: boolean;
}): Promise<{
s3uri: string;
etag?: string;
}>;
}
declare namespace SftpProviderClient {
export { RecursionFile };
}
import { SftpClient } from "@cumulus/sftp-client";
type RecursionFile = import('./recursion').RecursionFile;
//# sourceMappingURL=SftpProviderClient.d.ts.map