@ooneex/http-header 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,303 @@
1
+ import { MimeType as MimeType3 } from "@ooneex/http-mimes";
2
+ import { CharsetType as CharsetType3, EncodingType as EncodingType3, HttpMethodType as HttpMethodType3 } from "@ooneex/types";
3
+ import { MimeType as MimeType2 } from "@ooneex/http-mimes";
4
+ import { CharsetType as CharsetType2, EncodingType as EncodingType2, HttpMethodType as HttpMethodType2 } from "@ooneex/types";
5
+ import { MimeType } from "@ooneex/http-mimes";
6
+ import { CharsetType, EncodingType, HttpMethodType } from "@ooneex/types";
7
+ declare const HEADERS: readonly ["A-IM", "Accept", "Accept-Application", "Accept-Charset", "Accept-Datetime", "Accept-Encoding", "Accept-Encodxng", "Accept-Language", "Accept-Ranges", "Accept-Version", "Accepted", "Access-Control-Allow-Credentials", "Access-Control-Allow-Headers", "Access-Control-Allow-Methods", "Access-Control-Allow-Origin", "Access-Control-Expose-Headers", "Access-Control-Max-Age", "Access-Control-Request-Headers", "Access-Control-Request-Method", "Access-Token", "Accesskey", "Action", "Admin", "Age", "Ajax", "Akamai-Origin-Hop", "Allow", "App", "App-Env", "App-Key", "Appcookie", "Apply-To-Redirect-Ref", "Appname", "Appversion", "Atcept-Language", "Auth", "Auth-Any", "Auth-Basic", "Auth-Digest", "Auth-Digest-Ie", "Auth-Gssneg", "Auth-Key", "Auth-Ntlm", "Auth-Password", "Auth-Realm", "Auth-Type", "Auth-User", "Authentication", "Authorization", "Bad-Gateway", "Bad-Request", "Bae-Env-Addr-Bcms", "Bae-Env-Addr-Bcs", "Bae-Env-Addr-Bus", "Bae-Env-Addr-Channel", "Bae-Env-Addr-Sql-Ip", "Bae-Env-Addr-Sql-Port", "Bae-Env-Ak", "Bae-Env-Appid", "Bae-Env-Sk", "Bae-Logid", "Bar", "Base", "Base-Url", "Basic", "Bearer-Indication", "Body-Maxlength", "Body-Truncated", "Brief", "Browser-User-Agent", "Cache-Control", "Cache-Info", "Case-Files", "Catalog", "Catalog-Server", "Category", "Cert-Cookie", "Cert-Flags", "Cert-Issuer", "Cert-Keysize", "Cert-Secretkeysize", "Cert-Serialnumber", "Cert-Server-Issuer", "Cert-Server-Subject", "Cert-Subject", "Cf-Connecting-Ip", "Cf-Ipcountry", "Cf-Template-Path", "Cf-Visitor", "Ch", "Challenge-Response", "Charset", "Chunk-Size", "Client", "Client-Address", "Client-Bad-Request", "Client-Conflict", "Client-Error-Cannot-Access-Local-File", "Client-Error-Cannot-Connect", "Client-Error-Communication-Failure", "Client-Error-Connect", "Client-Error-Invalid-Parameters", "Client-Error-Invalid-Server-Address", "Client-Error-No-Error", "Client-Error-Protocol-Failure", "Client-Error-Unspecified-Error", "Client-Expectation-Failed", "Client-Forbidden", "Client-Gone", "Client-Ip", "Client-IP", "Client-Length-Required", "Client-Method-Not-Allowed", "Client-Not-Acceptable", "Client-Not-Found", "Client-Payment-Required", "Client-Precondition-Failed", "Client-Proxy-Auth-Required", "Client-Quirk-Mode", "Client-Request-Timeout", "Client-Request-Too-Large", "Client-Request-Uri-Too-Large", "Client-Requested-Range-Not-Possible", "Client-Unauthorized", "Client-Unsupported-Media-Type", "Clientaddress", "Clientip", "Cloudfront-Viewer-Country", "Cloudinary-Name", "Cloudinary-Public-Id", "Cloudinary-Version", "Cloudinaryurl", "Cluster-Client-IP", "Code", "Coming-From", "Compress", "Conflict", "Connection", "Connection-Type", "Contact", "Content", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Md5", "Content-Range", "Content-Security-Policy", "Content-Security-Policy-Report-Only", "Content-Type", "Content-Type-Xhtml", "Context-Path", "Continue", "Cookie", "Cookie-Domain", "Cookie-Httponly", "Cookie-Parse-Raw", "Cookie-Path", "Cookie-Secure", "Cookie-Vars", "Cookie2", "Cookies", "Core-Base", "Correlates", "Created", "Credentials-Filepath", "Cross-Origin-Embedder-Policy", "Cross-Origin-Opener-Policy", "Cross-Origin-Resource-Policy", "Curl", "Curl-Multithreaded", "Custom-Header", "Custom-Secret-Header", "Dataserviceversion", "Date", "Debug", "Deflate-Level-Def", "Deflate-Level-Max", "Deflate-Level-Min", "Deflate-Strategy-Def", "Deflate-Strategy-Filt", "Deflate-Strategy-Fixed", "Deflate-Strategy-Huff", "Deflate-Strategy-Rle", "Deflate-Type-Gzip", "Deflate-Type-Raw", "Deflate-Type-Zlib", "Delete", "Depth", "Destination", "Destroy", "Devblocksproxybase", "Devblocksproxyhost", "Devblocksproxyssl", "Device-Stock-Ua", "Digest", "Dir", "Dir-Name", "Dir-Resource", "Disable-Gzip", "Dkim-Signature", "DNT", "Dnt", "Download-Attachment", "Download-Bad-Url", "Download-Bz2", "Download-Cut-Short", "Download-E-Headers-Sent", "Download-E-Invalid-Archive-Type", "Download-E-Invalid-Content-Type", "Download-E-Invalid-File", "Download-E-Invalid-Param", "Download-E-Invalid-Request", "Download-E-Invalid-Resource", "Download-E-No-Ext-Mmagic", "Download-E-No-Ext-Zlib", "Download-Inline", "Download-Mime-Type", "Download-No-Server", "Download-Size", "Download-Status-Not-Found", "Download-Status-Server-Error", "Download-Status-Unauthorized", "Download-Status-Unknown", "Download-Tar", "Download-Tgz", "Download-Url", "Download-Zip", "E-Encoding", "E-Header", "E-Invalid-Param", "E-Malformed-Headers", "E-Message-Type", "E-Querystring", "E-Request", "E-Request-Method", "E-Request-Pool", "E-Response", "E-Runtime", "E-Socket", "E-Url", "Enable-Gzip", "Enable-No-Cache-Headers", "Encoding-Stream-Flush-Full", "Encoding-Stream-Flush-None", "Encoding-Stream-Flush-Sync", "Env-Silla-Environment", "Env-Vars", "Error", "Error-1", "Error-2", "Error-3", "Error-4", "Error-Formatting-Html", "Espo-Authorization", "Espo-Cgi-Auth", "Etag", "Eve-Charid", "Eve-Charname", "Eve-Solarsystemid", "Eve-Solarsystemname", "Eve-Trusted", "Ex-Copy-Movie", "Expect", "Expect-CT", "Expectation-Failed", "Expires", "Ext", "Failed-Dependency", "Fake-Header", "Fastly-Client-Ip", "Fb-Appid", "Fb-Secret", "Feature-Policy", "File-Not-Found", "Filename", "Files", "Files-Vars", "Fire-Breathing-Dragon", "Foo", "Foo-Bar", "Forbidden", "Force-Language", "Force-Local-Xhprof", "Format", "Forwarded", "Forwarded-For", "Forwarded-For-Ip", "Forwarded-Proto", "From", "Fromlink", "Front-End-Https", "Gateway-Interface", "Gateway-Time-Out", "Get", "Get-Vars", "Givenname", "Global-All", "Global-Cookie", "Global-Get", "Global-Post", "Gone", "Google-Code-Project-Hosting-Hook-Hmac", "Gzip-Level", "H0st", "Head", "Header", "Header-Lf", "Header-Status-Client-Error", "Header-Status-Informational", "Header-Status-Redirect", "Header-Status-Server-Error", "Header-Status-Successful", "Home", "Host", "Host-Liveserver", "Host-Name", "Host-Unavailable", "Hosti", "Htaccess", "Http-Accept", "Http-Accept-Encoding", "Http-Accept-Language", "Http-Authorization", "Http-Connection", "Http-Cookie", "Http-Host", "Http-Phone-Number", "Http-Referer", "Http-Url", "Http-User-Agent", "HTTP2-Settings", "Https", "Https-From-Lb", "Https-Keysize", "Https-Secretkeysize", "Https-Server-Issuer", "Https-Server-Subject", "If", "If-Match", "If-Modified-Since", "If-Modified-Since-Version", "If-None-Match", "If-Posted-Before", "If-Range", "If-Unmodified-Since", "If-Unmodified-Since-Version", "Image", "Images", "Incap-Client-Ip", "Info", "Info-Download-Size", "Info-Download-Time", "Info-Return-Code", "Info-Total-Request-Stat", "Info-Total-Response-Stat", "Insufficient-Storage", "Internal-Server-Error", "Ipresolve-Any", "Ipresolve-V4", "Ipresolve-V6", "Ischedule-Version", "Iv-Groups", "Iv-User", "Javascript", "Jenkins", "Keep-Alive", "Kiss-Rpc", "Label", "Large-Allocation", "Last-Event-Id", "Last-Modified", "Length-Required", "Link", "Local-Addr", "Local-Content-Sha1", "Local-Dir", "Location", "Lock-Token", "Locked", "Mail", "Mandatory", "Max-Conn", "Max-Forwards", "Max-Request-Size", "Max-Uri-Length", "Maxdataserviceversion", "Message", "Message-B", "Meth-", "Meth-Acl", "Meth-Baseline-Control", "Meth-Checkin", "Meth-Checkout", "Meth-Connect", "Meth-Copy", "Meth-Delete", "Meth-Get", "Meth-Head", "Meth-Label", "Meth-Lock", "Meth-Merge", "Meth-Mkactivity", "Meth-Mkcol", "Meth-Mkworkspace", "Meth-Move", "Meth-Options", "Meth-Post", "Meth-Propfind", "Meth-Proppatch", "Meth-Put", "Meth-Report", "Meth-Trace", "Meth-Uncheckout", "Meth-Unlock", "Meth-Update", "Meth-Version-Control", "Method", "Method-Not-Allowed", "Mimetype", "Mod-Env", "Mod-Rewrite", "Mod-Security-Message", "Modauth", "Mode", "Module-Class", "Module-Class-Path", "Module-Name", "Moved-Permanently", "Moved-Temporarily", "Ms-Asprotocolversion", "Msg-None", "Msg-Request", "Msg-Response", "Msisdn", "Multi-Status", "Multipart-Boundary", "Multiple-Choices", "Must", "My-Header", "Mysqlport", "Native-Sockets", "Negotiate", "Nl", "No-Content", "Non-Authoritative", "Nonce", "Not-Acceptable", "Not-Exists", "Not-Extended", "Not-Found", "Not-Implemented", "Not-Modified", "Notification-Template", "Oc-Chunked", "Ocs-Apirequest", "Ok", "On-Behalf-Of", "Onerror-Continue", "Onerror-Die", "Onerror-Return", "Only", "Opencart", "Options", "Organizer", "Orig_path_info", "Origin", "Origin-Isolation", "Originator", "Overwrite", "Params-Allow-Comma", "Params-Allow-Failure", "Params-Default", "Params-Get-Catid", "Params-Get-Currentday", "Params-Get-Disposition", "Params-Get-Downwards", "Params-Get-Givendate", "Params-Get-Lang", "Params-Get-Type", "Params-Raise-Error", "Partial-Content", "Passkey", "Password", "Path", "Path-Base", "Path-Info", "Path-Themes", "Path-Translated", "Payment-Required", "Pc-Remote-Addr", "Permanent", "Phone-Number", "Php", "Php-Auth-Pw", "Php-Auth-User", "Phpthreads", "Pink-Pony", "Port", "Portsensor-Auth", "Post", "Post-Error", "Post-Files", "Post-Vars", "Postredir-301", "Postredir-302", "Postredir-All", "Pragma", "Pragma-No-Cache", "Precondition-Failed", "Prefer", "Processing", "Profile", "Protocol", "Protocols", "Proxy", "Proxy-Agent", "Proxy-Authenticate", "Proxy-Authentication-Required", "Proxy-Authorization", "Proxy-Connection", "Proxy-Host", "Proxy-Http", "Proxy-Http-1-0", "Proxy-Password", "Proxy-Port", "Proxy-Pwd", "Proxy-Request-Fulluri", "Proxy-Socks4", "Proxy-Socks4a", "Proxy-Socks5", "Proxy-Socks5-Hostname", "Proxy-Url", "Proxy-User", "Public-Key-Pins", "Public-Key-Pins-Report-Only", "Pull", "Put", "Query-String", "Querystring", "Querystring-Type-Array", "Querystring-Type-Bool", "Querystring-Type-Float", "Querystring-Type-Int", "Querystring-Type-Object", "Querystring-Type-String", "Range", "Range-Not-Satisfiable", "Raw-Post-Data", "Read-State-Begin", "Read-State-Body", "Read-State-Headers", "Real-Ip", "Real-Method", "Reason", "Reason-Phrase", "Recipient", "Redirect", "Redirect-Found", "Redirect-Perm", "Redirect-Post", "Redirect-Problem-Withoutwww", "Redirect-Problem-Withwww", "Redirect-Proxy", "Redirect-Temp", "Redirected-Accept-Language", "Redirection-Found", "Redirection-Multiple-Choices", "Redirection-Not-Modified", "Redirection-Permanent", "Redirection-See-Other", "Redirection-Temporary", "Redirection-Unused", "Redirection-Use-Proxy", "Ref", "Referer", "Referrer", "Referrer-Policy", "Refferer", "Refresh", "Remix-Hash", "Remote-Addr", "Remote-Host", "Remote-Host-Wp", "Remote-User", "Remote-Userhttps", "Report-To", "Request", "Request-Entity-Too-Large", "Request-Error", "Request-Error-File", "Request-Error-Gzip-Crc", "Request-Error-Gzip-Data", "Request-Error-Gzip-Method", "Request-Error-Gzip-Read", "Request-Error-Proxy", "Request-Error-Redirects", "Request-Error-Response", "Request-Error-Url", "Request-Http-Ver-1-0", "Request-Http-Ver-1-1", "Request-Mbstring", "Request-Method", "Request-Method-", "Request-Method-Delete", "Request-Method-Get", "Request-Method-Head", "Request-Method-Options", "Request-Method-Post", "Request-Method-Put", "Request-Method-Trace", "Request-Time-Out", "Request-Timeout", "Request-Uri", "Request-Uri-Too-Large", "Request-Vars", "Request2-Tests-Base-Url", "Request2-Tests-Proxy-Host", "Requesttoken", "Reset-Content", "Response", "Rest-Key", "Rest-Sign", "Retry-After", "Returned-Error", "Rlnclientipaddr", "Root", "Safe-Ports-List", "Safe-Ports-Ssl-List", "Save-Data", "Schedule-Reply", "Scheme", "Script-Name", "Sec-Websocket-Accept", "Sec-Websocket-Extensions", "Sec-Websocket-Key", "Sec-Websocket-Key1", "Sec-Websocket-Key2", "Sec-Websocket-Origin", "Sec-Websocket-Protocol", "Sec-Websocket-Version", "Secretkey", "See-Other", "Self", "Send-X-Frame-Options", "Server", "Server-Bad-Gateway", "Server-Error", "Server-Gateway-Timeout", "Server-Internal", "Server-Name", "Server-Not-Implemented", "Server-Port", "Server-Port-Secure", "Server-Protocol", "Server-Service-Unavailable", "Server-Software", "Server-Unsupported-Version", "Server-Vars", "Server-Varsabantecart", "Service-Unavailable", "Session-Id-Tag", "Session-Vars", "Set-Cookie", "Set-Cookie2", "Shib-", "Shib-Application-Id", "Shib-Identity-Provider", "Shib-Logouturl", "Shopilex", "Slug", "Sn", "Soapaction", "Socket-Connection-Err", "Socketlog", "Somevar", "Sourcemap", "Sp-Client", "Sp-Host", "Ssl", "Ssl-Https", "Ssl-Offloaded", "Ssl-Session-Id", "Ssl-Version-Any", "Sslsessionid", "Start", "Status", "Status-", "Status-403", "Status-403-Admin-Del", "Status-404", "Status-Bad-Request", "Status-Code", "Status-Forbidden", "Status-Ok", "Status-Platform-403", "Str-Match", "Strict-Transport-Security", "Success-Accepted", "Success-Created", "Success-No-Content", "Success-Non-Authoritative", "Success-Ok", "Success-Partial-Content", "Success-Reset-Content", "Support", "Support-Encodings", "Support-Events", "Support-Magicmime", "Support-Requests", "Support-Sslrequests", "Surrogate-Capability", "Switching-Protocols", "TE", "Te", "Temporary-Redirect", "Test", "Test-Config", "Test-Server-Path", "Test-Something-Anything", "Ticket", "Time-Out", "Timeout", "Timing-Allow-Origin", "Title", "Tk", "Tmp", "Token", "Trailer", "Transfer-Encoding", "Translate", "Transport-Err", "True-Client-Ip", "True-Client-IP", "Ua", "Ua-Color", "Ua-Cpu", "Ua-Os", "Ua-Pixels", "Ua-Resolution", "Ua-Voice", "Unauthorized", "Unencoded-Url", "Unit-Test-Mode", "UniqueId", "Unless-Modified-Since", "Unprocessable-Entity", "Unsupported-Media-Type", "Upgrade", "Upgrade-Insecure-Requests", "Upgrade-Required", "Upload-Default-Chmod", "Uri", "Url", "Url-From-Env", "Url-Join-Path", "Url-Join-Query", "Url-Replace", "Url-Sanitize-Path", "Url-Strip-", "Url-Strip-All", "Url-Strip-Auth", "Url-Strip-Fragment", "Url-Strip-Pass", "Url-Strip-Path", "Url-Strip-Port", "Url-Strip-Query", "Url-Strip-User", "Use-Gzip", "Use-Proxy", "User", "User-Agent", "User-Agent-Via", "User-Email", "User-Id", "User-Mail", "User-Name", "User-Photos", "Useragent", "Useragent-Via", "Util", "Variant-Also-Varies", "Vary", "Verbose", "Verbose-Throttle", "Verify-Cert", "Version", "Version-1-0", "Version-1-1", "Version-Any", "Version-None", "Version-Not-Supported", "Versioncode", "Via", "Viad", "Waf-Stuff-Below", "Wap-Connection", "Warning", "Web-Server-Api", "Webodf-Member-Id", "Webodf-Session-Id", "Webodf-Session-Revision", "Work-Directory", "Www-Address", "Www-Authenticate", "X", "X-", "X-Aastra-Expmod1", "X-Aastra-Expmod2", "X-Aastra-Expmod3", "X-Accel-Mapping", "X-Access-Token", "X-Advertiser-Id", "X-Ajax-Real-Method", "X-Alto-Ajax-Keyz", "X-Amz-Date", "X-Amz-Website-Redirect-Location", "X-Amzn-Remapped-Host", "X-Api-Key", "X-Api-Signature", "X-Api-Timestamp", "X-Apitoken", "X-Apple-Client-Application", "X-Apple-Store-Front", "X-Arr-Log-Id", "X-Arr-Ssl", "X-ATT-DeviceId", "X-Att-Deviceid", "X-Auth-Key", "X-Auth-Mode", "X-Auth-Password", "X-Auth-Service-Provider", "X-Auth-Token", "X-Auth-User", "X-Auth-Userid", "X-Auth-Username", "X-Authentication", "X-Authentication-Key", "X-Authorization", "X-Avantgo-Screensize", "X-Azc-Remote-Addr", "X-Bear-Ajax-Request", "X-Bluecoat-Via", "X-Bolt-Phone-Ua", "X-Browser-Height", "X-Browser-Width", "X-Cascade", "X-Cept-Encoding", "X-Cf-Url", "X-Chrome-Extension", "X-Cisco-Bbsm-Clientip", "X-Client-Host", "X-Client-Id", "X-Client-Ip", "X-Client-IP", "X-Client-Key", "X-Client-Os", "X-Client-Os-Ver", "X-Clientip", "X-Cluster-Client-Ip", "X-Codeception-Codecoverage", "X-Codeception-Codecoverage-Config", "X-Codeception-Codecoverage-Debug", "X-Codeception-Codecoverage-Suite", "X-Collect-Coverage", "X-Coming-From", "X-Confirm-Delete", "X-Content-Type", "X-Content-Type-Options", "X-Correlation-ID", "X-Credentials-Request", "X-Csrf-Crumb", "X-Csrf-Token", "X-Csrftoken", "X-Cuid", "X-Custom", "X-Dagd-Proxy", "X-Davical-Testcase", "X-Dcmguid", "X-Debug-Test", "X-Device-User-Agent", "X-Download-Options", "X-Dialog", "X-Dns-Prefetch-Control", "X-Do-Not-Track", "X-Dokuwiki-Do", "X-Drestcg", "X-Dsid", "X-Elgg-Apikey", "X-Elgg-Hmac", "X-Elgg-Hmac-Algo", "X-Elgg-Nonce", "X-Elgg-Posthash", "X-Elgg-Posthash-Algo", "X-Elgg-Time", "X-Em-Uid", "X-Enable-Coverage", "X-Environment-Override", "X-Expected-Entity-Length", "X-Experience-Api-Version", "X-Fb-User-Remote-Addr", "X-File-Id", "X-File-Name", "X-File-Resume", "X-File-Size", "X-File-Type", "X-Filename", "X-Firelogger", "X-Fireloggerauth", "X-Firephp-Version", "X-Flash-Version", "X-Flx-Consumer-Key", "X-Flx-Consumer-Secret", "X-Flx-Redirect-Url", "X-Foo", "X-Foo-Bar", "X-Forward-For", "X-Forward-Proto", "X-Forwarded", "X-Forwarded-By", "X-Forwarded-For", "X-Forwarded-For-Original", "X-Forwarded-Host", "X-Forwarded-Port", "X-Forwarded-Proto", "X-Forwarded-Protocol", "X-Forwarded-Scheme", "X-Forwarded-Server", "X-Forwarded-Ssl", "X-Forwarder-For", "X-From", "X-Gb-Shared-Secret", "X-Geoip-Country", "X-Get-Checksum", "X-Helpscout-Event", "X-Helpscout-Signature", "X-Hgarg-", "X-Host", "X-Http-Destinationurl", "X-Http-Host-Override", "X-Http-Method", "X-Http-Method-Override", "X-Http-Path-Override", "X-Https", "X-Htx-Agent", "X-Huawei-Userid", "X-Hub-Signature", "X-If-Unmodified-Since", "X-Imbo-Test-Config", "X-Insight", "X-Ip", "X-Ip-Trail", "X-Iwproxy-Nesting", "X-Jphone-Color", "X-Jphone-Display", "X-Jphone-Geocode", "X-Jphone-Msname", "X-Jphone-Uid", "X-Json", "X-Kaltura-Remote-Addr", "X-Known-Signature", "X-Known-Username", "X-Litmus", "X-Litmus-Second", "X-Locking", "X-Machine", "X-Mandrill-Signature", "X-Method-Override", "X-Mobile-Gateway", "X-Mobile-Ua", "X-Mosso-Dt", "X-Moz", "X-Ms-Policykey", "X-Msisdn", "X-Myqee-System-Debug", "X-Myqee-System-Hash", "X-Myqee-System-Isadmin", "X-Myqee-System-Isrest", "X-Myqee-System-Pathinfo", "X-Myqee-System-Project", "X-Myqee-System-Rstr", "X-Myqee-System-Time", "X-Network-Info", "X-Nfsn-Https", "X-Ning-Request-Uri", "X-No-WWW-Authenticate", "X-Nokia-Bearer", "X-Nokia-Connection-Mode", "X-Nokia-Gateway-Id", "X-Nokia-Ipaddress", "X-Nokia-Msisdn", "X-Nokia-Wia-Accept-Original", "X-Nokia-Wtls", "X-Nuget-Apikey", "X-Oc-Mtime", "X-Opera-Info", "X-Operamini-Features", "X-Operamini-Phone", "X-Operamini-Phone-Ua", "X-Options", "X-Orange-Id", "X-Orchestra-Scheme", "X-Orig-Client", "X-Original-Host", "X-Original-Http-Command", "X-Original-Remote-Addr", "X-Original-Url", "X-Original-User-Agent", "X-Originally-Forwarded-For", "X-Originally-Forwarded-Proto", "X-Originating-Ip", "X-Originating-IP", "X-Os-Prefs", "X-Overlay", "X-Pagelet-Fragment", "X-Password", "X-Permitted-Cross-Domain-Policies", "X-Phabricator-Csrf", "X-Phpbb-Using-Plupload", "X-Pjax", "X-Pjax-Container", "X-Powered-By", "X-Prototype-Version", "X-Proxy-Url", "X-Pswd", "X-Purpose", "X-Qafoo-Profiler", "X-Real-Ip", "X-Remote-Addr", "X-Remote-IP", "X-Remote-Protocol", "X-Render-Partial", "X-Request", "X-Request-ID", "X-Request-Id", "X-Request-Signature", "X-Request-Start", "X-Request-Timestamp", "X-Requested-With", "X-Response-Format", "X-Rest-Cors", "X-Rest-Password", "X-Rest-Username", "X-Rewrite-Url", "X-Sakura-Forwarded-For", "X-Scalr-Auth-Key", "X-Scalr-Auth-Token", "X-Scalr-Env-Id", "X-Scanner", "X-Scheme", "X-Screen-Height", "X-Screen-Width", "X-Sendfile-Type", "X-Serial-Number", "X-Serialize", "X-Server-Id", "X-Server-Name", "X-Server-Port", "X-Signature", "X-Sina-Proxyuser", "X-Skyfire-Phone", "X-Skyfire-Screen", "X-Ssl", "X-Subdomain", "X-Te", "X-Teamsite-Preremap", "X-Test-Session-Id", "X-Timer", "X-Tine20-Jsonkey", "X-Tine20-Request-Type", "X-Tomboy-Client", "X-Tor", "X-Twilio-Signature", "X-Ua-Device", "X-Ucbrowser-Device-Ua", "X-UIDH", "X-Uidh", "X-Unique-Id", "X-Uniquewcid", "X-Up-Calling-Line-Id", "X-Up-Devcap-Iscolor", "X-Up-Devcap-Screendepth", "X-Up-Devcap-Screenpixels", "X-Up-Subno", "X-Update", "X-Update-Range", "X-Upload-Maxresolution", "X-Upload-Name", "X-Upload-Size", "X-Upload-Type", "X-Url-Scheme", "X-User", "X-User-Agent", "X-Username", "X-Varnish", "X-Verify-Credentials-Authorization", "X-Vodafone-3gpdpcontext", "X-Wap-Client-Sdu-Size", "X-Wap-Clientid", "X-Wap-Gateway", "X-Wap-Network-Client-Ip", "X-Wap-Network-Client-Msisdn", "X-Wap-Profile", "X-Wap-Proxy-Cookie", "X-Wap-Session-Id", "X-Wap-Tod", "X-Wap-Tod-Coded", "X-Whatever", "X-Wikimedia-Debug", "X-Wp-Nonce", "X-Wp-Pjax-Prefetch", "X-Ws-Api-Key", "X-Xc-Schema-Version", "X-Xhprof-Debug", "X-Xhr-Referer", "X-Xmlhttprequest", "X-Xpid", "X-Zikula-Ajax-Token", "X-Zotero-Version", "X-Ztgo-Bearerinfo", "X_alto_ajax_key", "Xauthorization", "Xonnection", "Xpdb-Debugger", "Xproxy", "Xroxy-Connection", "Xxx-Real-Ip", "Xxxxxxxxxxxxxxx", "Y", "Zotero-Api-Version", "Zotero-Write-Token", "Accept-Patch", "Alt-Svc", "Delta-Base", "ETag", "IM", "P3P", "WWW-Authenticate", "X-Frame-Options", "X-HTTP-Method-Override", "x-wap-profile", "Accept-CH", "Accept-CH-Lifetime", "Clear-Site-Data", "Cross-Origin-Resource-Policy", "DPR", "Device-Memory", "Early-Data", "Expect-CT", "Feature-Policy", "Sec-Fetch-Dest", "Sec-Fetch-Mode", "Sec-Fetch-Site", "Sec-Fetch-User", "Sec-WebSocket-Accept", "Server-Timing", "SourceMap", "Want-Digest", "X-DNS-Prefetch-Control", "X-ProxyUser-Ip", "X-XSS-Protection", "Public-Key-Pins", "Public-Key-Pins-Report-Only", "Sec-Fetch-Site", "Sec-Fetch-Mode", "Sec-Fetch-User", "Sec-Fetch-Dest", "Last-Event-ID", "Ping-From", "NEL", "Sec-WebSocket-Key", "Sec-WebSocket-Extensions", "Sec-WebSocket-Accept", "Sec-WebSocket-Protocol", "Sec-WebSocket-Version", "Accept-Push-Policy", "Accept-Signature", "Alt-Svc", "Date", "Signed-Headers", "Server-Timing", "Service-Worker-Allowed", "X-API-Version", "X-RateLimit-Limit", "X-RateLimit-Remaining", "X-RateLimit-Reset"];
8
+ declare enum ECookieSameSite {
9
+ STRICT = "Strict",
10
+ LAX = "Lax",
11
+ NONE = "None"
12
+ }
13
+ declare enum EXFrameOptions {
14
+ DENY = "DENY",
15
+ SAMEORIGIN = "SAMEORIGIN"
16
+ }
17
+ type CookieSameSiteType = `${ECookieSameSite}`;
18
+ type XFrameOptionsType = `${EXFrameOptions}` | string;
19
+ type HeaderFieldType = (typeof HEADERS)[number] | `X-Custom-${string}` | "X-Real-IP";
20
+ type UserAgentType = {
21
+ browser: {
22
+ name?: string;
23
+ version?: string;
24
+ major?: string;
25
+ };
26
+ engine: {
27
+ name?: string;
28
+ version?: string;
29
+ };
30
+ os: {
31
+ name?: string;
32
+ version?: string;
33
+ };
34
+ device: {
35
+ vendor?: string;
36
+ model?: string;
37
+ type?: string;
38
+ };
39
+ cpu: {
40
+ architecture?: string;
41
+ };
42
+ };
43
+ type UserAgentBrowserType = UserAgentType["browser"];
44
+ type UserAgentEngineType = UserAgentType["engine"];
45
+ type UserAgentOsType = UserAgentType["os"];
46
+ type UserAgentDeviceType = UserAgentType["device"];
47
+ type UserAgentCpuType = UserAgentType["cpu"];
48
+ interface IUserAgent {
49
+ readonly browser: UserAgentBrowserType;
50
+ readonly engine: UserAgentEngineType;
51
+ readonly os: UserAgentOsType;
52
+ readonly device: UserAgentDeviceType;
53
+ readonly cpu: UserAgentCpuType;
54
+ }
55
+ interface IHeader extends IReadonlyHeader {
56
+ readonly native: Headers;
57
+ add: (name: HeaderFieldType, value: string) => IHeader;
58
+ remove: (name: HeaderFieldType) => IHeader;
59
+ set: (name: HeaderFieldType, value: string) => IHeader;
60
+ contentType: (value: MimeType, charset?: CharsetType) => IHeader;
61
+ contentLength: (length: number) => IHeader;
62
+ contentDisposition: (value: string) => IHeader;
63
+ setJson: (charset?: CharsetType) => IHeader;
64
+ setHtml: (charset?: CharsetType) => IHeader;
65
+ setText: (charset?: CharsetType) => IHeader;
66
+ setForm: (charset?: CharsetType) => IHeader;
67
+ setFormData: (charset?: CharsetType) => IHeader;
68
+ setBlobType: (charset?: CharsetType) => IHeader;
69
+ setAccept: (mimeType: MimeType) => IHeader;
70
+ setLang: (language: string) => IHeader;
71
+ setAcceptEncoding: (encodings: EncodingType[]) => IHeader;
72
+ setHost: (host: string) => IHeader;
73
+ setUserAgent: (userAgent: string) => IHeader;
74
+ setReferer: (referer: string) => IHeader;
75
+ setOrigin: (origin: string) => IHeader;
76
+ setAuthorization: (value: string) => IHeader;
77
+ setBasicAuth: (token: string) => IHeader;
78
+ setBearerToken: (token: string) => IHeader;
79
+ setCookie: (name: string, value: string, options?: {
80
+ domain?: string;
81
+ path?: string;
82
+ expires?: Date;
83
+ maxAge?: number;
84
+ secure?: boolean;
85
+ httpOnly?: boolean;
86
+ sameSite?: CookieSameSiteType;
87
+ }) => IHeader;
88
+ setCookies: (cookies: Array<{
89
+ name: string;
90
+ value: string;
91
+ options?: {
92
+ domain?: string;
93
+ path?: string;
94
+ expires?: Date;
95
+ maxAge?: number;
96
+ secure?: boolean;
97
+ httpOnly?: boolean;
98
+ sameSite?: CookieSameSiteType;
99
+ };
100
+ }>) => IHeader;
101
+ addCookie: (name: string, value: string, options?: {
102
+ domain?: string;
103
+ path?: string;
104
+ expires?: Date;
105
+ maxAge?: number;
106
+ secure?: boolean;
107
+ httpOnly?: boolean;
108
+ sameSite?: CookieSameSiteType;
109
+ }) => IHeader;
110
+ removeCookie: (name: string, options?: {
111
+ domain?: string;
112
+ path?: string;
113
+ }) => IHeader;
114
+ setCacheControl: (value: string) => IHeader;
115
+ setEtag: (value: string) => IHeader;
116
+ setLastModified: (date: Date) => IHeader;
117
+ setIfModifiedSince: (date: Date) => IHeader;
118
+ setAccessControlAllowOrigin: (origin: string) => IHeader;
119
+ setAccessControlAllowMethods: (methods: HttpMethodType[]) => IHeader;
120
+ setAccessControlAllowHeaders: (headers: string[]) => IHeader;
121
+ setAccessControlAllowCredentials: (allow: boolean) => IHeader;
122
+ setContentSecurityPolicy: (policy: string) => IHeader;
123
+ setStrictTransportSecurity: (maxAge: number, includeSubDomains?: boolean, preload?: boolean) => IHeader;
124
+ setXContentTypeOptions: (value?: string) => IHeader;
125
+ setXFrameOptions: (value: XFrameOptionsType) => IHeader;
126
+ setXXSSProtection: (enabled?: boolean, mode?: string) => IHeader;
127
+ setLocation: (location: string) => IHeader;
128
+ setCustom: (value: string) => IHeader;
129
+ }
130
+ interface IReadonlyHeader {
131
+ readonly native: Headers;
132
+ get: (name: HeaderFieldType) => string | null;
133
+ has: (name: HeaderFieldType) => boolean;
134
+ toJson: () => Record<string, string>;
135
+ getContentType: () => MimeType | "*/*" | null;
136
+ getContentLength: () => number;
137
+ getCharset: () => CharsetType | null;
138
+ getContentDisposition: () => string | null;
139
+ getAccept: () => MimeType | "*/*" | null;
140
+ getLang: () => {
141
+ code: string;
142
+ region?: string;
143
+ } | null;
144
+ getAcceptEncoding: () => EncodingType[] | null;
145
+ getHost: () => string | null;
146
+ getUserAgent: () => IUserAgent | null;
147
+ getReferer: () => string | null;
148
+ getOrigin: () => string | null;
149
+ getAuthorization: () => string | null;
150
+ getBasicAuth: () => string | null;
151
+ getBearerToken: () => string | null;
152
+ getCookies: () => Record<string, string> | null;
153
+ getCookie: (name: string) => string | null;
154
+ getIp: () => string | null;
155
+ getXForwardedFor: () => string | null;
156
+ getXRealIP: () => string | null;
157
+ getClientIps: () => string[];
158
+ getCacheControl: () => string | null;
159
+ getEtag: () => string | null;
160
+ getLastModified: () => Date | null;
161
+ getIfModifiedSince: () => Date | null;
162
+ getIfNoneMatch: () => string | null;
163
+ getAccessControlAllowOrigin: () => string | null;
164
+ getAccessControlAllowMethods: () => HttpMethodType[] | null;
165
+ getAccessControlAllowHeaders: () => string[] | null;
166
+ getAccessControlAllowCredentials: () => boolean | null;
167
+ getContentSecurityPolicy: () => string | null;
168
+ getStrictTransportSecurity: () => string | null;
169
+ getXContentTypeOptions: () => string | null;
170
+ getXFrameOptions: () => string | null;
171
+ getXXSSProtection: () => string | null;
172
+ getLocation: () => string | null;
173
+ isSecure: () => boolean;
174
+ isAjax: () => boolean;
175
+ isCorsRequest: () => boolean;
176
+ [Symbol.iterator](): IterableIterator<[HeaderFieldType, string]>;
177
+ }
178
+ declare class ReadonlyHeader implements IReadonlyHeader {
179
+ readonly native: Headers;
180
+ constructor(native: Headers);
181
+ get(name: HeaderFieldType): string | null;
182
+ has(name: HeaderFieldType): boolean;
183
+ toJson(): Record<string, string>;
184
+ getContentType(): MimeType2 | "*/*" | null;
185
+ getContentLength(): number;
186
+ getCharset(): CharsetType2 | null;
187
+ getContentDisposition(): string | null;
188
+ getAccept(): MimeType2 | "*/*" | null;
189
+ getLang(): {
190
+ code: string;
191
+ region?: string;
192
+ } | null;
193
+ getAcceptEncoding(): EncodingType2[] | null;
194
+ getHost(): string | null;
195
+ getUserAgent(): IUserAgent | null;
196
+ getReferer(): string | null;
197
+ getOrigin(): string | null;
198
+ getAuthorization(): string | null;
199
+ getBasicAuth(): string | null;
200
+ getBearerToken(): string | null;
201
+ getCookies(): Record<string, string> | null;
202
+ getCookie(name: string): string | null;
203
+ getIp(): string | null;
204
+ getXForwardedFor(): string | null;
205
+ getXRealIP(): string | null;
206
+ getClientIps(): string[];
207
+ getCacheControl(): string | null;
208
+ getEtag(): string | null;
209
+ getLastModified(): Date | null;
210
+ getIfModifiedSince(): Date | null;
211
+ getIfNoneMatch(): string | null;
212
+ getAccessControlAllowOrigin(): string | null;
213
+ getAccessControlAllowMethods(): HttpMethodType2[] | null;
214
+ getAccessControlAllowHeaders(): string[] | null;
215
+ getAccessControlAllowCredentials(): boolean | null;
216
+ getContentSecurityPolicy(): string | null;
217
+ getStrictTransportSecurity(): string | null;
218
+ getXContentTypeOptions(): string | null;
219
+ getXFrameOptions(): string | null;
220
+ getXXSSProtection(): string | null;
221
+ getLocation(): string | null;
222
+ isSecure(): boolean;
223
+ isAjax(): boolean;
224
+ isCorsRequest(): boolean;
225
+ [Symbol.iterator](): IterableIterator<[HeaderFieldType, string]>;
226
+ }
227
+ declare class Header extends ReadonlyHeader implements IHeader {
228
+ constructor(headers?: Headers);
229
+ add(name: HeaderFieldType, value: string): this;
230
+ remove(name: HeaderFieldType): this;
231
+ set(name: HeaderFieldType, value: string): this;
232
+ contentType(type: MimeType3, charset?: CharsetType3): this;
233
+ contentLength(length: number): this;
234
+ contentDisposition(value: string): this;
235
+ clearContentType(): this;
236
+ setJson(charset?: CharsetType3): this;
237
+ setHtml(charset?: CharsetType3): this;
238
+ setText(charset?: CharsetType3): this;
239
+ setForm(charset?: CharsetType3): this;
240
+ setFormData(charset?: CharsetType3): this;
241
+ setBlobType(charset?: CharsetType3): this;
242
+ setAccept(mimeType: MimeType3): this;
243
+ setLang(language: string): this;
244
+ setAcceptEncoding(encodings: EncodingType3[]): this;
245
+ setHost(host: string): this;
246
+ setUserAgent(userAgent: string): this;
247
+ setReferer(referer: string): this;
248
+ setOrigin(origin: string): this;
249
+ setAuthorization(value: string): this;
250
+ setBasicAuth(token: string): this;
251
+ setBearerToken(token: string): this;
252
+ setCookie(name: string, value: string, options?: {
253
+ domain?: string;
254
+ path?: string;
255
+ expires?: Date;
256
+ maxAge?: number;
257
+ secure?: boolean;
258
+ httpOnly?: boolean;
259
+ sameSite?: "Strict" | "Lax" | "None";
260
+ }): this;
261
+ setCookies(cookies: {
262
+ name: string;
263
+ value: string;
264
+ options?: {
265
+ domain?: string;
266
+ path?: string;
267
+ expires?: Date;
268
+ maxAge?: number;
269
+ secure?: boolean;
270
+ httpOnly?: boolean;
271
+ sameSite?: "Strict" | "Lax" | "None";
272
+ };
273
+ }[]): this;
274
+ addCookie(name: string, value: string, options?: {
275
+ domain?: string;
276
+ path?: string;
277
+ expires?: Date;
278
+ maxAge?: number;
279
+ secure?: boolean;
280
+ httpOnly?: boolean;
281
+ sameSite?: "Strict" | "Lax" | "None";
282
+ }): this;
283
+ removeCookie(name: string, options?: {
284
+ domain?: string;
285
+ path?: string;
286
+ }): this;
287
+ setCacheControl(value: string): this;
288
+ setEtag(value: string): this;
289
+ setLastModified(date: Date): this;
290
+ setIfModifiedSince(date: Date): this;
291
+ setAccessControlAllowOrigin(origin: string): this;
292
+ setAccessControlAllowMethods(methods: HttpMethodType3[]): this;
293
+ setAccessControlAllowHeaders(headers: string[]): this;
294
+ setAccessControlAllowCredentials(allow: boolean): this;
295
+ setContentSecurityPolicy(policy: string): this;
296
+ setStrictTransportSecurity(maxAge: number, includeSubDomains?: boolean, preload?: boolean): this;
297
+ setXContentTypeOptions(value?: string): this;
298
+ setXFrameOptions(value: "DENY" | "SAMEORIGIN" | string): this;
299
+ setXXSSProtection(enabled?: boolean, mode?: string): this;
300
+ setLocation(location: string): this;
301
+ setCustom(value: string): this;
302
+ }
303
+ export { UserAgentType, UserAgentOsType, UserAgentEngineType, UserAgentDeviceType, UserAgentCpuType, UserAgentBrowserType, ReadonlyHeader, IUserAgent, IReadonlyHeader, IHeader, HeaderFieldType, Header };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import{UAParser as N}from"ua-parser-js";class G{native;constructor(U){this.native=U}get(U){return this.native.get(U)}has(U){return this.native.has(U)}toJson(){let U={};return this.native.forEach((T,B)=>{U[B]=T}),U}getContentType(){return this.get("Content-Type")}getContentLength(){let U=this.get("Content-Length")||null;return U?Number.parseInt(U,10):0}getCharset(){let U=this.getContentType();if(!U)return null;let T=U.match(/charset *= *(?<charset>[a-z0-9-]+)/i);if(!T)return null;return T[1]?.toUpperCase()||null}getContentDisposition(){return this.get("Content-Disposition")}getAccept(){return this.get("Accept")??null}getLang(){let U=this.get("Accept-Language");if(!U||U.trim()==="")return null;let T=U.split(",").map((z)=>z.split(";")[0]?.trim()).filter((z)=>Boolean(z))[0];if(!T)return null;let B=T.split("-"),E=B[0];if(!E)return null;if(B.length===1)return{code:E};let H=B[1];return{code:E,...H&&{region:H}}}getAcceptEncoding(){let U=this.get("Accept-Encoding");if(!U)return null;return U.split(",").map((T)=>T.trim())}getHost(){return this.get("Host")}getUserAgent(){let U=this.get("User-Agent")||null;return U?N(U):null}getReferer(){return this.get("Referer")}getOrigin(){return this.get("Origin")}getAuthorization(){return this.get("Authorization")}getBasicAuth(){let U=this.get("Authorization");if(!U)return null;let T=U.match(/Basic +(?<auth>[^, ]+)/);if(!T)return null;return T[1]||null}getBearerToken(){return(this.get("Authorization")||null)?.match(/Bearer +(?<token>[^, ]+)/)?.[1]||null}getCookies(){let U=this.get("Cookie");if(!U)return null;let T={};return U.split(";").forEach((B)=>{let[E,...H]=B.trim().split("=");if(E&&H.length>0){let z=H.join("=");T[E.trim()]=decodeURIComponent(z.trim())}}),Object.keys(T).length>0?T:null}getCookie(U){return this.getCookies()?.[U]||null}getIp(){return this.get("X-Forwarded-For")||this.get("X-Real-IP")||null}getXForwardedFor(){return this.get("X-Forwarded-For")}getXRealIP(){return this.get("X-Real-IP")}getClientIps(){let U=[],T=this.getXForwardedFor();if(T){let H=T.split(",").map((z)=>z.trim());U.push(...H)}let B=this.getXRealIP();if(B&&!U.includes(B))U.push(B);let E=this.getIp();if(E&&!U.includes(E))U.push(E);return U.filter((H)=>H&&H.length>0)}getCacheControl(){return this.get("Cache-Control")}getEtag(){return this.get("Etag")}getLastModified(){let U=this.get("Last-Modified");return U?new Date(U):null}getIfModifiedSince(){let U=this.get("If-Modified-Since");return U?new Date(U):null}getIfNoneMatch(){return this.get("If-None-Match")}getAccessControlAllowOrigin(){return this.get("Access-Control-Allow-Origin")}getAccessControlAllowMethods(){let U=this.get("Access-Control-Allow-Methods");if(!U)return null;return U.split(",").map((T)=>T.trim())}getAccessControlAllowHeaders(){let U=this.get("Access-Control-Allow-Headers");if(!U)return null;return U.split(",").map((T)=>T.trim())}getAccessControlAllowCredentials(){let U=this.get("Access-Control-Allow-Credentials");if(!U)return null;return U.toLowerCase()==="true"}getContentSecurityPolicy(){return this.get("Content-Security-Policy")}getStrictTransportSecurity(){return this.get("Strict-Transport-Security")}getXContentTypeOptions(){return this.get("X-Content-Type-Options")}getXFrameOptions(){return this.get("X-Frame-Options")}getXXSSProtection(){return this.get("X-XSS-Protection")}getLocation(){return this.get("Location")}isSecure(){return this.get("X-Forwarded-Proto")==="https"}isAjax(){return this.get("X-Requested-With")?.toLowerCase()==="xmlhttprequest"}isCorsRequest(){return this.has("Origin")}*[Symbol.iterator](){let U=[];this.native.forEach((T,B)=>{U.push([B,T])});for(let T of U)yield T}}class K extends G{constructor(U){super(U||new Headers)}add(U,T){return this.native.append(U,T),this}remove(U){return this.native.delete(U),this}set(U,T){return this.native.set(U,T),this}contentType(U,T){let B=String(U),E=T?`${B}; charset=${T}`:B;if(this.add("Content-Type",E),B.startsWith("text/")||B==="application/json")this.add("Accept-Charset",T||"utf-8");return this}contentLength(U){return this.add("Content-Length",U.toString()),this}contentDisposition(U){return this.add("Content-Disposition",U)}clearContentType(){return this.remove("Content-Type"),this.remove("Accept-Charset"),this}setJson(U){return this.add("Accept","application/json"),this.contentType("application/json",U),this}setHtml(U){return this.contentType("text/html",U)}setText(U){return this.contentType("text/plain",U)}setForm(U){return this.contentType("application/x-www-form-urlencoded",U)}setFormData(U){return this.contentType("multipart/form-data",U)}setBlobType(U){return this.contentType("application/octet-stream",U)}setAccept(U){return this.add("Accept",U)}setLang(U){return this.set("Accept-Language",U)}setAcceptEncoding(U){return this.add("Accept-Encoding",U.join(", "))}setHost(U){return this.add("Host",U)}setUserAgent(U){return this.add("User-Agent",U)}setReferer(U){return this.add("Referer",U)}setOrigin(U){return this.add("Origin",U)}setAuthorization(U){return this.add("Authorization",U)}setBasicAuth(U){return this.add("Authorization",`Basic ${U}`)}setBearerToken(U){return this.add("Authorization",`Bearer ${U}`)}setCookie(U,T,B){let E=`${U}=${T}`;if(B?.maxAge!==void 0)E+=`; Max-Age=${B.maxAge}`;if(B?.expires)E+=`; Expires=${B.expires.toUTCString()}`;if(B?.path)E+=`; Path=${B.path}`;if(B?.domain)E+=`; Domain=${B.domain}`;if(B?.secure)E+="; Secure";if(B?.httpOnly)E+="; HttpOnly";if(B?.sameSite)E+=`; SameSite=${B.sameSite}`;return this.add("Set-Cookie",E)}setCookies(U){return U.forEach((T)=>{this.setCookie(T.name,T.value,T.options)}),this}addCookie(U,T,B){return this.setCookie(U,T,B)}removeCookie(U,T){let B=new Date(0);return this.setCookie(U,"",{...T,expires:B,maxAge:0})}setCacheControl(U){return this.add("Cache-Control",U)}setEtag(U){return this.add("Etag",U)}setLastModified(U){return this.add("Last-Modified",U.toUTCString())}setIfModifiedSince(U){return this.add("If-Modified-Since",U.toUTCString())}setAccessControlAllowOrigin(U){return this.add("Access-Control-Allow-Origin",U)}setAccessControlAllowMethods(U){let T=U.join(", ");return this.add("Access-Control-Allow-Methods",T)}setAccessControlAllowHeaders(U){let T=U.join(", ");return this.add("Access-Control-Allow-Headers",T)}setAccessControlAllowCredentials(U){return this.add("Access-Control-Allow-Credentials",U.toString())}setContentSecurityPolicy(U){return this.add("Content-Security-Policy",U)}setStrictTransportSecurity(U,T=!1,B=!1){let E=`max-age=${U}`;if(T)E+="; includeSubDomains";if(B)E+="; preload";return this.add("Strict-Transport-Security",E)}setXContentTypeOptions(U="nosniff"){return this.add("X-Content-Type-Options",U)}setXFrameOptions(U){return this.add("X-Frame-Options",U)}setXXSSProtection(U=!0,T){let B=U?"1":"0";if(U&&T)B+=`; mode=${T}`;return this.add("X-XSS-Protection",B)}setLocation(U){return this.add("Location",U)}setCustom(U){return this.add("X-Custom",U)}}export{G as ReadonlyHeader,K as Header};
2
+
3
+ //# debugId=B656EC330750228F64756E2164756E21
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/ReadonlyHeader.ts", "src/Header.ts"],
4
+ "sourcesContent": [
5
+ "import type { MimeType } from \"@ooneex/http-mimes\";\nimport type { CharsetType, EncodingType, HttpMethodType } from \"@ooneex/types\";\nimport { UAParser } from \"ua-parser-js\";\nimport type { HeaderFieldType, IReadonlyHeader, IUserAgent } from \"./types\";\n\nexport class ReadonlyHeader implements IReadonlyHeader {\n constructor(public readonly native: Headers) {}\n\n public get(name: HeaderFieldType): string | null {\n return this.native.get(name);\n }\n\n public has(name: HeaderFieldType): boolean {\n return this.native.has(name);\n }\n\n public toJson(): Record<string, string> {\n const headers: Record<string, string> = {};\n\n this.native.forEach((value, key) => {\n headers[key] = value;\n });\n\n return headers;\n }\n\n public getContentType(): MimeType | \"*/*\" | null {\n return this.get(\"Content-Type\") as MimeType | \"*/*\" | null;\n }\n\n public getContentLength(): number {\n const length = this.get(\"Content-Length\") || null;\n\n return length ? Number.parseInt(length, 10) : 0;\n }\n\n public getCharset(): CharsetType | null {\n const contentType = this.getContentType();\n\n if (!contentType) {\n return null;\n }\n\n const match = (contentType as string).match(/charset *= *(?<charset>[a-z0-9-]+)/i);\n\n if (!match) {\n return null;\n }\n\n return (match[1]?.toUpperCase() || null) as CharsetType | null;\n }\n\n public getContentDisposition(): string | null {\n return this.get(\"Content-Disposition\");\n }\n\n // Content negotiation\n public getAccept(): MimeType | \"*/*\" | null {\n return (this.get(\"Accept\") ?? null) as MimeType | \"*/*\" | null;\n }\n\n public getLang(): { code: string; region?: string } | null {\n const acceptLanguage = this.get(\"Accept-Language\");\n\n if (!acceptLanguage || acceptLanguage.trim() === \"\") {\n return null;\n }\n\n // Parse the first language from Accept-Language header (same logic as getAcceptLanguage)\n const firstLang = acceptLanguage\n .split(\",\")\n .map((lang) => lang.split(\";\")[0]?.trim())\n .filter((lang): lang is string => Boolean(lang))[0];\n\n if (!firstLang) {\n return null;\n }\n\n const parts = firstLang.split(\"-\");\n\n const code = parts[0];\n if (!code) {\n return null;\n }\n\n if (parts.length === 1) {\n return { code };\n }\n\n const region = parts[1];\n return {\n code,\n ...(region && { region }),\n };\n }\n\n public getAcceptEncoding(): EncodingType[] | null {\n const encoding = this.get(\"Accept-Encoding\");\n\n if (!encoding) {\n return null;\n }\n\n return encoding.split(\",\").map((val) => val.trim()) as EncodingType[] | null;\n }\n\n public getHost(): string | null {\n return this.get(\"Host\");\n }\n\n public getUserAgent(): IUserAgent | null {\n const userAgent = this.get(\"User-Agent\") || null;\n\n return userAgent ? UAParser(userAgent) : null;\n }\n\n public getReferer(): string | null {\n return this.get(\"Referer\");\n }\n\n public getOrigin(): string | null {\n return this.get(\"Origin\");\n }\n\n // Authentication\n public getAuthorization(): string | null {\n return this.get(\"Authorization\");\n }\n\n public getBasicAuth(): string | null {\n const auth = this.get(\"Authorization\");\n\n if (!auth) {\n return null;\n }\n\n const match = auth.match(/Basic +(?<auth>[^, ]+)/);\n\n if (!match) {\n return null;\n }\n\n return match[1] || null;\n }\n\n public getBearerToken(): string | null {\n const token = this.get(\"Authorization\") || null;\n\n const match = token?.match(/Bearer +(?<token>[^, ]+)/);\n\n return match?.[1] || null;\n }\n\n public getCookies(): Record<string, string> | null {\n const cookieHeader = this.get(\"Cookie\");\n\n if (!cookieHeader) {\n return null;\n }\n\n const cookies: Record<string, string> = {};\n\n cookieHeader.split(\";\").forEach((cookie) => {\n const [key, ...valueParts] = cookie.trim().split(\"=\");\n if (key && valueParts.length > 0) {\n const value = valueParts.join(\"=\");\n cookies[key.trim()] = decodeURIComponent(value.trim());\n }\n });\n\n return Object.keys(cookies).length > 0 ? cookies : null;\n }\n\n public getCookie(name: string): string | null {\n const cookies = this.getCookies();\n\n return cookies?.[name] || null;\n }\n\n public getIp(): string | null {\n return this.get(\"X-Forwarded-For\") || this.get(\"X-Real-IP\") || null;\n }\n\n public getXForwardedFor(): string | null {\n return this.get(\"X-Forwarded-For\");\n }\n\n public getXRealIP(): string | null {\n return this.get(\"X-Real-IP\");\n }\n\n public getClientIps(): string[] {\n const ips: string[] = [];\n\n const xForwardedFor = this.getXForwardedFor();\n if (xForwardedFor) {\n const forwardedIps = xForwardedFor.split(\",\").map((ip) => ip.trim());\n ips.push(...forwardedIps);\n }\n\n const xRealIp = this.getXRealIP();\n if (xRealIp && !ips.includes(xRealIp)) {\n ips.push(xRealIp);\n }\n\n const ip = this.getIp();\n if (ip && !ips.includes(ip)) {\n ips.push(ip);\n }\n\n return ips.filter((ip) => ip && ip.length > 0);\n }\n\n public getCacheControl(): string | null {\n return this.get(\"Cache-Control\");\n }\n\n public getEtag(): string | null {\n return this.get(\"Etag\");\n }\n\n public getLastModified(): Date | null {\n const lastModified = this.get(\"Last-Modified\");\n return lastModified ? new Date(lastModified) : null;\n }\n\n public getIfModifiedSince(): Date | null {\n const ifModifiedSince = this.get(\"If-Modified-Since\");\n return ifModifiedSince ? new Date(ifModifiedSince) : null;\n }\n\n public getIfNoneMatch(): string | null {\n return this.get(\"If-None-Match\");\n }\n\n public getAccessControlAllowOrigin(): string | null {\n return this.get(\"Access-Control-Allow-Origin\");\n }\n\n public getAccessControlAllowMethods(): HttpMethodType[] | null {\n const methods = this.get(\"Access-Control-Allow-Methods\");\n\n if (!methods) {\n return null;\n }\n\n return methods.split(\",\").map((method) => method.trim()) as HttpMethodType[];\n }\n\n public getAccessControlAllowHeaders(): string[] | null {\n const headers = this.get(\"Access-Control-Allow-Headers\");\n\n if (!headers) {\n return null;\n }\n\n return headers.split(\",\").map((header) => header.trim());\n }\n\n public getAccessControlAllowCredentials(): boolean | null {\n const credentials = this.get(\"Access-Control-Allow-Credentials\");\n\n if (!credentials) {\n return null;\n }\n\n return credentials.toLowerCase() === \"true\";\n }\n\n public getContentSecurityPolicy(): string | null {\n return this.get(\"Content-Security-Policy\");\n }\n\n public getStrictTransportSecurity(): string | null {\n return this.get(\"Strict-Transport-Security\");\n }\n\n public getXContentTypeOptions(): string | null {\n return this.get(\"X-Content-Type-Options\");\n }\n\n public getXFrameOptions(): string | null {\n return this.get(\"X-Frame-Options\");\n }\n\n public getXXSSProtection(): string | null {\n return this.get(\"X-XSS-Protection\");\n }\n\n public getLocation(): string | null {\n return this.get(\"Location\");\n }\n\n public isSecure(): boolean {\n const proto = this.get(\"X-Forwarded-Proto\");\n return proto === \"https\";\n }\n\n public isAjax(): boolean {\n return this.get(\"X-Requested-With\")?.toLowerCase() === \"xmlhttprequest\";\n }\n\n public isCorsRequest(): boolean {\n return this.has(\"Origin\");\n }\n\n public *[Symbol.iterator](): IterableIterator<[HeaderFieldType, string]> {\n const entries: [HeaderFieldType, string][] = [];\n this.native.forEach((value, key) => {\n entries.push([key as HeaderFieldType, value]);\n });\n for (const entry of entries) {\n yield entry;\n }\n }\n}\n",
6
+ "import type { MimeType } from \"@ooneex/http-mimes\";\nimport type { CharsetType, EncodingType, HttpMethodType } from \"@ooneex/types\";\nimport { ReadonlyHeader } from \"./ReadonlyHeader\";\nimport type { HeaderFieldType, IHeader } from \"./types\";\n\nexport class Header extends ReadonlyHeader implements IHeader {\n constructor(headers?: Headers) {\n super(headers || new Headers());\n }\n\n // Core methods\n public add(name: HeaderFieldType, value: string): this {\n this.native.append(name, value);\n return this;\n }\n\n public remove(name: HeaderFieldType): this {\n this.native.delete(name);\n return this;\n }\n\n public set(name: HeaderFieldType, value: string): this {\n this.native.set(name, value);\n return this;\n }\n\n // Content handling\n public contentType(type: MimeType, charset?: CharsetType): this {\n const typeStr = String(type);\n const value = charset ? `${typeStr}; charset=${charset}` : typeStr;\n this.add(\"Content-Type\", value);\n\n if (typeStr.startsWith(\"text/\") || typeStr === \"application/json\") {\n this.add(\"Accept-Charset\", charset || \"utf-8\");\n }\n\n return this;\n }\n\n public contentLength(length: number): this {\n this.add(\"Content-Length\", length.toString());\n return this;\n }\n\n public contentDisposition(value: string): this {\n return this.add(\"Content-Disposition\", value);\n }\n\n public clearContentType(): this {\n this.remove(\"Content-Type\");\n this.remove(\"Accept-Charset\");\n return this;\n }\n\n // Content type convenience methods\n public setJson(charset?: CharsetType): this {\n this.add(\"Accept\", \"application/json\");\n this.contentType(\"application/json\", charset);\n return this;\n }\n\n public setHtml(charset?: CharsetType): this {\n return this.contentType(\"text/html\", charset);\n }\n\n public setText(charset?: CharsetType): this {\n return this.contentType(\"text/plain\", charset);\n }\n\n public setForm(charset?: CharsetType): this {\n return this.contentType(\"application/x-www-form-urlencoded\", charset);\n }\n\n public setFormData(charset?: CharsetType): this {\n return this.contentType(\"multipart/form-data\", charset);\n }\n\n public setBlobType(charset?: CharsetType): this {\n return this.contentType(\"application/octet-stream\", charset);\n }\n\n // Content negotiation\n public setAccept(mimeType: MimeType): this {\n return this.add(\"Accept\", mimeType as string);\n }\n\n public setLang(language: string): this {\n return this.set(\"Accept-Language\", language);\n }\n\n public setAcceptEncoding(encodings: EncodingType[]): this {\n return this.add(\"Accept-Encoding\", encodings.join(\", \"));\n }\n\n // Request information\n public setHost(host: string): this {\n return this.add(\"Host\", host);\n }\n\n public setUserAgent(userAgent: string): this {\n return this.add(\"User-Agent\", userAgent);\n }\n\n public setReferer(referer: string): this {\n return this.add(\"Referer\", referer);\n }\n\n public setOrigin(origin: string): this {\n return this.add(\"Origin\", origin);\n }\n\n // Authentication\n public setAuthorization(value: string): this {\n return this.add(\"Authorization\", value);\n }\n\n public setBasicAuth(token: string): this {\n return this.add(\"Authorization\", `Basic ${token}`);\n }\n\n public setBearerToken(token: string): this {\n return this.add(\"Authorization\", `Bearer ${token}`);\n }\n\n // Cookies\n public setCookie(\n name: string,\n value: string,\n options?: {\n domain?: string;\n path?: string;\n expires?: Date;\n maxAge?: number;\n secure?: boolean;\n httpOnly?: boolean;\n sameSite?: \"Strict\" | \"Lax\" | \"None\";\n },\n ): this {\n let cookieValue = `${name}=${value}`;\n\n if (options?.maxAge !== undefined) {\n cookieValue += `; Max-Age=${options.maxAge}`;\n }\n if (options?.expires) {\n cookieValue += `; Expires=${options.expires.toUTCString()}`;\n }\n if (options?.path) cookieValue += `; Path=${options.path}`;\n if (options?.domain) cookieValue += `; Domain=${options.domain}`;\n if (options?.secure) cookieValue += \"; Secure\";\n if (options?.httpOnly) cookieValue += \"; HttpOnly\";\n if (options?.sameSite) cookieValue += `; SameSite=${options.sameSite}`;\n\n return this.add(\"Set-Cookie\", cookieValue);\n }\n\n public setCookies(\n cookies: {\n name: string;\n value: string;\n options?: {\n domain?: string;\n path?: string;\n expires?: Date;\n maxAge?: number;\n secure?: boolean;\n httpOnly?: boolean;\n sameSite?: \"Strict\" | \"Lax\" | \"None\";\n };\n }[],\n ): this {\n cookies.forEach((cookie) => {\n this.setCookie(cookie.name, cookie.value, cookie.options);\n });\n return this;\n }\n\n public addCookie(\n name: string,\n value: string,\n options?: {\n domain?: string;\n path?: string;\n expires?: Date;\n maxAge?: number;\n secure?: boolean;\n httpOnly?: boolean;\n sameSite?: \"Strict\" | \"Lax\" | \"None\";\n },\n ): this {\n return this.setCookie(name, value, options);\n }\n\n public removeCookie(\n name: string,\n options?: {\n domain?: string;\n path?: string;\n },\n ): this {\n const pastDate = new Date(0); // January 1, 1970\n return this.setCookie(name, \"\", {\n ...options,\n expires: pastDate,\n maxAge: 0,\n });\n }\n\n // Caching\n public setCacheControl(value: string): this {\n return this.add(\"Cache-Control\", value);\n }\n\n public setEtag(value: string): this {\n return this.add(\"Etag\", value);\n }\n\n public setLastModified(date: Date): this {\n return this.add(\"Last-Modified\", date.toUTCString());\n }\n\n public setIfModifiedSince(date: Date): this {\n return this.add(\"If-Modified-Since\", date.toUTCString());\n }\n\n // CORS\n public setAccessControlAllowOrigin(origin: string): this {\n return this.add(\"Access-Control-Allow-Origin\", origin);\n }\n\n public setAccessControlAllowMethods(methods: HttpMethodType[]): this {\n const value = methods.join(\", \");\n return this.add(\"Access-Control-Allow-Methods\", value);\n }\n\n public setAccessControlAllowHeaders(headers: string[]): this {\n const value = headers.join(\", \");\n return this.add(\"Access-Control-Allow-Headers\", value);\n }\n\n public setAccessControlAllowCredentials(allow: boolean): this {\n return this.add(\"Access-Control-Allow-Credentials\", allow.toString());\n }\n\n // Security headers\n public setContentSecurityPolicy(policy: string): this {\n return this.add(\"Content-Security-Policy\", policy);\n }\n\n public setStrictTransportSecurity(maxAge: number, includeSubDomains = false, preload = false): this {\n let value = `max-age=${maxAge}`;\n if (includeSubDomains) value += \"; includeSubDomains\";\n if (preload) value += \"; preload\";\n return this.add(\"Strict-Transport-Security\", value);\n }\n\n public setXContentTypeOptions(value = \"nosniff\"): this {\n return this.add(\"X-Content-Type-Options\", value);\n }\n\n public setXFrameOptions(value: \"DENY\" | \"SAMEORIGIN\" | string): this {\n return this.add(\"X-Frame-Options\", value);\n }\n\n public setXXSSProtection(enabled = true, mode?: string): this {\n let value = enabled ? \"1\" : \"0\";\n if (enabled && mode) value += `; mode=${mode}`;\n return this.add(\"X-XSS-Protection\", value);\n }\n\n // Redirects\n public setLocation(location: string): this {\n return this.add(\"Location\", location);\n }\n\n // Utility\n public setCustom(value: string): this {\n return this.add(\"X-Custom\", value);\n }\n}\n"
7
+ ],
8
+ "mappings": "AAEA,mBAAS,qBAGF,MAAM,CAA0C,CACzB,OAA5B,WAAW,CAAiB,EAAiB,CAAjB,cAErB,GAAG,CAAC,EAAsC,CAC/C,OAAO,KAAK,OAAO,IAAI,CAAI,EAGtB,GAAG,CAAC,EAAgC,CACzC,OAAO,KAAK,OAAO,IAAI,CAAI,EAGtB,MAAM,EAA2B,CACtC,IAAM,EAAkC,CAAC,EAMzC,OAJA,KAAK,OAAO,QAAQ,CAAC,EAAO,IAAQ,CAClC,EAAQ,GAAO,EAChB,EAEM,EAGF,cAAc,EAA4B,CAC/C,OAAO,KAAK,IAAI,cAAc,EAGzB,gBAAgB,EAAW,CAChC,IAAM,EAAS,KAAK,IAAI,gBAAgB,GAAK,KAE7C,OAAO,EAAS,OAAO,SAAS,EAAQ,EAAE,EAAI,EAGzC,UAAU,EAAuB,CACtC,IAAM,EAAc,KAAK,eAAe,EAExC,GAAI,CAAC,EACH,OAAO,KAGT,IAAM,EAAS,EAAuB,MAAM,qCAAqC,EAEjF,GAAI,CAAC,EACH,OAAO,KAGT,OAAQ,EAAM,IAAI,YAAY,GAAK,KAG9B,qBAAqB,EAAkB,CAC5C,OAAO,KAAK,IAAI,qBAAqB,EAIhC,SAAS,EAA4B,CAC1C,OAAQ,KAAK,IAAI,QAAQ,GAAK,KAGzB,OAAO,EAA6C,CACzD,IAAM,EAAiB,KAAK,IAAI,iBAAiB,EAEjD,GAAI,CAAC,GAAkB,EAAe,KAAK,IAAM,GAC/C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,yBAA0B,CAAK,EAG1C,gBAAgB,CAAC,EAA6C,CACnE,OAAO,KAAK,IAAI,kBAAmB,CAAK,EAGnC,iBAAiB,CAAC,EAAU,GAAM,EAAqB,CAC5D,IAAI,EAAQ,EAAU,IAAM,IAC5B,GAAI,GAAW,EAAM,GAAS,UAAU,IACxC,OAAO,KAAK,IAAI,mBAAoB,CAAK,EAIpC,WAAW,CAAC,EAAwB,CACzC,OAAO,KAAK,IAAI,WAAY,CAAQ,EAI/B,SAAS,CAAC,EAAqB,CACpC,OAAO,KAAK,IAAI,WAAY,CAAK,EAErC",
9
+ "debugId": "B656EC330750228F64756E2164756E21",
10
+ "names": []
11
+ }
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@ooneex/http-header",
3
+ "description": "",
4
+ "version": "0.0.1",
5
+ "type": "module",
6
+ "files": [
7
+ "dist",
8
+ "LICENSE",
9
+ "README.md",
10
+ "package.json"
11
+ ],
12
+ "module": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "import": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ }
20
+ },
21
+ "./package.json": "./package.json"
22
+ },
23
+ "license": "MIT",
24
+ "scripts": {
25
+ "test": "bun test tests",
26
+ "build": "bunup",
27
+ "lint": "tsgo --noEmit && bunx biome lint",
28
+ "publish:prod": "bun publish --tolerate-republish --access public",
29
+ "publish:pack": "bun pm pack --destination ./dist",
30
+ "publish:dry": "bun publish --dry-run"
31
+ },
32
+ "dependencies": {
33
+ "ua-parser-js": "^2.0.6"
34
+ },
35
+ "devDependencies": {
36
+ "@ooneex/http-mimes": "0.0.1",
37
+ "@ooneex/types": "0.0.1"
38
+ },
39
+ "peerDependencies": {}
40
+ }