idea-aws
    Preparing search index...

    Class S3

    A wrapper for AWS Simple Storage Service.

    Index

    Constructors

    Properties

    client: S3Client
    DEFAULT_DOWNLOAD_BUCKET: string = 'idea-downloads'
    DEFAULT_DOWNLOAD_BUCKET_PREFIX: string = 'common'
    DEFAULT_DOWNLOAD_BUCKET_SEC_TO_EXP: number = 180
    DEFAULT_UPLOAD_BUCKET_SEC_TO_EXP: number = 300
    logger: LambdaLogger = ...

    Methods

    • Make a copy of an object of the bucket. In a versioned bucket, the output carries the version the copy created.

      Parameters

      Returns Promise<CopyObjectCommandOutput>

    • Create a download link of a piece of data (through S3). Practically, it uploads the file on an S3 bucket, generating and returning a url to it. The data must be entirely in memory (a string or bytes): the upload is a single PutObject, which needs the content length up front, so streams aren't supported.

      Parameters

      Returns Promise<SignedURL>

    • Get an object from a S3 bucket and convert the content to string. If the object was stored with Content-Encoding: gzip, it is decompressed transparently.

      Parameters

      Returns Promise<string>

    • Get the head of an object of an S3 bucket (its size, type and metadata, without the content). It fails when the object doesn't exist.

      Parameters

      Returns Promise<HeadObjectCommandOutput>

    • Get a signed URL to get a file on a S3 bucket.

      Parameters

      Returns Promise<SignedURL>

    • Get a signed URL to put a file on a S3 bucket.

      Parameters

      Returns Promise<SignedURL>