Documentation
    Preparing search index...

    Storage adapter implementing Google Firebase Storage integration. Uses firebase-admin to manage files, metadata, and signed URLs seamlessly across Firebase buckets.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _alias: string = ''
    _client: any
    _params: StorageParameters = {}

    Methods

    • Parameters

      • file: FileType
      • size: number
      • workingDir: string
      • bucketDir: string
      • thumbnailExtension: string
      • imagePath: string

      Returns Promise<{ [key: string]: string }>

    • Parameters

      Returns { bucketDir: any; extension: any; name: any }

    • Parameters

      • workingDirName: string

      Returns Promise<string>

    • Copies a file internally across or within Firebase buckets.

      Parameters

      Returns Promise<void>

    • Uploads a local file stream to a designated Firebase Storage bucket.

      Parameters

      • File: FileType

        Target file configuration.

      • stream: Readable

        Readable stream containing file data.

      Returns Promise<FileType>

      A promise resolving to the saved File footprint.

    • Deletes a file permanently from Firebase Storage.

      Parameters

      Returns Promise<boolean>

      True if deleted successfully.

    • Downloads a file from Firebase storage locally.

      Parameters

      Returns Promise<string | Buffer<ArrayBufferLike>>

      A promise resolving to the local file path or raw buffer data.

    • Extracts the first page of a document (e.g. PDF) via ImageMagick, resizes it, and uploads it as a thumbnail.

      Parameters

      • file: FileType

        Original document footprint.

      • sizes: number[]

        Array of desired thumbnail dimensions (px).

      Returns Promise<any>

      A mapping of generated thumbnail identifiers to their respective storage refs.

    • Downloads an image, generates resized thumbnails via sharp, and uploads them back.

      Parameters

      • file: FileType

        Original image footprint.

      • sizes: number[]

        Array of desired thumbnail dimensions (px).

      Returns Promise<any>

      A mapping of generated thumbnail identifiers to their respective storage refs.

    • Entry point for thumbnail generation. Analyzes the content type and automatically delegates to the appropriate generation strategy (Image, Video, or Document).

      Parameters

      • file: FileType

        Target file footprint.

      • sizes: number[]

        Desired dimensions.

      Returns Promise<any>

      The generated thumbnail map, or an empty object if unsupported/failed.

    • Extracts a single frame from a remote video via ffmpeg, resizes it, and uploads the frame as an image thumbnail.

      Parameters

      • file: FileType

        Original video footprint.

      • sizes: number[]

        Array of desired thumbnail dimensions (px).

      Returns Promise<any>

      A mapping of generated thumbnail identifiers to their respective storage refs.

    • Computes statistics for a given bucket.

      Parameters

      • Optionalbucket: string

        Target bucket name.

      • Optionalprefix: string

        Optional directory prefix.

      Returns Promise<BucketStatsType>

      A promise resolving to bucket statistics.

    • Provides access to the initialized Firebase getStorage() driver.

      Returns Storage

      The Firebase Storage instance.

    • Fetches explicit file metadata from Firebase, appending it to the footprint.

      Parameters

      Returns Promise<FileType>

      A promise resolving to the file augmented with Firebase metadata.

    • Downloads the file content locally into memory and wraps it in a Readable stream. Use carefully on large files to prevent buffer overflow.

      Parameters

      Returns Promise<Readable>

      A promise resolving to a Readable buffer stream.

      If the file doesn't exist on the remote bucket.

    • Generates a signed access URL using firebase-admin.

      Parameters

      • fileData: FileType

        The file to expose.

      • expiresIn: number = 7200

        Expiration in seconds.

      • Optionalaction: string

        The requested action (e.g. 'read', 'write').

      • Optionalextra: any

        Optional Firebase signed URL overrides.

      Returns Promise<FileResponseUrlType>

      A promise resolving to the signed URL payload.

    • Checks if the file is a video or audio stream based on its MIME type or file extension.

      Parameters

      Returns boolean

      True if the file represents a video or audio asset.

    • Moves a file internally across or within Firebase buckets.

      Parameters

      Returns Promise<void>

    • Creates a readable stream and directly pipes it into an active response.

      Parameters

      • file: FileType

        Target file.

      • res: any

        Output writable stream.

      Returns Promise<any>

      The piped stream instance.