UNPKG

@filesrocket/amazons3

Version:

Filerocket service to manage files from Amazon S3

24 lines (23 loc) 981 B
import { Paginated, OutputEntity } from '@filesrocket/core'; import S3 from 'aws-sdk/clients/s3'; import { AmazonConfig, ParamsUrl, Operation } from './declarations'; export declare class BaseAmazonRocket { protected readonly options: AmazonConfig; protected s3: S3; constructor(options: AmazonConfig); /** * Create a Bucket Amazon S3. Amazon S3 buckets, which are * similar to file folders, store objects, which consist * of data and its descriptive metadata. * @param name Bucket name. */ protected createBucket(name: string): Promise<string>; protected paginate(data: S3.ListObjectsV2Output): Paginated<OutputEntity>; /** * Generate a url for the files. * @param operation Operation. * @param params Params. */ protected generateUrl(operation: Operation, params: Partial<ParamsUrl>): string; protected builder(payload: S3.Object, query: Partial<ParamsUrl>): OutputEntity; }