@squidcloud/client
    Preparing search index...

    Class StorageClient

    StorageClient provides methods for managing files in a storage system (like S3).

    Index

    Methods

    • Deletes a single file from a specified path within the bucket.

      Parameters

      • filePathInBucket: string

        The path of the file within the bucket to be deleted.

      Returns Promise<void>

      A promise that resolves to void when the file has been deleted.

    • Deletes multiple files from specified paths within the bucket.

      Parameters

      • filePathsInBucket: string[]

        An array of paths for the files within the bucket to be deleted.

      Returns Promise<void>

      A promise that resolves to void when all specified files have been deleted.

    • Generates a URL for downloading a file from a specified path within the bucket.

      Parameters

      • filePathInBucket: string

        The path of the file within the bucket for which to generate the download URL.

      • OptionalurlExpirationInSeconds: number

        Optional expiration time in seconds for the download URL.

      Returns Promise<GetDownloadUrlResponse>

      A promise that resolves to a GetDownloadUrlResponse containing the download URL.

    • Retrieves metadata for a file located in a specified path within the bucket.

      Parameters

      • filePathInBucket: string

        The path of the file within the bucket.

      Returns Promise<GetFileMetadataResponse>

      A promise that resolves to a GetFileMetadataResponse containing the file's metadata.

    • Lists the contents of a directory within the bucket.

      Parameters

      • dirPathInBucket: string

        The path of the directory within the bucket.

      Returns Promise<ListDirectoryContentsResponse>

      A promise that resolves to a ListDirectoryContentsResponse containing the directory contents.

    • Uploads a file to a specified directory within the bucket.

      Parameters

      • dirPathInBucket: string

        The directory path within the bucket where the file should be uploaded.

      • file: File

        The file to upload.

      • OptionalexpirationInSeconds: number

        Optional expiration time in seconds for the upload.

      Returns Promise<void>

      A promise that resolves to void when the upload is complete.