Socket
Socket
Sign inDemoInstall

http-status-codes

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-status-codes - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

598

build/index.d.ts

@@ -1,301 +0,1 @@

import { StatusCodes, ReasonPhrases } from './codes';
/**
* Returns the reason phrase for the given status code.
* If the given status code does not exist, an error is thrown.
*
* @param {number|string} statusCode The HTTP status code
* @returns {string} The associated reason phrase (e.g. "Bad Request", "OK")
* */
export declare function getReasonPhrase(statusCode: (number | string)): (string);
/**
* Returns the status code for the given reason phrase.
* If the given reason phrase does not exist, undefined is returned.
*
* @param {string} reasonPhrase The HTTP reason phrase (e.g. "Bad Request", "OK")
* @returns {string} The associated status code
* */
export declare function getStatusCode(reasonPhrase: string): (number);
/**
* @deprecated
*
* Returns the reason phrase for the given status code.
* If the given status code does not exist, undefined is returned.
*
* Deprecated in favor of getReasonPhrase
*
* @param {number|string} statusCode The HTTP status code
* @returns {string|undefined} The associated reason phrase (e.g. "Bad Request", "OK")
* */
export declare const getStatusText: typeof getReasonPhrase;
export { StatusCodes, ReasonPhrases, };
/**
* @deprecated Please use StatusCodes.ACCEPTED
*
* */
export declare const ACCEPTED = 202;
/**
* @deprecated Please use StatusCodes.BAD_GATEWAY
*
* */
export declare const BAD_GATEWAY = 502;
/**
* @deprecated Please use StatusCodes.BAD_REQUEST
*
* */
export declare const BAD_REQUEST = 400;
/**
* @deprecated Please use StatusCodes.CONFLICT
*
* */
export declare const CONFLICT = 409;
/**
* @deprecated Please use StatusCodes.CONTINUE
*
* */
export declare const CONTINUE = 100;
/**
* @deprecated Please use StatusCodes.CREATED
*
* */
export declare const CREATED = 201;
/**
* @deprecated Please use StatusCodes.EXPECTATION_FAILED
*
* */
export declare const EXPECTATION_FAILED = 417;
/**
* @deprecated Please use StatusCodes.FAILED_DEPENDENCY
*
* */
export declare const FAILED_DEPENDENCY = 424;
/**
* @deprecated Please use StatusCodes.FORBIDDEN
*
* */
export declare const FORBIDDEN = 403;
/**
* @deprecated Please use StatusCodes.GATEWAY_TIMEOUT
*
* */
export declare const GATEWAY_TIMEOUT = 504;
/**
* @deprecated Please use StatusCodes.GONE
*
* */
export declare const GONE = 410;
/**
* @deprecated Please use StatusCodes.HTTP_VERSION_NOT_SUPPORTED
*
* */
export declare const HTTP_VERSION_NOT_SUPPORTED = 505;
/**
* @deprecated Please use StatusCodes.IM_A_TEAPOT
*
* */
export declare const IM_A_TEAPOT = 418;
/**
* @deprecated Please use StatusCodes.INSUFFICIENT_SPACE_ON_RESOURCE
*
* */
export declare const INSUFFICIENT_SPACE_ON_RESOURCE = 419;
/**
* @deprecated Please use StatusCodes.INSUFFICIENT_STORAGE
*
* */
export declare const INSUFFICIENT_STORAGE = 507;
/**
* @deprecated Please use StatusCodes.INTERNAL_SERVER_ERROR
*
* */
export declare const INTERNAL_SERVER_ERROR = 500;
/**
* @deprecated Please use StatusCodes.LENGTH_REQUIRED
*
* */
export declare const LENGTH_REQUIRED = 411;
/**
* @deprecated Please use StatusCodes.LOCKED
*
* */
export declare const LOCKED = 423;
/**
* @deprecated Please use StatusCodes.METHOD_FAILURE
*
* */
export declare const METHOD_FAILURE = 420;
/**
* @deprecated Please use StatusCodes.METHOD_NOT_ALLOWED
*
* */
export declare const METHOD_NOT_ALLOWED = 405;
/**
* @deprecated Please use StatusCodes.MOVED_PERMANENTLY
*
* */
export declare const MOVED_PERMANENTLY = 301;
/**
* @deprecated Please use StatusCodes.MOVED_TEMPORARILY
*
* */
export declare const MOVED_TEMPORARILY = 302;
/**
* @deprecated Please use StatusCodes.MULTI_STATUS
*
* */
export declare const MULTI_STATUS = 207;
/**
* @deprecated Please use StatusCodes.MULTIPLE_CHOICES
*
* */
export declare const MULTIPLE_CHOICES = 300;
/**
* @deprecated Please use StatusCodes.NETWORK_AUTHENTICATION_REQUIRED
*
* */
export declare const NETWORK_AUTHENTICATION_REQUIRED = 511;
/**
* @deprecated Please use StatusCodes.NO_CONTENT
*
* */
export declare const NO_CONTENT = 204;
/**
* @deprecated Please use StatusCodes.NON_AUTHORITATIVE_INFORMATION
*
* */
export declare const NON_AUTHORITATIVE_INFORMATION = 203;
/**
* @deprecated Please use StatusCodes.NOT_ACCEPTABLE
*
* */
export declare const NOT_ACCEPTABLE = 406;
/**
* @deprecated Please use StatusCodes.NOT_FOUND
*
* */
export declare const NOT_FOUND = 404;
/**
* @deprecated Please use StatusCodes.NOT_IMPLEMENTED
*
* */
export declare const NOT_IMPLEMENTED = 501;
/**
* @deprecated Please use StatusCodes.NOT_MODIFIED
*
* */
export declare const NOT_MODIFIED = 304;
/**
* @deprecated Please use StatusCodes.OK
*
* */
export declare const OK = 200;
/**
* @deprecated Please use StatusCodes.PARTIAL_CONTENT
*
* */
export declare const PARTIAL_CONTENT = 206;
/**
* @deprecated Please use StatusCodes.PAYMENT_REQUIRED
*
* */
export declare const PAYMENT_REQUIRED = 402;
/**
* @deprecated Please use StatusCodes.PERMANENT_REDIRECT
*
* */
export declare const PERMANENT_REDIRECT = 308;
/**
* @deprecated Please use StatusCodes.PRECONDITION_FAILED
*
* */
export declare const PRECONDITION_FAILED = 412;
/**
* @deprecated Please use StatusCodes.PRECONDITION_REQUIRED
*
* */
export declare const PRECONDITION_REQUIRED = 428;
/**
* @deprecated Please use StatusCodes.PROCESSING
*
* */
export declare const PROCESSING = 102;
/**
* @deprecated Please use StatusCodes.PROXY_AUTHENTICATION_REQUIRED
*
* */
export declare const PROXY_AUTHENTICATION_REQUIRED = 407;
/**
* @deprecated Please use StatusCodes.REQUEST_HEADER_FIELDS_TOO_LARGE
*
* */
export declare const REQUEST_HEADER_FIELDS_TOO_LARGE = 431;
/**
* @deprecated Please use StatusCodes.REQUEST_TIMEOUT
*
* */
export declare const REQUEST_TIMEOUT = 408;
/**
* @deprecated Please use StatusCodes.REQUEST_TOO_LONG
*
* */
export declare const REQUEST_TOO_LONG = 413;
/**
* @deprecated Please use StatusCodes.REQUEST_URI_TOO_LONG
*
* */
export declare const REQUEST_URI_TOO_LONG = 414;
/**
* @deprecated Please use StatusCodes.REQUESTED_RANGE_NOT_SATISFIABLE
*
* */
export declare const REQUESTED_RANGE_NOT_SATISFIABLE = 416;
/**
* @deprecated Please use StatusCodes.RESET_CONTENT
*
* */
export declare const RESET_CONTENT = 205;
/**
* @deprecated Please use StatusCodes.SEE_OTHER
*
* */
export declare const SEE_OTHER = 303;
/**
* @deprecated Please use StatusCodes.SERVICE_UNAVAILABLE
*
* */
export declare const SERVICE_UNAVAILABLE = 503;
/**
* @deprecated Please use StatusCodes.SWITCHING_PROTOCOLS
*
* */
export declare const SWITCHING_PROTOCOLS = 101;
/**
* @deprecated Please use StatusCodes.TEMPORARY_REDIRECT
*
* */
export declare const TEMPORARY_REDIRECT = 307;
/**
* @deprecated Please use StatusCodes.TOO_MANY_REQUESTS
*
* */
export declare const TOO_MANY_REQUESTS = 429;
/**
* @deprecated Please use StatusCodes.UNAUTHORIZED
*
* */
export declare const UNAUTHORIZED = 401;
/**
* @deprecated Please use StatusCodes.UNPROCESSABLE_ENTITY
*
* */
export declare const UNPROCESSABLE_ENTITY = 422;
/**
* @deprecated Please use StatusCodes.UNSUPPORTED_MEDIA_TYPE
*
* */
export declare const UNSUPPORTED_MEDIA_TYPE = 415;
/**
* @deprecated Please use StatusCodes.USE_PROXY
*
* */
export declare const USE_PROXY = 305;
export declare enum StatusCodes {

@@ -979,1 +679,299 @@ /**

export declare const reasonPhraseToStatusCode: Record<string, number>;
/**
* Returns the reason phrase for the given status code.
* If the given status code does not exist, an error is thrown.
*
* @param {number|string} statusCode The HTTP status code
* @returns {string} The associated reason phrase (e.g. "Bad Request", "OK")
* */
export declare function getReasonPhrase(statusCode: (number | string)): (string);
/**
* Returns the status code for the given reason phrase.
* If the given reason phrase does not exist, undefined is returned.
*
* @param {string} reasonPhrase The HTTP reason phrase (e.g. "Bad Request", "OK")
* @returns {string} The associated status code
* */
export declare function getStatusCode(reasonPhrase: string): (number);
/**
* @deprecated
*
* Returns the reason phrase for the given status code.
* If the given status code does not exist, undefined is returned.
*
* Deprecated in favor of getReasonPhrase
*
* @param {number|string} statusCode The HTTP status code
* @returns {string|undefined} The associated reason phrase (e.g. "Bad Request", "OK")
* */
export declare const getStatusText: typeof getReasonPhrase;
/**
* @deprecated Please use StatusCodes.ACCEPTED
*
* */
export declare const ACCEPTED = 202;
/**
* @deprecated Please use StatusCodes.BAD_GATEWAY
*
* */
export declare const BAD_GATEWAY = 502;
/**
* @deprecated Please use StatusCodes.BAD_REQUEST
*
* */
export declare const BAD_REQUEST = 400;
/**
* @deprecated Please use StatusCodes.CONFLICT
*
* */
export declare const CONFLICT = 409;
/**
* @deprecated Please use StatusCodes.CONTINUE
*
* */
export declare const CONTINUE = 100;
/**
* @deprecated Please use StatusCodes.CREATED
*
* */
export declare const CREATED = 201;
/**
* @deprecated Please use StatusCodes.EXPECTATION_FAILED
*
* */
export declare const EXPECTATION_FAILED = 417;
/**
* @deprecated Please use StatusCodes.FAILED_DEPENDENCY
*
* */
export declare const FAILED_DEPENDENCY = 424;
/**
* @deprecated Please use StatusCodes.FORBIDDEN
*
* */
export declare const FORBIDDEN = 403;
/**
* @deprecated Please use StatusCodes.GATEWAY_TIMEOUT
*
* */
export declare const GATEWAY_TIMEOUT = 504;
/**
* @deprecated Please use StatusCodes.GONE
*
* */
export declare const GONE = 410;
/**
* @deprecated Please use StatusCodes.HTTP_VERSION_NOT_SUPPORTED
*
* */
export declare const HTTP_VERSION_NOT_SUPPORTED = 505;
/**
* @deprecated Please use StatusCodes.IM_A_TEAPOT
*
* */
export declare const IM_A_TEAPOT = 418;
/**
* @deprecated Please use StatusCodes.INSUFFICIENT_SPACE_ON_RESOURCE
*
* */
export declare const INSUFFICIENT_SPACE_ON_RESOURCE = 419;
/**
* @deprecated Please use StatusCodes.INSUFFICIENT_STORAGE
*
* */
export declare const INSUFFICIENT_STORAGE = 507;
/**
* @deprecated Please use StatusCodes.INTERNAL_SERVER_ERROR
*
* */
export declare const INTERNAL_SERVER_ERROR = 500;
/**
* @deprecated Please use StatusCodes.LENGTH_REQUIRED
*
* */
export declare const LENGTH_REQUIRED = 411;
/**
* @deprecated Please use StatusCodes.LOCKED
*
* */
export declare const LOCKED = 423;
/**
* @deprecated Please use StatusCodes.METHOD_FAILURE
*
* */
export declare const METHOD_FAILURE = 420;
/**
* @deprecated Please use StatusCodes.METHOD_NOT_ALLOWED
*
* */
export declare const METHOD_NOT_ALLOWED = 405;
/**
* @deprecated Please use StatusCodes.MOVED_PERMANENTLY
*
* */
export declare const MOVED_PERMANENTLY = 301;
/**
* @deprecated Please use StatusCodes.MOVED_TEMPORARILY
*
* */
export declare const MOVED_TEMPORARILY = 302;
/**
* @deprecated Please use StatusCodes.MULTI_STATUS
*
* */
export declare const MULTI_STATUS = 207;
/**
* @deprecated Please use StatusCodes.MULTIPLE_CHOICES
*
* */
export declare const MULTIPLE_CHOICES = 300;
/**
* @deprecated Please use StatusCodes.NETWORK_AUTHENTICATION_REQUIRED
*
* */
export declare const NETWORK_AUTHENTICATION_REQUIRED = 511;
/**
* @deprecated Please use StatusCodes.NO_CONTENT
*
* */
export declare const NO_CONTENT = 204;
/**
* @deprecated Please use StatusCodes.NON_AUTHORITATIVE_INFORMATION
*
* */
export declare const NON_AUTHORITATIVE_INFORMATION = 203;
/**
* @deprecated Please use StatusCodes.NOT_ACCEPTABLE
*
* */
export declare const NOT_ACCEPTABLE = 406;
/**
* @deprecated Please use StatusCodes.NOT_FOUND
*
* */
export declare const NOT_FOUND = 404;
/**
* @deprecated Please use StatusCodes.NOT_IMPLEMENTED
*
* */
export declare const NOT_IMPLEMENTED = 501;
/**
* @deprecated Please use StatusCodes.NOT_MODIFIED
*
* */
export declare const NOT_MODIFIED = 304;
/**
* @deprecated Please use StatusCodes.OK
*
* */
export declare const OK = 200;
/**
* @deprecated Please use StatusCodes.PARTIAL_CONTENT
*
* */
export declare const PARTIAL_CONTENT = 206;
/**
* @deprecated Please use StatusCodes.PAYMENT_REQUIRED
*
* */
export declare const PAYMENT_REQUIRED = 402;
/**
* @deprecated Please use StatusCodes.PERMANENT_REDIRECT
*
* */
export declare const PERMANENT_REDIRECT = 308;
/**
* @deprecated Please use StatusCodes.PRECONDITION_FAILED
*
* */
export declare const PRECONDITION_FAILED = 412;
/**
* @deprecated Please use StatusCodes.PRECONDITION_REQUIRED
*
* */
export declare const PRECONDITION_REQUIRED = 428;
/**
* @deprecated Please use StatusCodes.PROCESSING
*
* */
export declare const PROCESSING = 102;
/**
* @deprecated Please use StatusCodes.PROXY_AUTHENTICATION_REQUIRED
*
* */
export declare const PROXY_AUTHENTICATION_REQUIRED = 407;
/**
* @deprecated Please use StatusCodes.REQUEST_HEADER_FIELDS_TOO_LARGE
*
* */
export declare const REQUEST_HEADER_FIELDS_TOO_LARGE = 431;
/**
* @deprecated Please use StatusCodes.REQUEST_TIMEOUT
*
* */
export declare const REQUEST_TIMEOUT = 408;
/**
* @deprecated Please use StatusCodes.REQUEST_TOO_LONG
*
* */
export declare const REQUEST_TOO_LONG = 413;
/**
* @deprecated Please use StatusCodes.REQUEST_URI_TOO_LONG
*
* */
export declare const REQUEST_URI_TOO_LONG = 414;
/**
* @deprecated Please use StatusCodes.REQUESTED_RANGE_NOT_SATISFIABLE
*
* */
export declare const REQUESTED_RANGE_NOT_SATISFIABLE = 416;
/**
* @deprecated Please use StatusCodes.RESET_CONTENT
*
* */
export declare const RESET_CONTENT = 205;
/**
* @deprecated Please use StatusCodes.SEE_OTHER
*
* */
export declare const SEE_OTHER = 303;
/**
* @deprecated Please use StatusCodes.SERVICE_UNAVAILABLE
*
* */
export declare const SERVICE_UNAVAILABLE = 503;
/**
* @deprecated Please use StatusCodes.SWITCHING_PROTOCOLS
*
* */
export declare const SWITCHING_PROTOCOLS = 101;
/**
* @deprecated Please use StatusCodes.TEMPORARY_REDIRECT
*
* */
export declare const TEMPORARY_REDIRECT = 307;
/**
* @deprecated Please use StatusCodes.TOO_MANY_REQUESTS
*
* */
export declare const TOO_MANY_REQUESTS = 429;
/**
* @deprecated Please use StatusCodes.UNAUTHORIZED
*
* */
export declare const UNAUTHORIZED = 401;
/**
* @deprecated Please use StatusCodes.UNPROCESSABLE_ENTITY
*
* */
export declare const UNPROCESSABLE_ENTITY = 422;
/**
* @deprecated Please use StatusCodes.UNSUPPORTED_MEDIA_TYPE
*
* */
export declare const UNSUPPORTED_MEDIA_TYPE = 415;
/**
* @deprecated Please use StatusCodes.USE_PROXY
*
* */
export declare const USE_PROXY = 305;
{
"name": "http-status-codes",
"version": "2.1.0",
"version": "2.1.1",
"description": "Constants enumerating the HTTP status codes. Based on the Java Apache HttpStatus API.",

@@ -5,0 +5,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc