@interopio/desktop-cli
Version:
io.Connect Desktop Seed Repository CLI Tools
53 lines • 1.5 kB
TypeScript
export interface DownloadOptions {
url: string;
targetPath: string;
filename?: string;
useCache?: boolean;
maxRetries?: number;
timeout?: number;
headers?: Record<string, string>;
}
export interface ProxyConfig {
host: string;
port: number;
protocol: 'http' | 'https';
auth?: {
username: string;
password: string;
};
}
export interface SSLConfig {
rejectUnauthorized?: boolean;
ca?: string | Buffer;
cert?: string | Buffer;
key?: string | Buffer;
}
export interface CacheConfig {
enabled: boolean;
directory?: string;
maxAge?: number;
maxSize?: number;
}
export declare class ComponentDownloader {
private proxyConfig?;
private sslConfig?;
private httpClient;
private cacheDir;
private cacheConfig;
constructor(proxyConfig?: ProxyConfig | undefined, sslConfig?: SSLConfig | undefined, cacheConfig?: Partial<CacheConfig>);
private createHttpClient;
private buildProxyUrl;
downloadComponent(options: DownloadOptions): Promise<string>;
extractComponent(archivePath: string, extractPath: string): Promise<void>;
private extractZip;
private extractTar;
private extractFilenameFromUrl;
private getCacheKey;
private getCachedFile;
private cacheFile;
private removeCacheEntry;
private cleanupCache;
clearCache(): Promise<void>;
static fromEnvironment(): ComponentDownloader;
}
//# sourceMappingURL=component-downloader.d.ts.map