Helper class useful for cases when:

  • response is not available in traditional sense (eg. lambda environment, fiddle, tests)
  • we need to run code that is dependant on having an editable response (cache revalidation)

Hierarchy

  • LambdaResponse

Implements

Constructors

  • Parameters

    • Optional responseStream: Writable
    • isDirectStream: boolean = false
    • originalStream: undefined | Writable = undefined

    Returns LambdaResponse

Properties

body?: string | Buffer

The response body as a string or a Buffer

chunks: any[] = []
encodedChunks: any[] = []
isDirectStream: boolean = false
isDownstreamInit: boolean = false
isEnded: boolean = false
isHeadersStreamed: boolean = false
isStreamableCallback: (() => boolean) = ...

Type declaration

    • (): boolean
    • Returns boolean

isStreaming: boolean = false
originalStream: undefined | Writable = undefined
statusCode: number

The HTTP status code

statusMessage?: string

The HTTP status message

Methods

  • Returns void

  • Returns void

  • Returns Promise<void>

  • Returns {
        body: undefined | string | Buffer;
        headers: ResponseHeaders;
        statusCode: number;
        statusMessage: undefined | string;
    }

    • body: undefined | string | Buffer
    • headers: ResponseHeaders
    • statusCode: number
    • statusMessage: undefined | string
  • Gets the first value of a header

    Returns

    The value of the header

    Parameters

    • name: string

      The name of the header to return

    Returns unknown

  • Returns void

  • Returns boolean

  • Returns boolean

  • Removes a header

    Parameters

    • name: string

      The header to remove

    Returns void

  • Parameters

    • data: string

    Returns void

  • Parameters

    • value: Writable

    Returns void

  • Parameters

    • value: boolean

    Returns void

  • Parameters

    • value: Writable

    Returns void

  • Sets a header

    Parameters

    • name: string

      The name of the header to set

    • value: unknown

      The value to set

    Returns void

  • Parameters

    • callback: boolean | (() => boolean)

    Returns undefined | (() => boolean)

  • Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Returns void

  • Returns Promise<boolean | void>

  • Parameters

    • chunk: string | Buffer

    Returns Promise<void>

Generated using TypeDoc