UNPKG

@alwatr/http-primer

Version:

Essential HTTP utilities for TypeScript, including types for HTTP methods, status codes, and headers.

4 lines (3 loc) 6.73 kB
/* @alwatr/http-primer v6.0.5 */ "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var main_exports={};__export(main_exports,{HttpMethods:()=>HttpMethods,HttpStatusCodes:()=>HttpStatusCodes,HttpStatusMessages:()=>HttpStatusMessages,MimeTypes:()=>MimeTypes});module.exports=__toCommonJS(main_exports);var HttpMethods={GET:"GET",HEAD:"HEAD",POST:"POST",PUT:"PUT",DELETE:"DELETE",CONNECT:"CONNECT",OPTIONS:"OPTIONS",TRACE:"TRACE",PATCH:"PATCH"};var HttpStatusCodes={Info_100_Continue:100,Info_101_Switching_Protocols:101,Info_102_Processing:102,Info_103_Early_Hints:103,Success_200_OK:200,Success_201_Created:201,Success_202_Accepted:202,Success_203_Non_Authoritative_Information:203,Success_204_No_Content:204,Success_205_Reset_Content:205,Success_206_Partial_Content:206,Success_207_Multi_Status:207,Success_208_Already_Reported:208,Success_226_IM_Used:226,Redirect_300_Multiple_Choices:300,Redirect_301_Moved_Permanently:301,Redirect_302_Found:302,Redirect_303_See_Other:303,Redirect_304_Not_Modified:304,Redirect_305_Use_Proxy:305,Redirect_306_Switch_Proxy:306,Redirect_307_Temporary_Redirect:307,Redirect_308_Permanent_Redirect:308,Error_Client_400_Bad_Request:400,Error_Client_401_Unauthorized:401,Error_Client_402_Payment_Required:402,Error_Client_403_Forbidden:403,Error_Client_404_Not_Found:404,Error_Client_405_Method_Not_Allowed:405,Error_Client_406_Not_Acceptable:406,Error_Client_407_Proxy_Authentication_Required:407,Error_Client_408_Request_Timeout:408,Error_Client_409_Conflict:409,Error_Client_410_Gone:410,Error_Client_411_Length_Required:411,Error_Client_412_Precondition_Failed:412,Error_Client_413_Payload_Too_Large:413,Error_Client_414_URI_Too_Long:414,Error_Client_415_Unsupported_Media_Type:415,Error_Client_416_Range_Not_Satisfiable:416,Error_Client_417_Expectation_Failed:417,Error_Client_421_Misdirected_Request:421,Error_Client_422_Unprocessable_Entity:422,Error_Client_423_Locked:423,Error_Client_424_Failed_Dependency:424,Error_Client_425_Too_Early:425,Error_Client_426_Upgrade_Required:426,Error_Client_428_Precondition_Required:428,Error_Client_429_Too_Many_Requests:429,Error_Client_431_Request_Header_Fields_Too_Large:431,Error_Client_451_Unavailable_For_Legal_Reasons:451,Error_Server_500_Internal_Server_Error:500,Error_Server_501_Not_Implemented:501,Error_Server_502_Bad_Gateway:502,Error_Server_503_Service_Unavailable:503,Error_Server_504_Gateway_Timeout:504,Error_Server_505_HTTP_Version_Not_Supported:505,Error_Server_506_Variant_Also_Negotiates:506,Error_Server_507_Insufficient_Storage:507,Error_Server_508_Loop_Detected:508,Error_Server_510_Not_Extended:510,Error_Server_511_Network_Authentication_Required:511};var HttpStatusMessages={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};var MimeTypes={AAC:"audio/aac",ABW:"application/x-abiword",ARC:"application/x-freearc",AVI:"video/x-msvideo",AZW:"application/vnd.amazon.ebook",BIN:"application/octet-stream",BMP:"image/bmp",BZ:"application/x-bzip",BZ2:"application/x-bzip2",CSH:"application/x-csh",CSS:"text/css",CSV:"text/csv",DOC:"application/msword",DOCX:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",EOT:"application/vnd.ms-fontobject",EPUB:"application/epub+zip",GZ:"application/gzip",GIF:"image/gif",HTML:"text/html",ICO:"image/vnd.microsoft.icon",ICS:"text/calendar",JAR:"application/java-archive",JPEG:"image/jpeg",JS:"text/javascript",JSON:"application/json",JSONLD:"application/ld+json",MID:"audio/midi",MIDI:"audio/midi",MJS:"text/javascript",MP3:"audio/mpeg",MP4:"video/mp4",MPEG:"video/mpeg",MPKG:"application/vnd.apple.installer+xml",ODP:"application/vnd.oasis.opendocument.presentation",ODS:"application/vnd.oasis.opendocument.spreadsheet",ODT:"application/vnd.oasis.opendocument.text",OGA:"audio/ogg",OGV:"video/ogg",OGX:"application/ogg",OPUS:"audio/opus",OTF:"font/otf",PNG:"image/png",PDF:"application/pdf",PHP:"application/x-httpd-php",PPT:"application/vnd.ms-powerpoint",PPTX:"application/vnd.openxmlformats-officedocument.presentationml.presentation",RAR:"application/vnd.rar",RTF:"application/rtf",SH:"application/x-sh",SVG:"image/svg+xml",SWF:"application/x-shockwave-flash",TAR:"application/x-tar",TIFF:"image/tiff",TS:"video/mp2t",TTF:"font/ttf",TXT:"text/plain",VS:"application/x-sh",WAV:"audio/wav",WEBA:"audio/webm",WEBM:"video/webm",WEBP:"image/webp",WOFF:"font/woff",WOFF2:"font/woff2",XHTML:"application/xhtml+xml",XLS:"application/vnd.ms-excel",XLSX:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",XML:"application/xml",XUL:"application/vnd.mozilla.xul+xml",ZIP:"application/zip","3GP":"video/3gpp","3G2":"video/3gpp2","7Z":"application/x-7z-compressed"};0&&(module.exports={HttpMethods,HttpStatusCodes,HttpStatusMessages,MimeTypes}); //# sourceMappingURL=main.cjs.map