TypeDoc all the thngs

This commit is contained in:
2021-03-25 08:50:13 -05:00
parent 7cb0546b01
commit fad1184afe
52 changed files with 976 additions and 3 deletions

View File

@@ -1,14 +1,24 @@
import {HTTPStatus} from "@extollo/util"
import {Request} from "../lifecycle/Request"
/**
* Abstract class that defines "factory" that knows how to write a particular
* response to the response object.
*/
export abstract class ResponseFactory {
/** The status that should be set on the response. */
protected targetStatus: HTTPStatus = HTTPStatus.OK
/**
* Called to write the response data to the HTTP response object.
* @param request
*/
public async write(request: Request): Promise<Request> {
request.response.setStatus(this.targetStatus)
return request
}
/** Set the target status of this factory. */
public status(status: HTTPStatus) {
this.targetStatus = status
return this