Documentation
    Preparing search index...

    A purely in-memory storage adapter designed for unit tests and local mock integrations. Files are temporarily stored in a Node.js Map<string, Buffer>.

    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>

    • Duplicates a buffer map entry to a new key.

      Parameters

      Returns Promise<any>

      True upon success.

    • Concatenates the readable stream into a buffer and stores it in memory.

      Parameters

      • file: FileType

        Target footprint.

      • stream: Readable

        Data stream.

      Returns Promise<FileType>

      A promise resolving to the saved footprint.

    • Erases the file from the memory map.

      Parameters

      Returns Promise<boolean>

      True if an element was removed.

    • 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 (mock implementation).

      Parameters

      • Optionalbucket: string

        Target bucket name.

      • Optionalprefix: string

        Optional directory prefix.

      Returns Promise<BucketStatsType>

      A promise resolving to bucket statistics.

    • Returns the in-memory Map acting as the driver.

      Returns Map<string, Buffer<ArrayBufferLike>>

      The map containing buffered files.

    • Creates a readable stream from the memory buffer.

      Parameters

      Returns Promise<Readable>

      The generated stream.

      If the buffer doesn't exist.

    • Returns a mock upload endpoint URL.

      Parameters

      Returns Promise<any>

      A mock string upload URL.

    • Returns a mock URL pointing to a fictitious test domain.

      Parameters

      Returns Promise<any>

      A mock string URL.

    • 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.

    • Pipes the buffered memory content directly into an output response.

      Parameters

      • file: FileType

        Target footprint.

      • res: any

        Output writable stream.

      Returns Promise<any>

      If the file is missing from memory.