Constructs a new Response object with the given status code, body, and optional behavior.
The HTTP status code of the response.
The body of the response.
OptionaloptBehaviour: { Optional behavior configuration for the response.
OptionaldisableOptionalrawIndicates whether the response body should be treated as raw data.
OptionalshouldIndicates whether the response should be streamed.
OptionalthrowIndicates whether errors should be thrown for non-successful status codes.
ReadonlydisableIndicates whether the transaction ID is disabled.
ReadonlyrawIndicates whether the request body should be treated as raw data.
ReadonlyshouldDetermines whether streaming is enabled or not.
ReadonlythrowA boolean flag indicating whether to throw an error when encountering errors. If set to true, any errors encountered will result in an exception being thrown. If set to false, errors will be logged but the program will continue execution.
Builds the response for the given context and transaction.
The context object.
The transaction object.
Optional flag to indicate whether to call the context or not.
StaticBadCreates a BadRequestResponse object with the given parameters.
Optionalmsg: stringThe error message.
OptionalerrCode: stringThe error code.
OptionaloptBody: anyOptional additional body data.
StaticBadCreates a BadRequestResponse object with rollback option.
The error message.
OptionalerrCode: stringThe error code.
OptionaloptBody: anyOptional body to include in the response.
StaticMissingGenerates a response object for a missing path parameter error.
The name of the missing path parameter.
StaticMissingCreates a response object for a missing query parameter error.
The name of the missing query parameter.
StaticRedirectStaticSimpleCreates a simple HTTP response with the given body and optional status code.
The body of the response.
OptionaloptionalCode: numberThe optional status code of the response. Defaults to 200.
StaticStepStaticSuccessStaticSuccessStaticSuccessCreates a success response object with a streaming body and specified content type.
The stream object to be used as the response body.
The content type of the response.
StaticUnauthorizedCreates an unauthorized response with the given error message and error code.
The error message.
OptionalerrCode: stringThe error code (optional).
Represents a response object with various methods for building and manipulating the response.