@d1g1tal/transportr 0.0.2
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.
- package/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/transportr.js +887 -0
- package/dist/transportr.min.js +4 -0
- package/dist/transportr.min.js.map +7 -0
- package/index.d.ts +5 -0
- package/index.js +5 -0
- package/package.json +70 -0
- package/src/http-media-type.d.ts +149 -0
- package/src/http-media-type.js +150 -0
- package/src/http-request-headers.d.ts +43 -0
- package/src/http-request-headers.js +306 -0
- package/src/http-request-methods.d.ts +12 -0
- package/src/http-request-methods.js +271 -0
- package/src/http-response-headers.d.ts +46 -0
- package/src/http-response-headers.js +344 -0
- package/src/transportr.d.ts +509 -0
- package/src/transportr.js +462 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var Transportr=(()=>{var H=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ie=Object.prototype.hasOwnProperty;var ce=(r,e,t)=>e in r?H(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var le=(r,e)=>{for(var t in e)H(r,t,{get:e[t],enumerable:!0})},pe=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of oe(e))!ie.call(r,s)&&s!==t&&H(r,s,{get:()=>e[s],enumerable:!(a=ne(e,s))||a.enumerable});return r};var de=r=>pe(H({},"__esModule",{value:!0}),r);var S=(r,e,t)=>(ce(r,typeof e!="symbol"?e+"":e,t),t),j=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var u=(r,e,t)=>(j(r,e,"read from private field"),t?t.call(r):e.get(r)),x=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},Z=(r,e,t,a)=>(j(r,e,"write to private field"),a?a.call(r,t):e.set(r,t),t);var i=(r,e,t)=>(j(r,e,"access private method"),t);var _e={};le(_e,{default:()=>h});var g=class{#e;constructor(e=[]){this.#e=Array.of(...e)}static from(e,t,a){return new g(Array.from(e,t,a))}static withSize(e){return new g(new Array(e))}add(e){return this.#e.push(e),this}addAll(e){return this.#e.push(...e),this}clear(){this.#e.length=0}concat(e){return this(this.#e.concat(...e))}every(e){return this.#e.every((t,a)=>e(t,a,this))}some(e){return this.#e.some((t,a)=>e(t,a,this))}filter(e){return new g(this.#e.filter((t,a)=>e(t,a,this)))}find(e,t){return this.#e.find((a,s)=>e(a,s,this),t)}findIndex(e,t){return this.#e.findIndex((a,s)=>e(a,s,this),t)}map(e){return new g(this.#e.map((t,a)=>e(t,a,this)))}reduce(e,t){return this.#e.reduce(e,t)}sort(e){return this.#e.sort(e),this}forEach(e){this.#e.forEach((t,a)=>e(t,a,this))}get(e,t=0){return this.#e.at(this.#e.indexOf(e,t))}has(e){return this.#e.includes(e)}insert(e,t){this.#e.splice(e,0,t)}delete(e){return this.#e.splice(this.#e.indexOf(e),1).length==1}deleteAt(e){return this.#e.splice(e,1).length==1}keys(){return this.#e.keys()}values(){return this[Symbol.iterator]()}entries(){return this.#e.entries()}isEmpty(){return this.#e.length===0}toArray(){return[...this.#e]}toString(){return this.#e.toString()}valueOf(){return this.#e.valueOf()}get size(){return this.#e.length}[Symbol.iterator](){return this.#e[Symbol.iterator]()}get[Symbol.toStringTag](){return"List"}};var M=class extends Map{set(e,t){return super.set(e,(this.get(e)??new g).add(t)),this}[Symbol.toStringTag](){return"MultiMap"}};var A=class extends Map{set(e,t){return super.set(e,(super.get(e)??new Set).add(t)),this}[Symbol.toStringTag](){return"SetMultiMap"}};var v=class{#e;#t;constructor(e){this.#e=e,this.#t=null}get value(){return this.#e}get next(){return this.#t}get[Symbol.toStringTag](){return"Node"}};var L=class extends Map{set(e,t){return super.set(e,(super.get(e)??new WeakSet).add(t)),this}[Symbol.toStringTag](){return"WeakSetMultiMap"}};var he=r=>r?.constructor??r?.prototype?.constructor??globalThis[Object.prototype.toString.call(r).slice(8,-1)]??r,k=he;var ue=(r,e)=>k(r)===e,b=ue;var K=(...r)=>r.reduce((e,t)=>(Object.keys(t).forEach(a=>{let s=e[a],p=t[a];Array.isArray(s)&&Array.isArray(p)?e[a]=[...new Set([...p,...s])]:b(s,Object)&&b(p,Object)?e[a]=K(s,p):e[a]=p}),e),{}),l=K;var Q=r=>r.replace(/^[ \t\n\r]+/u,"").replace(/[ \t\n\r]+$/u,""),z=r=>r.replace(/[ \t\n\r]+$/u,""),ee=r=>r===" "||r===" "||r===`
|
|
2
|
+
`||r==="\r",E=r=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(r),D=r=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(r),f=r=>r.replace(/[A-Z]/ug,e=>e.toLowerCase()),te=(r,e)=>{let t="";for(e++;;){for(;e<r.length&&r[e]!=='"'&&r[e]!=="\\";)t+=r[e],++e;if(e>=r.length)break;let a=r[e];if(++e,a==="\\"){if(e>=r.length){t+="\\";break}t+=r[e],++e}else break}return[t,e]};var w=class{constructor(e){this._map=e}get size(){return this._map.size}get(e){return this._map.get(f(String(e)))}has(e){return this._map.has(f(String(e)))}set(e,t){if(e=f(String(e)),t=String(t),!E(e))throw new Error(`Invalid media type parameter name "${e}": only HTTP token code points are valid.`);if(!D(t))throw new Error(`Invalid media type parameter value "${t}": only HTTP quoted-string token code points are valid.`);return this._map.set(e,t),this}clear(){this._map.clear()}delete(e){return e=f(String(e)),this._map.delete(e)}forEach(e,t){this._map.forEach(e,t)}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}[Symbol.iterator](){return this._map[Symbol.iterator]()}};var fe=r=>{r=Q(r);let e=0,t="";for(;e<r.length&&r[e]!=="/";)t+=r[e],++e;if(t.length===0||!E(t)||e>=r.length)return null;++e;let a="";for(;e<r.length&&r[e]!==";";)a+=r[e],++e;if(a=z(a),a.length===0||!E(a))return null;let s={type:f(t),subtype:f(a),parameters:new Map};for(;e<r.length;){for(++e;ee(r[e]);)++e;let p="";for(;e<r.length&&r[e]!==";"&&r[e]!=="=";)p+=r[e],++e;if(p=f(p),e<r.length){if(r[e]===";")continue;++e}let d=null;if(r[e]==='"')for([d,e]=te(r,e);e<r.length&&r[e]!==";";)++e;else{for(d="";e<r.length&&r[e]!==";";)d+=r[e],++e;if(d=z(d),d==="")continue}p.length>0&&E(p)&&D(d)&&!s.parameters.has(p)&&s.parameters.set(p,d)}return s},$=fe;var me=r=>{let e=`${r.type}/${r.subtype}`;if(r.parameters.size===0)return e;for(let[t,a]of r.parameters)e+=";",e+=t,e+="=",(!E(a)||a.length===0)&&(a=a.replace(/(["\\])/ug,"\\$1"),a=`"${a}"`),e+=a;return e},B=me;var o=class{constructor(e){e=String(e);let t=$(e);if(t===null)throw new Error(`Could not parse media type string '${e}'`);this._type=t.type,this._subtype=t.subtype,this._parameters=new w(t.parameters)}static parse(e){try{return new this(e)}catch{return null}}get essence(){return`${this.type}/${this.subtype}`}get type(){return this._type}set type(e){if(e=f(String(e)),e.length===0)throw new Error("Invalid type: must be a non-empty string");if(!E(e))throw new Error(`Invalid type ${e}: must contain only HTTP token code points`);this._type=e}get subtype(){return this._subtype}set subtype(e){if(e=f(String(e)),e.length===0)throw new Error("Invalid subtype: must be a non-empty string");if(!E(e))throw new Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return B(this)}isJavaScript({prohibitParameters:e=!1}={}){switch(this._type){case"text":switch(this._subtype){case"ecmascript":case"javascript":case"javascript1.0":case"javascript1.1":case"javascript1.2":case"javascript1.3":case"javascript1.4":case"javascript1.5":case"jscript":case"livescript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}case"application":switch(this._subtype){case"ecmascript":case"javascript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}default:return!1}}isXML(){return this._subtype==="xml"&&(this._type==="text"||this._type==="application")||this._subtype.endsWith("+xml")}isHTML(){return this._subtype==="html"&&this._type==="text"}get[Symbol.toStringTag](){return"MediaType"}};var Te={AAC:"audio/aac",ABW:"application/x-abiword",ARC:"application/x-freearc",AVIF:"image/avif",AVI:"video/x-msvideo",AZW:"application/vnd.amazon.ebook",BIN:"application/octet-stream",BMP:"image/bmp",BZIP:"application/x-bzip",BZIP2:"application/x-bzip2",CDA:"application/x-cdf",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",GZIP:"application/gzip",GIF:"image/gif",HTML:"text/html",ICO:"image/vnd.microsoft.icon",ICS:"text/calendar",JAR:"application/java-archive",JPEG:"image/jpeg",JAVA_SCRIPT:"text/javascript",JSON:"application/json",JSON_LD:"application/ld+json",MID:"audio/midi",X_MID:"audio/x-midi",MP3:"audio/mpeg",MP4A:"audio/mp4",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",TAR:"application/x-tar",TIFF:"image/tiff",TRANSPORT_STREAM:"video/mp2t",TTF:"font/ttf",TEXT:"text/plain",VSD:"application/vnd.visio",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"},n=Te;var ge={ACCEPT:"accept",ACCEPT_CHARSET:"accept-charset",ACCEPT_ENCODING:"accept-encoding",ACCEPT_LANGUAGE:"accept-language",AUTHORIZATION:"authorization",CACHE_CONTROL:"cache-control",CONNECTION:"connection",COOKIE:"cookie",CONTENT_LENGTH:"content-length",CONTENT_MD5:"content-md5",CONTENT_TYPE:"content-type",DATE:"date",EXPECT:"expect",FROM:"from",HOST:"host",IF_MATCH:"if-match",IF_MODIFIED_SINCE:"if-modified-since",IF_NONE_MATCH:"if-none-match",IF_RANGE:"if-range",IF_UNMODIFIED_SINCE:"if-unmodified-since",MAX_FORWARDS:"max-forwards",ORIGIN:"origin",PRAGMA:"pragma",PROXY_AUTHORIZATION:"proxy-authorization",RANGE:"range",REFERER:"referer",TE:"te",USER_AGENT:"user-agent",UPGRADE:"upgrade",VIA:"via",WARNING:"warning",X_REQUESTED_WITH:"x-requested-with",DNT:"dnt",X_FORWARDED_FOR:"x-forwarded-for",X_FORWARDED_HOST:"x-forwarded-host",X_FORWARDED_PROTO:"x-forwarded-proto",FRONT_END_HTTPS:"front-end-https",X_HTTP_METHOD_OVERRIDE:"x-http-method-override",X_ATT_DEVICE_ID:"x-att-deviceid",X_WAP_PROFILE:"x-wap-profile"},O=ge;var Ee={OPTIONS:"OPTIONS",GET:"GET",HEAD:"HEAD",POST:"POST",PUT:"PUT",DELETE:"DELETE",TRACE:"TRACE",CONNECT:"CONNECT",PATCH:"PATCH"},P=Ee;var ye={PROXY_CONNECTION:"proxy-connection",X_UIDH:"x-uidh",X_CSRF_TOKEN:"x-csrf-token",ACCESS_CONTROL_ALLOW_ORIGIN:"access-control-allow-origin",ACCEPT_PATCH:"accept-patch",ACCEPT_RANGES:"accept-ranges",AGE:"age",ALLOW:"allow",CACHE_CONTROL:"cache-control",CONNECTION:"connection",CONTENT_DISPOSITION:"content-disposition",CONTENT_ENCODING:"content-encoding",CONTENT_LANGUAGE:"content-language",CONTENT_LENGTH:"content-length",CONTENT_LOCATION:"content-location",CONTENT_RANGE:"content-range",CONTENT_TYPE:"content-type",DATE:"date",ETAG:"etag",EXPIRES:"expires",LAST_MODIFIED:"last-modified",LINK:"link",LOCATION:"location",P3P:"p3p",PRAGMA:"pragma",PROXY_AUTHENTICATION:"proxy-authenticate",PUBLIC_KEY_PINS:"public-key-pins",RETRY_AFTER:"retry-after",SERVER:"server",SET_COOKIE:"set-cookie",STATUS:"status",STRICT_TRANSPORT_SECURITY:"strict-transport-security",TRAILER:"trailer",TRANSFER_ENCODING:"transfer-encoding",UPGRADE:"upgrade",VARY:"vary",VIA:"via",WARNING:"warning",WWW_AUTHENTICATE:"www-authenticate",X_XSS_PROTECTION:"x-xss-protection",CONTENT_SECURITY_POLICY:"content-security-policy",X_CONTENT_TYPE_OPTIONS:"x-content-type-options",X_POWERED_BY:"x-powered-by"},V=ye;var J=class extends Error{},Oe=/\/$/,N=async r=>await r.text(),re=async r=>await r.json(),I=async r=>await r.blob(),Ce=async r=>await r.arrayBuffer(),xe=async r=>r.body,Pe=async r=>new DOMParser().parseFromString(await r.text(),h.MediaType.XML.essence),R,m,F,G,y,_,T,C,X,ae,W,se,c=class{constructor(e=location.origin){x(this,y);x(this,T);x(this,R,void 0);x(this,G,{body:null,cache:c.CachingPolicy.NO_STORE,credentials:"same-origin",headers:{},integrity:void 0,keepalive:void 0,method:void 0,mode:"cors",redirect:"follow",referrer:"about:client",referrerPolicy:"strict-origin-when-cross-origin",signal:null,window:null});Z(this,R,e instanceof URL?e:e.startsWith("/")?new URL(e,location.origin):new URL(e))}get baseUrl(){return u(this,R)}async get(e,t={}){return i(this,T,C).call(this,e,l(t,{method:P.GET}))}async post(e,t,a={}){return i(this,T,C).call(this,e,l(a,{body:t,method:P.POST}))}async put(e,t={}){return i(this,T,C).call(this,e,l(t,{method:P.PUT}))}async patch(e,t={}){return i(this,T,C).call(this,e,l(t,{method:P.PATCH}))}async delete(e,t={}){return i(this,T,C).call(this,e,l(t,{method:P.DELETE}))}async head(e,t={}){return i(this,T,C).call(this,e,l(t,{method:P.HEAD}))}async options(e,t={}){return i(this,T,C).call(this,e,l(t,{method:P.OPTIONS}))}async request(e,t={}){return i(this,T,C).call(this,e,t)}async getJson(e,t={}){return i(this,y,_).call(this,e,l(t,{headers:{[O.ACCEPT]:c.MediaType.JSON}}),re)}async getXml(e,t={}){return new DOMParser().parseFromString(await i(this,y,_).call(this,e,l(t,{headers:{[O.ACCEPT]:c.MediaType.XML}}),I),n.XML)}async getHtml(e,t={}){return i(this,y,_).call(this,e,l(t,{headers:{[O.ACCEPT]:n.HTML}}),N)}async getScript(e,t={}){return i(this,y,_).call(this,e,l(t,{headers:{[O.ACCEPT]:n.JAVA_SCRIPT}}),N)}async getBlob(e,t={}){return await i(this,y,_).call(this,e,l(t,{headers:{[O.ACCEPT]:n.BIN}}),I)}async getImage(e,t={}){return URL.createObjectURL(await i(this,y,_).call(this,e,l(t,{headers:{[O.ACCEPT]:"image/*"}}),I))}async getBuffer(e,t={}){return await i(this,y,_).call(this,e,l(t,{headers:{[O.ACCEPT]:n.BIN}}),Ce)}async getStream(e,t={}){return await i(this,y,_).call(this,e,l(t,{headers:{[O.ACCEPT]:n.BIN}}),xe)}},h=c;R=new WeakMap,m=new WeakMap,F=new WeakMap,G=new WeakMap,y=new WeakSet,_=async function(e,t,a){return i(this,T,C).call(this,e,l(t,{method:c.Method.GET}),a)},T=new WeakSet,C=async function(e,t,a){var Y,q;console.debug(`Calling '${e}'`);let s=l(u(this,G),t);new Headers(s.headers).get(c.RequestHeader.CONTENT_TYPE)==c.MediaType.JSON&&(s.body=JSON.stringify(s.body));let d;try{d=await fetch(i(Y=c,X,ae).call(Y,u(this,R),e,s.searchParams),s)}catch(U){console.error(U),process.exit(1)}if(!d.ok)throw new J(`An error has occurred with your request: ${d.status} - ${await d.text()}`);try{return await(a?a(d):i(q=c,W,se).call(q,d))}catch(U){console.error(U),process.exit(1)}},X=new WeakSet,ae=function(e,t,a={}){e=new URL(`${e.pathname.replace(Oe,"")}${t}`,e.origin);for(let[s,p]of Object.entries(a))e.searchParams.has(s)?e.searchParams.set(s,p):e.searchParams.append(s,p);return e},W=new WeakSet,se=async function(e){let t=new o(e.headers.get(V.CONTENT_TYPE));for(let[a,s]of u(c,F).entries())if(s.has(t.subtype))return await a(e);return console.warn("Unable to process response. Unknown content-type or no response handler defined."),e},x(h,X),x(h,W),x(h,m,{JSON:new o(n.JSON),XML:new o(n.XML),HTML:new o(n.HTML),SCRIPT:new o(n.JAVA_SCRIPT),TEXT:new o(n.TEXT),CSS:new o(n.CSS),WEBP:new o(n.WEBP),PNG:new o(n.PNG),GIF:new o(n.GIF),JPG:new o(n.JPEG),OTF:new o(n.OTF),WOFF:new o(n.WOFF),WOFF2:new o(n.WOFF2),TTF:new o(n.TTF),PDF:new o(n.PDF)}),x(h,F,new A([[re,u(c,m).JSON.subtype],[N,u(c,m).HTML.subtype],[N,u(c,m).SCRIPT.subtype],[N,u(c,m).CSS.subtype],[N,u(c,m).TEXT.subtype],[Pe,u(c,m).XML.subtype],[I,u(c,m).GIF.subtype],[I,u(c,m).JPG.subtype],[I,u(c,m).PNG.subtype]])),S(h,"Method",Object.freeze(P)),S(h,"MediaType",n),S(h,"RequestHeader",O),S(h,"ResponseHeader",Object.freeze(V)),S(h,"CachingPolicy",{DEFAULT:"default",FORCE_CACHE:"force-cache",NO_CACHE:"no-cache",NO_STORE:"no-store",ONLY_IF_CACHED:"only-if-cached",RELOAD:"reload"}),S(h,"CredentialsPolicy",{INCLUDE:"include",OMIT:"omit",SAME_ORIGIN:"same-origin"});return de(_e);})();
|
|
3
|
+
window.Transportr = Transportr.default;
|
|
4
|
+
//# sourceMappingURL=transportr.min.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/transportr.js", "../node_modules/@d1g1tal/collections/src/list.js", "../node_modules/@d1g1tal/collections/src/multi-map.js", "../node_modules/@d1g1tal/collections/src/set-multi-map.js", "../node_modules/@d1g1tal/collections/src/node.js", "../node_modules/@d1g1tal/collections/src/weak-set-multi-map.js", "../node_modules/@d1g1tal/chrysalis/src/esm/object-type.js", "../node_modules/@d1g1tal/chrysalis/src/esm/object-is-type.js", "../node_modules/@d1g1tal/chrysalis/src/esm/object-merge.js", "../node_modules/@d1g1tal/media-type/src/utils.js", "../node_modules/@d1g1tal/media-type/src/media-type-parameters.js", "../node_modules/@d1g1tal/media-type/src/parser.js", "../node_modules/@d1g1tal/media-type/src/serializer.js", "../node_modules/@d1g1tal/media-type/src/media-type.js", "../src/http-media-type.js", "../src/http-request-headers.js", "../src/http-request-methods.js", "../src/http-response-headers.js"],
|
|
4
|
+
"sourcesContent": ["import { SetMultiMap } from '@d1g1tal/collections';\nimport { _objectMerge } from '@d1g1tal/chrysalis';\nimport { MediaType } from '@d1g1tal/media-type';\nimport HttpMediaType from './http-media-type.js';\nimport HttpRequestHeader from './http-request-headers.js';\nimport HttpRequestMethod from './http-request-methods.js';\nimport HttpResponseHeader from './http-response-headers.js';\n\n/**\n * @template T extends ResponseBody\n * @typedef {function(Response): Promise<T>} ResponseHandler<T>\n */\n\n/** @typedef {Object<string, (boolean|string|number|Array)>} JsonObject */\n/** @typedef {Blob|ArrayBuffer|TypedArray|DataView|FormData|URLSearchParams|string|ReadableStream} RequestBody */\n/** @typedef {Blob|ArrayBuffer|FormData|string|ReadableStream} ResponseBody */\n/** @typedef {'default'|'force-cache'|'no-cache'|'no-store'|'only-if-cached'|'reload'} RequestCache */\n/** @typedef {'include'|'omit'|'same-origin'} RequestCredentials */\n/** @typedef {Headers|Object<string, string>} RequestHeaders */\n/** @typedef {'GET'|'POST'|'PUT'|'PATCH'|'DELETE'|'HEAD'|'OPTIONS'} RequestMethod */\n/** @typedef {'cors'|'navigate'|'no-cors'|'same-origin'} RequestMode */\n/** @typedef {'error'|'follow'|'manual'} RequestRedirect */\n/** @typedef {''|'no-referrer'|'no-referrer-when-downgrade'|'origin'|'origin-when-cross-origin'|'same-origin'|'strict-origin'|'strict-origin-when-cross-origin'|'unsafe-url'} ReferrerPolicy */\n/** @typedef {Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|BigInt64Array|BigUint64Array} TypedArray */\n\n/**\n * The options for a {@link Request} object or the second parameter of a {@link fetch} request\n *\n * @typedef {Object} RequestOptions\n * @property {RequestBody} body A RequestInit object or null to set request's body.\n * @property {RequestCache} cache A string indicating how the request will interact with the browser's cache to set request's cache.\n * @property {RequestCredentials} credentials A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.\n * @property {RequestHeaders} headers A Headers object, an object literal, or an array of two-item arrays to set request's headers.\n * @property {string} integrity A cryptographic hash of the resource to be fetched by request. Sets request's integrity.\n * @property {boolean} keepalive A boolean to set request's keepalive.\n * @property {RequestMethod} method A string to set request's method.\n * @property {RequestMode} mode A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.\n * @property {RequestRedirect} redirect A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.\n * @property {string} referrer A string whose value is a same-origin URL, \"about:client\", or the empty string, to set request's referrer.\n * @property {ReferrerPolicy} referrerPolicy A referrer policy to set request's referrerPolicy.\n * @property {AbortSignal} signal An AbortSignal to set request's signal.\n * @property {null} window Can only be null. Used to disassociate request from any Window.\n */\n\n/** @extends Error */\nclass HttpError extends Error {}\n\n/** @type {RegExp} */\nconst endsWithSlashRegEx = /\\/$/;\n\n/** @type {ResponseHandler<string>} */\nconst _handleText = async (response) => await response.text();\n\n/** @type {ResponseHandler<JsonObject>} */\nconst _handleJson = async (response) => await response.json();\n\n/** @type {ResponseHandler<Blob>} */\nconst _handleBlob = async (response) => await response.blob();\n\n/** @type {ResponseHandler<ArrayBuffer>} */\nconst _handleBuffer = async (response) => await response.arrayBuffer();\n\n/** @type {ResponseHandler<ReadableStream<Uint8Array>} */\nconst _handleReadableStream = async (response) => response.body;\n\n/** @type {ResponseHandler<Document>} */\nconst _handleXml = async (response) => new DOMParser().parseFromString(await response.text(), Transportr.MediaType.XML.essence);\n\nexport default class Transportr {\n\t#baseUrl;\n\t/**\n\t * @static\n\t * @constant {Object<string, MediaType>}\n\t */\n\tstatic #MediaType = {\n\t\tJSON: new MediaType(HttpMediaType.JSON),\n\t\tXML: new MediaType(HttpMediaType.XML),\n\t\tHTML: new MediaType(HttpMediaType.HTML),\n\t\tSCRIPT: new MediaType(HttpMediaType.JAVA_SCRIPT),\n\t\tTEXT: new MediaType(HttpMediaType.TEXT),\n\t\tCSS: new MediaType(HttpMediaType.CSS),\n\t\tWEBP: new MediaType(HttpMediaType.WEBP),\n\t\tPNG: new MediaType(HttpMediaType.PNG),\n\t\tGIF: new MediaType(HttpMediaType.GIF),\n\t\tJPG: new MediaType(HttpMediaType.JPEG),\n\t\tOTF: new MediaType(HttpMediaType.OTF),\n\t\tWOFF: new MediaType(HttpMediaType.WOFF),\n\t\tWOFF2: new MediaType(HttpMediaType.WOFF2),\n\t\tTTF: new MediaType(HttpMediaType.TTF),\n\t\tPDF: new MediaType(HttpMediaType.PDF)\n\t};\n\t/**\n\t * @static\n\t * @type {SetMultiMap<ResponseHandler<ResponseBody>, string>}\n\t */\n\tstatic #contentTypeHandlers = new SetMultiMap([\n\t\t[_handleJson, Transportr.#MediaType.JSON.subtype],\n\t\t[_handleText, Transportr.#MediaType.HTML.subtype],\n\t\t[_handleText, Transportr.#MediaType.SCRIPT.subtype],\n\t\t[_handleText, Transportr.#MediaType.CSS.subtype],\n\t\t[_handleText, Transportr.#MediaType.TEXT.subtype],\n\t\t[_handleXml, Transportr.#MediaType.XML.subtype],\n\t\t[_handleBlob, Transportr.#MediaType.GIF.subtype],\n\t\t[_handleBlob, Transportr.#MediaType.JPG.subtype],\n\t\t[_handleBlob, Transportr.#MediaType.PNG.subtype]\n\t]);\n\n\t/**\n\t * Create a new Transportr instance with the provided location or origin and context path.\n\t *\n\t * @param {URL | string} [url = location.origin] The URL for {@link fetch} requests.\n\t */\n\tconstructor(url = location.origin) {\n\t\t/** @type {URL} */\n\t\tthis.#baseUrl = url instanceof URL ? url : url.startsWith('/') ? new URL(url, location.origin) : new URL(url);\n\t}\n\n\t/**\n\t * @static\n\t * @constant {Object<string, 'GET'|'POST'|'PUT'|'PATCH'|'DELETE'|'HEAD'|'OPTIONS'|'TRACE'|'CONNECT'>}\n\t */\n\tstatic Method = Object.freeze(HttpRequestMethod);\n\n\t/**\n\t * @static\n\t * @constant {Object<string, string>}\n\t */\n\tstatic MediaType = HttpMediaType;\n\n\t/**\n\t * @static\n\t * @constant {Object<string, string>}\n\t */\n\tstatic RequestHeader = HttpRequestHeader;\n\n\t/**\n\t * @static\n\t * @constant {Object<string, string>}\n\t */\n\tstatic ResponseHeader = Object.freeze(HttpResponseHeader);\n\n\tstatic CachingPolicy = {\n\t\tDEFAULT: 'default',\n\t\tFORCE_CACHE: 'force-cache',\n\t\tNO_CACHE: 'no-cache',\n\t\tNO_STORE: 'no-store',\n\t\tONLY_IF_CACHED: 'only-if-cached',\n\t\tRELOAD: 'reload'\n\t};\n\n\t/**\n\t * @static\n\t * @type {Object<string, string>}\n\t */\n\tstatic CredentialsPolicy = {\n\t\tINCLUDE: 'include',\n\t\tOMIT: 'omit',\n\t\tSAME_ORIGIN: 'same-origin'\n\t};\n\n\t/** @type {RequestOptions} */\n\t#defaultRequestOptions = {\n\t\tbody: null,\n\t\tcache: Transportr.CachingPolicy.NO_STORE,\n\t\tcredentials: 'same-origin',\n\t\theaders: {},\n\t\tintegrity: undefined,\n\t\tkeepalive: undefined,\n\t\tmethod: undefined,\n\t\tmode: 'cors',\n\t\tredirect: 'follow',\n\t\treferrer: 'about:client',\n\t\treferrerPolicy: 'strict-origin-when-cross-origin',\n\t\tsignal: null,\n\t\twindow: null\n\t};\n\n\t/**\n\t *\n\t * @returns {URL} The base URL used for requests\n\t */\n\tget baseUrl() {\n\t\treturn this.#baseUrl;\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<*>}\n\t */\n\tasync get(path, options = {}) {\n\t\treturn this.#request(path, _objectMerge(options, { method: HttpRequestMethod.GET }));\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {Object} body\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<*>}\n\t */\n\tasync post(path, body, options = {}) {\n\t\treturn this.#request(path, _objectMerge(options, { body, method: HttpRequestMethod.POST }));\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<*>}\n\t */\n\tasync put(path, options = {}) {\n\t\treturn this.#request(path, _objectMerge(options, { method: HttpRequestMethod.PUT }));\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<*>}\n\t */\n\tasync patch(path, options = {}) {\n\t\treturn this.#request(path, _objectMerge(options, { method: HttpRequestMethod.PATCH }));\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<*>}\n\t */\n\tasync delete(path, options = {}) {\n\t\treturn this.#request(path, _objectMerge(options, { method: HttpRequestMethod.DELETE }));\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<*>}\n\t */\n\tasync head(path, options = {}) {\n\t\treturn this.#request(path, _objectMerge(options, { method: HttpRequestMethod.HEAD }));\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<*>}\n\t */\n\tasync options(path, options = {}) {\n\t\treturn this.#request(path, _objectMerge(options, { method: HttpRequestMethod.OPTIONS }));\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<*>}\n\t */\n\tasync request(path, options = {}) {\n\t\treturn this.#request(path, options);\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<JsonObject>}\n\t */\n\tasync getJson(path, options = {}) {\n\t\treturn this.#get(path, _objectMerge(options, { headers: { [HttpRequestHeader.ACCEPT]: Transportr.MediaType.JSON } }), _handleJson);\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<Document>}\n\t */\n\tasync getXml(path, options = {}) {\n\t\treturn new DOMParser().parseFromString(await this.#get(path, _objectMerge(options, { headers: { [HttpRequestHeader.ACCEPT]: Transportr.MediaType.XML } }), _handleBlob), HttpMediaType.XML);\n\t}\n\n\t/**\n\t * TODO - Add way to return portion of the retrieved HTML using a selector. Like jQuery.\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<string>}\n\t */\n\tasync getHtml(path, options = {}) {\n\t\treturn this.#get(path, _objectMerge(options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.HTML } }), _handleText);\n\t}\n\n\t/**\n\t * TODO - Do I need this? What special handling might this need??\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<string>}\n\t */\n\tasync getScript(path, options = {}) {\n\t\treturn this.#get(path, _objectMerge(options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.JAVA_SCRIPT } }), _handleText);\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<Blob>}\n\t */\n\tasync getBlob(path, options = {}) {\n\t\treturn await this.#get(path, _objectMerge(options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.BIN } }), _handleBlob);\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<string>}\n\t */\n\tasync getImage(path, options = {}) {\n\t\treturn URL.createObjectURL(await this.#get(path, _objectMerge(options, { headers: { [HttpRequestHeader.ACCEPT]: 'image/*' } }), _handleBlob));\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<ArrayBuffer>}\n\t */\n\tasync getBuffer(path, options = {}) {\n\t\treturn await this.#get(path, _objectMerge(options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.BIN } }), _handleBuffer);\n\t}\n\n\t/**\n\t *\n\t * @async\n\t * @param {string} path\n\t * @param {RequestOptions} [options = {}]\n\t * @returns {Promise<ReadableStream<Uint8Array>}\n\t */\n\tasync getStream(path, options = {}) {\n\t\treturn await this.#get(path, _objectMerge(options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.BIN } }), _handleReadableStream);\n\t}\n\n\t/**\n\t *\n\t * @param {string} path\n\t * @param {RequestOptions} options\n\t * @param {ResponseHandler} responseHandler\n\t * @returns\n\t */\n\tasync #get(path, options, responseHandler) {\n\t\treturn this.#request(path, _objectMerge(options, { method: Transportr.Method.GET }), responseHandler);\n\t}\n\n\t/**\n\t *\n\t * @private\n\t * @async\n\t * @param {string} path\n\t * @param {RequestInit} options\n\t * @param {ResponseHandler<ResponseBody>} [responseHandler]\n\t * @returns {Promise<ResponseBody|Response>}\n\t */\n\tasync #request(path, options, responseHandler) {\n\t\tconsole.debug(`Calling '${path}'`);\n\n\t\t/** @type {RequestOptions} */\n\t\tconst requestOptions = _objectMerge(this.#defaultRequestOptions, options);\n\t\tconst headers = new Headers(requestOptions.headers);\n\n\t\tif (headers.get(Transportr.RequestHeader.CONTENT_TYPE) == Transportr.MediaType.JSON) {\n\t\t\trequestOptions.body = JSON.stringify(requestOptions.body);\n\t\t}\n\n\t\tlet response;\n\t\ttry {\n\t\t\tresponse = await fetch(Transportr.#createUrl(this.#baseUrl, path, requestOptions.searchParams), requestOptions);\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t\t// Need to ensure that the process terminates since an error occurred.\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\tif (!response.ok) {\n\t\t\tthrow new HttpError(`An error has occurred with your request: ${response.status} - ${await response.text()}`);\n\t\t}\n\n\t\ttry {\n\t\t\treturn await (responseHandler ? responseHandler(response) : Transportr.#processResponse(response));\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t\t// Need to ensure that the process terminates since an error occurred.\n\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * @private\n\t * @static\n\t * @param {URL} url\n\t * @param {string} path\n\t * @param {Object} [searchParams = {}]\n\t * @returns {URL}\n\t */\n\tstatic #createUrl(url, path, searchParams = {}) {\n\t\turl = new URL(`${url.pathname.replace(endsWithSlashRegEx, '')}${path}`, url.origin);\n\n\t\tfor (const [ name, value ] of Object.entries(searchParams)) {\n\t\t\tif (url.searchParams.has(name)) {\n\t\t\t\turl.searchParams.set(name, value);\n\t\t\t} else {\n\t\t\t\turl.searchParams.append(name, value);\n\t\t\t}\n\t\t}\n\n\t\treturn url;\n\t}\n\n\t/**\n\t *\n\t * @private\n\t * @static\n\t * @async\n\t * @param {Response} response\n\t * @returns {Promise<ResponseBody|Response>}\n\t */\n\tstatic async #processResponse(response) {\n\t\tconst mediaType = new MediaType(response.headers.get(HttpResponseHeader.CONTENT_TYPE));\n\n\t\tfor (const [responseHandler, contentTypes] of Transportr.#contentTypeHandlers.entries()) {\n\t\t\tif (contentTypes.has(mediaType.subtype)) {\n\t\t\t\treturn await responseHandler(response);\n\t\t\t}\n\t\t}\n\n\t\tconsole.warn('Unable to process response. Unknown content-type or no response handler defined.');\n\n\t\treturn response;\n\t}\n}", "\n/**\n *\n * @template E\n * @typedef {Iterable<E>} List<E>\n */\n\n/**\n * @template E\n * @type {List<E>}\n */\nexport default class List {\n\t/** @type {Array<E>} */\n\t#array;\n\n\t/**\n\t *\n\t * @param {Iterable<E>} [iterable]\n\t */\n\tconstructor(iterable = []) {\n\t\tthis.#array = Array.of(...iterable);\n\t}\n\n\t/**\n\t *\n\t * @param {Iterable<E>} iterable\n\t * @param {function(E, number?)} mapper\n\t * @param {*} context\n\t * @returns {List<E>}\n\t */\n\tstatic from(iterable, mapper, context) {\n\t\treturn new List(Array.from(iterable, mapper, context));\n\t}\n\n\tstatic withSize(size) {\n\t\treturn new List(new Array(size));\n\t}\n\n\t/**\n\t *\n\t * @param {E} element\n\t * @returns {List<E>} The updated list\n\t */\n\tadd(element) {\n\t\tthis.#array.push(element);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t *\n\t * @param {Iterable<E>} iterable\n\t * @returns {List<E>} The updated list\n\t */\n\taddAll(iterable) {\n\t\tthis.#array.push(...iterable);\n\n\t\treturn this;\n\t}\n\n\tclear() {\n\t\tthis.#array.length = 0;\n\t}\n\n\t/**\n\t *\n\t * @param {E} elements\n\t * @returns {List<E>}\n\t */\n\tconcat(elements) {\n\t\treturn this(this.#array.concat(...elements));\n\t}\n\n\t/**\n\t *\n\t * @param {function(E, number?, List<E>?): boolean} predicate\n\t * @returns {boolean}\n\t */\n\tevery(predicate) {\n\t\treturn this.#array.every((element, index) => predicate(element, index, this));\n\t}\n\n\t/**\n\t *\n\t * @param {function(E, number?, List<E>?): boolean} predicate\n\t * @returns {boolean}\n\t */\n\tsome(predicate) {\n\t\treturn this.#array.some((element, index) => predicate(element, index, this));\n\t}\n\n\t/**\n\t *\n\t * @param {function(E, number?, List<E>?): boolean} predicate\n\t * @returns {List<E>}\n\t */\n\tfilter(predicate) {\n\t\treturn new List(this.#array.filter((element, index) => predicate(element, index, this)));\n\t}\n\n\t/**\n\t *\n\t * @param {function(E, number?, List<E>?): boolean} predicate\n\t * @param {*} [context] Optional object to use as this when calling the predicate function\n\t * @returns {E}\n\t */\n\tfind(predicate, context) {\n\t\treturn this.#array.find((element, index) => predicate(element, index, this), context);\n\t}\n\n\t/**\n\t *\n\t * @param {function(E, number?, List<E>?): boolean} predicate\n\t * @param {*} [context] Optional object to use as this when calling the predicate function\n\t * @returns {number}\n\t */\n\tfindIndex(predicate, context) {\n\t\treturn this.#array.findIndex((element, index) => predicate(element, index, this), context);\n\t}\n\n\t/**\n\t *\n\t * @param {function(E, number?, List<E>?)} mapper\n\t * @returns {List<E>}\n\t */\n\tmap(mapper) {\n\t\treturn new List(this.#array.map((element, index) => mapper(element, index, this)));\n\t}\n\n\t/**\n\t * Executes a user-supplied \"reducer\" callback function on each element of the list, in order,\n\t * passing in the return value from the calculation on the preceding element. The final result\n\t * of running the reducer across all elements of the array is a single value.\n\t *\n\t * @param {function(E, E, *)} reducer\n\t * @param {*} [initialValue]\n\t * @returns {*}\n\t */\n\treduce(reducer, initialValue) {\n\t\treturn this.#array.reduce(reducer, initialValue);\n\t}\n\n\t/**\n\t * Sorts the elements of a list in place and returns the reference to the same list, now sorted.\n\t * The default sort order is ascending, built upon converting the elements into strings,\n\t * then comparing their sequences of UTF-16 code units values.\n\t *\n\t * The sort() method preserves empty slots. If the source list is sparse, the empty slots are moved to the end of the list, and always come after all the undefined values.\n\t *\n\t * @example\n\t * // returns\n\t * new List([50, 3, 20, 33, 9, 1]).sort();\n\t * @param {function(E, E): number} [comparator] A function that defines the sort order. If omitted, the list elements are converted to strings, then sorted according to each character's Unicode code point value.\n\t * @returns {List<E>} The reference to the original list, now sorted. Note that the list is sorted in place, and no copy is made.\n\t */\n\tsort(comparator) {\n\t\tthis.#array.sort(comparator);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t *\n\t * @param {function(E, number?, List<E>?): boolean} consumer\n\t */\n\tforEach(consumer) {\n\t\tthis.#array.forEach((element, index) => consumer(element, index, this));\n\t}\n\n\t/**\n\t *\n\t * @param {E} element\n\t * @param {number} [fromIndex]\n\t * @returns {E}\n\t */\n\tget(element, fromIndex = 0) {\n\t\treturn this.#array.at(this.#array.indexOf(element, fromIndex));\n\t}\n\n\t/**\n\t *\n\t * @param {E} element\n\t * @returns {boolean}\n\t */\n\thas(element) {\n\t\treturn this.#array.includes(element);\n\t}\n\n\t/**\n\t * Inserts the entry in a sorted list in the correct position.\n\t * The list must be sorted in ascending order to work.\n\t *\n\t * @param {number} index\n\t * @param {E} element The entry to add to the list.\n\t */\n\tinsert(index, element) {\n\t\tthis.#array.splice(index, 0, element);\n\t}\n\n\t/**\n\t * Removes the element associated to the value and returns a boolean asserting whether an element was successfully removed or not.\n\t *\n\t * @param {E} element The element to remove\n\t * @returns {boolean} true if element was already in {@link List}; otherwise false.\n\t */\n\tdelete(element) {\n\t\treturn this.#array.splice(this.#array.indexOf(element), 1).length == 1;\n\t}\n\n\t/**\n\t * Removes the element at the specified index and returns a boolean asserting whether an element was successfully removed or not.\n\t *\n\t * @param {number} index The element to remove\n\t * @returns {boolean} true if element was already in {@link List}; otherwise false.\n\t */\n\tdeleteAt(index) {\n\t\treturn this.#array.splice(index, 1).length == 1;\n\t}\n\n\tkeys() {\n\t\treturn this.#array.keys();\n\t}\n\n\t/**\n\t *\n\t * @returns {IterableIterator<E>}\n\t */\n\tvalues() {\n\t\treturn this[Symbol.iterator]();\n\t}\n\n\t/**\n\t *\n\t * @returns {IterableIterator<number, E>}\n\t */\n\tentries() {\n\t\treturn this.#array.entries();\n\t}\n\n\t/**\n\t * Checks to see if the list is empty\n\t *\n\t * @returns {boolean} true if the list is empty, false otherwise.\n\t */\n\tisEmpty() {\n\t\treturn this.#array.length === 0;\n\t}\n\n\ttoArray() {\n\t\treturn [...this.#array];\n\t}\n\n\ttoString() {\n\t\treturn this.#array.toString();\n\t}\n\n\tvalueOf() {\n\t\treturn this.#array.valueOf();\n\t}\n\n\tget size() {\n\t\treturn this.#array.length;\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.#array[Symbol.iterator]();\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'List';\n\t}\n}", "import List from './list.js';\n\n/**\n *\n * @template K\n * @template V\n * @typedef {Map<K, V>} MultiMap\n * @extends Map\n */\nexport default class MultiMap extends Map {\n\t/**\n\t * Adds a new element with a specified key and value to the MultiMap.\n\t * If an element with the same key already exists, the value will be added to the underlying {@link List}.\n\t *\n\t * @override\n\t * @template K\n\t * @template V\n\t * @param {K} key The key to set.\n\t * @param {V} value The value to add to the MultiMap\n\t * @returns {MultiMap<K, V>} The MultiMap with the updated key and value.\n\t */\n\tset(key, value) {\n\t\tsuper.set(key, (this.get(key) ?? new List()).add(value));\n\n\t\treturn this;\n\t}\n\n\t[Symbol.toStringTag]() {\n\t\treturn 'MultiMap';\n\t}\n}", "/**\n *\n * @typedef {Map<*, *>} MultiMap\n * @extends Map\n */\nexport default class SetMultiMap extends Map {\n\t/**\n\t * Adds a new element with a specified key and value to the MultiMap. If an element with the same key already exists, the value will be added to the underlying {@link Set}.\n\t *\n\t * @param {*} key The key to set.\n\t * @param {*} value The value to add to the MultiMap\n\t * @returns {MultiMap} The MultiMap with the updated key and value.\n\t */\n\tset(key, value) {\n\t\tsuper.set(key, (super.get(key) ?? new Set()).add(value));\n\n\t\treturn this;\n\t}\n\n\t[Symbol.toStringTag]() {\n\t\treturn 'SetMultiMap';\n\t}\n}", "export default class Node {\n\t#value;\n\t#next;\n\n\tconstructor(value) {\n\t\tthis.#value = value;\n\t\tthis.#next = null;\n\t}\n\n\tget value() {\n\t\treturn this.#value;\n\t}\n\n\tget next() {\n\t\treturn this.#next;\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Node';\n\t}\n}", "/**\n *\n * @typedef {Map<*, *>} MultiMap\n * @extends Map\n */\nexport default class WeakSetMultiMap extends Map {\n\t/**\n\t * Adds a new element with a specified key and value to the MultiMap. If an element with the same key already exists, the value will be added to the underlying {@link Set}.\n\t *\n\t * @param {*} key The key to set.\n\t * @param {*} value The value to add to the MultiMap\n\t * @returns {MultiMap} The MultiMap with the updated key and value.\n\t */\n\tset(key, value) {\n\t\tsuper.set(key, (super.get(key) ?? new WeakSet()).add(value));\n\n\t\treturn this;\n\t}\n\n\t[Symbol.toStringTag]() {\n\t\treturn 'WeakSetMultiMap';\n\t}\n}", "/** @typedef {Object.prototype.constructor} Type */\n\n/**\n * Gets the object type for the current instance.\n *\n * @param {*} object The object to check\n * @returns {Type} The object type\n */\nconst _type = (object) => object?.constructor ?? object?.prototype?.constructor ?? globalThis[Object.prototype.toString.call(object).slice(8, -1)] ?? object;\n\nexport default _type;", "import _type from './object-type.js';\n\n/** @typedef {Object.prototype.constructor} Type */\n\n/**\n * Gets the object type for the provided instance.\n * \n * @param {*} object The instance to compare.\n * @param {Type} type The type to compare.\n * @returns {boolean} true if the provided instance is the type provided, false otherwise.\n */\nconst _isType = (object, type) => _type(object) === type;\n\nexport default _isType;", "import _isType from './object-is-type.js';\n\n/**\n * Performs a deep merge of multiple objects.\n *\n * @param {...Object} objects The objects to merge\n * @returns {Object} The merged object\n */\nconst _objectMerge = (...objects) => {\n\treturn objects.reduce((prev, obj) => {\n\t\tObject.keys(obj).forEach(key => {\n\t\t\tconst pVal = prev[key];\n\t\t\tconst oVal = obj[key];\n\n\t\t\tif (Array.isArray(pVal) && Array.isArray(oVal)) {\n\t\t\t\tprev[key] = [...new Set([...oVal, ...pVal])];\n\t\t\t}\telse if (_isType(pVal, Object) && _isType(oVal, Object)) {\n\t\t\t\tprev[key] = _objectMerge(pVal, oVal);\n\t\t\t}\telse {\n\t\t\t\tprev[key] = oVal;\n\t\t\t}\n\t\t});\n\n\t\treturn prev;\n\t}, {});\n};\n\nexport default _objectMerge;", "/** @module utils */\n\n/**\n * A function to remove any leading and trailing HTTP whitespace.\n *\n * @param {string} string The string to process.\n * @returns {string} The processed string.\n */\nconst removeLeadingAndTrailingHTTPWhitespace = (string) => string.replace(/^[ \\t\\n\\r]+/u, '').replace(/[ \\t\\n\\r]+$/u, '');\n\n/**\n * A function to remove any trailing HTTP whitespace.\n *\n * @param {string} string The string to process.\n * @returns {string} The processed string.\n */\nconst removeTrailingHTTPWhitespace = (string) => string.replace(/[ \\t\\n\\r]+$/u, '');\n\n/**\n * Determines if the provided character is whitespace.\n *\n * @param {string} char The character to evaluate.\n * @returns {boolean} true if the character is whitespace, false otherwise.\n */\nconst isHTTPWhitespaceChar = (char) => char === ' ' || char === '\\t' || char === '\\n' || char === '\\r';\n\n/**\n * Determines if the provided string contains only HTTP token code points.\n *\n * @param {string} string The string to evaluate.\n * @returns {boolean} true if the string contains only HTTP token code points.\n */\nconst solelyContainsHTTPTokenCodePoints = (string) => /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(string);\n\n/**\n * Determines if the provided string contains only quoted HTTP token code points.\n *\n * @param {string} string The string to evaluate.\n * @returns {boolean} true if the string contains only quoted HTTP token code points.\n */\nconst solelyContainsHTTPQuotedStringTokenCodePoints = (string) => /^[\\t\\u0020-\\u007E\\u0080-\\u00FF]*$/u.test(string);\n\n/**\n * A function to lower case ASCII characters.\n *\n * @param {string} string The string to process.\n * @returns {string} The processed string with all ASCII characters lower cased.\n */\nconst asciiLowercase = (string) => string.replace(/[A-Z]/ug, l => l.toLowerCase());\n\n/**\n * Collects all the HTTP quoted strings.\n * This variant only implements it with the extract-value flag set.\n *\n * @param {string} input The string to process.\n * @param {number} position The starting position.\n * @returns {Array<string | number>} An array that includes the resulting string and updated position.\n */\nconst collectAnHTTPQuotedString = (input, position) => {\n\tlet value = '';\n\n\tposition++;\n\n\twhile (true) {\n\t\twhile (position < input.length && input[position] !== '\"' && input[position] !== '\\\\') {\n\t\t\tvalue += input[position];\n\t\t\t++position;\n\t\t}\n\n\t\tif (position >= input.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst quoteOrBackslash = input[position];\n\t\t++position;\n\n\t\tif (quoteOrBackslash === '\\\\') {\n\t\t\tif (position >= input.length) {\n\t\t\t\tvalue += '\\\\';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvalue += input[position];\n\t\t\t++position;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn [value, position];\n};\n\nexport { removeLeadingAndTrailingHTTPWhitespace, removeTrailingHTTPWhitespace, isHTTPWhitespaceChar, solelyContainsHTTPTokenCodePoints, solelyContainsHTTPQuotedStringTokenCodePoints, asciiLowercase, collectAnHTTPQuotedString };\n", "import { asciiLowercase, solelyContainsHTTPQuotedStringTokenCodePoints, solelyContainsHTTPTokenCodePoints } from './utils.js';\n\n/**\n * Class representing the parameters for a media type record.\n * This class has the equivalent surface API to a JavaScript {@link Map}.\n *\n * However, {@link MediaTypeParameters} methods will always interpret their arguments\n * as appropriate for media types, so parameter names will be lowercased,\n * and attempting to set invalid characters will throw an {@link Error}.\n *\n * @example charset=utf-8\n * @module MediaTypeParameters\n */\nexport default class MediaTypeParameters {\n\t/**\n\t * Create a new MediaTypeParameters instance.\n\t *\n\t * @param {Map.<string, string>} map The map of parameters for a media type.\n\t */\n\tconstructor(map) {\n\t\tthis._map = map;\n\t}\n\n\t/**\n\t * Gets the number of media type parameters.\n\t *\n\t * @returns {number} The number of media type parameters\n\t */\n\tget size() {\n\t\treturn this._map.size;\n\t}\n\n\t/**\n\t * Gets the media type parameter value for the supplied name.\n\t *\n\t * @param {string} name The name of the media type parameter to retrieve.\n\t * @returns {string} The media type parameter value.\n\t */\n\tget(name) {\n\t\treturn this._map.get(asciiLowercase(String(name)));\n\t}\n\n\t/**\n\t * Indicates whether the media type parameter with the specified name exists or not.\n\t *\n\t * @param {string} name The name of the media type parameter to check.\n\t * @returns {boolean} true if the media type parameter exists, false otherwise.\n\t */\n\thas(name) {\n\t\treturn this._map.has(asciiLowercase(String(name)));\n\t}\n\n\t/**\n\t * Adds a new media type parameter using the specified name and value to the MediaTypeParameters.\n\t * If an parameter with the same name already exists, the parameter will be updated.\n\t *\n\t * @param {string} name The name of the media type parameter to set.\n\t * @param {string} value The media type parameter value.\n\t * @returns {MediaTypeParameters} This instance.\n\t */\n\tset(name, value) {\n\t\tname = asciiLowercase(String(name));\n\t\tvalue = String(value);\n\n\t\tif (!solelyContainsHTTPTokenCodePoints(name)) {\n\t\t\tthrow new Error(`Invalid media type parameter name \"${name}\": only HTTP token code points are valid.`);\n\t\t}\n\n\t\tif (!solelyContainsHTTPQuotedStringTokenCodePoints(value)) {\n\t\t\tthrow new Error(`Invalid media type parameter value \"${value}\": only HTTP quoted-string token code points are valid.`);\n\t\t}\n\n\t\tthis._map.set(name, value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Clears all the media type parameters.\n\t */\n\tclear() {\n\t\tthis._map.clear();\n\t}\n\n\t/**\n\t * Removes the media type parameter using the specified name.\n\t *\n\t * @param {string} name The name of the media type parameter to delete.\n\t * @returns {boolean} true if the parameter existed and has been removed, or false if the parameter does not exist.\n\t */\n\tdelete(name) {\n\t\tname = asciiLowercase(String(name));\n\t\treturn this._map.delete(name);\n\t}\n\n\t/**\n\t * Executes a provided function once per each name/value pair in the MediaTypeParameters, in insertion order.\n\t *\n\t * @param {function(string, string): void} callback The function called on each iteration.\n\t * @param {*} [thisArg] Optional object when binding 'this' to the callback.\n\t */\n\tforEach(callback, thisArg) {\n\t\tthis._map.forEach(callback, thisArg);\n\t}\n\n\t/**\n\t * Returns an iterable of parameter names.\n\t *\n\t * @returns {IterableIterator<string>} The {@link IterableIterator} of media type parameter names.\n\t */\n\tkeys() {\n\t\treturn this._map.keys();\n\t}\n\n\t/**\n\t * Returns an iterable of parameter values.\n\t *\n\t * @returns {IterableIterator<string>} The {@link IterableIterator} of media type parameter values.\n\t */\n\tvalues() {\n\t\treturn this._map.values();\n\t}\n\n\t/**\n\t * Returns an iterable of name, value pairs for every parameter entry in the media type parameters.\n\t *\n\t * @returns {IterableIterator<Array<Array<string>>>} The media type parameter entries.\n\t */\n\tentries() {\n\t\treturn this._map.entries();\n\t}\n\n\t/**\n\t * A method that returns the default iterator for the {@link MediaTypeParameters}. Called by the semantics of the for-of statement.\n\t *\n\t * @returns {Iterator<string, string, undefined>} The {@link Symbol.iterator} for the media type parameters.\n\t */\n\t[Symbol.iterator]() {\n\t\treturn this._map[Symbol.iterator]();\n\t}\n}", "import {\n\tasciiLowercase,\n\tcollectAnHTTPQuotedString, isHTTPWhitespaceChar, removeLeadingAndTrailingHTTPWhitespace,\n\tremoveTrailingHTTPWhitespace, solelyContainsHTTPQuotedStringTokenCodePoints, solelyContainsHTTPTokenCodePoints\n} from './utils.js';\n\n/**\n * Function to parse a media type.\n *\n * @module parser\n * @param {string} input The media type to parse\n * @returns {{ type: string, subtype: string, parameters: Map<string, string> }} An object populated with the parsed media type properties and any parameters.\n */\nconst parse = (input) => {\n\tinput = removeLeadingAndTrailingHTTPWhitespace(input);\n\n\tlet position = 0;\n\tlet type = '';\n\twhile (position < input.length && input[position] !== '/') {\n\t\ttype += input[position];\n\t\t++position;\n\t}\n\n\tif (type.length === 0 || !solelyContainsHTTPTokenCodePoints(type)) {\n\t\treturn null;\n\t}\n\n\tif (position >= input.length) {\n\t\treturn null;\n\t}\n\n\t// Skips past \"/\"\n\t++position;\n\n\tlet subtype = '';\n\twhile (position < input.length && input[position] !== ';') {\n\t\tsubtype += input[position];\n\t\t++position;\n\t}\n\n\tsubtype = removeTrailingHTTPWhitespace(subtype);\n\n\tif (subtype.length === 0 || !solelyContainsHTTPTokenCodePoints(subtype)) {\n\t\treturn null;\n\t}\n\n\tconst mediaType = {\n\t\ttype: asciiLowercase(type),\n\t\tsubtype: asciiLowercase(subtype),\n\t\tparameters: new Map()\n\t};\n\n\twhile (position < input.length) {\n\t\t// Skip past \";\"\n\t\t++position;\n\n\t\twhile (isHTTPWhitespaceChar(input[position])) {\n\t\t\t++position;\n\t\t}\n\n\t\tlet parameterName = '';\n\t\twhile (position < input.length && input[position] !== ';' && input[position] !== '=') {\n\t\t\tparameterName += input[position];\n\t\t\t++position;\n\t\t}\n\t\tparameterName = asciiLowercase(parameterName);\n\n\t\tif (position < input.length) {\n\t\t\tif (input[position] === ';') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip past \"=\"\n\t\t\t++position;\n\t\t}\n\n\t\tlet parameterValue = null;\n\t\tif (input[position] === '\"') {\n\t\t\t[parameterValue, position] = collectAnHTTPQuotedString(input, position);\n\n\t\t\twhile (position < input.length && input[position] !== ';') {\n\t\t\t\t++position;\n\t\t\t}\n\t\t} else {\n\t\t\tparameterValue = '';\n\t\t\twhile (position < input.length && input[position] !== ';') {\n\t\t\t\tparameterValue += input[position];\n\t\t\t\t++position;\n\t\t\t}\n\n\t\t\tparameterValue = removeTrailingHTTPWhitespace(parameterValue);\n\n\t\t\tif (parameterValue === '') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (parameterName.length > 0 &&\n\t\t\tsolelyContainsHTTPTokenCodePoints(parameterName) &&\n\t\t\tsolelyContainsHTTPQuotedStringTokenCodePoints(parameterValue) &&\n\t\t\t!mediaType.parameters.has(parameterName)) {\n\t\t\tmediaType.parameters.set(parameterName, parameterValue);\n\t\t}\n\t}\n\n\treturn mediaType;\n};\n\nexport default parse;", "import { solelyContainsHTTPTokenCodePoints } from './utils.js';\n// eslint-disable-next-line jsdoc/valid-types\n/** @typedef { import('./media-type.js').default } MediaType */\n\n/**\n * A function that serializes the provided {@link mediaType} to a string.\n *\n * @module serializer\n * @param {MediaType} mediaType The media type to serialize.\n * @returns {string} The serialized media type.\n */\nconst serialize = (mediaType) => {\n\tlet serialization = `${mediaType.type}/${mediaType.subtype}`;\n\n\tif (mediaType.parameters.size === 0) {\n\t\treturn serialization;\n\t}\n\n\tfor (let [name, value] of mediaType.parameters) {\n\t\tserialization += ';';\n\t\tserialization += name;\n\t\tserialization += '=';\n\n\t\tif (!solelyContainsHTTPTokenCodePoints(value) || value.length === 0) {\n\t\t\tvalue = value.replace(/([\"\\\\])/ug, '\\\\$1');\n\t\t\tvalue = `\"${value}\"`;\n\t\t}\n\n\t\tserialization += value;\n\t}\n\n\treturn serialization;\n};\n\nexport default serialize;", "import MediaTypeParameters from './media-type-parameters.js';\nimport parse from './parser.js';\nimport serialize from './serializer.js';\nimport { asciiLowercase, solelyContainsHTTPTokenCodePoints } from './utils.js';\n\n/**\n * Class used to parse media types.\n *\n * @see https://mimesniff.spec.whatwg.org/#understanding-mime-types\n * @module MediaType\n */\nexport default class MediaType {\n\t/**\n\t * Create a new MediaType instance from a string representation.\n\t *\n\t * @param {string} string The media type to parse\n\t */\n\tconstructor(string) {\n\t\tstring = String(string);\n\t\tconst result = parse(string);\n\t\tif (result === null) {\n\t\t\tthrow new Error(`Could not parse media type string '${string}'`);\n\t\t}\n\n\t\tthis._type = result.type;\n\t\tthis._subtype = result.subtype;\n\t\tthis._parameters = new MediaTypeParameters(result.parameters);\n\t}\n\n\t/**\n\t * Static factor method for parsing a media type.\n\t *\n\t * @param {string} string The media type to parse\n\t * @returns {MediaType} The parsed {@link MediaType} object\n\t */\n\tstatic parse(string) {\n\t\ttry {\n\t\t\treturn new this(string);\n\t\t} catch (e) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * Gets the media type essence (type/subtype).\n\t *\n\t * @returns {string} The media type without any parameters\n\t */\n\tget essence() {\n\t\treturn `${this.type}/${this.subtype}`;\n\t}\n\n\t/**\n\t * Gets the type.\n\t *\n\t * @returns {string} The type.\n\t */\n\tget type() {\n\t\treturn this._type;\n\t}\n\n\t/**\n\t * Sets the type.\n\t */\n\tset type(value) {\n\t\tvalue = asciiLowercase(String(value));\n\n\t\tif (value.length === 0) {\n\t\t\tthrow new Error('Invalid type: must be a non-empty string');\n\t\t}\n\t\tif (!solelyContainsHTTPTokenCodePoints(value)) {\n\t\t\tthrow new Error(`Invalid type ${value}: must contain only HTTP token code points`);\n\t\t}\n\n\t\tthis._type = value;\n\t}\n\n\t/**\n\t * Gets the subtype.\n\t *\n\t * @returns {string} The subtype.\n\t */\n\tget subtype() {\n\t\treturn this._subtype;\n\t}\n\n\t/**\n\t * Sets the subtype.\n\t */\n\tset subtype(value) {\n\t\tvalue = asciiLowercase(String(value));\n\n\t\tif (value.length === 0) {\n\t\t\tthrow new Error('Invalid subtype: must be a non-empty string');\n\t\t}\n\t\tif (!solelyContainsHTTPTokenCodePoints(value)) {\n\t\t\tthrow new Error(`Invalid subtype ${value}: must contain only HTTP token code points`);\n\t\t}\n\n\t\tthis._subtype = value;\n\t}\n\n\t/**\n\t * Gets the parameters.\n\t *\n\t * @returns {MediaTypeParameters} The media type parameters.\n\t */\n\tget parameters() {\n\t\treturn this._parameters;\n\t}\n\n\t/**\n\t * Gets the serialized version of the media type.\n\t *\n\t * @returns {string} The serialized media type.\n\t */\n\ttoString() {\n\t\t// The serialize function works on both 'media type records' (i.e. the results of parse) and on this class, since\n\t\t// this class's interface is identical.\n\t\treturn serialize(this);\n\t}\n\n\t/**\n\t * Determines if this instance is a JavaScript media type.\n\t *\n\t * @param {Object} [options] Optional options.\n\t * @param {boolean} [options.prohibitParameters=false] The option to prohibit parameters when checking if the media type is JavaScript.\n\t * @returns {boolean} true if this instance represents a JavaScript media type, false otherwise.\n\t */\n\tisJavaScript({prohibitParameters = false} = {}) {\n\t\tswitch (this._type) {\n\t\t\tcase 'text': {\n\t\t\t\tswitch (this._subtype) {\n\t\t\t\t\tcase 'ecmascript':\n\t\t\t\t\tcase 'javascript':\n\t\t\t\t\tcase 'javascript1.0':\n\t\t\t\t\tcase 'javascript1.1':\n\t\t\t\t\tcase 'javascript1.2':\n\t\t\t\t\tcase 'javascript1.3':\n\t\t\t\t\tcase 'javascript1.4':\n\t\t\t\t\tcase 'javascript1.5':\n\t\t\t\t\tcase 'jscript':\n\t\t\t\t\tcase 'livescript':\n\t\t\t\t\tcase 'x-ecmascript':\n\t\t\t\t\tcase 'x-javascript': return !prohibitParameters || this._parameters.size === 0;\n\t\t\t\t\tdefault: return false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase 'application': {\n\t\t\t\tswitch (this._subtype) {\n\t\t\t\t\tcase 'ecmascript':\n\t\t\t\t\tcase 'javascript':\n\t\t\t\t\tcase 'x-ecmascript':\n\t\t\t\t\tcase 'x-javascript': return !prohibitParameters || this._parameters.size === 0;\n\t\t\t\t\tdefault: return false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdefault: return false;\n\t\t}\n\t}\n\n\t/**\n\t * Determines if this instance is an XML media type.\n\t *\n\t * @returns {boolean} true if this instance represents an XML media type, false otherwise.\n\t */\n\tisXML() {\n\t\treturn (this._subtype === 'xml' && (this._type === 'text' || this._type === 'application')) || this._subtype.endsWith('+xml');\n\t}\n\n\t/**\n\t * Determines if this instance is an HTML media type.\n\t *\n\t * @returns {boolean} true if this instance represents an HTML media type, false otherwise.\n\t */\n\tisHTML() {\n\t\treturn this._subtype === 'html' && this._type === 'text';\n\t}\n\n\t/**\n\t * Gets the name of the class.\n\t *\n\t * @returns {string} The class name\n\t */\n\tget [Symbol.toStringTag]() {\n\t\treturn 'MediaType';\n\t}\n}", "const HttpMediaType = {\n\t/** Advanced Audio Coding (AAC) */\n\tAAC: 'audio/aac',\n\t/** AbiWord */\n\tABW: 'application/x-abiword',\n\t/** Archive document (multiple files embedded) */\n\tARC: 'application/x-freearc',\n\t/** AVIF image */\n\tAVIF: 'image/avif',\n\t/** Audio Video Interleave (AVI) */\n\tAVI: 'video/x-msvideo',\n\t/** Amazon Kindle eBook format */\n\tAZW: 'application/vnd.amazon.ebook',\n\t/** Binary Data */\n\tBIN: 'application/octet-stream',\n\t/** Windows OS/2 Bitmap Graphics */\n\tBMP: 'image/bmp',\n\t/** Bzip Archive */\n\tBZIP: 'application/x-bzip',\n\t/** Bzip2 Archive */\n\tBZIP2: 'application/x-bzip2',\n\t/** CD audio */\n\tCDA: 'application/x-cdf',\n\t/** C Shell Script */\n\tCSH: 'application/x-csh',\n\t/** Cascading Style Sheets (CSS) */\n\tCSS: 'text/css',\n\t/** Comma-Separated Values */\n\tCSV: 'text/csv',\n\t/** Microsoft Office Word Document */\n\tDOC: 'application/msword',\n\t/** Microsoft Office Word Document (OpenXML) */\n\tDOCX: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n\t/** Microsoft Embedded OpenType */\n\tEOT: 'application/vnd.ms-fontobject',\n\t/** Electronic Publication (EPUB) */\n\tEPUB: 'application/epub+zip',\n\t/** GZip Compressed Archive */\n\tGZIP: 'application/gzip',\n\t/** Graphics Interchange Format */\n\tGIF: 'image/gif',\n\t/** HyperText Markup Language (HTML) */\n\tHTML: 'text/html',\n\t/** Icon Format */\n\tICO: 'image/vnd.microsoft.icon',\n\t/** iCalendar Format */\n\tICS: 'text/calendar',\n\t/** Java Archive (JAR) */\n\tJAR: 'application/java-archive',\n\t/** JPEG Image */\n\tJPEG: 'image/jpeg',\n\t/** JavaScript */\n\tJAVA_SCRIPT: 'text/javascript',\n\t/** JavaScript Object Notation Format (JSON) */\n\tJSON: 'application/json',\n\t/** JavaScript Object Notation LD Format */\n\tJSON_LD: 'application/ld+json',\n\t/** Musical Instrument Digital Interface (MIDI) */\n\tMID: 'audio/midi',\n\t/** Musical Instrument Digital Interface (MIDI) */\n\tX_MID: 'audio/x-midi',\n\t/** MP3 Audio */\n\tMP3: 'audio/mpeg',\n\t/** MPEG-4 Audio */\n\tMP4A: 'audio/mp4',\n\t/** MPEG-4 Video */\n\tMP4: 'video/mp4',\n\t/** MPEG Video */\n\tMPEG: 'video/mpeg',\n\t/** Apple Installer Package */\n\tMPKG: 'application/vnd.apple.installer+xml',\n\t/** OpenDocument Presentation Document */\n\tODP: 'application/vnd.oasis.opendocument.presentation',\n\t/** OpenDocument Spreadsheet Document */\n\tODS: 'application/vnd.oasis.opendocument.spreadsheet',\n\t/** OpenDocument Text Document */\n\tODT: 'application/vnd.oasis.opendocument.text',\n\t/** Ogg Audio */\n\tOGA: 'audio/ogg',\n\t/** Ogg Video */\n\tOGV: 'video/ogg',\n\t/** Ogg */\n\tOGX: 'application/ogg',\n\t/** Opus audio */\n\tOPUS: 'audio/opus',\n\t/** OpenType Font File */\n\tOTF: 'font/otf',\n\t/** Portable Network Graphics (PNG) */\n\tPNG: 'image/png',\n\t/** Adobe Portable Document Format */\n\tPDF: 'application/pdf',\n\t/** Hypertext Preprocessor (Personal Home Page) */\n\tPHP: 'application/x-httpd-php',\n\t/** Microsoft PowerPoint */\n\tPPT: 'application/vnd.ms-powerpoint',\n\t/** Microsoft Office Presentation (OpenXML) */\n\tPPTX: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n\t/** RAR Archive */\n\tRAR: 'application/vnd.rar',\n\t/** Rich Text Format */\n\tRTF: 'application/rtf',\n\t/** Bourne Shell Script */\n\tSH: 'application/x-sh',\n\t/** Scalable Vector Graphics (SVG) */\n\tSVG: 'image/svg+xml',\n\t/** Tape Archive (TAR) */\n\tTAR: 'application/x-tar',\n\t/** Tagged Image File Format (TIFF) */\n\tTIFF: 'image/tiff',\n\t/** MPEG transport stream */\n\tTRANSPORT_STREAM: 'video/mp2t',\n\t/** TrueType Font */\n\tTTF: 'font/ttf',\n\t/** Text, (generally ASCII or ISO 8859-n) */\n\tTEXT: 'text/plain',\n\t/** Microsoft Visio */\n\tVSD: 'application/vnd.visio',\n\t/** Waveform Audio Format (WAV) */\n\tWAV: 'audio/wav',\n\t/** Open Web Media Project - Audio */\n\tWEBA: 'audio/webm',\n\t/** Open Web Media Project - Video */\n\tWEBM: 'video/webm',\n\t/** WebP Image */\n\tWEBP: 'image/webp',\n\t/** Web Open Font Format */\n\tWOFF: 'font/woff',\n\t/** Web Open Font Format */\n\tWOFF2: 'font/woff2',\n\t/** XHTML - The Extensible HyperText Markup Language */\n\tXHTML: 'application/xhtml+xml',\n\t/** Microsoft Excel Document */\n\tXLS: 'application/vnd.ms-excel',\n\t/** Microsoft Office Spreadsheet Document (OpenXML) */\n\tXLSX: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n\t/** Extensible Markup Language (XML) */\n\tXML: 'application/xml',\n\t/** XML User Interface Language (XUL) */\n\tXUL: 'application/vnd.mozilla.xul+xml',\n\t/** Zip Archive */\n\tZIP: 'application/zip',\n\t/** 3GPP audio/video container */\n\t'3GP': 'video/3gpp',\n\t/** 3GPP2 audio/video container */\n\t'3G2': 'video/3gpp2',\n\t/** 7-Zip Archive */\n\t'7Z': 'application/x-7z-compressed',\n};\n\nexport default HttpMediaType;", "const HttpRequestHeader = {\n\t/**\n\t * Content-Types that are acceptable for the response. See Content negotiation. Permanent.\n\t *\n\t * @example\n\t * <code>Accept: text/plain</code>\n\t */\n\tACCEPT: 'accept',\n\t/**\n\t * Character sets that are acceptable. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Charset: utf-8</code>\n\t */\n\tACCEPT_CHARSET: 'accept-charset',\n\t/**\n\t * List of acceptable encodings. See HTTP compression. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Encoding: gzip, deflate</code>\n\t */\n\tACCEPT_ENCODING: 'accept-encoding',\n\t/**\n\t * List of acceptable human languages for response. See Content negotiation. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Language: en-US</code>\n\t */\n\tACCEPT_LANGUAGE: 'accept-language',\n\t/**\n\t * Authentication credentials for HTTP authentication. Permanent.\n\t *\n\t * @example\n\t * <code>Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code>\n\t */\n\tAUTHORIZATION: 'authorization',\n\t/**\n\t * Used to specify directives that must be obeyed by all caching mechanisms along the request-response chain.\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>Cache-Control: no-cache</code>\n\t */\n\tCACHE_CONTROL: 'cache-control',\n\t/**\n\t * Control options for the current connection and list of hop-by-hop request fields. Permanent.\n\t *\n\t * @example\n\t * <code>Connection: keep-alive</code>\n\t * <code>Connection: Upgrade</code>\n\t */\n\tCONNECTION: 'connection',\n\t/**\n\t * An HTTP cookie previously sent by the server with Set-Cookie (below). Permanent: standard.\n\t *\n\t * @example\n\t * <code>Cookie: $Version=1, Skin=new,</code>\n\t */\n\tCOOKIE: 'cookie',\n\t/**\n\t * The length of the request body in octets (8-bit bytes). Permanent.\n\t *\n\t * @example\n\t * <code>Content-Length: 348</code>\n\t */\n\tCONTENT_LENGTH: 'content-length',\n\t/**\n\t * A Base64-encoded binary MD5 sum of the content of the request body. Obsolete.\n\t *\n\t * @example\n\t * <code>Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==</code>\n\t */\n\tCONTENT_MD5: 'content-md5',\n\t/**\n\t * The MIME type of the body of the request (used with POST and PUT requests). Permanent.\n\t * <code>Content-Type: application/x-www-form-urlencoded</code>\n\t */\n\tCONTENT_TYPE: 'content-type',\n\t/**\n\t * The date and time that the message was sent (in \"HTTP-date\" format as defined by RFC 7231 Date/Time Formats).\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>Date: Tue, 15 Nov 1994 08:12:31 GMT</code>\n\t */\n\tDATE: 'date',\n\t/**\n\t * Indicates that particular server behaviors are required by the client. Permanent.\n\t *\n\t * @example\n\t * <code>Expect: 100-continue</code>\n\t */\n\tEXPECT: 'expect',\n\t/**\n\t * The email address of the user making the request. Permanent.\n\t *\n\t * @example\n\t * <code>From: user@example.com</code>\n\t */\n\tFROM: 'from',\n\t/**\n\t * The domain name of the server (for virtual hosting), and the TCP port number on which the server is listening. The\n\t * port number may be omitted if the port is the standard port for the service requested. Permanent. Mandatory since\n\t * HTTP/1.1.\n\t *\n\t * @example\n\t * <code>Host: en.wikipedia.org:80</code>\n\t * <code>Host: en.wikipedia.org</code>\n\t */\n\tHOST: 'host',\n\t/**\n\t * Only perform the action if the client supplied entity matches the same entity on the server. This is mainly for\n\t * methods like PUT to only update a resource if it has not been modified since the user last updated it. Permanent.\n\t *\n\t * @example\n\t * <code>If-Match: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_MATCH: 'if-match',\n\t/**\n\t * Allows a 304 Not Modified to be returned if content is unchanged. Permanent.\n\t *\n\t * @example\n\t * <code>If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code>\n\t */\n\tIF_MODIFIED_SINCE: 'if-modified-since',\n\t/**\n\t * Allows a 304 Not Modified to be returned if content is unchanged, see HTTP ETag. Permanent.\n\t *\n\t * @example\n\t * <code>If-None-Match: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_NONE_MATCH: 'if-none-match',\n\t/**\n\t * If the entity is unchanged, send me the part(s) that I am missing, otherwise, send me the entire new entity.\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>If-Range: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_RANGE: 'if-range',\n\t/**\n\t * Only send the response if the entity has not been modified since a specific time. Permanent.\n\t *\n\t * @example\n\t * <code>If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code>\n\t */\n\tIF_UNMODIFIED_SINCE: 'if-unmodified-since',\n\t/**\n\t * Limit the number of times the message can be forwarded through proxies or gateways. Permanent.\n\t *\n\t * @example\n\t * <code>Max-Forwards: 10</code>\n\t */\n\tMAX_FORWARDS: 'max-forwards',\n\t/**\n\t * Initiates a request for cross-origin resource sharing (asks server for an 'Access-Control-Allow-Origin' response\n\t * field). Permanent: standard.\n\t *\n\t * @example\n\t * <code>Origin: http://www.example-social-network.com</code>\n\t */\n\tORIGIN: 'origin',\n\t/**\n\t * Implementation-specific fields that may have various effects anywhere along the request-response chain. Permanent.\n\t *\n\t * @example\n\t * <code>Pragma: no-cache</code>\n\t */\n\tPRAGMA: 'pragma',\n\t/**\n\t * Authorization credentials for connecting to a proxy. Permanent.\n\t *\n\t * @example\n\t * <code>Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code>\n\t */\n\tPROXY_AUTHORIZATION: 'proxy-authorization',\n\t/**\n\t * Request only part of an entity. Bytes are numbered from 0. See Byte serving. Permanent.\n\t *\n\t * @example\n\t * <code>Range: bytes=500-999</code>\n\t */\n\tRANGE: 'range',\n\t/**\n\t * This is the address of the previous web page from which a link to the currently requested page was followed. (The\n\t * word \"referrer\" has been misspelled in the RFC as well as in most implementations to the point that it has become\n\t * standard usage and is considered correct terminology). Permanent.\n\t *\n\t * @example\n\t * <code>Referer: http://en.wikipedia.org/wiki/Main_Page</code>\n\t */\n\tREFERER: 'referer',\n\t/**\n\t * The transfer encodings the user agent is willing to accept: the same values as for the response header field\n\t * Transfer-Encoding can be used, plus the \"trailers\" value (related to the \"chunked\" transfer method) to notify the\n\t * server it expects to receive additional fields in the trailer after the last, zero-sized, chunk. Permanent.\n\t *\n\t * @example\n\t * <code>TE: trailers, deflate</code>\n\t */\n\tTE: 'te',\n\t/**\n\t * The user agent string of the user agent. Permanent.\n\t *\n\t * @example\n\t * <code>User-Agent: Mozilla/5.0 (X11, Linux x86_64, rv:12.0) Gecko/20100101 Firefox/21.0</code>\n\t */\n\tUSER_AGENT: 'user-agent',\n\t/**\n\t * Ask the server to upgrade to another protocol. Permanent.\n\t *\n\t * @example\n\t * <code>Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11</code>\n\t */\n\tUPGRADE: 'upgrade',\n\t/**\n\t * Informs the server of proxies through which the request was sent. Permanent.\n\t *\n\t * @example\n\t * <code>Via: 1.0 fred, 1.1 example.com (Apache/1.1)</code>\n\t */\n\tVIA: 'via',\n\t/**\n\t * A general warning about possible problems with the entity body. Permanent.\n\t *\n\t * @example\n\t * <code>Warning: 199 Miscellaneous warning</code>\n\t */\n\tWARNING: 'warning',\n\t/**\n\t * mainly used to identify Ajax requests. Most JavaScript frameworks send this field with value of XMLHttpRequest.\n\t *\n\t * @example\n\t * <code>X-Requested-With: XMLHttpRequest</code>\n\t */\n\tX_REQUESTED_WITH: 'x-requested-with',\n\t/**\n\t * Requests a web application to disable their tracking of a user. This is Mozilla's version of the X-Do-Not-Track\n\t * header field (since Firefox 4.0 Beta 11). Safari and IE9 also have support for this field. On March 7, 2011, a\n\t * draft proposal was submitted to IETF. The W3C Tracking Protection Working Group is producing a specification.\n\t *\n\t * @example\n\t * <code>DNT: 1 (Do Not Track Enabled)</code>\n\t * <code>DNT: 0 (Do Not Track Disabled)</code>\n\t */\n\tDNT: 'dnt',\n\t/**\n\t * A de facto standard for identifying the originating IP address of a client connecting to a web server through an\n\t * HTTP proxy or load balancer.\n\t *\n\t * @example\n\t * <code>X-Forwarded-For: client1, proxy1, proxy2</code>\n\t * <code>X-Forwarded-For: 129.78.138.66, 129.78.64.103</code>\n\t */\n\tX_FORWARDED_FOR: 'x-forwarded-for',\n\t/**\n\t * A de facto standard for identifying the original host requested by the client in the Host HTTP request header, since\n\t * the host name and/or port of the reverse proxy (load balancer) may differ from the origin server handling the\n\t * request.\n\t *\n\t * @example\n\t * <code>X-Forwarded-Host: en.wikipedia.org:80</code>\n\t * <code>X-Forwarded-Host: en.wikipedia.org</code>\n\t */\n\tX_FORWARDED_HOST: 'x-forwarded-host',\n\t/**\n\t * A de facto standard for identifying the originating protocol of an HTTP request, since a reverse proxy (load\n\t * balancer) may communicate with a web server using HTTP even if the request to the reverse proxy is HTTPS. An\n\t * alternative form of the header (X-ProxyUser-Ip) is used by Google clients talking to Google servers.\n\t *\n\t * @example\n\t * <code>X-Forwarded-Proto: https</code>\n\t */\n\tX_FORWARDED_PROTO: 'x-forwarded-proto',\n\t/**\n\t * Non-standard header field used by Microsoft applications and load-balancers.\n\t *\n\t * @example\n\t * <code>Front-End-Https: on</code>\n\t */\n\tFRONT_END_HTTPS: 'front-end-https',\n\t/**\n\t * Requests a web application override the method specified in the request (typically POST) with the method given in\n\t * the header field (typically PUT or DELETE). Can be used when a user agent or firewall prevents PUT or DELETE methods\n\t * from being sent directly (note that this either a bug in the software component, which ought to be fixed, or an\n\t * intentional configuration, in which case bypassing it may be the wrong thing to do).\n\t *\n\t * @example\n\t * <code>X-HTTP-Method-Override: DELETE</code>\n\t */\n\tX_HTTP_METHOD_OVERRIDE: 'x-http-method-override',\n\t/**\n\t * Allows easier parsing of the MakeModel/Firmware that is usually found in the User-Agent String of AT&T Devices.\n\t *\n\t * @example\n\t * <code>X-Att-Deviceid: GT-P7320/P7320XXLPG</code>\n\t */\n\tX_ATT_DEVICE_ID: 'x-att-deviceid',\n\t/**\n\t * Links to an XML file on the Internet with a full description and details about the device currently connecting. In the example to the right is an XML file for an AT&T Samsung Galaxy S2.\n\t * x-wap-profile: http://wap.samsungmobile.com/uaprof/SGH-I777.xml\n\t */\n\tX_WAP_PROFILE: 'x-wap-profile',\n};\n\nexport default HttpRequestHeader;", "const HttpRequestMethod = {\n\t/**\n\t * The OPTIONS method represents a request for information about the communication options available on the\n\t * request/response chain identified by the Request-URI. This method allows the client to determine the options and/or\n\t * requirements associated with a resource, or the capabilities of a server, without implying a resource action or\n\t * initiating a resource retrieval.\n\t *\n\t * Responses to this method are not cacheable.\n\t *\n\t * If the OPTIONS request includes an entity-body (as indicated by the presence of Content-Length or\n\t * Transfer-Encoding), then the media type MUST be indicated by a Content-Type field. Although this specification does\n\t * not define any use for such a body, future extensions to HTTP might use the OPTIONS body to make more detailed\n\t * queries on the server. A server that does not support such an extension MAY discard the request body.\n\t *\n\t * If the Request-URI is an asterisk (\"*\"), the OPTIONS request is intended to apply to the server in general rather\n\t * than to a specific resource. Since a server's communication options typically depend on the resource, the \"*\"\n\t * request is only useful as a \"ping\" or \"no-op\" type of method, it does nothing beyond allowing the client to test the\n\t * capabilities of the server. For example, this can be used to test a proxy for HTTP/1.1 compliance (or lack thereof).\n\t *\n\t * If the Request-URI is not an asterisk, the OPTIONS request applies only to the options that are available when\n\t * communicating with that resource.\n\t *\n\t * A 200 response SHOULD include any header fields that indicate optional features implemented by the server and\n\t * applicable to that resource (e.g., Allow), possibly including extensions not defined by this specification. The\n\t * response body, if any, SHOULD also include information about the communication options. The format for such a body\n\t * is not defined by this specification, but might be defined by future extensions to HTTP. Content negotiation MAY be\n\t * used to select the appropriate response format. If no response body is included, the response MUST include a\n\t * Content-Length field with a field-value of \"0\".\n\t *\n\t * The Max-Forwards request-header field MAY be used to target a specific proxy in the request chain. When a proxy\n\t * receives an OPTIONS request on an absoluteURI for which request forwarding is permitted, the proxy MUST check for a\n\t * Max-Forwards field. If the Max-Forwards field-value is zero (\"0\"), the proxy MUST NOT forward the message, instead,\n\t * the proxy SHOULD respond with its own communication options. If the Max-Forwards field-value is an integer greater\n\t * than zero, the proxy MUST decrement the field-value when it forwards the request. If no Max-Forwards field is\n\t * present in the request, then the forwarded request MUST NOT include a Max-Forwards field.\n\t */\n\tOPTIONS: 'OPTIONS',\n\t/**\n\t * The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If\n\t * the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in\n\t * the response and not the source text of the process, unless that text happens to be the output of the process.\n\t *\n\t * The semantics of the GET method change to a \"conditional GET\" if the request message includes an If-Modified-Since;\n\t * If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. A conditional GET method requests that the\n\t * entity be transferred only under the circumstances described by the conditional header field(s). The conditional GET\n\t * method is intended to reduce unnecessary network usage by allowing cached entities to be refreshed without requiring\n\t * multiple requests or transferring data already held by the client.\n\t *\n\t * The semantics of the GET method change to a \"partial GET\" if the request message includes a Range header field. A\n\t * partial GET requests that only part of the entity be transferred, as described in section 14.35. The partial GET\n\t * method is intended to reduce unnecessary network usage by allowing partially-retrieved entities to be completed\n\t * without transferring data already held by the client.\n\t *\n\t * The response to a GET request is cacheable if and only if it meets the requirements for HTTP caching described in\n\t * section 13.\n\t *\n\t * See section 15.1.3 for security considerations when used for forms.\n\t */\n\tGET: 'GET',\n\t/**\n\t * The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The\n\t * meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information\n\t * sent in response to a GET request. This method can be used for obtaining meta information about the entity implied by\n\t * the request without transferring the entity-body itself. This method is often used for testing hypertext links for\n\t * validity, accessibility, and recent modification.\n\t *\n\t * The response to a HEAD request MAY be cacheable in the sense that the information contained in the response MAY be\n\t * used to update a previously cached entity from that resource. If the new field values indicate that the cached\n\t * entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or\n\t * Last-Modified), then the cache MUST treat the cache entry as stale.\n\t */\n\tHEAD: 'HEAD',\n\t/**\n\t * The POST method is used to request that the origin server accept the entity enclosed in the request as a new\n\t * subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform\n\t * method to cover the following functions:\n\t * <ul>\n\t * <li>Annotation of existing resources,</li>\n\t * <li>Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles,</li>\n\t * <li>Providing a block of data, such as the result of submitting a form, to a data-handling process,</li>\n\t * <li>Extending a database through an append operation.</li>\n\t * </ul>\n\t *\n\t * The actual function performed by the POST method is determined by the server and is usually dependent on the\n\t * Request-URI. The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory\n\t * containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a\n\t * database.\n\t *\n\t * The action performed by the POST method might not result in a resource that can be identified by a URI. In this\n\t * case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the\n\t * response includes an entity that describes the result.\n\t *\n\t * If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity\n\t * which describes the status of the request and refers to the new resource, and a Location header (see section 14.30).\n\t *\n\t * Responses to this method are not cacheable, unless the response includes appropriate Cache-Control or Expires header\n\t * fields. However, the 303 (See Other) response can be used to direct the user agent to retrieve a cacheable resource.\n\t *\n\t * POST requests MUST obey the message transmission requirements set out in section 8.2.\n\t *\n\t * See section 15.1.3 for security considerations.\n\t */\n\tPOST: 'POST',\n\t/**\n\t * The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers\n\t * to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing\n\t * on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being\n\t * defined as a new resource by the requesting user agent, the origin server can create the resource with that URI. If\n\t * a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. If an\n\t * existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate\n\t * successful completion of the request. If the resource could not be created or modified with the Request-URI, an\n\t * appropriate error response SHOULD be given that reflects the nature of the problem. The recipient of the entity MUST\n\t * \\NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a\n\t * 501 (Not Implemented) response in such cases.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those\n\t * entries SHOULD be treated as stale. Responses to this method are not cacheable.\n\t *\n\t * The fundamental difference between the POST and PUT requests is reflected in the different meaning of the\n\t * Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource\n\t * might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations.\n\t * In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what\n\t * URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires\n\t * that the request be applied to a different URI, it MUST send a 301 (Moved Permanently) response, the user agent MAY\n\t * then make its own decision regarding whether or not to redirect the request.\n\t *\n\t * A single resource MAY be identified by many different URIs. For example, an article might have a URI for identifying\n\t * \"the current version\" which is separate from the URI identifying each particular version. In this case, a PUT\n\t * request on a general URI might result in several other URIs being defined by the origin server.\n\t *\n\t * HTTP/1.1 does not define how a PUT method affects the state of an origin server.\n\t *\n\t * PUT requests MUST obey the message transmission requirements set out in section 8.2.\n\t *\n\t * Unless otherwise specified for a particular entity-header, the entity-headers in the PUT request SHOULD be applied\n\t * to the resource created or modified by the PUT.\n\t */\n\tPUT: 'PUT',\n\t/**\n\t * The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY\n\t * be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the\n\t * operation has been carried out, even if the status code returned from the origin server indicates that the action\n\t * has been completed successfully. However, the server SHOULD NOT indicate success unless, at the time the response\n\t * is given, it intends to delete the resource or move it to an inaccessible location.\n\t *\n\t * A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if\n\t * the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not\n\t * include an entity.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those\n\t * entries SHOULD be treated as stale. Responses to this method are not cacheable.\n\t */\n\tDELETE: 'DELETE',\n\t/**\n\t * The TRACE method is used to invoke a remote, application-layer loop- back of the request message. The final\n\t * recipient of the request SHOULD reflect the message received back to the client as the entity-body of a 200 (OK)\n\t * response. The final recipient is either the origin server or the first proxy or gateway to receive a Max-Forwards\n\t * value of zero (0) in the request (see section 14.31). A TRACE request MUST NOT include an entity.\n\t *\n\t * TRACE allows the client to see what is being received at the other end of the request chain and use that data for\n\t * testing or diagnostic information. The value of the Via header field (section 14.45) is of particular interest,\n\t * since it acts as a trace of the request chain. Use of the Max-Forwards header field allows the client to limit the\n\t * length of the request chain, which is useful for testing a chain of proxies forwarding messages in an infinite loop.\n\t *\n\t * If the request is valid, the response SHOULD contain the entire request message in the entity-body, with a\n\t * Content-Type of \"message/http\". Responses to this method MUST NOT be cached.\n\t */\n\tTRACE: 'TRACE',\n\t/**\n\t * This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a\n\t * tunnel (e.g. SSL tunneling [44]).\n\t */\n\tCONNECT: 'CONNECT',\n\t/**\n\t * The PATCH method requests that a set of changes described in the\n\t * request entity be applied to the resource identified by the Request-\n\t * URI. The set of changes is represented in a format called a \"patch\n\t * document\" identified by a media type. If the Request-URI does not\n\t * point to an existing resource, the server MAY create a new resource,\n\t * depending on the patch document type (whether it can logically modify\n\t * a null resource) and permissions, etc.\n\t *\n\t * The difference between the PUT and PATCH requests is reflected in the\n\t * way the server processes the enclosed entity to modify the resource\n\t * identified by the Request-URI. In a PUT request, the enclosed entity\n\t * is considered to be a modified version of the resource stored on the\n\t * origin server, and the client is requesting that the stored version\n\t * be replaced. With PATCH, however, the enclosed entity contains a set\n\t * of instructions describing how a resource currently residing on the\n\t * origin server should be modified to produce a new version. The PATCH\n\t * method affects the resource identified by the Request-URI, and it\n\t * also MAY have side effects on other resources; i.e., new resources\n\t * may be created, or existing ones modified, by the application of a\n\t * PATCH.\n\t *\n\t * PATCH is neither safe nor idempotent as defined by [RFC2616], Section\n\t * 9.1.\n\t *\n\t * A PATCH request can be issued in such a way as to be idempotent,\n\t * which also helps prevent bad outcomes from collisions between two\n\t * PATCH requests on the same resource in a similar time frame.\n\t * Collisions from multiple PATCH requests may be more dangerous than\n\t * PUT collisions because some patch formats need to operate from a\n\t * known base-point or else they will corrupt the resource. Clients\n\t * using this kind of patch application SHOULD use a conditional request\n\t * such that the request will fail if the resource has been updated\n\t * since the client last accessed the resource. For example, the client\n\t * can use a strong ETag [RFC2616] in an If-Match header on the PATCH\n\t * request.\n\t *\n\t * There are also cases where patch formats do not need to operate from\n\t * a known base-point (e.g., appending text lines to log files, or non-\n\t * colliding rows to database tables), in which case the same care in\n\t * client requests is not needed.\n\t *\n\t * The server MUST apply the entire set of changes atomically and never\n\t * provide (e.g., in response to a GET during this operation) a\n\t * partially modified representation. If the entire patch document\n\t * cannot be successfully applied, then the server MUST NOT apply any of\n\t * the changes. The determination of what constitutes a successful\n\t * PATCH can vary depending on the patch document and the type of\n\t * resource(s) being modified. For example, the common 'diff' utility\n\t * can generate a patch document that applies to multiple files in a\n\t * directory hierarchy. The atomicity requirement holds for all\n\t * directly affected files. See \"Error Handling\", Section 2.2, for\n\t * details on status codes and possible error conditions.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies\n\t * one or more currently cached entities, those entries SHOULD be\n\t * treated as stale. A response to this method is only cacheable if it\n\t * contains explicit freshness information (such as an Expires header or\n\t * \"Cache-Control: max-age\" directive) as well as the Content-Location\n\t * header matching the Request-URI, indicating that the PATCH response\n\t * body is a resource representation. A cached PATCH response can only\n\t * be used to respond to subsequent GET and HEAD requests; it MUST NOT\n\t * be used to respond to other methods (in particular, PATCH).\n\t *\n\t * Note that entity-headers contained in the request apply only to the\n\t * contained patch document and MUST NOT be applied to the resource\n\t * being modified. Thus, a Content-Language header could be present on\n\t * the request, but it would only mean (for whatever that's worth) that\n\t * the patch document had a language. Servers SHOULD NOT store such\n\t * headers except as trace information, and SHOULD NOT use such header\n\t * values the same way they might be used on PUT requests. Therefore,\n\t * this document does not specify a way to modify a document's Content-\n\t * Type or Content-Language value through headers, though a mechanism\n\t * could well be designed to achieve this goal through a patch document.\n\t *\n\t * There is no guarantee that a resource can be modified with PATCH.\n\t * Further, it is expected that different patch document formats will be\n\t * appropriate for different types of resources and that no single\n\t * format will be appropriate for all types of resources. Therefore,\n\t * there is no single default patch document format that implementations\n\t * are required to support. Servers MUST ensure that a received patch\n\t * document is appropriate for the type of resource identified by the\n\t * Request-URI.\n\t *\n\t * Clients need to choose when to use PATCH rather than PUT. For\n\t * example, if the patch document size is larger than the size of the\n\t * new resource data that would be used in a PUT, then it might make\n\t * sense to use PUT instead of PATCH. A comparison to POST is even more\n\t * difficult, because POST is used in widely varying ways and can\n\t * encompass PUT and PATCH-like operations if the server chooses. If\n\t * the operation does not modify the resource identified by the Request-\n\t * URI in a predictable way, POST should be considered instead of PATCH\n\t * or PUT.\n\t */\n\tPATCH: 'PATCH'\n};\n\nexport default HttpRequestMethod;", "const HttpResponseHeader = {\n\t/**\n\t * Implemented as a misunderstanding of the HTTP specifications. Common because of mistakes in implementations of early HTTP versions. Has exactly the same functionality as standard Connection field.\n\t *\n\t * @example\n\t * proxy-connection: keep-alive\n\t */\n\tPROXY_CONNECTION: 'proxy-connection',\n\t/**\n\t * Server-side deep packet insertion of a unique ID identifying customers of Verizon Wireless, also known as \"perma-cookie\" or \"supercookie\"\n\t *\n\t * @example\n\t * x-uidh: ...\n\t */\n\tX_UIDH: 'x-uidh',\n\t/**\n\t * Used to prevent cross-site request forgery. Alternative header names are: X-CSRFToken and X-XSRF-TOKEN\n\t *\n\t * @example\n\t * x-csrf-token: i8XNjC4b8KVok4uw5RftR38Wgp2BFwql\n\t */\n\tX_CSRF_TOKEN: 'x-csrf-token',\n\t/**\n\t * Specifying which web sites can participate in cross-origin resource sharing\n\t *\n\t * @example\n\t * access-control-allow-origin: *\n\t * Provisional\n\t */\n\tACCESS_CONTROL_ALLOW_ORIGIN: 'access-control-allow-origin',\n\t/**\n\t * Specifies which patch document formats this server supports\n\t *\n\t * @example\n\t * accept-patch: text/example,charset=utf-8\n\t * Permanent\n\t */\n\tACCEPT_PATCH: 'accept-patch',\n\t/**\n\t * What partial content range types this server supports via byte serving\n\t *\n\t * @example\n\t * accept-ranges: bytes\n\t * Permanent\n\t */\n\tACCEPT_RANGES: 'accept-ranges',\n\t/**\n\t * The age the object has been in a proxy cache in seconds\n\t *\n\t * @example\n\t * age: 12\n\t * Permanent\n\t */\n\tAGE: 'age',\n\t/**\n\t * Valid actions for a specified resource. To be used for a 405 Method not allowed\n\t *\n\t * @example\n\t * allow: GET, HEAD\n\t * Permanent\n\t */\n\tALLOW: 'allow',\n\t/**\n\t * Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds\n\t *\n\t * @example\n\t * cache-control: max-age=3600\n\t * Permanent\n\t */\n\tCACHE_CONTROL: 'cache-control',\n\t/**\n\t * Control options for the current connection and list of hop-by-hop response fields\n\t *\n\t * @example\n\t * connection: close\n\t * Permanent\n\t */\n\tCONNECTION: 'connection',\n\t/**\n\t * An opportunity to raise a \"File Download\" dialogue box for a known MIME type with binary format or suggest a filename for dynamic content. Quotes are necessary with special characters.\n\t *\n\t * @example\n\t * content-disposition: attachment, filename=\"fname.ext\"\n\t * Permanent\n\t */\n\tCONTENT_DISPOSITION: 'content-disposition',\n\t/**\n\t * The type of encoding used on the data. See HTTP compression.\n\t *\n\t * @example\n\t * content-encoding: gzip\n\t * Permanent\n\t */\n\tCONTENT_ENCODING: 'content-encoding',\n\t/**\n\t * The natural language or languages of the intended audience for the enclosed content\n\t *\n\t * @example\n\t * content-language: da\n\t * Permanent\n\t */\n\tCONTENT_LANGUAGE: 'content-language',\n\t/**\n\t * The length of the response body in octets (8-bit bytes)\n\t *\n\t * @example\n\t * content-length: 348\n\t * Permanent\n\t */\n\tCONTENT_LENGTH: 'content-length',\n\t/**\n\t * An alternate location for the returned data\n\t *\n\t * @example\n\t * content-location: /index.htm\n\t * Permanent\n\t */\n\tCONTENT_LOCATION: 'content-location',\n\t/**\n\t * Where in a full body message this partial message belongs\n\t *\n\t * @example\n\t * content-range: bytes 21010-47021/47022\n\t * Permanent\n\t */\n\tCONTENT_RANGE: 'content-range',\n\t/**\n\t * The MIME type of this content\n\t *\n\t * @example\n\t * content-type: text/html, charset=utf-8\n\t * Permanent\n\t */\n\tCONTENT_TYPE: 'content-type',\n\t/**\n\t * The date and time that the message was sent (in \"HTTP-date\" format as defined by RFC 7231)\n\t *\n\t * @example\n\t * date: Tue, 15 Nov 1994 08:12:31 GMT\n\t * Permanent\n\t */\n\tDATE: 'date',\n\t/**\n\t * An identifier for a specific version of a resource, often a message digest\n\t *\n\t * @example\n\t * etag: \"737060cd8c284d8af7ad3082f209582d\"\n\t * Permanent\n\t */\n\tETAG: 'etag',\n\t/**\n\t * Gives the date/time after which the response is considered stale (in \"HTTP-date\" format as defined by RFC 7231)\n\t *\n\t * @example\n\t * expires: Thu, 01 Dec 1994 16:00:00 GMT\n\t * Permanent\n\t */\n\tEXPIRES: 'expires',\n\t/**\n\t * The last modified date for the requested object (in \"HTTP-date\" format as defined by RFC 7231)\n\t *\n\t * @example\n\t * last-modified: Tue, 15 Nov 1994 12:45:26 GMT\n\t * Permanent\n\t */\n\tLAST_MODIFIED: 'last-modified',\n\t/**\n\t * Used to express a typed relationship with another resource, where the relation type is defined by RFC 5988\n\t *\n\t * @example\n\t * link: </feed>, rel=\"alternate\"\n\t * Permanent\n\t */\n\tLINK: 'link',\n\t/**\n\t * Used in redirection, or when a new resource has been created.\n\t *\n\t * @example\n\t * location: http://www.w3.org/pub/WWW/People.html\n\t * Permanent\n\t */\n\tLOCATION: 'location',\n\t/**\n\t * This field is supposed to set P3P policy, in the form of P3P:CP=\"your_compact_policy\". However, P3P did not take off, most browsers have never fully\n\t * implemented it, a lot of websites set this field with fake policy text, that was enough to fool browsers the existence of P3P policy and grant permissions for third party cookies.\n\t *\n\t * @example\n\t * p3p: CP=\"This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info.\"\n\t * Permanent\n\t */\n\tP3P: 'p3p',\n\t/**\n\t * Implementation-specific fields that may have various effects anywhere along the request-response chain.\n\t *\n\t * @example\n\t * pragma: no-cache\n\t * Permanent\n\t */\n\tPRAGMA: 'pragma',\n\t/**\n\t * Request authentication to access the proxy.\n\t *\n\t * @example\n\t * proxy-authenticate: Basic\n\t * Permanent\n\t */\n\tPROXY_AUTHENTICATION: 'proxy-authenticate',\n\t/**\n\t * HTTP Public Key Pinning, announces hash of website's authentic TLS certificate\n\t *\n\t * @example\n\t * public-key-pins: max-age=2592000, pin-sha256=\"E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=\",\n\t * Permanent\n\t */\n\tPUBLIC_KEY_PINS: 'public-key-pins',\n\t/**\n\t * If an entity is temporarily unavailable, this instructs the client to try again later. Value could be a specified period of time (in seconds) or a HTTP-date.\n\t *\n\t * @example\n\t * retry-after: 120\n\t * retry-after: Fri, 07 Nov 2014 23:59:59 GMT\n\t * Permanent\n\t */\n\tRETRY_AFTER: 'retry-after',\n\t/**\n\t * A name for the server\n\t *\n\t * @example\n\t * server: Apache/2.4.1 (Unix)\n\t * Permanent\n\t */\n\tSERVER: 'server',\n\t/**\n\t * An HTTP cookie\n\t *\n\t * @example\n\t * set-cookie: UserID=JohnDoe, Max-Age=3600, Version=1\n\t * Permanent\n\t */\n\tSET_COOKIE: 'set-cookie',\n\t/**\n\t * CGI header field specifying the status of the HTTP response. Normal HTTP responses use a separate \"Status-Line\" instead, defined by RFC 7230.\n\t *\n\t * @example\n\t * status: 200 OK\n\t */\n\tSTATUS: 'status',\n\t/**\n\t * A HSTS Policy informing the HTTP client how long to cache the HTTPS only policy and whether this applies to subdomains.\n\t *\n\t * @example\n\t * strict-transport-security: max-age=16070400, includeSubDomains\n\t * Permanent\n\t */\n\tSTRICT_TRANSPORT_SECURITY: 'strict-transport-security',\n\t/**\n\t * The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded with chunked transfer coding.\n\t *\n\t * @example\n\t * trailer: Max-Forwards\n\t * Permanent\n\t */\n\tTRAILER: 'trailer',\n\t/**\n\t * The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress, deflate, gzip, identity.\n\t *\n\t * @example\n\t * transfer-encoding: chunked\n\t * Permanent\n\t */\n\tTRANSFER_ENCODING: 'transfer-encoding',\n\t/**\n\t * Ask the client to upgrade to another protocol.\n\t *\n\t * @example\n\t * upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11\n\t * Permanent\n\t */\n\tUPGRADE: 'upgrade',\n\t/**\n\t * Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server.\n\t *\n\t * @example\n\t * vary: *\n\t * Permanent\n\t */\n\tVARY: 'vary',\n\t/**\n\t * Informs the client of proxies through which the response was sent.\n\t *\n\t * @example\n\t * via: 1.0 fred, 1.1 example.com (Apache/1.1)\n\t * Permanent\n\t */\n\tVIA: 'via',\n\t/**\n\t * A general warning about possible problems with the entity body.\n\t *\n\t * @example\n\t * warning: 199 Miscellaneous warning\n\t * Permanent\n\t */\n\tWARNING: 'warning',\n\t/**\n\t * Indicates the authentication scheme that should be used to access the requested entity.\n\t *\n\t * @example\n\t * www-authenticate: Basic\n\t * Permanent\n\t */\n\tWWW_AUTHENTICATE: 'www-authenticate',\n\t/**\n\t * Cross-site scripting (XSS) filter\n\t *\n\t * @example\n\t * x-xss-protection: 1, mode=block\n\t */\n\tX_XSS_PROTECTION: 'x-xss-protection',\n\t/**\n\t * The HTTP Content-Security-Policy response header allows web site administrators to control resources the user agent is allowed\n\t * to load for a given page. With a few exceptions, policies mostly involve specifying server origins and script endpoints.\n\t * This helps guard against cross-site scripting attacks (Cross-site_scripting).\n\t *\n\t * @example\n\t * content-security-policy: default-src\n\t */\n\tCONTENT_SECURITY_POLICY: 'content-security-policy',\n\t/**\n\t * The only defined value, \"nosniff\", prevents Internet Explorer from MIME-sniffing a response away from the declared content-type. This also applies to Google Chrome, when downloading extensions.\n\t *\n\t * @example\n\t * x-content-type-options: nosniff\n\t */\n\tX_CONTENT_TYPE_OPTIONS: 'x-content-type-options',\n\t/**\n\t * specifies the technology (e.g. ASP.NET, PHP, JBoss) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)\n\t *\n\t * @example\n\t * x-powered-by: PHP/5.4.0\n\t */\n\tX_POWERED_BY: 'x-powered-by'\n};\n\nexport default HttpResponseHeader;"],
|
|
5
|
+
"mappings": "08BAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,ICWA,IAAqBC,EAArB,KAA0B,CAEzBC,GAMA,YAAYC,EAAW,CAAC,EAAG,CAC1B,KAAKD,GAAS,MAAM,GAAG,GAAGC,CAAQ,CACnC,CASA,OAAO,KAAKA,EAAUC,EAAQC,EAAS,CACtC,OAAO,IAAIJ,EAAK,MAAM,KAAKE,EAAUC,EAAQC,CAAO,CAAC,CACtD,CAEA,OAAO,SAASC,EAAM,CACrB,OAAO,IAAIL,EAAK,IAAI,MAAMK,CAAI,CAAC,CAChC,CAOA,IAAIC,EAAS,CACZ,YAAKL,GAAO,KAAKK,CAAO,EAEjB,IACR,CAOA,OAAOJ,EAAU,CAChB,YAAKD,GAAO,KAAK,GAAGC,CAAQ,EAErB,IACR,CAEA,OAAQ,CACP,KAAKD,GAAO,OAAS,CACtB,CAOA,OAAOM,EAAU,CAChB,OAAO,KAAK,KAAKN,GAAO,OAAO,GAAGM,CAAQ,CAAC,CAC5C,CAOA,MAAMC,EAAW,CAChB,OAAO,KAAKP,GAAO,MAAM,CAACK,EAASG,IAAUD,EAAUF,EAASG,EAAO,IAAI,CAAC,CAC7E,CAOA,KAAKD,EAAW,CACf,OAAO,KAAKP,GAAO,KAAK,CAACK,EAASG,IAAUD,EAAUF,EAASG,EAAO,IAAI,CAAC,CAC5E,CAOA,OAAOD,EAAW,CACjB,OAAO,IAAIR,EAAK,KAAKC,GAAO,OAAO,CAACK,EAASG,IAAUD,EAAUF,EAASG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EAAWX,GAAW,OAAO,OAAO,EAClD,CAACT,EAAawB,EAAAJ,EAAWX,GAAW,IAAI,OAAO,EAC/C,CAACT,EAAawB,EAAAJ,EAAWX,GAAW,KAAK,OAAO,EAChD,CAACH,GAAYkB,EAAAJ,EAAWX,GAAW,IAAI,OAAO,EAC9C,CAACN,EAAaqB,EAAAJ,EAAWX,GAAW,IAAI,OAAO,EAC/C,CAACN,EAAaqB,EAAAJ,EAAWX,GAAW,IAAI,OAAO,EAC/C,CAACN,EAAaqB,EAAAJ,EAAWX,GAAW,IAAI,OAAO,CAChD,CAAC,GAgBDqC,EArDoBvC,EAqDb,SAAS,OAAO,OAAOsB,CAAiB,GAM/CiB,EA3DoBvC,EA2Db,YAAYyB,GAMnBc,EAjEoBvC,EAiEb,gBAAgBwB,GAMvBe,EAvEoBvC,EAuEb,iBAAiB,OAAO,OAAOoC,CAAkB,GAExDG,EAzEoBvC,EAyEb,gBAAgB,CACtB,QAAS,UACT,YAAa,cACb,SAAU,WACV,SAAU,WACV,eAAgB,iBAChB,OAAQ,QACT,GAMAuC,EAtFoBvC,EAsFb,oBAAoB,CAC1B,QAAS,UACT,KAAM,OACN,YAAa,aACd",
|
|
6
|
+
"names": ["transportr_exports", "__export", "Transportr", "List", "#array", "iterable", "mapper", "context", "size", "element", "elements", "predicate", "index", "reducer", "initialValue", "comparator", "consumer", "fromIndex", "MultiMap", "key", "value", "List", "SetMultiMap", "key", "value", "Node", "#value", "#next", "value", "WeakSetMultiMap", "key", "value", "_type", "object", "object_type_default", "_isType", "object", "type", "object_type_default", "object_is_type_default", "_objectMerge", "objects", "prev", "obj", "key", "pVal", "oVal", "object_is_type_default", "object_merge_default", "removeLeadingAndTrailingHTTPWhitespace", "string", "removeTrailingHTTPWhitespace", "isHTTPWhitespaceChar", "char", "solelyContainsHTTPTokenCodePoints", "solelyContainsHTTPQuotedStringTokenCodePoints", "asciiLowercase", "l", "collectAnHTTPQuotedString", "input", "position", "value", "quoteOrBackslash", "MediaTypeParameters", "map", "name", "asciiLowercase", "value", "solelyContainsHTTPTokenCodePoints", "solelyContainsHTTPQuotedStringTokenCodePoints", "callback", "thisArg", "parse", "input", "removeLeadingAndTrailingHTTPWhitespace", "position", "type", "solelyContainsHTTPTokenCodePoints", "subtype", "removeTrailingHTTPWhitespace", "mediaType", "asciiLowercase", "isHTTPWhitespaceChar", "parameterName", "parameterValue", "collectAnHTTPQuotedString", "solelyContainsHTTPQuotedStringTokenCodePoints", "parser_default", "serialize", "mediaType", "serialization", "name", "value", "solelyContainsHTTPTokenCodePoints", "serializer_default", "MediaType", "string", "result", "parser_default", "MediaTypeParameters", "value", "asciiLowercase", "solelyContainsHTTPTokenCodePoints", "serializer_default", "prohibitParameters", "HttpMediaType", "http_media_type_default", "HttpRequestHeader", "http_request_headers_default", "HttpRequestMethod", "http_request_methods_default", "HttpResponseHeader", "http_response_headers_default", "HttpError", "endsWithSlashRegEx", "_handleText", "response", "_handleJson", "_handleBlob", "_handleBuffer", "_handleReadableStream", "_handleXml", "Transportr", "_baseUrl", "_MediaType", "_contentTypeHandlers", "_defaultRequestOptions", "_get", "get_fn", "_request", "request_fn", "_createUrl", "createUrl_fn", "_processResponse", "processResponse_fn", "_Transportr", "url", "__privateAdd", "__privateSet", "__privateGet", "path", "options", "__privateMethod", "object_merge_default", "http_request_methods_default", "body", "http_request_headers_default", "http_media_type_default", "responseHandler", "_a", "_b", "requestOptions", "error", "searchParams", "name", "value", "mediaType", "MediaType", "http_response_headers_default", "contentTypes", "SetMultiMap", "__publicField"]
|
|
7
|
+
}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as HttpMediaType } from "./src/http-media-type.js";
|
|
2
|
+
export { default as HttpRequestHeader } from "./src/http-request-headers.js";
|
|
3
|
+
export { default as HttpRequestMethod } from "./src/http-request-methods.js";
|
|
4
|
+
export { default as HttpResponseHeader } from "./src/http-response-headers.js";
|
|
5
|
+
export { default as Transportr } from "./src/transportr.js";
|
package/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as HttpMediaType } from './src/http-media-type.js';
|
|
2
|
+
export { default as HttpRequestHeader } from './src/http-request-headers.js';
|
|
3
|
+
export { default as HttpRequestMethod } from './src/http-request-methods.js';
|
|
4
|
+
export { default as HttpResponseHeader } from './src/http-response-headers.js';
|
|
5
|
+
export { default as Transportr } from './src/transportr.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@d1g1tal/transportr",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "JavaScript wrapper for the Fetch API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./src/transportr.js",
|
|
10
|
+
"default": "./dist/transportr.min.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"browser": {
|
|
14
|
+
"transportr.js": "./dist/transportr.js",
|
|
15
|
+
"transportr.min.js": "./dist/transportr.min.js",
|
|
16
|
+
"transportr.min.js.map": "./dist/transportr.min.js.map"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"/src",
|
|
23
|
+
"/dist",
|
|
24
|
+
"index.js",
|
|
25
|
+
"index.d.ts"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "rimraf dist && esbuild src/transportr.js --bundle --platform=browser --global-name=Transportr --footer:js='window.Transportr = Transportr.default;' --outfile=dist/transportr.js && esbuild src/transportr.js --bundle --sourcemap --minify --platform=browser --global-name=Transportr --footer:js='window.Transportr = Transportr.default;' --outfile=dist/transportr.min.js",
|
|
29
|
+
"lint": "eslint --ext .js --ignore-path .gitignore .",
|
|
30
|
+
"d.ts": "tsc --allowJs -declaration --emitDeclarationOnly --skipLibCheck --lib esnext index.js",
|
|
31
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/D1g1talEntr0py/transportr.git"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"Fetch",
|
|
39
|
+
"JavaScript"
|
|
40
|
+
],
|
|
41
|
+
"author": "Jason DiMeo",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/D1g1talEntr0py/transportr/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/D1g1talEntr0py/transportr#readme",
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@skypack/package-check": "^0.2.2",
|
|
49
|
+
"@xmldom/xmldom": "^0.8.2",
|
|
50
|
+
"esbuild": "^0.15.11",
|
|
51
|
+
"eslint": "^8.25.0",
|
|
52
|
+
"eslint-plugin-compat": "^4.0.2",
|
|
53
|
+
"eslint-plugin-jsdoc": "^39.3.6",
|
|
54
|
+
"jest": "^29.2.0",
|
|
55
|
+
"rimraf": "^3.0.2"
|
|
56
|
+
},
|
|
57
|
+
"browserslist": [
|
|
58
|
+
">= 0.5%",
|
|
59
|
+
"last 2 major versions",
|
|
60
|
+
"Firefox ESR",
|
|
61
|
+
"not dead",
|
|
62
|
+
"not ios_saf < 15",
|
|
63
|
+
"not op_mini all"
|
|
64
|
+
],
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@d1g1tal/chrysalis": "^1.1.7",
|
|
67
|
+
"@d1g1tal/collections": "^0.0.3",
|
|
68
|
+
"@d1g1tal/media-type": "^4.0.0"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
export default HttpMediaType;
|
|
2
|
+
declare const HttpMediaType: {
|
|
3
|
+
/** Advanced Audio Coding (AAC) */
|
|
4
|
+
AAC: string;
|
|
5
|
+
/** AbiWord */
|
|
6
|
+
ABW: string;
|
|
7
|
+
/** Archive document (multiple files embedded) */
|
|
8
|
+
ARC: string;
|
|
9
|
+
/** AVIF image */
|
|
10
|
+
AVIF: string;
|
|
11
|
+
/** Audio Video Interleave (AVI) */
|
|
12
|
+
AVI: string;
|
|
13
|
+
/** Amazon Kindle eBook format */
|
|
14
|
+
AZW: string;
|
|
15
|
+
/** Binary Data */
|
|
16
|
+
BIN: string;
|
|
17
|
+
/** Windows OS/2 Bitmap Graphics */
|
|
18
|
+
BMP: string;
|
|
19
|
+
/** Bzip Archive */
|
|
20
|
+
BZIP: string;
|
|
21
|
+
/** Bzip2 Archive */
|
|
22
|
+
BZIP2: string;
|
|
23
|
+
/** CD audio */
|
|
24
|
+
CDA: string;
|
|
25
|
+
/** C Shell Script */
|
|
26
|
+
CSH: string;
|
|
27
|
+
/** Cascading Style Sheets (CSS) */
|
|
28
|
+
CSS: string;
|
|
29
|
+
/** Comma-Separated Values */
|
|
30
|
+
CSV: string;
|
|
31
|
+
/** Microsoft Office Word Document */
|
|
32
|
+
DOC: string;
|
|
33
|
+
/** Microsoft Office Word Document (OpenXML) */
|
|
34
|
+
DOCX: string;
|
|
35
|
+
/** Microsoft Embedded OpenType */
|
|
36
|
+
EOT: string;
|
|
37
|
+
/** Electronic Publication (EPUB) */
|
|
38
|
+
EPUB: string;
|
|
39
|
+
/** GZip Compressed Archive */
|
|
40
|
+
GZIP: string;
|
|
41
|
+
/** Graphics Interchange Format */
|
|
42
|
+
GIF: string;
|
|
43
|
+
/** HyperText Markup Language (HTML) */
|
|
44
|
+
HTML: string;
|
|
45
|
+
/** Icon Format */
|
|
46
|
+
ICO: string;
|
|
47
|
+
/** iCalendar Format */
|
|
48
|
+
ICS: string;
|
|
49
|
+
/** Java Archive (JAR) */
|
|
50
|
+
JAR: string;
|
|
51
|
+
/** JPEG Image */
|
|
52
|
+
JPEG: string;
|
|
53
|
+
/** JavaScript */
|
|
54
|
+
JAVA_SCRIPT: string;
|
|
55
|
+
/** JavaScript Object Notation Format (JSON) */
|
|
56
|
+
JSON: string;
|
|
57
|
+
/** JavaScript Object Notation LD Format */
|
|
58
|
+
JSON_LD: string;
|
|
59
|
+
/** Musical Instrument Digital Interface (MIDI) */
|
|
60
|
+
MID: string;
|
|
61
|
+
/** Musical Instrument Digital Interface (MIDI) */
|
|
62
|
+
X_MID: string;
|
|
63
|
+
/** MP3 Audio */
|
|
64
|
+
MP3: string;
|
|
65
|
+
/** MPEG-4 Audio */
|
|
66
|
+
MP4A: string;
|
|
67
|
+
/** MPEG-4 Video */
|
|
68
|
+
MP4: string;
|
|
69
|
+
/** MPEG Video */
|
|
70
|
+
MPEG: string;
|
|
71
|
+
/** Apple Installer Package */
|
|
72
|
+
MPKG: string;
|
|
73
|
+
/** OpenDocument Presentation Document */
|
|
74
|
+
ODP: string;
|
|
75
|
+
/** OpenDocument Spreadsheet Document */
|
|
76
|
+
ODS: string;
|
|
77
|
+
/** OpenDocument Text Document */
|
|
78
|
+
ODT: string;
|
|
79
|
+
/** Ogg Audio */
|
|
80
|
+
OGA: string;
|
|
81
|
+
/** Ogg Video */
|
|
82
|
+
OGV: string;
|
|
83
|
+
/** Ogg */
|
|
84
|
+
OGX: string;
|
|
85
|
+
/** Opus audio */
|
|
86
|
+
OPUS: string;
|
|
87
|
+
/** OpenType Font File */
|
|
88
|
+
OTF: string;
|
|
89
|
+
/** Portable Network Graphics (PNG) */
|
|
90
|
+
PNG: string;
|
|
91
|
+
/** Adobe Portable Document Format */
|
|
92
|
+
PDF: string;
|
|
93
|
+
/** Hypertext Preprocessor (Personal Home Page) */
|
|
94
|
+
PHP: string;
|
|
95
|
+
/** Microsoft PowerPoint */
|
|
96
|
+
PPT: string;
|
|
97
|
+
/** Microsoft Office Presentation (OpenXML) */
|
|
98
|
+
PPTX: string;
|
|
99
|
+
/** RAR Archive */
|
|
100
|
+
RAR: string;
|
|
101
|
+
/** Rich Text Format */
|
|
102
|
+
RTF: string;
|
|
103
|
+
/** Bourne Shell Script */
|
|
104
|
+
SH: string;
|
|
105
|
+
/** Scalable Vector Graphics (SVG) */
|
|
106
|
+
SVG: string;
|
|
107
|
+
/** Tape Archive (TAR) */
|
|
108
|
+
TAR: string;
|
|
109
|
+
/** Tagged Image File Format (TIFF) */
|
|
110
|
+
TIFF: string;
|
|
111
|
+
/** MPEG transport stream */
|
|
112
|
+
TRANSPORT_STREAM: string;
|
|
113
|
+
/** TrueType Font */
|
|
114
|
+
TTF: string;
|
|
115
|
+
/** Text, (generally ASCII or ISO 8859-n) */
|
|
116
|
+
TEXT: string;
|
|
117
|
+
/** Microsoft Visio */
|
|
118
|
+
VSD: string;
|
|
119
|
+
/** Waveform Audio Format (WAV) */
|
|
120
|
+
WAV: string;
|
|
121
|
+
/** Open Web Media Project - Audio */
|
|
122
|
+
WEBA: string;
|
|
123
|
+
/** Open Web Media Project - Video */
|
|
124
|
+
WEBM: string;
|
|
125
|
+
/** WebP Image */
|
|
126
|
+
WEBP: string;
|
|
127
|
+
/** Web Open Font Format */
|
|
128
|
+
WOFF: string;
|
|
129
|
+
/** Web Open Font Format */
|
|
130
|
+
WOFF2: string;
|
|
131
|
+
/** XHTML - The Extensible HyperText Markup Language */
|
|
132
|
+
XHTML: string;
|
|
133
|
+
/** Microsoft Excel Document */
|
|
134
|
+
XLS: string;
|
|
135
|
+
/** Microsoft Office Spreadsheet Document (OpenXML) */
|
|
136
|
+
XLSX: string;
|
|
137
|
+
/** Extensible Markup Language (XML) */
|
|
138
|
+
XML: string;
|
|
139
|
+
/** XML User Interface Language (XUL) */
|
|
140
|
+
XUL: string;
|
|
141
|
+
/** Zip Archive */
|
|
142
|
+
ZIP: string;
|
|
143
|
+
/** 3GPP audio/video container */
|
|
144
|
+
'3GP': string;
|
|
145
|
+
/** 3GPP2 audio/video container */
|
|
146
|
+
'3G2': string;
|
|
147
|
+
/** 7-Zip Archive */
|
|
148
|
+
'7Z': string;
|
|
149
|
+
};
|