s3-cli-js
Version:
A TypeScript-based npm package that replaces AWS CLI for S3 operations using presigned URLs
58 lines • 1.74 kB
TypeScript
/**
* S3 Client implementation using presigned URLs and direct HTTP requests
*/
import { S3Config, S3Bucket, ListObjectsOptions, ListObjectsResult, PresignedUrlOptions, ProgressCallback } from './types';
export declare class S3ClientWrapper {
private client;
private config;
constructor(config: S3Config);
/**
* List all buckets
*/
listBuckets(): Promise<S3Bucket[]>;
/**
* List objects in a bucket
*/
listObjects(options: ListObjectsOptions): Promise<ListObjectsResult>;
/**
* Create a bucket
*/
createBucket(bucketName: string): Promise<void>;
/**
* Delete a bucket
*/
deleteBucket(bucketName: string): Promise<void>;
/**
* Check if object exists
*/
objectExists(bucket: string, key: string): Promise<boolean>;
/**
* Get object metadata
*/
getObjectMetadata(bucket: string, key: string): Promise<{
size: number;
lastModified: Date;
etag: string;
} | null>;
/**
* Generate presigned URL for S3 operations
*/
getPresignedUrl(options: PresignedUrlOptions): Promise<string>;
/**
* Upload file using presigned URL and direct HTTP
*/
uploadFile(filePath: string, bucket: string, key: string, onProgress?: ProgressCallback): Promise<void>;
/**
* Download file using presigned URL and direct HTTP
*/
downloadFile(bucket: string, key: string, filePath: string, onProgress?: ProgressCallback): Promise<void>;
/**
* Delete object using presigned URL
*/
deleteObject(bucket: string, key: string): Promise<void>;
/**
* Make direct HTTP request
*/
private httpRequest;
}
//# sourceMappingURL=s3-client.d.ts.map