http-response-helper
Version:
HTTP-Response-Helper is a utility library for sending HTTP responses with the correct status code.
91 lines (90 loc) • 4.35 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpStatusCodes = void 0;
exports.HttpStatusCodes = {
CONTINUE: { code: 100, status: "Continue" },
SWITCHING_PROTOCOLS: { code: 101, status: "Switching Protocols" },
PROCESSING: { code: 102, status: "Processing" },
EARLY_HINTS: { code: 103, status: "Early Hints" },
UPLOAD_RESUMPTION_SUPPORTED: {
code: 104,
status: "Upload Resumption Supported",
},
OK: { code: 200, status: "OK" },
CREATED: { code: 201, status: "Created" },
ACCEPTED: { code: 202, status: "Accepted" },
NON_AUTHORITATIVE_INFORMATION: {
code: 203,
status: "Non-Authoritative Information",
},
NO_CONTENT: { code: 204, status: "No Content" },
RESET_CONTENT: { code: 205, status: "Reset Content" },
PARTIAL_CONTENT: { code: 206, status: "Partial Content" },
MULTI_STATUS: { code: 207, status: "Multi-Status" },
ALREADY_REPORTED: { code: 208, status: "Already Reported" },
IM_USED: { code: 226, status: "IM Used" },
MULTIPLE_CHOICES: { code: 300, status: "Multiple Choices" },
MOVED_PERMANENTLY: { code: 301, status: "Moved Permanently" },
FOUND: { code: 302, status: "Found" },
SEE_OTHER: { code: 303, status: "See Other" },
NOT_MODIFIED: { code: 304, status: "Not Modified" },
USE_PROXY: { code: 305, status: "Use Proxy" },
UNUSED_306: { code: 306, status: "Unused" },
TEMPORARY_REDIRECT: { code: 307, status: "Temporary Redirect" },
PERMANENT_REDIRECT: { code: 308, status: "Permanent Redirect" },
BAD_REQUEST: { code: 400, status: "Bad Request" },
UNAUTHORIZED: { code: 401, status: "Unauthorized" },
PAYMENT_REQUIRED: { code: 402, status: "Payment Required" },
FORBIDDEN: { code: 403, status: "Forbidden" },
NOT_FOUND: { code: 404, status: "Not Found" },
METHOD_NOT_ALLOWED: { code: 405, status: "Method Not Allowed" },
NOT_ACCEPTABLE: { code: 406, status: "Not Acceptable" },
PROXY_AUTHENTICATION_REQUIRED: {
code: 407,
status: "Proxy Authentication Required",
},
REQUEST_TIMEOUT: { code: 408, status: "Request Timeout" },
CONFLICT: { code: 409, status: "Conflict" },
GONE: { code: 410, status: "Gone" },
LENGTH_REQUIRED: { code: 411, status: "Length Required" },
PRECONDITION_FAILED: { code: 412, status: "Precondition Failed" },
CONTENT_TOO_LARGE: { code: 413, status: "Content Too Large" },
URI_TOO_LONG: { code: 414, status: "URI Too Long" },
UNSUPPORTED_MEDIA_TYPE: { code: 415, status: "Unsupported Media Type" },
RANGE_NOT_SATISFIABLE: { code: 416, status: "Range Not Satisfiable" },
EXPECTATION_FAILED: { code: 417, status: "Expectation Failed" },
UNUSED_418: { code: 418, status: "Unused" },
MISDIRECTED_REQUEST: { code: 421, status: "Misdirected Request" },
UNPROCESSABLE_CONTENT: { code: 422, status: "Unprocessable Content" },
LOCKED: { code: 423, status: "Locked" },
FAILED_DEPENDENCY: { code: 424, status: "Failed Dependency" },
TOO_EARLY: { code: 425, status: "Too Early" },
UPGRADE_REQUIRED: { code: 426, status: "Upgrade Required" },
PRECONDITION_REQUIRED: { code: 428, status: "Precondition Required" },
TOO_MANY_REQUESTS: { code: 429, status: "Too Many Requests" },
REQUEST_HEADER_FIELDS_TOO_LARGE: {
code: 431,
status: "Request Header Fields Too Large",
},
UNAVAILABLE_FOR_LEGAL_REASONS: {
code: 451,
status: "Unavailable For Legal Reasons",
},
INTERNAL_SERVER_ERROR: { code: 500, status: "Internal Server Error" },
NOT_IMPLEMENTED: { code: 501, status: "Not Implemented" },
BAD_GATEWAY: { code: 502, status: "Bad Gateway" },
SERVICE_UNAVAILABLE: { code: 503, status: "Service Unavailable" },
GATEWAY_TIMEOUT: { code: 504, status: "Gateway Timeout" },
HTTP_VERSION_NOT_SUPPORTED: {
code: 505,
status: "HTTP Version Not Supported",
},
VARIANT_ALSO_NEGOTIATES: { code: 506, status: "Variant Also Negotiates" },
INSUFFICIENT_STORAGE: { code: 507, status: "Insufficient Storage" },
LOOP_DETECTED: { code: 508, status: "Loop Detected" },
NOT_EXTENDED: { code: 510, status: "Not Extended" },
NETWORK_AUTHENTICATION_REQUIRED: {
code: 511,
status: "Network Authentication Required",
},
};