@anot/http-response-builder
Version:
A robust and type-safe library for constructing HTTP responses with optional paging and metadata. Designed for TypeScript and JavaScript, it ensures correct typing while simplifying the creation of various HTTP response types.
60 lines (59 loc) • 1.86 kB
TypeScript
export declare enum HttpStatusCode {
CONTINUE = 100,
SWITCHING_PROTOCOLS = 101,
PROCESSING = 102,
OK = 200,
CREATED = 201,
ACCEPTED = 202,
NON_AUTHORITATIVE_INFORMATION = 203,
NO_CONTENT = 204,
RESET_CONTENT = 205,
PARTIAL_CONTENT = 206,
MULTIPLE_CHOICES = 300,
MOVED_PERMANENTLY = 301,
FOUND = 302,
SEE_OTHER = 303,
NOT_MODIFIED = 304,
TEMPORARY_REDIRECT = 307,
PERMANENT_REDIRECT = 308,
BAD_REQUEST = 400,
UNAUTHORIZED = 401,
PAYMENT_REQUIRED = 402,
FORBIDDEN = 403,
NOT_FOUND = 404,
INTERNAL_SERVER_ERROR = 500,
NOT_IMPLEMENTED = 501,
BAD_GATEWAY = 502,
SERVICE_UNAVAILABLE = 503,
GATEWAY_TIMEOUT = 504
}
export declare enum HttpStatusMessage {
CONTINUE = "Continue",
SWITCHING_PROTOCOLS = "Switching Protocols",
PROCESSING = "Processing",
OK = "OK",
CREATED = "Created",
ACCEPTED = "Accepted",
NON_AUTHORITATIVE_INFORMATION = "Non-Authoritative Information",
NO_CONTENT = "No Content",
RESET_CONTENT = "Reset Content",
PARTIAL_CONTENT = "Partial Content",
MULTIPLE_CHOICES = "Multiple Choices",
MOVED_PERMANENTLY = "Moved Permanently",
FOUND = "Found",
SEE_OTHER = "See Other",
NOT_MODIFIED = "Not Modified",
TEMPORARY_REDIRECT = "Temporary Redirect",
PERMANENT_REDIRECT = "Permanent Redirect",
BAD_REQUEST = "Bad Request",
UNAUTHORIZED = "Unauthorized",
PAYMENT_REQUIRED = "Payment Required",
FORBIDDEN = "Forbidden",
NOT_FOUND = "Not Found",
INTERNAL_SERVER_ERROR = "Internal Server Error",
NOT_IMPLEMENTED = "Not Implemented",
BAD_GATEWAY = "Bad Gateway",
SERVICE_UNAVAILABLE = "Service Unavailable",
GATEWAY_TIMEOUT = "Gateway Timeout"
}
export declare function getHttpStatusMessage(code: HttpStatusCode): HttpStatusMessage | undefined;