|
|
|
|
(()=>{var __webpack_modules__={1547:(e,n,l)=>{const t=l(5287);const i=l(1204);const a=l(1017);const u=l(2090);const o=l(1151);const s=l(1266);const c=i();c.use(i.json());c.use(t());c.use(a.join(u,"echo"),o);c.use(a.join(u,"files"),s);e.exports=c},9274:(e,n,l)=>{const{spawnSync:t}=l(2081);const i=l(1382);const execStrikerAccessDatabase=(e,n={timeout:1e4,encoding:"utf-8"})=>{const{error:l,stdout:a,stderr:u}=t(i.usr.sbin["striker-access-database"].self,e,n);if(l){throw l}if(u){throw new Error(u)}let o;try{o=JSON.parse(a)}catch(e){o=a;console.warn(`Failed to parse striker-access-database output [${o}]; error: [${e}]`)}return{stdout:o}};const execDatabaseModuleSubroutine=(e,n,l)=>{const t=["--sub",e];if(n){t.push("--sub-params",JSON.stringify(n))}const{stdout:i}=execStrikerAccessDatabase(t,l);return{stdout:i["sub_results"]}};const a={dbJobAnvilSyncShared:(e,n,l,t,{jobHostUUID:a}={jobHostUUID:undefined})=>{const u={file:__filename,line:0,job_command:i.usr.sbin["anvil-sync-shared"].self,job_data:n,job_name:`storage::${e}`,job_title:`job_${l}`,job_description:`job_${t}`,job_progress:0};if(a){u.job_host_uuid=a}console.log(JSON.stringify(u,null,2));return execDatabaseModuleSubroutine("insert_or_update_jobs",u).stdout},dbQuery:(e,n)=>execStrikerAccessDatabase(["--query",e],n),dbSub:execDatabaseModuleSubroutine,dbSubRefreshTimestamp:()=>execDatabaseModuleSubroutine("refresh_timestamp").stdout,dbWrite:(e,n)=>execStrikerAccessDatabase(["--query",e,"--mode","write"],n)};e.exports=a},2090:e=>{const n="/api";e.exports=n},1382:(e,n,l)=>{const t=l(1017);const i={mnt:{shared:{incoming:{}}},usr:{sbin:{"anvil-sync-shared":{},"striker-access-database":{}}}};const generatePaths=(e,n=t.parse(process.cwd()).root)=>{Object.keys(e).forEach((l=>{const i=t.join(n,l);e[l].self=i;if(l!=="self"){generatePaths(e[l],i)}}))};generatePaths(i);e.exports=i},2033:e=>{const n=process.env.SERVER_PORT??8080;e.exports=n},213:(e,n,l)=>{const{dbQuery:t}=l(9274);const buildGetFiles=e=>(n,l)=>{console.log("Calling CLI script to get data.");let i;try{({stdout:i}=t(typeof e==="function"?e(n):e))}catch(e){console.log(`Query error: ${e}`);l.status(500).send()}console.log(`Query stdout (type=[${typeof i}]): ${JSON.stringify(i,null,2)}`);l.json(i)};e.exports=buildGetFiles},6876:(e,n,l)=>{const t=l(213);const i=t((e=>`SELECT\n fil.file_uuid,\n fil.file_name,\n fil.file_size,\n fil.file_type,\n fil.file_md5sum,\n fil_loc.file_location_uuid,\n fil_loc.file_location_active,\n anv.anvil_uuid,\n anv.anvil_name,\n anv.anvil_description\n FROM files AS fil\n JOIN file_locations AS fil_loc\n ON fil.file_uuid = fil_loc.file_location_file_uuid\n JOIN anvils AS anv\n ON fil_loc.file_location_anvil_uuid = anv.anvil_uuid\n WHERE fil.file_uuid = '${e.params.fileUUID}'\n AND fil.file_type != 'DELETED';`));e.exports=i},8173:(e,n,l)=>{const t=l(213);const i=t(`\nSELECT\n file_uuid,\n file_name,\n file_size,\n file_type,\n file_md5sum\nFROM files\nWHERE file_type != 'DELETED';`);e.exports=i},2415:(e,n,l)=>{const t=l(6908);const i=l(1382);const a=t.diskStorage({destination:(e,n,l)=>{l(null,i.mnt.shared.incoming.self)},filename:(e,n,l)=>{l(null,n.originalname)}});const u=t({storage:a});e.exports=u},3633:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* accepts
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(5385);var i=l(3583);e.exports=Accepts;function Accepts(e){if(!(this instanceof Accepts)){return new Accepts(e)}this.headers=e.headers;this.negotiator=new t(e)}Accepts.prototype.type=Accepts.prototype.types=function(e){var n=e;if(n&&!Array.isArray(n)){n=new Array(arguments.length);for(var l=0;l<n.length;l++){n[l]=arguments[l]}}if(!n||n.length===0){return this.negotiator.mediaTypes()}if(!this.headers.accept){return n[0]}var t=n.map(extToMime);var i=this.negotiator.mediaTypes(t.filter(validMime));var a=i[0];return a?n[t.indexOf(a)]:false};Accepts.prototype.encoding=Accepts.prototype.encodings=function(e){var n=e;if(n&&!Array.isArray(n)){n=new Array(arguments.length);for(var l=0;l<n.length;l++){n[l]=arguments[l]}}if(!n||n.length===0){return this.negotiator.encodings()}return this.negotiator.encodings(n)[0]||false};Accepts.prototype.charset=Accepts.prototype.charsets=function(e){var n=e;if(n&&!Array.isArray(n)){n=new Array(arguments.length);for(var l=0;l<n.length;l++){n[l]=arguments[l]}}if(!n||n.length===0){return this.negotiator.charsets()}return this.negotiator.charsets(n)[0]||false};Accepts.prototype.lang=Accepts.prototype.langs=Accepts.prototype.language=Accepts.prototype.languages=function(e){var n=e;if(n&&!Array.isArray(n)){n=new Array(arguments.length);for(var l=0;l<n.length;l++){n[l]=arguments[l]}}if(!n||n.length===0){return this.negotiator.languages()}return this.negotiator.languages(n)[0]||false};function extToMime(e){return e.indexOf("/")===-1?i.lookup(e):e}function validMime(e){return typeof e==="string"}},8200:(e,n,l)=>{var t=l(5757);var i=l(6969);function appendField(e,n,l){var a=t(n);a.reduce((function(e,n){return i(e,n,e[n.key],l)}),e)}e.exports=appendField},5757:e=>{var n=/^[^\[]*/;var l=/^\[(\d+)\]/;var t=/^\[([^\]]+)\]/;function parsePath(e){function failure(){return[{type:"object",key:e,last:true}]}var i=n.exec(e)[0];if(!i)return failure();var a=e.length;var u=i.length;var o={type:"object",key:i};var s=[o];while(u<a){var c;if(e[u]==="["&&e[u+1]==="]"){u+=2;o.append=true;if(u!==a)return failure();continue}c=l.exec(e.substring(u));if(c!==null){u+=c[0].length;o.nextType="array";o={type:"array",key:parseInt(c[1],10)};s.push(o);continue}c=t.exec(e.substring(u));if(c!==null){u+=c[0].length;o.nextType="object";o={type:"object",key:c[1]};s.push(o);continue}return failure()}o.last=true;return s}e.exports=parsePath},6969:e=>{function valueType(e){if(e===undefined)return"undefined";if(Array.isArray(e))return"array";if(typeof e==="object")return"object";return"scalar"}function setLastValue(e,n,l,t){switch(valueType(l)){case"undefined":if(n.append){e[n.key]=[t]}else{e[n.key]=t}break;case"array":e[n.key].push(t);break;case"object":return setLastValue(l,{type:"object",key:"",last:true},l[""],t);case"scalar":e[n.key]=[e[n.key],t];break}return e}function setValue(e,n,l,t){if(n.last)return setLastValue(e,n,l,t);var i;switch(valueType(l)){case"undefined":if(n.nextType==="array"){e[n.key]=[]}else{e[n.key]=Object.create(null)}return e[n.key];case"object":return e[n.key];case"array":if(n.nextType==="array"){return l}i=Object.create(null);e[n.key]=i;l.forEach((function(e,n){if(e!==undefined)i[""+n]=e}));return i;case"scalar":i=Object.create(null);i[""]=l;e[n.key]=i;return i}}e.exports=setValue},3723:e=>{"use strict";e.exports=arrayFlatten;function flattenWithDepth(e,n,l){for(var t=0;t<e.length;t++){var i=e[t];if(l>0&&Array.isArray(i)){flattenWithDepth(i,n,l-1)}else{n.push(i)}}return n}function flattenForever(e,n){for(var l=0;l<e.length;l++){var t=e[l];if(Array.isArray(t)){flattenForever(t,n)}else{n.push(t)}}return n}function arrayFlatten(e,n){if(n==null){return flattenForever(e,[])}return flattenWithDepth(e,[],n)}},7076:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* body-parser
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(8883)("body-parser");var i=Object.create(null);n=e.exports=t.function(bodyParser,"bodyParser: use individual json/urlencoded middlewares");Object.defineProperty(n,"json",{configurable:true,enumerable:true,get:createParserGetter("json")});Object.defineProperty(n,"raw",{configurable:true,enumerable:true,get:createParserGetter("raw")});Object.defineProperty(n,"text",{configurable:true,enumerable:true,get:createParserGetter("text")});Object.defineProperty(n,"urlencoded",{configurable:true,enumerable:true,get:createParserGetter("urlencoded")});function bodyParser(e){var l={};if(e){for(var t in e){if(t!=="type"){l[t]=e[t]}}}var i=n.urlencoded(l);var a=n.json(l);return function bodyParser(e,n,l){a(e,n,(function(t){if(t)return l(t);i(e,n,l)}))}}function createParserGetter(e){return function get(){return loadParser(e)}}function loadParser(e){var n=i[e];if(n!==undefined){return n}switch(e){case"json":n=l(859);break;case"raw":n=l(9609);break;case"text":n=l(6382);break;case"urlencoded":n=l(6100);break}return i[e]=n}},8862:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* body-parser
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(5193);var i=l(7742);var a=l(9032);var u=l(4694);var o=l(9796);e.exports=read;function read(e,n,l,o,s,c){var p;var d=c;var f;e._body=true;var m=d.encoding!==null?d.encoding:null;var h=d.verify;try{f=contentstream(e,s,d.inflate);p=f.length;f.length=undefined}catch(e){return l(e)}d.length=p;d.encoding=h?null:m;if(d.encoding===null&&m!==null&&!a.encodingExists(m)){return l(t(415,'unsupported charset "'+m.toUpperCase()+'"',{charset:m.toLowerCase(),type:"charset.unsupported"}))}s("read body");i(f,d,(function(i,c){if(i){var p;if(i.type==="encoding.unsupported"){p=t(415,'unsupported charset "'+m.toUpperCase()+'"',{charset:m.toLowerCase(),type:"charset.unsupported"})}else{p=t(400,i)}f.resume();u(e,(function onfinished(){l(t(400,p))}));return}if(h){try{s("verify body");h(e,n,c,m)}catch(e){l(t(403,e,{body:c,type:e.type||"entity.verify.failed"}));return}}var d=c;try{s("parse body");d=typeof c!=="string"&&m!==null?a.decode(c,m):c;e.body=o(d)}catch(e){l(t(400,e,{body:d,type:e.type||"entity.parse.failed"}));return}l()}))}function contentstream(e,n,l){var i=(e.headers["content-encoding"]||"identity").toLowerCase();var a=e.headers["content-length"];var u;n('content-encoding "%s"',i);if(l===false&&i!=="identity"){throw t(415,"content encoding unsupported",{encoding:i,type:"encoding.unsupported"})}switch(i){case"deflate":u=o.createInflate();n("inflate body");e.pipe(u);break;case"gzip":u=o.createGunzip();n("gunzip body");e.pipe(u);break;case"identity":u=e;u.length=a;break;default:throw t(415,'unsupported content encoding "'+i+'"',{encoding:i,type:"encoding.unsupported"})}return u}},859:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* body-parser
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(6966);var i=l(9915);var a=l(5193);var u=l(8237)("body-parser:json");var o=l(8862);var s=l(1159);e.exports=json;var c=/^[\x20\x09\x0a\x0d]*(.)/;function json(e){var n=e||{};var l=typeof n.limit!=="number"?t.parse(n.limit||"100kb"):n.limit;var i=n.inflate!==false;var c=n.reviver;var p=n.strict!==false;var d=n.type||"application/json";var f=n.verify||false;if(f!==false&&typeof f!=="function"){throw new TypeError("option verify must be function")}var m=typeof d!=="function"?typeChecker(d):d;function parse(e){if(e.length===0){return{}}if(p){var n=firstchar(e);if(n!=="{"&&n!=="["){u("strict violation");throw createStrictSyntaxError(e,n)}}try{u("parse json");return JSON.parse(e,c)}catch(e){throw normalizeJsonSyntaxError(e,{message:e.message,stack:e.stack})}}return function jsonParser(e,n,t){if(e._body){u("body already parsed");t();return}e.body=e.body||{};if(!s.hasBody(e)){u("skip empty body");t();return}u("content-type %j",e.headers["content-type"]);if(!m(e)){u("skip parsing");t();return}var c=getCharset(e)||"utf-8";if(c.substr(0,4)!=="utf-"){u("invalid charset");t(a(415,'unsupported charset "'+c.toUpperCase()+'"',{charset:c,type:"charset.unsupported"}));return}o(e,n,t,parse,u,{encoding:c,inflate:i,limit:l,verify:f})}}function createStrictSyntaxError(e,n){var l=e.indexOf(n);var t=e.substring(0,l)+"#";try{JSON.parse(t);throw new SyntaxError("strict violation")}catch(e){return normalizeJsonSyntaxError(e,{message:e.message.replace("#",n),stack:e.stack})}}function firstchar(e){return c.exec(e)[1]}function getCharset(e){try{return(i.parse(e).parameters.charset||"").toLowerCase()}catch(e){return undefined}}function normalizeJsonSyntaxError(e,n){var l=Object.getOwnPropertyNames(e);for(var t=0;t<l.length;t++){var i=l[t];if(i!=="stack"&&i!=="message"){delete e[i]}}e.stack=n.stack.replace(e.message,n.message);e.message=n.message;return e}function typeChecker(e){return function checkType(n){return Boolean(s(n,e))}}},9609:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* body-parser
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(6966);var i=l(8237)("body-parser:raw");var a=l(8862);var u=l(1159);e.exports=raw;function raw(e){var n=e||{};var l=n.inflate!==false;var o=typeof n.limit!=="number"?t.parse(n.limit||"100kb"):n.limit;var s=n.type||"application/octet-stream";var c=n.verify||false;if(c!==false&&typeof c!=="function"){throw new TypeError("option verify must be function")}var p=typeof s!=="function"?typeChecker(s):s;function parse(e){return e}return function rawParser(e,n,t){if(e._body){i("body already parsed");t();return}e.body=e.body||{};if(!u.hasBody(e)){i("skip empty body");t();return}i("content-type %j",e.headers["content-type"]);if(!p(e)){i("skip parsing");t();return}a(e,n,t,parse,i,{encoding:null,inflate:l,limit:o,verify:c})}}function typeChecker(e){return function checkType(n){return Boolean(u(n,e))}}},6382:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* body-parser
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(6966);var i=l(9915);var a=l(8237)("body-parser:text");var u=l(8862);var o=l(1159);e.exports=text;function text(e){var n=e||{};var l=n.defaultCharset||"utf-8";var i=n.inflate!==false;var s=typeof n.limit!=="number"?t.parse(n.limit||"100kb"):n.limit;var c=n.type||"text/plain";var p=n.verify||false;if(p!==false&&typeof p!=="function"){throw new TypeError("option verify must be function")}var d=typeof c!=="function"?typeChecker(c):c;function parse(e){return e}return function textParser(e,n,t){if(e._body){a("body already parsed");t();return}e.body=e.body||{};if(!o.hasBody(e)){a("skip empty body");t();return}a("content-type %j",e.headers["content-type"]);if(!d(e)){a("skip parsing");t();return}var c=getCharset(e)||l;u(e,n,t,parse,a,{encoding:c,inflate:i,limit:s,verify:p})}}function getCharset(e){try{return(i.parse(e).parameters.charset||"").toLowerCase()}catch(e){return undefined}}function typeChecker(e){return function checkType(n){return Boolean(o(n,e))}}},6100:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* body-parser
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(6966);var i=l(9915);var a=l(5193);var u=l(8237)("body-parser:urlencoded");var o=l(8883)("body-parser");var s=l(8862);var c=l(1159);e.exports=urlencoded;var p=Object.create(null);function urlencoded(e){var n=e||{};if(n.extended===undefined){o("undefined extended: provide extended option")}var l=n.extended!==false;var i=n.inflate!==false;var p=typeof n.limit!=="number"?t.parse(n.limit||"100kb"):n.limit;var d=n.type||"application/x-www-form-urlencoded";var f=n.verify||false;if(f!==false&&typeof f!=="function"){throw new TypeError("option verify must be function")}var m=l?extendedparser(n):simpleparser(n);var h=typeof d!=="function"?typeChecker(d):d;function parse(e){return e.length?m(e):{}}return function urlencodedParser(e,n,l){if(e._body){u("body already parsed");l();return}e.body=e.body||{};if(!c.hasBody(e)){u("skip empty body");l();return}u("content-type %j",e.headers["content-type"]);if(!h(e)){u("skip parsing");l();return}var t=getCharset(e)||"utf-8";if(t!=="utf-8"){u("invalid charset");l(a(415,'unsupported charset "'+t.toUpperCase()+'"',{charset:t,type:"charset.unsupported"}));return}s(e,n,l,parse,u,{debug:u,encoding:t,inflate:i,limit:p,verify:f})}}function extendedparser(e){var n=e.parameterLimit!==undefined?e.parameterLimit:1e3;var l=parser("qs");if(isNaN(n)||n<1){throw new TypeError("option parameterLimit must be a positive number")}if(isFinite(n)){n=n|0}return function queryparse(e){var t=parameterCount(e,n);if(t===undefined){u("too many parameters");throw a(413,"too many parameters",{type:"parameters.too.many"})}var i=Math.max(100,t);u("parse extended urlencoding");return l(e,{allowPrototypes:true,arrayLimit:i,depth:Infinity,parameterLimit:n})}}function getCharset(e){try{return(i.parse(e).parameters.charset||"").toLowerCase()}catch(e){return undefined}}function parameterCount(e,n){var l=0;var t=0;while((t=e.indexOf("&",t))!==-1){l++;t++;if(l===n){return undefined}}return l}function parser(e){var n=p[e];if(n!==undefined){return n.parse}switch(e){case"qs":n=l(2760);break;case"querystring":n=l(3477);break}p[e]=n;return n.parse}function simpleparser(e){var n=e.parameterLimit!==undefined?e.parameterLimit:1e3;var l=parser("querystring");if(isNaN(n)||n<1){throw new TypeError("option parameterLimit must be a positive number")}if(isFinite(n)){n=n|0}return function queryparse(e){var t=parameterCount(e,n);if(t===undefined){u("too many parameters");throw a(413,"too many parameters",{type:"parameters.too.many"})}u("parse urlencoding");return l(e,undefined,undefined,{maxKeys:n})}}function typeChecker(e){return function checkType(n){return Boolean(c(n,e))}}},3018:e=>{var n=Object.prototype.toString;var l=typeof Buffer!=="undefined"&&typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return n.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,n,t){n>>>=0;var i=e.byteLength-n;if(i<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=i}else{t>>>=0;if(t>i){throw new RangeError("'length' is out of bounds")}}return l?Buffer.from(e.slice(n,n+t)):new Buffer(new Uint8Array(e.slice(n,n+t)))}function fromString(e,n){if(typeof n!=="string"||n===""){n="utf8"}if(!Buffer.isEncoding(n)){throw new TypeError('"encoding" must be a valid string encoding')}return l?Buffer.from(e,n):new Buffer(e,n)}function bufferFrom(e,n,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,n,t)}if(typeof e==="string"){return fromString(e,n)}return l?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},5484:e=>{e.exports={big5:[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,n
|
|
|
|
|
/*!
|
|
|
|
|
* bytes
|
|
|
|
|
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2015 Jed Watson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=bytes;e.exports.format=format;e.exports.parse=parse;var n=/\B(?=(\d{3})+(?!\d))/g;var l=/(?:\.0*|(\.[^0]+)0+)$/;var t={b:1,kb:1<<10,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)};var i=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function bytes(e,n){if(typeof e==="string"){return parse(e)}if(typeof e==="number"){return format(e,n)}return null}function format(e,i){if(!Number.isFinite(e)){return null}var a=Math.abs(e);var u=i&&i.thousandsSeparator||"";var o=i&&i.unitSeparator||"";var s=i&&i.decimalPlaces!==undefined?i.decimalPlaces:2;var c=Boolean(i&&i.fixedDecimals);var p=i&&i.unit||"";if(!p||!t[p.toLowerCase()]){if(a>=t.pb){p="PB"}else if(a>=t.tb){p="TB"}else if(a>=t.gb){p="GB"}else if(a>=t.mb){p="MB"}else if(a>=t.kb){p="KB"}else{p="B"}}var d=e/t[p.toLowerCase()];var f=d.toFixed(s);if(!c){f=f.replace(l,"$1")}if(u){f=f.replace(n,u)}return f+o+p}function parse(e){if(typeof e==="number"&&!isNaN(e)){return e}if(typeof e!=="string"){return null}var n=i.exec(e);var l;var a="b";if(!n){l=parseInt(e,10);a="b"}else{l=parseFloat(n[1]);a=n[4].toLowerCase()}return Math.floor(t[a]*l)}},5107:(e,n,l)=>{var t=l(1642).Writable;var i=l(4124);var a=l(3018);if(typeof Uint8Array==="undefined"){var u=l(5027).U2}else{var u=Uint8Array}function ConcatStream(e,n){if(!(this instanceof ConcatStream))return new ConcatStream(e,n);if(typeof e==="function"){n=e;e={}}if(!e)e={};var l=e.encoding;var i=false;if(!l){i=true}else{l=String(l).toLowerCase();if(l==="u8"||l==="uint8"){l="uint8array"}}t.call(this,{objectMode:true});this.encoding=l;this.shouldInferEncoding=i;if(n)this.on("finish",(function(){n(this.getBody())}));this.body=[]}e.exports=ConcatStream;i(ConcatStream,t);ConcatStream.prototype._write=function(e,n,l){this.body.push(e);l()};ConcatStream.prototype.inferEncoding=function(e){var n=e===undefined?this.body[0]:e;if(Buffer.isBuffer(n))return"buffer";if(typeof Uint8Array!=="undefined"&&n instanceof Uint8Array)return"uint8array";if(Array.isArray(n))return"array";if(typeof n==="string")return"string";if(Object.prototype.toString.call(n)==="[object Object]")return"object";return"buffer"};ConcatStream.prototype.getBody=function(){if(!this.encoding&&this.body.length===0)return[];if(this.shouldInferEncoding)this.encoding=this.inferEncoding();if(this.encoding==="array")return arrayConcat(this.body);if(this.encoding==="string")return stringConcat(this.body);if(this.encoding==="buffer")return bufferConcat(this.body);if(this.encoding==="uint8array")return u8Concat(this.body);return this.body};var o=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"};function isArrayish(e){return/Array\]$/.test(Object.prototype.toString.call(e))}function isBufferish(e){return typeof e==="string"||isArrayish(e)||e&&typeof e.subarray==="function"}function stringConcat(e){var n=[];var l=false;for(var t=0;t<e.length;t++){var i=e[t];if(typeof i==="string"){n.push(i)}else if(Buffer.isBuffer(i)){n.push(i)}else if(isBufferish(i)){n.push(a(i))}else{n.push(a(String(i)))}}if(Buffer.isBuffer(e[0])){n=Buffer.concat(n);n=n.toString("utf8")}else{n=n.join("")}return n}function bufferConcat(e){var n=[];for(var l=0;l<e.length;l++){var t=e[l];if(Buffer.isBuffer(t)){n.push(t)}else if(isBufferish(t)){n.push(a(t))}else{n.push(a(String(t)))}}return Buffer.concat(n)}function arrayConcat(e){var n=[];for(var l=0;l<e.length;l++){n.push.apply(n,e[l])}return n}function u8Concat(e){var n=0;for(var l=0;l<e.length;l++){if(typeof e[l]==="string"){e[l]=a(e[l])}n+=e[l].length}var t=new u(n);for(var l=0,i=0;l<e.length;l++){var o=e[l];for(var s=0;s<o.length;s++){t[i++]=o[s]}}return t}},3921:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* content-disposition
|
|
|
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=contentDisposition;e.exports.parse=parse;var t=l(1017).basename;var i=l(1867).Buffer;var a=/[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;var u=/%[0-9A-Fa-f]{2}/;var o=/%([0-9A-Fa-f]{2})/g;var s=/[^\x20-\x7e\xa0-\xff]/g;var c=/\\([\u0000-\u007f])/g;var p=/([\\"])/g;var d=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g;var f=/^[\x20-\x7e\x80-\xff]+$/;var m=/^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/;var h=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/;var v=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function contentDisposition(e,n){var l=n||{};var t=l.type||"attachment";var i=createparams(e,l.fallback);return format(new ContentDisposition(t,i))}function createparams(e,n){if(e===undefined){return}var l={};if(typeof e!=="string"){throw new TypeError("filename must be a string")}if(n===undefined){n=true}if(typeof n!=="string"&&typeof n!=="boolean"){throw new TypeError("fallback must be a string or boolean")}if(typeof n==="string"&&s.test(n)){throw new TypeError("fallback must be ISO-8859-1 string")}var i=t(e);var a=f.test(i);var o=typeof n!=="string"?n&&getlatin1(i):t(n);var c=typeof o==="string"&&o!==i;if(c||!a||u.test(i)){l["filename*"]=i}if(a||c){l.filename=c?o:i}return l}function format(e){var n=e.parameters;var l=e.type;if(!l||typeof l!=="string"||!m.test(l)){throw new TypeError("invalid type")}var t=String(l).toLowerCase();if(n&&typeof n==="object"){var i;var a=Object.keys(n).sort();for(var u=0;u<a.length;u++){i=a[u];var o=i.substr(-1)==="*"?ustring(n[i]):qstring(n[i]);t+="; "+i+"="+o}}return t}function decodefield(e){var n=h.exec(e);if(!n){throw new TypeError("invalid extended field value")}var l=n[1].toLowerCase();var t=n[2];var a;var u=t.replace(o,pdecode);switch(l){case"iso-8859-1":a=getlatin1(u);break;case"utf-8":a=i.from(u,"binary").toString("utf8");break;default:throw new TypeError("unsupported charset in extended field")}return a}function getlatin1(e){return String(e).replace(s,"?")}function parse(e){if(!e||typeof e!=="string"){throw new TypeError("argument string is required")}var n=v.exec(e);if(!n){throw new TypeError("invalid type format")}var l=n[0].length;var t=n[1].toLowerCase();var i;var a=[];var u={};var o;l=d.lastIndex=n[0].substr(-1)===";"?l-1:l;while(n=d.exec(e)){if(n.index!==l){throw new TypeError("invalid parameter format")}l+=n[0].length;i=n[1].toLowerCase();o=n[2];if(a.indexOf(i)!==-1){throw new TypeError("invalid duplicate parameter")}a.push(i);if(i.indexOf("*")+1===i.length){i=i.slice(0,-1);o=decodefield(o);u[i]=o;continue}if(typeof u[i]==="string"){continue}if(o[0]==='"'){o=o.substr(1,o.length-2).replace(c,"$1")}u[i]=o}if(l!==-1&&l!==e.length){throw new TypeError("invalid parameter format")}return new ContentDisposition(t,u)}function pdecode(e,n){return String.fromCharCode(parseInt(n,16))}function pencode(e){return"%"+String(e).charCodeAt(0).toString(16).toUpperCase()}function qstring(e){var n=String(e);return'"'+n.replace(p,"\\$1")+'"'}function ustring(e){var n=String(e);var l=encodeURIComponent(n).replace(a,pencode);return"UTF-8''"+l}function ContentDisposition(e,n){this.type=e;this.parameters=n}},9915:(e,n)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* content-type
|
|
|
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var l=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;var t=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/;var i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;var a=/\\([\u000b\u0020-\u00ff])/g;var u=/([\\"])/g;var o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;n.format=format;n.parse=parse;function format(e){if(!e||typeof e!=="object"){throw new TypeError("argument obj is required")}var n=e.parameters;var l=e.type;if(!l||!o.test(l)){throw new TypeError("invalid type")}var t=l;if(n&&typeof n==="object"){var a;var u=Object.keys(n).sort();for(var s=0;s<u.length;s++){a=u[s];if(!i.test(a)){throw new TypeError("invalid parameter name")}t+="; "+a+"="+qstring(n[a])}}return t}function parse(e){if(!e){throw new TypeError("argument string is required")}var n=typeof e==="object"?getcontenttype(e):e;if(typeof n!=="string"){throw new TypeError("argument string is required to be a string")}var t=n.indexOf(";");var i=t!==-1?n.substr(0,t).trim():n.trim();if(!o.test(i)){throw new TypeError("invalid media type")}var u=new ContentType(i.toLowerCase());if(t!==-1){var s;var c;var p;l.lastIndex=t;while(c=l.exec(n)){if(c.index!==t){throw new TypeError("invalid parameter format")}t+=c[0].length;s=c[1].toLowerCase();p=c[2];if(p[0]==='"'){p=p.substr(1,p.length-2).replace(a,"$1")}u.parameters[s]=p}if(t!==n.length){throw new TypeError("invalid parameter format")}}return u}function getcontenttype(e){var n;if(typeof e.getHeader==="function"){n=e.getHeader("content-type")}else if(typeof e.headers==="object"){n=e.headers&&e.headers["content-type"]}if(typeof n!=="string"){throw new TypeError("content-type header is missing from object")}return n}function qstring(e){var n=String(e);if(i.test(n)){return n}if(n.length>0&&!t.test(n)){throw new TypeError("invalid parameter value")}return'"'+n.replace(u,"\\$1")+'"'}function ContentType(e){this.parameters=Object.create(null);this.type=e}},1579:(e,n,l)=>{var t=l(6113);n.sign=function(e,n){if("string"!=typeof e)throw new TypeError("Cookie value must be provided as a string.");if("string"!=typeof n)throw new TypeError("Secret string must be provided.");return e+"."+t.createHmac("sha256",n).update(e).digest("base64").replace(/\=+$/,"")};n.unsign=function(e,l){if("string"!=typeof e)throw new TypeError("Signed cookie string must be provided.");if("string"!=typeof l)throw new TypeError("Secret string must be provided.");var t=e.slice(0,e.lastIndexOf(".")),i=n.sign(t,l);return sha1(i)==sha1(e)?t:false};function sha1(e){return t.createHash("sha1").update(e).digest("hex")}},3658:(e,n)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* cookie
|
|
|
|
|
* Copyright(c) 2012-2014 Roman Shtylman
|
|
|
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/n.parse=parse;n.serialize=serialize;var l=decodeURIComponent;var t=encodeURIComponent;var i=/; */;var a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function parse(e,n){if(typeof e!=="string"){throw new TypeError("argument str must be a string")}var t={};var a=n||{};var u=e.split(i);var o=a.decode||l;for(var s=0;s<u.length;s++){var c=u[s];var p=c.indexOf("=");if(p<0){continue}var d=c.substr(0,p).trim();var f=c.substr(++p,c.length).trim();if('"'==f[0]){f=f.slice(1,-1)}if(undefined==t[d]){t[d]=tryDecode(f,o)}}return t}function serialize(e,n,l){var i=l||{};var u=i.encode||t;if(typeof u!=="function"){throw new TypeError("option encode is invalid")}if(!a.test(e)){throw new TypeError("argument name is invalid")}var o=u(n);if(o&&!a.test(o)){throw new TypeError("argument val is invalid")}var s=e+"="+o;if(null!=i.maxAge){var c=i.maxAge-0;if(isNaN(c))throw new Error("maxAge should be a Number");s+="; Max-Age="+Math.floor(c)}if(i.domain){if(!a.test(i.domain)){throw new TypeError("option domain is invalid")}s+="; Domain="+i.domain}if(i.path){if(!a.test(i.path)){throw new TypeError("option path is invalid")}s+="; Path="+i.path}if(i.expires){if(typeof i.expires.toUTCString!=="function"){throw new TypeError("option expires is invalid")}s+="; Expires="+i.expires.toUTCString()}if(i.httpOnly){s+="; HttpOnly"}if(i.secure){s+="; Secure"}if(i.sameSite){var p=typeof i.sameSite==="string"?i.sameSite.toLowerCase():i.sameSite;switch(p){case true:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function tryDecode(e,n){try{return n(e)}catch(n){return e}}},5898:(e,n,l)=>{function isArray(e){if(Array.isArray){return Array.isArray(e)}return objectToString(e)==="[object Array]"}n.isArray=isArray;function isBoolean(e){return typeof e==="boolean"}n.isBoolean=isBoolean;function isNull(e){return e===null}n.isNull=isNull;function isNullOrUndefined(e){return e==null}n.isNullOrUndefined=isNullOrUndefined;function isNumber(e){return typeof e==="number"}n.isNumber=isNumber;function isString(e){return typeof e==="string"}n.isString=isString;function isSymbol(e){return typeof e==="symbol"}n.isSymbol=isSymbol;function isUndefined(e){return e===void 0}n.isUndefined=isUndefined;function isRegExp(e){return objectToString(e)==="[object RegExp]"}n.isRegExp=isRegExp;function isObject(e){return typeof e==="object"&&e!==null}n.isObject=isObject;function isDate(e){return objectToString(e)==="[object Date]"}n.isDate=isDate;function isError(e){return objectToString(e)==="[object Error]"||e instanceof Error}n.isError=isError;function isFunction(e){return typeof e==="function"}n.isFunction=isFunction;function isPrimitive(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}n.isPrimitive=isPrimitive;n.isBuffer=l(4300).Buffer.isBuffer;function objectToString(e){return Object.prototype.toString.call(e)}},5287:(e,n,l)=>{(function(){"use strict";var n=l(7426);var t=l(5931);var i={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:false,optionsSuccessStatus:204};function isString(e){return typeof e==="string"||e instanceof String}function isOriginAllowed(e,n){if(Array.isArray(n)){for(var l=0;l<n.length;++l){if(isOriginAllowed(e,n[l])){return true}}return false}else if(isString(n)){return e===n}else if(n instanceof RegExp){return n.test(e)}else{return!!n}}function configureOrigin(e,n){var l=n.headers.origin,t=[],i;if(!e.origin||e.origin==="*"){t.push([{key:"Access-Control-Allow-Origin",value:"*"}])}else if(isString(e.origin)){t.push([{key:"Access-Control-Allow-Origin",value:e.origin}]);t.push([{key:"Vary",value:"Origin"}])}else{i=isOriginAllowed(l,e.origin);t.push([{key:"Access-Control-Allow-Origin",value:i?l:false}]);t.push([{key:"Vary",value:"Origin"}])}return t}function configureMethods(e){var n=e.methods;if(n.join){n=e.methods.join(",")}return{key:"Access-Control-Allow-Methods",value:n}}function configureCredentials(e){if(e.cr
|
|
|
|
|
/*!
|
|
|
|
|
* depd
|
|
|
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/
|
|
|
|
|
var callSiteToString=__nccwpck_require__(9829).callSiteToString;var eventListenerCount=__nccwpck_require__(9829).eventListenerCount;var relative=__nccwpck_require__(1017).relative;module.exports=depd;var basePath=process.cwd();function containsNamespace(e,n){var l=e.split(/[ ,]+/);var t=String(n).toLowerCase();for(var i=0;i<l.length;i++){var a=l[i];if(a&&(a==="*"||a.toLowerCase()===t)){return true}}return false}function convertDataDescriptorToAccessor(e,n,l){var t=Object.getOwnPropertyDescriptor(e,n);var i=t.value;t.get=function getter(){return i};if(t.writable){t.set=function setter(e){return i=e}}delete t.value;delete t.writable;Object.defineProperty(e,n,t);return t}function createArgumentsString(e){var n="";for(var l=0;l<e;l++){n+=", arg"+l}return n.substr(2)}function createStackString(e){var n=this.name+": "+this.namespace;if(this.message){n+=" deprecated "+this.message}for(var l=0;l<e.length;l++){n+="\n at "+callSiteToString(e[l])}return n}function depd(e){if(!e){throw new TypeError("argument namespace is required")}var n=getStack();var l=callSiteLocation(n[1]);var t=l[0];function deprecate(e){log.call(deprecate,e)}deprecate._file=t;deprecate._ignored=isignored(e);deprecate._namespace=e;deprecate._traced=istraced(e);deprecate._warned=Object.create(null);deprecate.function=wrapfunction;deprecate.property=wrapproperty;return deprecate}function isignored(e){if(process.noDeprecation){return true}var n=process.env.NO_DEPRECATION||"";return containsNamespace(n,e)}function istraced(e){if(process.traceDeprecation){return true}var n=process.env.TRACE_DEPRECATION||"";return containsNamespace(n,e)}function log(e,n){var l=eventListenerCount(process,"deprecation")!==0;if(!l&&this._ignored){return}var t;var i;var a;var u;var o=0;var s=false;var c=getStack();var p=this._file;if(n){u=n;a=callSiteLocation(c[1]);a.name=u.name;p=a[0]}else{o=2;u=callSiteLocation(c[o]);a=u}for(;o<c.length;o++){t=callSiteLocation(c[o]);i=t[0];if(i===p){s=true}else if(i===this._file){p=this._file}else if(s){break}}var d=t?u.join(":")+"__"+t.join(":"):undefined;if(d!==undefined&&d in this._warned){return}this._warned[d]=true;var f=e;if(!f){f=a===u||!a.name?defaultMessage(u):defaultMessage(a)}if(l){var m=DeprecationError(this._namespace,f,c.slice(o));process.emit("deprecation",m);return}var h=process.stderr.isTTY?formatColor:formatPlain;var v=h.call(this,f,t,c.slice(o));process.stderr.write(v+"\n","utf8")}function callSiteLocation(e){var n=e.getFileName()||"<anonymous>";var l=e.getLineNumber();var t=e.getColumnNumber();if(e.isEval()){n=e.getEvalOrigin()+", "+n}var i=[n,l,t];i.callSite=e;i.name=e.getFunctionName();return i}function defaultMessage(e){var n=e.callSite;var l=e.name;if(!l){l="<anonymous@"+formatLocation(e)+">"}var t=n.getThis();var i=t&&n.getTypeName();if(i==="Object"){i=undefined}if(i==="Function"){i=t.name||i}return i&&n.getMethodName()?i+"."+l:l}function formatPlain(e,n,l){var t=(new Date).toUTCString();var i=t+" "+this._namespace+" deprecated "+e;if(this._traced){for(var a=0;a<l.length;a++){i+="\n at "+callSiteToString(l[a])}return i}if(n){i+=" at "+formatLocation(n)}return i}function formatColor(e,n,l){var t="[36;1m"+this._namespace+"[22;39m"+" [33;1mdeprecated[22;39m"+" [0m"+e+"[39m";if(this._traced){for(var i=0;i<l.length;i++){t+="\n [36mat "+callSiteToString(l[i])+"[39m"}return t}if(n){t+=" [36m"+formatLocation(n)+"[39m"}return t}function formatLocation(e){return relative(basePath,e[0])+":"+e[1]+":"+e[2]}function getStack(){var e=Error.stackTraceLimit;var n={};var l=Error.prepareStackTrace;Error.prepareStackTrace=prepareObjectStackTrace;Error.stackTraceLimit=Math.max(10,e);Error.captureStackTrace(n);var t=n.stack.slice(1);Error.prepareStackTrace=l;Error.stackTraceLimit=e;return t}function prepareObjectStackTrace(e,n){return n}function wrapfunction(fn,message){if(typeof fn!=="function"){throw new TypeError("argument fn must be a function")}var args=createArgumentsString(fn.length);var deprecate=this;var stack=getStack();var site=callSiteLocation(stack[1]);site.name=fn.name;var deprecatedfn=eval("(function ("+args+") {\
|
|
|
|
|
/*!
|
|
|
|
|
* depd
|
|
|
|
|
* Copyright(c) 2014 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=callSiteToString;function callSiteFileLocation(e){var n;var l="";if(e.isNative()){l="native"}else if(e.isEval()){n=e.getScriptNameOrSourceURL();if(!n){l=e.getEvalOrigin()}}else{n=e.getFileName()}if(n){l+=n;var t=e.getLineNumber();if(t!=null){l+=":"+t;var i=e.getColumnNumber();if(i){l+=":"+i}}}return l||"unknown source"}function callSiteToString(e){var n=true;var l=callSiteFileLocation(e);var t=e.getFunctionName();var i=e.isConstructor();var a=!(e.isToplevel()||i);var u="";if(a){var o=e.getMethodName();var s=getConstructorName(e);if(t){if(s&&t.indexOf(s)!==0){u+=s+"."}u+=t;if(o&&t.lastIndexOf("."+o)!==t.length-o.length-1){u+=" [as "+o+"]"}}else{u+=s+"."+(o||"<anonymous>")}}else if(i){u+="new "+(t||"<anonymous>")}else if(t){u+=t}else{n=false;u+=l}if(n){u+=" ("+l+")"}return u}function getConstructorName(e){var n=e.receiver;return n.constructor&&n.constructor.name||null}},2078:e=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* depd
|
|
|
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=eventListenerCount;function eventListenerCount(e,n){return e.listeners(n).length}},9829:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* depd
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(2361).EventEmitter;lazyProperty(e.exports,"callSiteToString",(function callSiteToString(){var e=Error.stackTraceLimit;var n={};var t=Error.prepareStackTrace;function prepareObjectStackTrace(e,n){return n}Error.prepareStackTrace=prepareObjectStackTrace;Error.stackTraceLimit=2;Error.captureStackTrace(n);var i=n.stack.slice();Error.prepareStackTrace=t;Error.stackTraceLimit=e;return i[0].toString?toString:l(5554)}));lazyProperty(e.exports,"eventListenerCount",(function eventListenerCount(){return t.listenerCount||l(2078)}));function lazyProperty(e,n,l){function get(){var t=l();Object.defineProperty(e,n,{configurable:true,enumerable:true,value:t});return t}Object.defineProperty(e,n,{configurable:true,enumerable:true,get:get})}function toString(e){return e.toString()}},3225:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* destroy
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(7147).ReadStream;var i=l(2781);e.exports=destroy;function destroy(e){if(e instanceof t){return destroyReadStream(e)}if(!(e instanceof i)){return e}if(typeof e.destroy==="function"){e.destroy()}return e}function destroyReadStream(e){e.destroy();if(typeof e.close==="function"){e.on("open",onOpenClose)}return e}function onOpenClose(){if(typeof this.fd==="number"){this.close()}}},8138:(e,n,l)=>{var t=l(2781).Writable||l(376).Writable,i=l(3837).inherits;var a=l(2405);var u=l(4688),o=l(5810);var s=45,c=new Buffer("-"),p=new Buffer("\r\n"),EMPTY_FN=function(){};function Dicer(e){if(!(this instanceof Dicer))return new Dicer(e);t.call(this,e);if(!e||!e.headerFirst&&typeof e.boundary!=="string")throw new TypeError("Boundary required");if(typeof e.boundary==="string")this.setBoundary(e.boundary);else this._bparser=undefined;this._headerFirst=e.headerFirst;var n=this;this._dashes=0;this._parts=0;this._finished=false;this._realFinish=false;this._isPreamble=true;this._justMatched=false;this._firstWrite=true;this._inHeader=true;this._part=undefined;this._cb=undefined;this._ignoreData=false;this._partOpts=typeof e.partHwm==="number"?{highWaterMark:e.partHwm}:{};this._pause=false;this._hparser=new o(e);this._hparser.on("header",(function(e){n._inHeader=false;n._part.emit("header",e)}))}i(Dicer,t);Dicer.prototype.emit=function(e){if(e==="finish"&&!this._realFinish){if(!this._finished){var n=this;process.nextTick((function(){n.emit("error",new Error("Unexpected end of multipart data"));if(n._part&&!n._ignoreData){var e=n._isPreamble?"Preamble":"Part";n._part.emit("error",new Error(e+" terminated early due to unexpected end of multipart data"));n._part.push(null);process.nextTick((function(){n._realFinish=true;n.emit("finish");n._realFinish=false}));return}n._realFinish=true;n.emit("finish");n._realFinish=false}))}}else t.prototype.emit.apply(this,arguments)};Dicer.prototype._write=function(e,n,l){if(!this._hparser&&!this._bparser)return l();if(this._headerFirst&&this._isPreamble){if(!this._part){this._part=new u(this._partOpts);if(this._events.preamble)this.emit("preamble",this._part);else this._ignore()}var t=this._hparser.push(e);if(!this._inHeader&&t!==undefined&&t<e.length)e=e.slice(t);else return l()}if(this._firstWrite){this._bparser.push(p);this._firstWrite=false}this._bparser.push(e);if(this._pause)this._cb=l;else l()};Dicer.prototype.reset=function(){this._part=undefined;this._bparser=undefined;this._hparser=undefined};Dicer.prototype.setBoundary=function(e){var n=this;this._bparser=new a("\r\n--"+e);this._bparser.on("info",(function(e,l,t,i){n._oninfo(e,l,t,i)}))};Dicer.prototype._ignore=function(){if(this._part&&!this._ignoreData){this._ignoreData=true;this._part.on("error",EMPTY_FN);this._part.resume()}};Dicer.prototype._oninfo=function(e,n,l,t){var i,a=this,o=0,p,d,f=true;if(!this._part&&this._justMatched&&n){while(this._dashes<2&&l+o<t){if(n[l+o]===s){++o;++this._dashes}else{if(this._dashes)i=c;this._dashes=0;break}}if(this._dashes===2){if(l+o<t&&this._events.trailer)this.emit("trailer",n.slice(l+o,t));this.reset();this._finished=true;if(a._parts===0){a._realFinish=true;a.emit("finish");a._realFinish=false}}if(this._dashes)return}if(this._justMatched)this._justMatched=false;if(!this._part){this._part=new u(this._partOpts);this._part._read=function(e){a._unpause()};d=this._isPreamble?"preamble":"part";if(this._events[d])this.emit(d,this._part);else this._ignore();if(!this._isPreamble)this._inHeader=true}if(n&&l<t&&!this._ignoreData){if(this._isPreamble||!this._inHeader){if(i)f=this._part.push(i);f=this._part.push(n.slice(l,t));if(!f)this._pause=true}else if(!this._isPreamble&&this._inHeader){if(i)this._hparser.push(i);p=this._hparser.push(n.slice(l,t));if(!this._inHeader&&p!==undefined&&p<t)this._oninfo(false,n,l+p,t)}}if(e){this._hparser.reset();if(this._isPreamble)this._isPreamble=false;else{++this._parts;this._part.on("end",(function(){if(--a._parts===0){if(a._finished){a._realFinish=true;a.emit("finish");a._realFinish=false}else{a._unpause()}}}))}this._part.push(null);this._part=undefined;this._ignoreData=false
|
|
|
|
|
/*!
|
|
|
|
|
* ee-first
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=first;function first(e,n){if(!Array.isArray(e))throw new TypeError("arg must be an array of [ee, events...] arrays");var l=[];for(var t=0;t<e.length;t++){var i=e[t];if(!Array.isArray(i)||i.length<2)throw new TypeError("each array member must be [ee, events...]");var a=i[0];for(var u=1;u<i.length;u++){var o=i[u];var s=listener(o,callback);a.on(o,s);l.push({ee:a,event:o,fn:s})}}function callback(){cleanup();n.apply(null,arguments)}function cleanup(){var e;for(var n=0;n<l.length;n++){e=l[n];e.ee.removeListener(e.event,e.fn)}}function thunk(e){n=e}thunk.cancel=cleanup;return thunk}function listener(e,n){return function onevent(l){var t=new Array(arguments.length);var i=this;var a=e==="error"?l:null;for(var u=0;u<t.length;u++){t[u]=arguments[u]}n(a,i,e,t)}}},6592:e=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* encodeurl
|
|
|
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=encodeUrl;var n=/(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g;var l=/(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g;var t="$1<EFBFBD>$2";function encodeUrl(e){return String(e).replace(l,t).replace(n,encodeURI)}},4070:e=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* escape-html
|
|
|
|
|
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2015 Andreas Lubbe
|
|
|
|
|
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var n=/["'&<>]/;e.exports=escapeHtml;function escapeHtml(e){var l=""+e;var t=n.exec(l);if(!t){return l}var i;var a="";var u=0;var o=0;for(u=t.index;u<l.length;u++){switch(l.charCodeAt(u)){case 34:i=""";break;case 38:i="&";break;case 39:i="'";break;case 60:i="<";break;case 62:i=">";break;default:continue}if(o!==u){a+=l.substring(o,u)}o=u+1;a+=i}return o!==u?a+l.substring(o,u):a}},9972:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* etag
|
|
|
|
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=etag;var t=l(6113);var i=l(7147).Stats;var a=Object.prototype.toString;function entitytag(e){if(e.length===0){return'"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"'}var n=t.createHash("sha1").update(e,"utf8").digest("base64").substring(0,27);var l=typeof e==="string"?Buffer.byteLength(e,"utf8"):e.length;return'"'+l.toString(16)+"-"+n+'"'}function etag(e,n){if(e==null){throw new TypeError("argument entity is required")}var l=isstats(e);var t=n&&typeof n.weak==="boolean"?n.weak:l;if(!l&&typeof e!=="string"&&!Buffer.isBuffer(e)){throw new TypeError("argument entity must be string, Buffer, or fs.Stats")}var i=l?stattag(e):entitytag(e);return t?"W/"+i:i}function isstats(e){if(typeof i==="function"&&e instanceof i){return true}return e&&typeof e==="object"&&"ctime"in e&&a.call(e.ctime)==="[object Date]"&&"mtime"in e&&a.call(e.mtime)==="[object Date]"&&"ino"in e&&typeof e.ino==="number"&&"size"in e&&typeof e.size==="number"}function stattag(e){var n=e.mtime.getTime().toString(16);var l=e.size.toString(16);return'"'+l+"-"+n+'"'}},1204:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* express
|
|
|
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2013 Roman Shtylman
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=l(2587)},313:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* express
|
|
|
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2013 Roman Shtylman
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(810);var i=l(4963);var a=l(8752);var u=l(2636);var o=l(9768);var s=l(8237)("express:application");var c=l(9209);var p=l(3685);var d=l(3561).compileETag;var f=l(3561).compileQueryParser;var m=l(3561).compileTrust;var h=l(8883)("express");var v=l(3723);var g=l(4429);var b=l(1017).resolve;var x=l(414);var y=Array.prototype.slice;var w=n=e.exports={};var k="@@symbol:trust_proxy_default";w.init=function init(){this.cache={};this.engines={};this.settings={};this.defaultConfiguration()};w.defaultConfiguration=function defaultConfiguration(){var e=process.env.NODE_ENV||"development";this.enable("x-powered-by");this.set("etag","weak");this.set("env",e);this.set("query parser","extended");this.set("subdomain offset",2);this.set("trust proxy",false);Object.defineProperty(this.settings,k,{configurable:true,value:true});s("booting in %s mode",e);this.on("mount",(function onmount(e){if(this.settings[k]===true&&typeof e.settings["trust proxy fn"]==="function"){delete this.settings["trust proxy"];delete this.settings["trust proxy fn"]}x(this.request,e.request);x(this.response,e.response);x(this.engines,e.engines);x(this.settings,e.settings)}));this.locals=Object.create(null);this.mountpath="/";this.locals.settings=this.settings;this.set("view",c);this.set("views",b("views"));this.set("jsonp callback name","callback");if(e==="production"){this.enable("view cache")}Object.defineProperty(this,"router",{get:function(){throw new Error("'app.router' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.")}})};w.lazyrouter=function lazyrouter(){if(!this._router){this._router=new i({caseSensitive:this.enabled("case sensitive routing"),strict:this.enabled("strict routing")});this._router.use(o(this.get("query parser fn")));this._router.use(u.init(this))}};w.handle=function handle(e,n,l){var i=this._router;var a=l||t(e,n,{env:this.get("env"),onerror:logerror.bind(this)});if(!i){s("no routes defined on app");a();return}i.handle(e,n,a)};w.use=function use(e){var n=0;var l="/";if(typeof e!=="function"){var t=e;while(Array.isArray(t)&&t.length!==0){t=t[0]}if(typeof t!=="function"){n=1;l=e}}var i=v(y.call(arguments,n));if(i.length===0){throw new TypeError("app.use() requires a middleware function")}this.lazyrouter();var a=this._router;i.forEach((function(e){if(!e||!e.handle||!e.set){return a.use(l,e)}s(".use app under %s",l);e.mountpath=l;e.parent=this;a.use(l,(function mounted_app(n,l,t){var i=n.app;e.handle(n,l,(function(e){x(n,i.request);x(l,i.response);t(e)}))}));e.emit("mount",this)}),this);return this};w.route=function route(e){this.lazyrouter();return this._router.route(e)};w.engine=function engine(e,n){if(typeof n!=="function"){throw new Error("callback function required")}var l=e[0]!=="."?"."+e:e;this.engines[l]=n;return this};w.param=function param(e,n){this.lazyrouter();if(Array.isArray(e)){for(var l=0;l<e.length;l++){this.param(e[l],n)}return this}this._router.param(e,n);return this};w.set=function set(e,n){if(arguments.length===1){return this.settings[e]}s('set "%s" to %o',e,n);this.settings[e]=n;switch(e){case"etag":this.set("etag fn",d(n));break;case"query parser":this.set("query parser fn",f(n));break;case"trust proxy":this.set("trust proxy fn",m(n));Object.defineProperty(this.settings,k,{configurable:true,value:false});break}return this};w.path=function path(){return this.parent?this.parent.path()+this.mountpath:""};w.enabled=function enabled(e){return Boolean(this.set(e))};w.disabled=function disabled(e){return!this.set(e)};w.enable=function enable(e){return this.set(e,true)};w.disable=function disable(e){return this.set(e,false)};a.forEach((function(e){w[e]=function(n){if(e==="get"&&arguments.length===1){return this.set(n)}this.lazyrouter();var l=this._router.route(n);l[e].apply(l,y.call(arguments,1));return this}}));w.all=function all(e){this.lazyrouter();var n=this._router.route(e);var l=y.call(arguments,1);for(var t=0;t<a.length;t++){n[a[t]].apply(n,l)}return this};w.del=h.function(w.delete,"app.del: Use app.delete instead");w.render=function render(e,n,l){var t=this.cache;var
|
|
|
|
|
/*!
|
|
|
|
|
* express
|
|
|
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2013 Roman Shtylman
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(7076);var i=l(2361).EventEmitter;var a=l(1149);var u=l(313);var o=l(3699);var s=l(4963);var c=l(8467);var p=l(4934);n=e.exports=createApplication;function createApplication(){var app=function(e,n,l){app.handle(e,n,l)};a(app,i.prototype,false);a(app,u,false);app.request=Object.create(c,{app:{configurable:true,enumerable:true,writable:true,value:app}});app.response=Object.create(p,{app:{configurable:true,enumerable:true,writable:true,value:app}});app.init();return app}n.application=u;n.request=c;n.response=p;n.Route=o;n.Router=s;n.json=t.json;n.query=l(9768);n.raw=t.raw;n["static"]=l(3146);n.text=t.text;n.urlencoded=t.urlencoded;var d=["bodyParser","compress","cookieSession","session","logger","cookieParser","favicon","responseTime","errorHandler","timeout","methodOverride","vhost","csrf","directory","limit","multipart","staticCache"];d.forEach((function(e){Object.defineProperty(n,e,{get:function(){throw new Error("Most middleware (like "+e+") is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.")},configurable:true})}))},2636:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* express
|
|
|
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2013 Roman Shtylman
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(414);n.init=function(e){return function expressInit(n,l,i){if(e.enabled("x-powered-by"))l.setHeader("X-Powered-By","Express");n.res=l;l.req=n;n.next=i;t(n,e.request);t(l,e.response);l.locals=l.locals||Object.create(null);i()}}},9768:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* express
|
|
|
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2013 Roman Shtylman
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(4429);var i=l(9808);var a=l(2760);e.exports=function query(e){var n=t({},e);var l=a.parse;if(typeof e==="function"){l=e;n=undefined}if(n!==undefined&&n.allowPrototypes===undefined){n.allowPrototypes=true}return function query(e,t,a){if(!e.query){var u=i(e).query;e.query=l(u,n)}a()}}},8467:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* express
|
|
|
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2013 Roman Shtylman
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(3633);var i=l(8883)("express");var a=l(1808).isIP;var u=l(1159);var o=l(3685);var s=l(3136);var c=l(6435);var p=l(9808);var d=l(140);var f=Object.create(o.IncomingMessage.prototype);e.exports=f;f.get=f.header=function header(e){if(!e){throw new TypeError("name argument is required to req.get")}if(typeof e!=="string"){throw new TypeError("name must be a string to req.get")}var n=e.toLowerCase();switch(n){case"referer":case"referrer":return this.headers.referrer||this.headers.referer;default:return this.headers[n]}};f.accepts=function(){var e=t(this);return e.types.apply(e,arguments)};f.acceptsEncodings=function(){var e=t(this);return e.encodings.apply(e,arguments)};f.acceptsEncoding=i.function(f.acceptsEncodings,"req.acceptsEncoding: Use acceptsEncodings instead");f.acceptsCharsets=function(){var e=t(this);return e.charsets.apply(e,arguments)};f.acceptsCharset=i.function(f.acceptsCharsets,"req.acceptsCharset: Use acceptsCharsets instead");f.acceptsLanguages=function(){var e=t(this);return e.languages.apply(e,arguments)};f.acceptsLanguage=i.function(f.acceptsLanguages,"req.acceptsLanguage: Use acceptsLanguages instead");f.range=function range(e,n){var range=this.get("Range");if(!range)return;return c(e,range,n)};f.param=function param(e,n){var l=this.params||{};var t=this.body||{};var a=this.query||{};var u=arguments.length===1?"name":"name, default";i("req.param("+u+"): Use req.params, req.body, or req.query instead");if(null!=l[e]&&l.hasOwnProperty(e))return l[e];if(null!=t[e])return t[e];if(null!=a[e])return a[e];return n};f.is=function is(e){var n=e;if(!Array.isArray(e)){n=new Array(arguments.length);for(var l=0;l<n.length;l++){n[l]=arguments[l]}}return u(this,n)};defineGetter(f,"protocol",(function protocol(){var e=this.connection.encrypted?"https":"http";var n=this.app.get("trust proxy fn");if(!n(this.connection.remoteAddress,0)){return e}var l=this.get("X-Forwarded-Proto")||e;var t=l.indexOf(",");return t!==-1?l.substring(0,t).trim():l.trim()}));defineGetter(f,"secure",(function secure(){return this.protocol==="https"}));defineGetter(f,"ip",(function ip(){var e=this.app.get("trust proxy fn");return d(this,e)}));defineGetter(f,"ips",(function ips(){var e=this.app.get("trust proxy fn");var n=d.all(this,e);n.reverse().pop();return n}));defineGetter(f,"subdomains",(function subdomains(){var e=this.hostname;if(!e)return[];var n=this.app.get("subdomain offset");var subdomains=!a(e)?e.split(".").reverse():[e];return subdomains.slice(n)}));defineGetter(f,"path",(function path(){return p(this).pathname}));defineGetter(f,"hostname",(function hostname(){var e=this.app.get("trust proxy fn");var n=this.get("X-Forwarded-Host");if(!n||!e(this.connection.remoteAddress,0)){n=this.get("Host")}else if(n.indexOf(",")!==-1){n=n.substring(0,n.indexOf(",")).trimRight()}if(!n)return;var l=n[0]==="["?n.indexOf("]")+1:0;var t=n.indexOf(":",l);return t!==-1?n.substring(0,t):n}));defineGetter(f,"host",i.function((function host(){return this.hostname}),"req.host: Use req.hostname instead"));defineGetter(f,"fresh",(function(){var e=this.method;var n=this.res;var l=n.statusCode;if("GET"!==e&&"HEAD"!==e)return false;if(l>=200&&l<300||304===l){return s(this.headers,{etag:n.get("ETag"),"last-modified":n.get("Last-Modified")})}return false}));defineGetter(f,"stale",(function stale(){return!this.fresh}));defineGetter(f,"xhr",(function xhr(){var e=this.get("X-Requested-With")||"";return e.toLowerCase()==="xmlhttprequest"}));function defineGetter(e,n,l){Object.defineProperty(e,n,{configurable:true,enumerable:true,get:l})}},4934:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* express
|
|
|
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(1867).Buffer;var i=l(3921);var a=l(8883)("express");var u=l(6592);var o=l(4070);var s=l(3685);var c=l(3561).isAbsolute;var p=l(4694);var d=l(1017);var f=l(7415);var m=l(4429);var h=l(1579).sign;var v=l(3561).normalizeType;var g=l(3561).normalizeTypes;var b=l(3561).setCharset;var x=l(3658);var y=l(2966);var w=d.extname;var k=y.mime;var _=d.resolve;var E=l(5931);var S=Object.create(s.ServerResponse.prototype);e.exports=S;var j=/;\s*charset\s*=/;S.status=function status(e){this.statusCode=e;return this};S.links=function(e){var n=this.get("Link")||"";if(n)n+=", ";return this.set("Link",n+Object.keys(e).map((function(n){return"<"+e[n]+'>; rel="'+n+'"'})).join(", "))};S.send=function send(e){var n=e;var l;var i=this.req;var u;var o=this.app;if(arguments.length===2){if(typeof arguments[0]!=="number"&&typeof arguments[1]==="number"){a("res.send(body, status): Use res.status(status).send(body) instead");this.statusCode=arguments[1]}else{a("res.send(status, body): Use res.status(status).send(body) instead");this.statusCode=arguments[0];n=arguments[1]}}if(typeof n==="number"&&arguments.length===1){if(!this.get("Content-Type")){this.type("txt")}a("res.send(status): Use res.sendStatus(status) instead");this.statusCode=n;n=f[n]}switch(typeof n){case"string":if(!this.get("Content-Type")){this.type("html")}break;case"boolean":case"number":case"object":if(n===null){n=""}else if(t.isBuffer(n)){if(!this.get("Content-Type")){this.type("bin")}}else{return this.json(n)}break}if(typeof n==="string"){l="utf8";u=this.get("Content-Type");if(typeof u==="string"){this.set("Content-Type",b(u,"utf-8"))}}var s=o.get("etag fn");var c=!this.get("ETag")&&typeof s==="function";var p;if(n!==undefined){if(t.isBuffer(n)){p=n.length}else if(!c&&n.length<1e3){p=t.byteLength(n,l)}else{n=t.from(n,l);l=undefined;p=n.length}this.set("Content-Length",p)}var d;if(c&&p!==undefined){if(d=s(n,l)){this.set("ETag",d)}}if(i.fresh)this.statusCode=304;if(204===this.statusCode||304===this.statusCode){this.removeHeader("Content-Type");this.removeHeader("Content-Length");this.removeHeader("Transfer-Encoding");n=""}if(i.method==="HEAD"){this.end()}else{this.end(n,l)}return this};S.json=function json(e){var n=e;if(arguments.length===2){if(typeof arguments[1]==="number"){a("res.json(obj, status): Use res.status(status).json(obj) instead");this.statusCode=arguments[1]}else{a("res.json(status, obj): Use res.status(status).json(obj) instead");this.statusCode=arguments[0];n=arguments[1]}}var l=this.app;var t=l.get("json escape");var i=l.get("json replacer");var u=l.get("json spaces");var o=stringify(n,i,u,t);if(!this.get("Content-Type")){this.set("Content-Type","application/json")}return this.send(o)};S.jsonp=function jsonp(e){var n=e;if(arguments.length===2){if(typeof arguments[1]==="number"){a("res.jsonp(obj, status): Use res.status(status).json(obj) instead");this.statusCode=arguments[1]}else{a("res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead");this.statusCode=arguments[0];n=arguments[1]}}var l=this.app;var t=l.get("json escape");var i=l.get("json replacer");var u=l.get("json spaces");var o=stringify(n,i,u,t);var s=this.req.query[l.get("jsonp callback name")];if(!this.get("Content-Type")){this.set("X-Content-Type-Options","nosniff");this.set("Content-Type","application/json")}if(Array.isArray(s)){s=s[0]}if(typeof s==="string"&&s.length!==0){this.set("X-Content-Type-Options","nosniff");this.set("Content-Type","text/javascript");s=s.replace(/[^\[\]\w$.]/g,"");o=o.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");o="/**/ typeof "+s+" === 'function' && "+s+"("+o+");"}return this.send(o)};S.sendStatus=function sendStatus(e){var n=f[e]||String(e);this.statusCode=e;this.type("txt");return this.send(n)};S.sendFile=function sendFile(e,n,l){var t=l;var i=this.req;var a=this;var u=i.next;var o=n||{};if(!e){throw new TypeError("path argument is required to res.sendFile")}if(typeof e!=="string"){throw new TypeError("path must be a string to res.sendFile")}if(typeof n==="function"){t=n;o={}}if(!o.root&&!c(e)){throw new TypeError("path must be absolute or sp
|
|
|
|
|
/*!
|
|
|
|
|
* express
|
|
|
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2013 Roman Shtylman
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(3699);var i=l(5624);var a=l(8752);var u=l(4429);var o=l(8237)("express:router");var s=l(8883)("express");var c=l(3723);var p=l(9808);var d=l(414);var f=/^\[object (\S+)\]$/;var m=Array.prototype.slice;var h=Object.prototype.toString;var v=e.exports=function(e){var n=e||{};function router(e,n,l){router.handle(e,n,l)}d(router,v);router.params={};router._params=[];router.caseSensitive=n.caseSensitive;router.mergeParams=n.mergeParams;router.strict=n.strict;router.stack=[];return router};v.param=function param(e,n){if(typeof e==="function"){s("router.param(fn): Refactor to use path params");this._params.push(e);return}var l=this._params;var t=l.length;var i;if(e[0]===":"){s("router.param("+JSON.stringify(e)+", fn): Use router.param("+JSON.stringify(e.substr(1))+", fn) instead");e=e.substr(1)}for(var a=0;a<t;++a){if(i=l[a](e,n)){n=i}}if("function"!==typeof n){throw new Error("invalid param() call for "+e+", got "+n)}(this.params[e]=this.params[e]||[]).push(n);return this};v.handle=function handle(e,n,l){var t=this;o("dispatching %s %s",e.method,e.url);var i=0;var a=getProtohost(e.url)||"";var u="";var s=false;var c={};var p=[];var d=t.stack;var f=e.params;var m=e.baseUrl||"";var h=restore(l,e,"baseUrl","next","params");e.next=next;if(e.method==="OPTIONS"){h=wrap(h,(function(e,l){if(l||p.length===0)return e(l);sendOptionsResponse(n,p,e)}))}e.baseUrl=m;e.originalUrl=e.originalUrl||e.url;next();function next(l){var o=l==="route"?null:l;if(s){e.url=e.url.substr(1);s=false}if(u.length!==0){e.baseUrl=m;e.url=a+u+e.url.substr(a.length);u=""}if(o==="router"){setImmediate(h,null);return}if(i>=d.length){setImmediate(h,o);return}var v=getPathname(e);if(v==null){return h(o)}var g;var b;var x;while(b!==true&&i<d.length){g=d[i++];b=matchLayer(g,v);x=g.route;if(typeof b!=="boolean"){o=o||b}if(b!==true){continue}if(!x){continue}if(o){b=false;continue}var y=e.method;var w=x._handles_method(y);if(!w&&y==="OPTIONS"){appendMethods(p,x._options())}if(!w&&y!=="HEAD"){b=false;continue}}if(b!==true){return h(o)}if(x){e.route=x}e.params=t.mergeParams?mergeParams(g.params,f):g.params;var k=g.path;t.process_params(g,c,e,n,(function(l){if(l){return next(o||l)}if(x){return g.handle_request(e,n,next)}trim_prefix(g,o,k,v)}))}function trim_prefix(l,t,i,c){if(i.length!==0){var p=c[i.length];if(p&&p!=="/"&&p!==".")return next(t);o("trim prefix (%s) from url %s",i,e.url);u=i;e.url=a+e.url.substr(a.length+u.length);if(!a&&e.url[0]!=="/"){e.url="/"+e.url;s=true}e.baseUrl=m+(u[u.length-1]==="/"?u.substring(0,u.length-1):u)}o("%s %s : %s",l.name,i,e.originalUrl);if(t){l.handle_error(t,e,n,next)}else{l.handle_request(e,n,next)}}};v.process_params=function process_params(e,n,l,t,i){var a=this.params;var u=e.keys;if(!u||u.length===0){return i()}var o=0;var s;var c=0;var p;var d;var f;var m;function param(e){if(e){return i(e)}if(o>=u.length){return i()}c=0;p=u[o++];s=p.name;d=l.params[s];f=a[s];m=n[s];if(d===undefined||!f){return param()}if(m&&(m.match===d||m.error&&m.error!=="route")){l.params[s]=m.value;return param(m.error)}n[s]=m={error:null,match:d,value:d};paramCallback()}function paramCallback(e){var n=f[c++];m.value=l.params[p.name];if(e){m.error=e;param(e);return}if(!n)return param();try{n(l,t,paramCallback,d,p.name)}catch(e){paramCallback(e)}}param()};v.use=function use(e){var n=0;var l="/";if(typeof e!=="function"){var t=e;while(Array.isArray(t)&&t.length!==0){t=t[0]}if(typeof t!=="function"){n=1;l=e}}var a=c(m.call(arguments,n));if(a.length===0){throw new TypeError("Router.use() requires a middleware function")}for(var u=0;u<a.length;u++){var e=a[u];if(typeof e!=="function"){throw new TypeError("Router.use() requires a middleware function but got a "+gettype(e))}o("use %o %s",l,e.name||"<anonymous>");var s=new i(l,{sensitive:this.caseSensitive,strict:false,end:false},e);s.route=undefined;this.stack.push(s)}return this};v.route=function route(e){var route=new t(e);var n=new i(e,{sensitive:this.caseSensitive,strict:this.strict,end:true},route.dispatch.bind(route));n.route=route;this.stack.push(n);return route};a.concat("all").forEach((function(e){
|
|
|
|
|
/*!
|
|
|
|
|
* express
|
|
|
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2013 Roman Shtylman
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(7819);var i=l(8237)("express:router:layer");var a=Object.prototype.hasOwnProperty;e.exports=Layer;function Layer(e,n,l){if(!(this instanceof Layer)){return new Layer(e,n,l)}i("new %o",e);var a=n||{};this.handle=l;this.name=l.name||"<anonymous>";this.params=undefined;this.path=undefined;this.regexp=t(e,this.keys=[],a);this.regexp.fast_star=e==="*";this.regexp.fast_slash=e==="/"&&a.end===false}Layer.prototype.handle_error=function handle_error(e,n,l,t){var i=this.handle;if(i.length!==4){return t(e)}try{i(e,n,l,t)}catch(e){t(e)}};Layer.prototype.handle_request=function handle(e,n,l){var t=this.handle;if(t.length>3){return l()}try{t(e,n,l)}catch(e){l(e)}};Layer.prototype.match=function match(e){var match;if(e!=null){if(this.regexp.fast_slash){this.params={};this.path="";return true}if(this.regexp.fast_star){this.params={0:decode_param(e)};this.path=e;return true}match=this.regexp.exec(e)}if(!match){this.params=undefined;this.path=undefined;return false}this.params={};this.path=match[0];var n=this.keys;var l=this.params;for(var t=1;t<match.length;t++){var i=n[t-1];var u=i.name;var o=decode_param(match[t]);if(o!==undefined||!a.call(l,u)){l[u]=o}}return true};function decode_param(e){if(typeof e!=="string"||e.length===0){return e}try{return decodeURIComponent(e)}catch(n){if(n instanceof URIError){n.message="Failed to decode param '"+e+"'";n.status=n.statusCode=400}throw n}}},3699:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* express
|
|
|
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2013 Roman Shtylman
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(8237)("express:router:route");var i=l(3723);var a=l(5624);var u=l(8752);var o=Array.prototype.slice;var s=Object.prototype.toString;e.exports=Route;function Route(e){this.path=e;this.stack=[];t("new %o",e);this.methods={}}Route.prototype._handles_method=function _handles_method(e){if(this.methods._all){return true}var n=e.toLowerCase();if(n==="head"&&!this.methods["head"]){n="get"}return Boolean(this.methods[n])};Route.prototype._options=function _options(){var e=Object.keys(this.methods);if(this.methods.get&&!this.methods.head){e.push("head")}for(var n=0;n<e.length;n++){e[n]=e[n].toUpperCase()}return e};Route.prototype.dispatch=function dispatch(e,n,l){var t=0;var i=this.stack;if(i.length===0){return l()}var a=e.method.toLowerCase();if(a==="head"&&!this.methods["head"]){a="get"}e.route=this;next();function next(u){if(u&&u==="route"){return l()}if(u&&u==="router"){return l(u)}var o=i[t++];if(!o){return l(u)}if(o.method&&o.method!==a){return next(u)}if(u){o.handle_error(u,e,n,next)}else{o.handle_request(e,n,next)}}};Route.prototype.all=function all(){var e=i(o.call(arguments));for(var n=0;n<e.length;n++){var l=e[n];if(typeof l!=="function"){var t=s.call(l);var u="Route.all() requires a callback function but got a "+t;throw new TypeError(u)}var c=a("/",{},l);c.method=undefined;this.methods._all=true;this.stack.push(c)}return this};u.forEach((function(e){Route.prototype[e]=function(){var n=i(o.call(arguments));for(var l=0;l<n.length;l++){var u=n[l];if(typeof u!=="function"){var c=s.call(u);var p="Route."+e+"() requires a callback function but got a "+c;throw new Error(p)}t("%s %o",e,this.path);var d=a("/",{},u);d.method=e;this.methods[e]=true;this.stack.push(d)}return this}}))},3561:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* express
|
|
|
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(1867).Buffer;var i=l(3921);var a=l(9915);var u=l(8883)("express");var o=l(3723);var s=l(2966).mime;var c=l(9972);var p=l(140);var d=l(2760);var f=l(3477);n.etag=createETagGenerator({weak:false});n.wetag=createETagGenerator({weak:true});n.isAbsolute=function(e){if("/"===e[0])return true;if(":"===e[1]&&("\\"===e[2]||"/"===e[2]))return true;if("\\\\"===e.substring(0,2))return true};n.flatten=u.function(o,"utils.flatten: use array-flatten npm module instead");n.normalizeType=function(e){return~e.indexOf("/")?acceptParams(e):{value:s.lookup(e),params:{}}};n.normalizeTypes=function(e){var l=[];for(var t=0;t<e.length;++t){l.push(n.normalizeType(e[t]))}return l};n.contentDisposition=u.function(i,"utils.contentDisposition: use content-disposition npm module instead");function acceptParams(e,n){var l=e.split(/ *; */);var t={value:l[0],quality:1,params:{},originalIndex:n};for(var i=1;i<l.length;++i){var a=l[i].split(/ *= */);if("q"===a[0]){t.quality=parseFloat(a[1])}else{t.params[a[0]]=a[1]}}return t}n.compileETag=function(e){var l;if(typeof e==="function"){return e}switch(e){case true:l=n.wetag;break;case false:break;case"strong":l=n.etag;break;case"weak":l=n.wetag;break;default:throw new TypeError("unknown value for etag function: "+e)}return l};n.compileQueryParser=function compileQueryParser(e){var n;if(typeof e==="function"){return e}switch(e){case true:n=f.parse;break;case false:n=newObject;break;case"extended":n=parseExtendedQueryString;break;case"simple":n=f.parse;break;default:throw new TypeError("unknown value for query parser function: "+e)}return n};n.compileTrust=function(e){if(typeof e==="function")return e;if(e===true){return function(){return true}}if(typeof e==="number"){return function(n,l){return l<e}}if(typeof e==="string"){e=e.split(/ *, */)}return p.compile(e||[])};n.setCharset=function setCharset(e,n){if(!e||!n){return e}var l=a.parse(e);l.parameters.charset=n;return a.format(l)};function createETagGenerator(e){return function generateETag(n,l){var i=!t.isBuffer(n)?t.from(n,l):n;return c(i,e)}}function parseExtendedQueryString(e){return d.parse(e,{allowPrototypes:true})}function newObject(){return{}}},9209:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* express
|
|
|
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2013 Roman Shtylman
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(8237)("express:view");var i=l(1017);var a=l(7147);var u=i.dirname;var o=i.basename;var s=i.extname;var c=i.join;var p=i.resolve;e.exports=View;function View(e,n){var l=n||{};this.defaultEngine=l.defaultEngine;this.ext=s(e);this.name=e;this.root=l.root;if(!this.ext&&!this.defaultEngine){throw new Error("No default engine was specified and no extension was provided.")}var i=e;if(!this.ext){this.ext=this.defaultEngine[0]!=="."?"."+this.defaultEngine:this.defaultEngine;i+=this.ext}if(!l.engines[this.ext]){var a=this.ext.substr(1);t('require "%s"',a);var u=require(a).__express;if(typeof u!=="function"){throw new Error('Module "'+a+'" does not provide a view engine.')}l.engines[this.ext]=u}this.engine=l.engines[this.ext];this.path=this.lookup(i)}View.prototype.lookup=function lookup(e){var n;var l=[].concat(this.root);t('lookup "%s"',e);for(var i=0;i<l.length&&!n;i++){var a=l[i];var s=p(a,e);var c=u(s);var d=o(s);n=this.resolve(c,d)}return n};View.prototype.render=function render(e,n){t('render "%s"',this.path);this.engine(this.path,e,n)};View.prototype.resolve=function resolve(e,n){var l=this.ext;var t=c(e,n);var i=tryStat(t);if(i&&i.isFile()){return t}t=c(e,o(n,l),"index"+l);i=tryStat(t);if(i&&i.isFile()){return t}};function tryStat(e){t('stat "%s"',e);try{return a.statSync(e)}catch(e){return undefined}}},810:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* finalhandler
|
|
|
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(8237)("finalhandler");var i=l(6592);var a=l(4070);var u=l(4694);var o=l(9808);var s=l(7415);var c=l(3124);var p=/\x20{2}/g;var d=/\n/g;var f=typeof setImmediate==="function"?setImmediate:function(e){process.nextTick(e.bind.apply(e,arguments))};var m=u.isFinished;function createHtmlDocument(e){var n=a(e).replace(d,"<br>").replace(p," ");return"<!DOCTYPE html>\n"+'<html lang="en">\n'+"<head>\n"+'<meta charset="utf-8">\n'+"<title>Error</title>\n"+"</head>\n"+"<body>\n"+"<pre>"+n+"</pre>\n"+"</body>\n"+"</html>\n"}e.exports=finalhandler;function finalhandler(e,n,l){var a=l||{};var u=a.env||process.env.NODE_ENV||"development";var o=a.onerror;return function(l){var a;var s;var c;if(!l&&headersSent(n)){t("cannot 404 after headers sent");return}if(l){c=getErrorStatusCode(l);if(c===undefined){c=getResponseStatusCode(n)}else{a=getErrorHeaders(l)}s=getErrorMessage(l,c,u)}else{c=404;s="Cannot "+e.method+" "+i(getResourceName(e))}t("default %s",c);if(l&&o){f(o,l,e,n)}if(headersSent(n)){t("cannot %d after headers sent",c);e.socket.destroy();return}send(e,n,c,a,s)}}function getErrorHeaders(e){if(!e.headers||typeof e.headers!=="object"){return undefined}var n=Object.create(null);var l=Object.keys(e.headers);for(var t=0;t<l.length;t++){var i=l[t];n[i]=e.headers[i]}return n}function getErrorMessage(e,n,l){var t;if(l!=="production"){t=e.stack;if(!t&&typeof e.toString==="function"){t=e.toString()}}return t||s[n]}function getErrorStatusCode(e){if(typeof e.status==="number"&&e.status>=400&&e.status<600){return e.status}if(typeof e.statusCode==="number"&&e.statusCode>=400&&e.statusCode<600){return e.statusCode}return undefined}function getResourceName(e){try{return o.original(e).pathname}catch(e){return"resource"}}function getResponseStatusCode(e){var n=e.statusCode;if(typeof n!=="number"||n<400||n>599){n=500}return n}function headersSent(e){return typeof e.headersSent!=="boolean"?Boolean(e._header):e.headersSent}function send(e,n,l,t,i){function write(){var a=createHtmlDocument(i);n.statusCode=l;n.statusMessage=s[l];setHeaders(n,t);n.setHeader("Content-Security-Policy","default-src 'none'");n.setHeader("X-Content-Type-Options","nosniff");n.setHeader("Content-Type","text/html; charset=utf-8");n.setHeader("Content-Length",Buffer.byteLength(a,"utf8"));if(e.method==="HEAD"){n.end();return}n.end(a,"utf8")}if(m(e)){write();return}c(e);u(e,write);e.resume()}function setHeaders(e,n){if(!n){return}var l=Object.keys(n);for(var t=0;t<l.length;t++){var i=l[t];e.setHeader(i,n[i])}}},6868:e=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* forwarded
|
|
|
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=forwarded;function forwarded(e){if(!e){throw new TypeError("argument req is required")}var n=parse(e.headers["x-forwarded-for"]||"");var l=getSocketAddr(e);var t=[l].concat(n);return t}function getSocketAddr(e){return e.socket?e.socket.remoteAddress:e.connection.remoteAddress}function parse(e){var n=e.length;var l=[];var t=e.length;for(var i=e.length-1;i>=0;i--){switch(e.charCodeAt(i)){case 32:if(t===n){t=n=i}break;case 44:if(t!==n){l.push(e.substring(t,n))}t=n=i;break;default:t=i;break}}if(t!==n){l.push(e.substring(t,n))}return l}},3136:e=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* fresh
|
|
|
|
|
* Copyright(c) 2012 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2016-2017 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var n=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;e.exports=fresh;function fresh(e,l){var t=e["if-modified-since"];var i=e["if-none-match"];if(!t&&!i){return false}var a=e["cache-control"];if(a&&n.test(a)){return false}if(i&&i!=="*"){var u=l["etag"];if(!u){return false}var o=true;var s=parseTokenList(i);for(var c=0;c<s.length;c++){var p=s[c];if(p===u||p==="W/"+u||"W/"+p===u){o=false;break}}if(o){return false}}if(t){var d=l["last-modified"];var f=!d||!(parseHttpDate(d)<=parseHttpDate(t));if(f){return false}}return true}function parseHttpDate(e){var n=e&&Date.parse(e);return typeof n==="number"?n:NaN}function parseTokenList(e){var n=0;var l=[];var t=0;for(var i=0,a=e.length;i<a;i++){switch(e.charCodeAt(i)){case 32:if(t===n){t=n=i+1}break;case 44:l.push(e.substring(t,n));t=n=i+1;break;default:n=i+1;break}}l.push(e.substring(t,n));return l}},5193:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* http-errors
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(8883)("http-errors");var i=l(414);var a=l(7415);var u=l(4124);var o=l(6399);e.exports=createError;e.exports.HttpError=createHttpErrorConstructor();populateConstructorExports(e.exports,a.codes,e.exports.HttpError);function codeClass(e){return Number(String(e).charAt(0)+"00")}function createError(){var e;var n;var l=500;var i={};for(var u=0;u<arguments.length;u++){var o=arguments[u];if(o instanceof Error){e=o;l=e.status||e.statusCode||l;continue}switch(typeof o){case"string":n=o;break;case"number":l=o;if(u!==0){t("non-first-argument status code; replace with createError("+o+", ...)")}break;case"object":i=o;break}}if(typeof l==="number"&&(l<400||l>=600)){t("non-error status code; use only 4xx or 5xx status codes")}if(typeof l!=="number"||!a[l]&&(l<400||l>=600)){l=500}var s=createError[l]||createError[codeClass(l)];if(!e){e=s?new s(n):new Error(n||a[l]);Error.captureStackTrace(e,createError)}if(!s||!(e instanceof s)||e.status!==l){e.expose=l<500;e.status=e.statusCode=l}for(var c in i){if(c!=="status"&&c!=="statusCode"){e[c]=i[c]}}return e}function createHttpErrorConstructor(){function HttpError(){throw new TypeError("cannot construct abstract class")}u(HttpError,Error);return HttpError}function createClientErrorConstructor(e,n,l){var t=n.match(/Error$/)?n:n+"Error";function ClientError(e){var n=e!=null?e:a[l];var u=new Error(n);Error.captureStackTrace(u,ClientError);i(u,ClientError.prototype);Object.defineProperty(u,"message",{enumerable:true,configurable:true,value:n,writable:true});Object.defineProperty(u,"name",{enumerable:false,configurable:true,value:t,writable:true});return u}u(ClientError,e);nameFunc(ClientError,t);ClientError.prototype.status=l;ClientError.prototype.statusCode=l;ClientError.prototype.expose=true;return ClientError}function createServerErrorConstructor(e,n,l){var t=n.match(/Error$/)?n:n+"Error";function ServerError(e){var n=e!=null?e:a[l];var u=new Error(n);Error.captureStackTrace(u,ServerError);i(u,ServerError.prototype);Object.defineProperty(u,"message",{enumerable:true,configurable:true,value:n,writable:true});Object.defineProperty(u,"name",{enumerable:false,configurable:true,value:t,writable:true});return u}u(ServerError,e);nameFunc(ServerError,t);ServerError.prototype.status=l;ServerError.prototype.statusCode=l;ServerError.prototype.expose=false;return ServerError}function nameFunc(e,n){var l=Object.getOwnPropertyDescriptor(e,"name");if(l&&l.configurable){l.value=n;Object.defineProperty(e,"name",l)}}function populateConstructorExports(e,n,l){n.forEach((function forEachCode(n){var t;var i=o(a[n]);switch(codeClass(n)){case 400:t=createClientErrorConstructor(l,i,n);break;case 500:t=createServerErrorConstructor(l,i,n);break}if(t){e[n]=t;e[i]=t}}));e["I'mateapot"]=t.function(e.ImATeapot,'"I\'mateapot"; use "ImATeapot" instead')}},9695:(e,n,l)=>{"use strict";var t=l(5118).Buffer;n._dbcs=DBCSCodec;var i=-1,a=-2,u=-10,o=-1e3,s=new Array(256),c=-1;for(var p=0;p<256;p++)s[p]=i;function DBCSCodec(e,n){this.encodingName=e.encodingName;if(!e)throw new Error("DBCS codec is called without the data.");if(!e.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var l=e.table();this.decodeTables=[];this.decodeTables[0]=s.slice(0);this.decodeTableSeq=[];for(var t=0;t<l.length;t++)this._addDecodeChunk(l[t]);this.defaultCharUnicode=n.defaultCharUnicode;this.encodeTable=[];this.encodeTableSeq=[];var u={};if(e.encodeSkipVals)for(var t=0;t<e.encodeSkipVals.length;t++){var c=e.encodeSkipVals[t];if(typeof c==="number")u[c]=true;else for(var p=c.from;p<=c.to;p++)u[p]=true}this._fillEncodeTable(0,0,u);if(e.encodeAdd){for(var d in e.encodeAdd)if(Object.prototype.hasOwnProperty.call(e.encodeAdd,d))this._setEncodeChar(d.charCodeAt(0),e.encodeAdd[d])}this.defCharSB=this.encodeTable[0][n.defaultCharSingleByte.charCodeAt(0)];if(this.defCharSB===i)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===i)this.defCharSB="?".charCodeAt(0);if(typeof e.gb18030==="function"){this.gb18030=e.gb18030();var f=this.decodeTables.length;var m=this.decodeTables[f]=s.slice(0);var h=this.decodeTables.length;var v
|
|
|
|
|
/*!
|
|
|
|
|
* media-typer
|
|
|
|
|
* Copyright(c) 2014 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/
|
|
|
|
|
var l=/; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g;var t=/^[\u0020-\u007e\u0080-\u00ff]+$/;var i=/^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/;var a=/\\([\u0000-\u007f])/g;var u=/([\\"])/g;var o=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/;var s=/^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/;var c=/^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;n.format=format;n.parse=parse;function format(e){if(!e||typeof e!=="object"){throw new TypeError("argument obj is required")}var n=e.parameters;var l=e.subtype;var t=e.suffix;var a=e.type;if(!a||!s.test(a)){throw new TypeError("invalid type")}if(!l||!o.test(l)){throw new TypeError("invalid subtype")}var u=a+"/"+l;if(t){if(!s.test(t)){throw new TypeError("invalid suffix")}u+="+"+t}if(n&&typeof n==="object"){var c;var p=Object.keys(n).sort();for(var d=0;d<p.length;d++){c=p[d];if(!i.test(c)){throw new TypeError("invalid parameter name")}u+="; "+c+"="+qstring(n[c])}}return u}function parse(e){if(!e){throw new TypeError("argument string is required")}if(typeof e==="object"){e=getcontenttype(e)}if(typeof e!=="string"){throw new TypeError("argument string is required to be a string")}var n=e.indexOf(";");var t=n!==-1?e.substr(0,n):e;var i;var u;var o=splitType(t);var s={};var c;l.lastIndex=n;while(u=l.exec(e)){if(u.index!==n){throw new TypeError("invalid parameter format")}n+=u[0].length;i=u[1].toLowerCase();c=u[2];if(c[0]==='"'){c=c.substr(1,c.length-2).replace(a,"$1")}s[i]=c}if(n!==-1&&n!==e.length){throw new TypeError("invalid parameter format")}o.parameters=s;return o}function getcontenttype(e){if(typeof e.getHeader==="function"){return e.getHeader("content-type")}if(typeof e.headers==="object"){return e.headers&&e.headers["content-type"]}}function qstring(e){var n=String(e);if(i.test(n)){return n}if(n.length>0&&!t.test(n)){throw new TypeError("invalid parameter value")}return'"'+n.replace(u,"\\$1")+'"'}function splitType(e){var n=c.exec(e.toLowerCase());if(!n){throw new TypeError("invalid media type")}var l=n[1];var t=n[2];var i;var a=t.lastIndexOf("+");if(a!==-1){i=t.substr(a+1);t=t.substr(0,a)}var u={type:l,subtype:t,suffix:i};return u}},1149:e=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* merge-descriptors
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=merge;var n=Object.prototype.hasOwnProperty;function merge(e,l,t){if(!e){throw new TypeError("argument dest is required")}if(!l){throw new TypeError("argument src is required")}if(t===undefined){t=true}Object.getOwnPropertyNames(l).forEach((function forEachOwnPropertyName(i){if(!t&&n.call(e,i)){return}var a=Object.getOwnPropertyDescriptor(l,i);Object.defineProperty(e,i,a)}));return e}},8752:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* methods
|
|
|
|
|
* Copyright(c) 2013-2014 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(3685);e.exports=getCurrentNodeMethods()||getBasicNodeMethods();function getCurrentNodeMethods(){return t.METHODS&&t.METHODS.map((function lowerCaseMethod(e){return e.toLowerCase()}))}function getBasicNodeMethods(){return["get","post","put","head","delete","options","trace","copy","lock","mkcol","move","purge","propfind","proppatch","unlock","report","mkactivity","checkout","merge","m-search","notify","subscribe","unsubscribe","patch","search","connect"]}},3105:(e,n,l)=>{
|
|
|
|
|
/*!
|
|
|
|
|
* mime-db
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/
|
|
|
|
|
e.exports=l(3765)},3583:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* mime-types
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(3105);var i=l(1017).extname;var a=/^\s*([^;\s]*)(?:;|\s|$)/;var u=/^text\//i;n.charset=charset;n.charsets={lookup:charset};n.contentType=contentType;n.extension=extension;n.extensions=Object.create(null);n.lookup=lookup;n.types=Object.create(null);populateMaps(n.extensions,n.types);function charset(e){if(!e||typeof e!=="string"){return false}var n=a.exec(e);var l=n&&t[n[1].toLowerCase()];if(l&&l.charset){return l.charset}if(n&&u.test(n[1])){return"UTF-8"}return false}function contentType(e){if(!e||typeof e!=="string"){return false}var l=e.indexOf("/")===-1?n.lookup(e):e;if(!l){return false}if(l.indexOf("charset")===-1){var t=n.charset(l);if(t)l+="; charset="+t.toLowerCase()}return l}function extension(e){if(!e||typeof e!=="string"){return false}var l=a.exec(e);var t=l&&n.extensions[l[1].toLowerCase()];if(!t||!t.length){return false}return t[0]}function lookup(e){if(!e||typeof e!=="string"){return false}var l=i("x."+e).toLowerCase().substr(1);if(!l){return false}return n.types[l]||false}function populateMaps(e,n){var l=["nginx","apache",undefined,"iana"];Object.keys(t).forEach((function forEachMimeType(i){var a=t[i];var u=a.extensions;if(!u||!u.length){return}e[i]=u;for(var o=0;o<u.length;o++){var s=u[o];if(n[s]){var c=l.indexOf(t[n[s]].source);var p=l.indexOf(a.source);if(n[s]!=="application/octet-stream"&&(c>p||c===p&&n[s].substr(0,12)==="application/")){continue}}n[s]=i}}))}},5018:(e,n,l)=>{var t=l(1017);var i=l(7147);function Mime(){this.types=Object.create(null);this.extensions=Object.create(null)}Mime.prototype.define=function(e){for(var n in e){var l=e[n];for(var t=0;t<l.length;t++){if(process.env.DEBUG_MIME&&this.types[l[t]]){console.warn((this._loading||"define()").replace(/.*\//,""),'changes "'+l[t]+'" extension type from '+this.types[l[t]]+" to "+n)}this.types[l[t]]=n}if(!this.extensions[n]){this.extensions[n]=l[0]}}};Mime.prototype.load=function(e){this._loading=e;var n={},l=i.readFileSync(e,"ascii"),t=l.split(/[\r\n]+/);t.forEach((function(e){var l=e.replace(/\s*#.*|^\s*|\s*$/g,"").split(/\s+/);n[l.shift()]=l}));this.define(n);this._loading=null};Mime.prototype.lookup=function(e,n){var l=e.replace(/^.*[\.\/\\]/,"").toLowerCase();return this.types[l]||n||this.default_type};Mime.prototype.extension=function(e){var n=e.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();return this.extensions[n]};var a=new Mime;a.define(l(5799));a.default_type=a.lookup("bin");a.Mime=Mime;a.charsets={lookup:function(e,n){return/^text\/|^application\/(javascript|json)/.test(e)?"UTF-8":n}};e.exports=a},6186:(e,n,l)=>{var t=l(1017);var i=l(7147);var a=parseInt("0777",8);e.exports=mkdirP.mkdirp=mkdirP.mkdirP=mkdirP;function mkdirP(e,n,l,u){if(typeof n==="function"){l=n;n={}}else if(!n||typeof n!=="object"){n={mode:n}}var o=n.mode;var s=n.fs||i;if(o===undefined){o=a}if(!u)u=null;var c=l||function(){};e=t.resolve(e);s.mkdir(e,o,(function(l){if(!l){u=u||e;return c(null,u)}switch(l.code){case"ENOENT":if(t.dirname(e)===e)return c(l);mkdirP(t.dirname(e),n,(function(l,t){if(l)c(l,t);else mkdirP(e,n,c,t)}));break;default:s.stat(e,(function(e,n){if(e||!n.isDirectory())c(l,u);else c(null,u)}));break}}))}mkdirP.sync=function sync(e,n,l){if(!n||typeof n!=="object"){n={mode:n}}var u=n.mode;var o=n.fs||i;if(u===undefined){u=a}if(!l)l=null;e=t.resolve(e);try{o.mkdirSync(e,u);l=l||e}catch(i){switch(i.code){case"ENOENT":l=sync(t.dirname(e),n,l);sync(e,n,l);break;default:var s;try{s=o.statSync(e)}catch(e){throw i}if(!s.isDirectory())throw i;break}}return l}},900:e=>{var n=1e3;var l=n*60;var t=l*60;var i=t*24;var a=i*365.25;e.exports=function(e,n){n=n||{};var l=typeof e;if(l==="string"&&e.length>0){return parse(e)}else if(l==="number"&&isNaN(e)===false){return n.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var u=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!u){return}var o=parseFloat(u[1]);var s=(u[2]||"ms").toLowerCase();switch(s)
|
|
|
|
|
/*!
|
|
|
|
|
* negotiator
|
|
|
|
|
* Copyright(c) 2012 Federico Romero
|
|
|
|
|
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
|
|
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=Object.create(null);e.exports=Negotiator;e.exports.Negotiator=Negotiator;function Negotiator(e){if(!(this instanceof Negotiator)){return new Negotiator(e)}this.request=e}Negotiator.prototype.charset=function charset(e){var n=this.charsets(e);return n&&n[0]};Negotiator.prototype.charsets=function charsets(e){var n=loadModule("charset").preferredCharsets;return n(this.request.headers["accept-charset"],e)};Negotiator.prototype.encoding=function encoding(e){var n=this.encodings(e);return n&&n[0]};Negotiator.prototype.encodings=function encodings(e){var n=loadModule("encoding").preferredEncodings;return n(this.request.headers["accept-encoding"],e)};Negotiator.prototype.language=function language(e){var n=this.languages(e);return n&&n[0]};Negotiator.prototype.languages=function languages(e){var n=loadModule("language").preferredLanguages;return n(this.request.headers["accept-language"],e)};Negotiator.prototype.mediaType=function mediaType(e){var n=this.mediaTypes(e);return n&&n[0]};Negotiator.prototype.mediaTypes=function mediaTypes(e){var n=loadModule("mediaType").preferredMediaTypes;return n(this.request.headers.accept,e)};Negotiator.prototype.preferredCharset=Negotiator.prototype.charset;Negotiator.prototype.preferredCharsets=Negotiator.prototype.charsets;Negotiator.prototype.preferredEncoding=Negotiator.prototype.encoding;Negotiator.prototype.preferredEncodings=Negotiator.prototype.encodings;Negotiator.prototype.preferredLanguage=Negotiator.prototype.language;Negotiator.prototype.preferredLanguages=Negotiator.prototype.languages;Negotiator.prototype.preferredMediaType=Negotiator.prototype.mediaType;Negotiator.prototype.preferredMediaTypes=Negotiator.prototype.mediaTypes;function loadModule(e){var n=t[e];if(n!==undefined){return n}switch(e){case"charset":n=l(9296);break;case"encoding":n=l(5297);break;case"language":n=l(9722);break;case"mediaType":n=l(2563);break;default:throw new Error("Cannot find module '"+e+"'")}t[e]=n;return n}},9296:e=>{"use strict";e.exports=preferredCharsets;e.exports.preferredCharsets=preferredCharsets;var n=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function parseAcceptCharset(e){var n=e.split(",");for(var l=0,t=0;l<n.length;l++){var i=parseCharset(n[l].trim(),l);if(i){n[t++]=i}}n.length=t;return n}function parseCharset(e,l){var t=n.exec(e);if(!t)return null;var i=t[1];var a=1;if(t[2]){var u=t[2].split(";");for(var o=0;o<u.length;o++){var s=u[o].trim().split("=");if(s[0]==="q"){a=parseFloat(s[1]);break}}}return{charset:i,q:a,i:l}}function getCharsetPriority(e,n,l){var t={o:-1,q:0,s:0};for(var i=0;i<n.length;i++){var a=specify(e,n[i],l);if(a&&(t.s-a.s||t.q-a.q||t.o-a.o)<0){t=a}}return t}function specify(e,n,l){var t=0;if(n.charset.toLowerCase()===e.toLowerCase()){t|=1}else if(n.charset!=="*"){return null}return{i:l,o:n.i,q:n.q,s:t}}function preferredCharsets(e,n){var l=parseAcceptCharset(e===undefined?"*":e||"");if(!n){return l.filter(isQuality).sort(compareSpecs).map(getFullCharset)}var t=n.map((function getPriority(e,n){return getCharsetPriority(e,l,n)}));return t.filter(isQuality).sort(compareSpecs).map((function getCharset(e){return n[t.indexOf(e)]}))}function compareSpecs(e,n){return n.q-e.q||n.s-e.s||e.o-n.o||e.i-n.i||0}function getFullCharset(e){return e.charset}function isQuality(e){return e.q>0}},5297:e=>{"use strict";e.exports=preferredEncodings;e.exports.preferredEncodings=preferredEncodings;var n=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function parseAcceptEncoding(e){var n=e.split(",");var l=false;var t=1;for(var i=0,a=0;i<n.length;i++){var u=parseEncoding(n[i].trim(),i);if(u){n[a++]=u;l=l||specify("identity",u);t=Math.min(t,u.q||1)}}if(!l){n[a++]={encoding:"identity",q:t,i:i}}n.length=a;return n}function parseEncoding(e,l){var t=n.exec(e);if(!t)return null;var i=t[1];var a=1;if(t[2]){var u=t[2].split(";");for(var o=0;o<u.length;o++){var s=u[o].trim().split("=");if(s[0]==="q"){a=parseFloat(s[1]);break}}}return{encoding:i,q:a,i:l}}function getEncodingPriority(e,n,l){var t={o:-1,q:0,s:0};for(var i=0;i<n.length;i++){var a=specify(e,n[i],l);if(a&&(t.s-a.s||t.q-a.q||t.o-a.o)<0){t=a}}return t}function spec
|
|
|
|
|
/*
|
|
|
|
|
object-assign
|
|
|
|
|
(c) Sindre Sorhus
|
|
|
|
|
@license MIT
|
|
|
|
|
*/var n=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty;var t=Object.prototype.propertyIsEnumerable;function toObject(e){if(e===null||e===undefined){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function shouldUseNative(){try{if(!Object.assign){return false}var e=new String("abc");e[5]="de";if(Object.getOwnPropertyNames(e)[0]==="5"){return false}var n={};for(var l=0;l<10;l++){n["_"+String.fromCharCode(l)]=l}var t=Object.getOwnPropertyNames(n).map((function(e){return n[e]}));if(t.join("")!=="0123456789"){return false}var i={};"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e}));if(Object.keys(Object.assign({},i)).join("")!=="abcdefghijklmnopqrst"){return false}return true}catch(e){return false}}e.exports=shouldUseNative()?Object.assign:function(e,i){var a;var u=toObject(e);var o;for(var s=1;s<arguments.length;s++){a=Object(arguments[s]);for(var c in a){if(l.call(a,c)){u[c]=a[c]}}if(n){o=n(a);for(var p=0;p<o.length;p++){if(t.call(a,o[p])){u[o[p]]=a[o[p]]}}}}return u}},4694:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* on-finished
|
|
|
|
|
* Copyright(c) 2013 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2014 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=onFinished;e.exports.isFinished=isFinished;var t=l(4401);var i=typeof setImmediate==="function"?setImmediate:function(e){process.nextTick(e.bind.apply(e,arguments))};function onFinished(e,n){if(isFinished(e)!==false){i(n,null,e);return e}attachListener(e,n);return e}function isFinished(e){var n=e.socket;if(typeof e.finished==="boolean"){return Boolean(e.finished||n&&!n.writable)}if(typeof e.complete==="boolean"){return Boolean(e.upgrade||!n||!n.readable||e.complete&&!e.readable)}return undefined}function attachFinishedListener(e,n){var l;var i;var a=false;function onFinish(e){l.cancel();i.cancel();a=true;n(e)}l=i=t([[e,"end","finish"]],onFinish);function onSocket(n){e.removeListener("socket",onSocket);if(a)return;if(l!==i)return;i=t([[n,"error","close"]],onFinish)}if(e.socket){onSocket(e.socket);return}e.on("socket",onSocket);if(e.socket===undefined){patchAssignSocket(e,onSocket)}}function attachListener(e,n){var l=e.__onFinished;if(!l||!l.queue){l=e.__onFinished=createListener(e);attachFinishedListener(e,l)}l.queue.push(n)}function createListener(e){function listener(n){if(e.__onFinished===listener)e.__onFinished=null;if(!listener.queue)return;var l=listener.queue;listener.queue=null;for(var t=0;t<l.length;t++){l[t](n,e)}}listener.queue=[];return listener}function patchAssignSocket(e,n){var l=e.assignSocket;if(typeof l!=="function")return;e.assignSocket=function _assignSocket(e){l.call(this,e);n(e)}}},9808:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* parseurl
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(7310);var i=t.parse;var a=t.Url;e.exports=parseurl;e.exports.original=originalurl;function parseurl(e){var n=e.url;if(n===undefined){return undefined}var l=e._parsedUrl;if(fresh(n,l)){return l}l=fastparse(n);l._raw=n;return e._parsedUrl=l}function originalurl(e){var n=e.originalUrl;if(typeof n!=="string"){return parseurl(e)}var l=e._parsedOriginalUrl;if(fresh(n,l)){return l}l=fastparse(n);l._raw=n;return e._parsedOriginalUrl=l}function fastparse(e){if(typeof e!=="string"||e.charCodeAt(0)!==47){return i(e)}var n=e;var l=null;var t=null;for(var u=1;u<e.length;u++){switch(e.charCodeAt(u)){case 63:if(t===null){n=e.substring(0,u);l=e.substring(u+1);t=e.substring(u)}break;case 9:case 10:case 12:case 13:case 32:case 35:case 160:case 65279:return i(e)}}var o=a!==undefined?new a:{};o.path=e;o.href=e;o.pathname=n;if(t!==null){o.query=l;o.search=t}return o}function fresh(e,n){return typeof n==="object"&&n!==null&&(a===undefined||n instanceof a)&&n._raw===e}},7819:e=>{e.exports=pathtoRegexp;var n=/\((?!\?)/g;function pathtoRegexp(e,l,t){t=t||{};l=l||[];var i=t.strict;var a=t.end!==false;var u=t.sensitive?"":"i";var o=0;var s=l.length;var c=0;var p=0;var d;if(e instanceof RegExp){while(d=n.exec(e.source)){l.push({name:p++,optional:false,offset:d.index})}return e}if(Array.isArray(e)){e=e.map((function(e){return pathtoRegexp(e,l,t).source}));return new RegExp("(?:"+e.join("|")+")",u)}e=("^"+e+(i?"":e[e.length-1]==="/"?"?":"/?")).replace(/\/\(/g,"/(?:").replace(/([\/\.])/g,"\\$1").replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g,(function(e,n,t,i,a,u,s,c){n=n||"";t=t||"";a=a||"([^\\/"+t+"]+?)";s=s||"";l.push({name:i,optional:!!s,offset:c+o});var p=""+(s?"":n)+"(?:"+t+(s?n:"")+a+(u?"((?:[\\/"+t+"].+?)?)":"")+")"+s;o+=p.length-e.length;return p})).replace(/\*/g,(function(e,n){var t=l.length;while(t-- >s&&l[t].offset>n){l[t].offset+=3}return"(.*)"}));while(d=n.exec(e)){var f=0;var m=d.index;while(e.charAt(--m)==="\\"){f++}if(f%2===1){continue}if(s+c===l.length||l[s+c].offset>d.index){l.splice(s+c,0,{name:p++,optional:false,offset:d.index})}c++}e+=a?"$":e[e.length-1]==="/"?"":"(?=\\/|$)";return new RegExp(e,u)}},7810:e=>{"use strict";if(typeof process==="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){e.exports={nextTick:nextTick}}else{e.exports=process}function nextTick(e,n,l,t){if(typeof e!=="function"){throw new TypeError('"callback" argument must be a function')}var i=arguments.length;var a,u;switch(i){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function afterTickOne(){e.call(null,n)}));case 3:return process.nextTick((function afterTickTwo(){e.call(null,n,l)}));case 4:return process.nextTick((function afterTickThree(){e.call(null,n,l,t)}));default:a=new Array(i-1);u=0;while(u<a.length){a[u++]=arguments[u]}return process.nextTick((function afterTick(){e.apply(null,a)}))}}},140:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* proxy-addr
|
|
|
|
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=proxyaddr;e.exports.all=alladdrs;e.exports.compile=compile;var t=l(6868);var i=l(7263);var a=/^[0-9]+$/;var u=i.isValid;var o=i.parse;var s={linklocal:["169.254.0.0/16","fe80::/10"],loopback:["127.0.0.1/8","::1/128"],uniquelocal:["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16","fc00::/7"]};function alladdrs(e,n){var l=t(e);if(!n){return l}if(typeof n!=="function"){n=compile(n)}for(var i=0;i<l.length-1;i++){if(n(l[i],i))continue;l.length=i+1}return l}function compile(e){if(!e){throw new TypeError("argument is required")}var n;if(typeof e==="string"){n=[e]}else if(Array.isArray(e)){n=e.slice()}else{throw new TypeError("unsupported trust argument")}for(var l=0;l<n.length;l++){e=n[l];if(!Object.prototype.hasOwnProperty.call(s,e)){continue}e=s[e];n.splice.apply(n,[l,1].concat(e));l+=e.length-1}return compileTrust(compileRangeSubnets(n))}function compileRangeSubnets(e){var n=new Array(e.length);for(var l=0;l<e.length;l++){n[l]=parseipNotation(e[l])}return n}function compileTrust(e){var n=e.length;return n===0?trustNone:n===1?trustSingle(e[0]):trustMulti(e)}function parseipNotation(e){var n=e.lastIndexOf("/");var l=n!==-1?e.substring(0,n):e;if(!u(l)){throw new TypeError("invalid IP address: "+l)}var t=o(l);if(n===-1&&t.kind()==="ipv6"&&t.isIPv4MappedAddress()){t=t.toIPv4Address()}var i=t.kind()==="ipv6"?128:32;var s=n!==-1?e.substring(n+1,e.length):null;if(s===null){s=i}else if(a.test(s)){s=parseInt(s,10)}else if(t.kind()==="ipv4"&&u(s)){s=parseNetmask(s)}else{s=null}if(s<=0||s>i){throw new TypeError("invalid range on address: "+e)}return[t,s]}function parseNetmask(e){var n=o(e);var l=n.kind();return l==="ipv4"?n.prefixLengthFromSubnetMask():null}function proxyaddr(e,n){if(!e){throw new TypeError("req argument is required")}if(!n){throw new TypeError("trust argument is required")}var l=alladdrs(e,n);var t=l[l.length-1];return t}function trustNone(){return false}function trustMulti(e){return function trust(n){if(!u(n))return false;var l=o(n);var t;var i=l.kind();for(var a=0;a<e.length;a++){var s=e[a];var c=s[0];var p=c.kind();var d=s[1];var f=l;if(i!==p){if(p==="ipv4"&&!l.isIPv4MappedAddress()){continue}if(!t){t=p==="ipv4"?l.toIPv4Address():l.toIPv4MappedAddress()}f=t}if(f.match(c,d)){return true}}return false}}function trustSingle(e){var n=e[0];var l=n.kind();var t=l==="ipv4";var i=e[1];return function trust(e){if(!u(e))return false;var a=o(e);var s=a.kind();if(s!==l){if(t&&!a.isIPv4MappedAddress()){return false}a=t?a.toIPv4Address():a.toIPv4MappedAddress()}return a.match(n,i)}}},4907:e=>{"use strict";var n=String.prototype.replace;var l=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return n.call(e,l,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},2760:(e,n,l)=>{"use strict";var t=l(9954);var i=l(3912);var a=l(4907);e.exports={formats:a,parse:i,stringify:t}},3912:(e,n,l)=>{"use strict";var t=l(2360);var i=Object.prototype.hasOwnProperty;var a={allowDots:false,allowPrototypes:false,arrayLimit:20,charset:"utf-8",charsetSentinel:false,comma:false,decoder:t.decode,delimiter:"&",depth:5,ignoreQueryPrefix:false,interpretNumericEntities:false,parameterLimit:1e3,parseArrays:true,plainObjects:false,strictNullHandling:false};var interpretNumericEntities=function(e){return e.replace(/&#(\d+);/g,(function(e,n){return String.fromCharCode(parseInt(n,10))}))};var u="utf8=%26%2310003%3B";var o="utf8=%E2%9C%93";var s=function parseQueryStringValues(e,n){var l={};var s=n.ignoreQueryPrefix?e.replace(/^\?/,""):e;var c=n.parameterLimit===Infinity?undefined:n.parameterLimit;var p=s.split(n.delimiter,c);var d=-1;var f;var m=n.charset;if(n.charsetSentinel){for(f=0;f<p.length;++f){if(p[f].indexOf("utf8=")===0){if(p[f]===o){m="utf-8"}else if(p[f]===u){m="iso-8859-1"}d=f;f=p.length}}}for(f=0;f<p.length;++f){if(f===d){continue}var h=p[f];var v=h.indexOf("]=");var g=v===-1?h.indexOf("="):v+1;var b,x;if(g===-1){b=n.decoder(h,a.decoder,m);x=n.strictNullHandling?null:""}else{b=n.decoder(h.slice(0,g),a.decoder,m);x=n.decoder(h.slice(g+1),a.decoder,m)}if(x&&n.interpretNumericEntities&&m==="iso-8859-1"
|
|
|
|
|
/*!
|
|
|
|
|
* range-parser
|
|
|
|
|
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=rangeParser;function rangeParser(e,n,l){if(typeof n!=="string"){throw new TypeError("argument str must be a string")}var t=n.indexOf("=");if(t===-1){return-2}var i=n.slice(t+1).split(",");var a=[];a.type=n.slice(0,t);for(var u=0;u<i.length;u++){var o=i[u].split("-");var s=parseInt(o[0],10);var c=parseInt(o[1],10);if(isNaN(s)){s=e-c;c=e-1}else if(isNaN(c)){c=e-1}if(c>e-1){c=e-1}if(isNaN(s)||isNaN(c)||s>c||s<0){continue}a.push({start:s,end:c})}if(a.length<1){return-1}return l&&l.combine?combineRanges(a):a}function combineRanges(e){var n=e.map(mapWithIndex).sort(sortByRangeStart);for(var l=0,t=1;t<n.length;t++){var i=n[t];var a=n[l];if(i.start>a.end+1){n[++l]=i}else if(i.end>a.end){a.end=i.end;a.index=Math.min(a.index,i.index)}}n.length=l+1;var u=n.sort(sortByRangeIndex).map(mapWithoutIndex);u.type=e.type;return u}function mapWithIndex(e,n){return{start:e.start,end:e.end,index:n}}function mapWithoutIndex(e){return{start:e.start,end:e.end}}function sortByRangeIndex(e,n){return e.index-n.index}function sortByRangeStart(e,n){return e.start-n.start}},7742:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* raw-body
|
|
|
|
|
* Copyright(c) 2013-2014 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(6966);var i=l(5193);var a=l(9032);var u=l(3124);e.exports=getRawBody;var o=/^Encoding not recognized: /;function getDecoder(e){if(!e)return null;try{return a.getDecoder(e)}catch(n){if(!o.test(n.message))throw n;throw i(415,"specified encoding unsupported",{encoding:e,type:"encoding.unsupported"})}}function getRawBody(e,n,l){var i=l;var a=n||{};if(n===true||typeof n==="string"){a={encoding:n}}if(typeof n==="function"){i=n;a={}}if(i!==undefined&&typeof i!=="function"){throw new TypeError("argument callback must be a function")}if(!i&&!global.Promise){throw new TypeError("argument callback is required")}var u=a.encoding!==true?a.encoding:"utf-8";var o=t.parse(a.limit);var s=a.length!=null&&!isNaN(a.length)?parseInt(a.length,10):null;if(i){return readStream(e,u,s,o,i)}return new Promise((function executor(n,l){readStream(e,u,s,o,(function onRead(e,t){if(e)return l(e);n(t)}))}))}function halt(e){u(e);if(typeof e.pause==="function"){e.pause()}}function readStream(e,n,l,t,a){var u=false;var o=true;if(t!==null&&l!==null&&l>t){return done(i(413,"request entity too large",{expected:l,length:l,limit:t,type:"entity.too.large"}))}var s=e._readableState;if(e._decoder||s&&(s.encoding||s.decoder)){return done(i(500,"stream encoding should not be set",{type:"stream.encoding.set"}))}var c=0;var p;try{p=getDecoder(n)}catch(e){return done(e)}var d=p?"":[];e.on("aborted",onAborted);e.on("close",cleanup);e.on("data",onData);e.on("end",onEnd);e.on("error",onEnd);o=false;function done(){var n=new Array(arguments.length);for(var l=0;l<n.length;l++){n[l]=arguments[l]}u=true;if(o){process.nextTick(invokeCallback)}else{invokeCallback()}function invokeCallback(){cleanup();if(n[0]){halt(e)}a.apply(null,n)}}function onAborted(){if(u)return;done(i(400,"request aborted",{code:"ECONNABORTED",expected:l,length:l,received:c,type:"request.aborted"}))}function onData(e){if(u)return;c+=e.length;if(t!==null&&c>t){done(i(413,"request entity too large",{limit:t,received:c,type:"entity.too.large"}))}else if(p){d+=p.write(e)}else{d.push(e)}}function onEnd(e){if(u)return;if(e)return done(e);if(l!==null&&c!==l){done(i(400,"request size did not match content length",{expected:l,length:l,received:c,type:"request.size.invalid"}))}else{var n=p?d+(p.end()||""):Buffer.concat(d);done(null,n)}}function cleanup(){d=null;e.removeListener("aborted",onAborted);e.removeListener("data",onData);e.removeListener("end",onEnd);e.removeListener("error",onEnd);e.removeListener("close",cleanup)}}},1359:(e,n,l)=>{"use strict";var t=l(7810);var i=Object.keys||function(e){var n=[];for(var l in e){n.push(l)}return n};e.exports=Duplex;var a=Object.create(l(5898));a.inherits=l(4124);var u=l(1433);var o=l(6993);a.inherits(Duplex,u);{var s=i(o.prototype);for(var c=0;c<s.length;c++){var p=s[c];if(!Duplex.prototype[p])Duplex.prototype[p]=o.prototype[p]}}function Duplex(e){if(!(this instanceof Duplex))return new Duplex(e);u.call(this,e);o.call(this,e);if(e&&e.readable===false)this.readable=false;if(e&&e.writable===false)this.writable=false;this.allowHalfOpen=true;if(e&&e.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function onend(){if(this.allowHalfOpen||this._writableState.ended)return;t.nextTick(onEndNT,this)}function onEndNT(e){e.end()}Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function(e){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=e;this._writableState.destroyed=e}});Duplex.prototype._destroy=function(e,n){this.push(null);this.end();t.nextTick(n,e)}},1542:(e,n,l)=>{"use strict";e.exports=PassThrough;var t=l(4415);var i=Object.create(l(5898));i.inherits=l(4124);i.inherits(PassThrough,t);function PassThrough(e){if(!(this instanceof PassThrough))return new PassThrough(e);t.call(this,e)
|
|
|
|
|
/*!
|
|
|
|
|
* send
|
|
|
|
|
* Copyright(c) 2012 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(5193);var i=l(8237)("send");var a=l(8883)("send");var u=l(3225);var o=l(6592);var s=l(4070);var c=l(9972);var p=l(3136);var d=l(7147);var f=l(5018);var m=l(987);var h=l(4694);var v=l(6435);var g=l(1017);var b=l(7415);var x=l(2781);var y=l(3837);var w=g.extname;var k=g.join;var _=g.normalize;var E=g.resolve;var S=g.sep;var j=/^ *bytes=/;var C=60*60*24*365*1e3;var T=/(?:^|[\\/])\.\.(?:[\\/]|$)/;e.exports=send;e.exports.mime=f;function send(e,n,l){return new SendStream(e,n,l)}function SendStream(e,n,l){x.call(this);var t=l||{};this.options=t;this.path=n;this.req=e;this._acceptRanges=t.acceptRanges!==undefined?Boolean(t.acceptRanges):true;this._cacheControl=t.cacheControl!==undefined?Boolean(t.cacheControl):true;this._etag=t.etag!==undefined?Boolean(t.etag):true;this._dotfiles=t.dotfiles!==undefined?t.dotfiles:"ignore";if(this._dotfiles!=="ignore"&&this._dotfiles!=="allow"&&this._dotfiles!=="deny"){throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"')}this._hidden=Boolean(t.hidden);if(t.hidden!==undefined){a("hidden: use dotfiles: '"+(this._hidden?"allow":"ignore")+"' instead")}if(t.dotfiles===undefined){this._dotfiles=undefined}this._extensions=t.extensions!==undefined?normalizeList(t.extensions,"extensions option"):[];this._immutable=t.immutable!==undefined?Boolean(t.immutable):false;this._index=t.index!==undefined?normalizeList(t.index,"index option"):["index.html"];this._lastModified=t.lastModified!==undefined?Boolean(t.lastModified):true;this._maxage=t.maxAge||t.maxage;this._maxage=typeof this._maxage==="string"?m(this._maxage):Number(this._maxage);this._maxage=!isNaN(this._maxage)?Math.min(Math.max(0,this._maxage),C):0;this._root=t.root?E(t.root):null;if(!this._root&&t.from){this.from(t.from)}}y.inherits(SendStream,x);SendStream.prototype.etag=a.function((function etag(e){this._etag=Boolean(e);i("etag %s",this._etag);return this}),"send.etag: pass etag as option");SendStream.prototype.hidden=a.function((function hidden(e){this._hidden=Boolean(e);this._dotfiles=undefined;i("hidden %s",this._hidden);return this}),"send.hidden: use dotfiles option");SendStream.prototype.index=a.function((function index(e){var index=!e?[]:normalizeList(e,"paths argument");i("index %o",e);this._index=index;return this}),"send.index: pass index as option");SendStream.prototype.root=function root(e){this._root=E(String(e));i("root %s",this._root);return this};SendStream.prototype.from=a.function(SendStream.prototype.root,"send.from: pass root as option");SendStream.prototype.root=a.function(SendStream.prototype.root,"send.root: pass root as option");SendStream.prototype.maxage=a.function((function maxage(e){this._maxage=typeof e==="string"?m(e):Number(e);this._maxage=!isNaN(this._maxage)?Math.min(Math.max(0,this._maxage),C):0;i("max-age %d",this._maxage);return this}),"send.maxage: pass maxAge as option");SendStream.prototype.error=function error(e,n){if(hasListeners(this,"error")){return this.emit("error",t(e,n,{expose:false}))}var l=this.res;var i=b[e]||String(e);var a=createHtmlDocument("Error",s(i));clearHeaders(l);if(n&&n.headers){setHeaders(l,n.headers)}l.statusCode=e;l.setHeader("Content-Type","text/html; charset=UTF-8");l.setHeader("Content-Length",Buffer.byteLength(a));l.setHeader("Content-Security-Policy","default-src 'none'");l.setHeader("X-Content-Type-Options","nosniff");l.end(a)};SendStream.prototype.hasTrailingSlash=function hasTrailingSlash(){return this.path[this.path.length-1]==="/"};SendStream.prototype.isConditionalGET=function isConditionalGET(){return this.req.headers["if-match"]||this.req.headers["if-unmodified-since"]||this.req.headers["if-none-match"]||this.req.headers["if-modified-since"]};SendStream.prototype.isPreconditionFailure=function isPreconditionFailure(){var e=this.req;var n=this.res;var l=e.headers["if-match"];if(l){var t=n.getHeader("ETag");return!t||l!=="*"&&parseTokenList(l).every((function(e){return e!==t&&e!=="W/"+t&&"W/"+e!==t}))}var i=parseHttpDate(e.headers["if-unmodified-since"]);if(!isNaN(i)){var a=parseHttpDate(n.getHeader("Last-Modified"));return isNaN(a)||a>i}
|
|
|
|
|
/*!
|
|
|
|
|
* serve-static
|
|
|
|
|
* Copyright(c) 2010 Sencha Inc.
|
|
|
|
|
* Copyright(c) 2011 TJ Holowaychuk
|
|
|
|
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(6592);var i=l(4070);var a=l(9808);var u=l(1017).resolve;var o=l(2966);var s=l(7310);e.exports=serveStatic;e.exports.mime=o.mime;function serveStatic(e,n){if(!e){throw new TypeError("root path required")}if(typeof e!=="string"){throw new TypeError("root path must be a string")}var l=Object.create(n||null);var t=l.fallthrough!==false;var i=l.redirect!==false;var s=l.setHeaders;if(s&&typeof s!=="function"){throw new TypeError("option setHeaders must be function")}l.maxage=l.maxage||l.maxAge||0;l.root=u(e);var c=i?createRedirectDirectoryListener():createNotFoundDirectoryListener();return function serveStatic(e,n,i){if(e.method!=="GET"&&e.method!=="HEAD"){if(t){return i()}n.statusCode=405;n.setHeader("Allow","GET, HEAD");n.setHeader("Content-Length","0");n.end();return}var u=!t;var p=a.original(e);var d=a(e).pathname;if(d==="/"&&p.pathname.substr(-1)!=="/"){d=""}var f=o(e,d,l);f.on("directory",c);if(s){f.on("headers",s)}if(t){f.on("file",(function onFile(){u=true}))}f.on("error",(function error(e){if(u||!(e.statusCode<500)){i(e);return}i()}));f.pipe(n)}}function collapseLeadingSlashes(e){for(var n=0;n<e.length;n++){if(e.charCodeAt(n)!==47){break}}return n>1?"/"+e.substr(n):e}function createHtmlDocument(e,n){return"<!DOCTYPE html>\n"+'<html lang="en">\n'+"<head>\n"+'<meta charset="utf-8">\n'+"<title>"+e+"</title>\n"+"</head>\n"+"<body>\n"+"<pre>"+n+"</pre>\n"+"</body>\n"+"</html>\n"}function createNotFoundDirectoryListener(){return function notFound(){this.error(404)}}function createRedirectDirectoryListener(){return function redirect(e){if(this.hasTrailingSlash()){this.error(404);return}var n=a.original(this.req);n.path=null;n.pathname=collapseLeadingSlashes(n.pathname+"/");var l=t(s.format(n));var u=createHtmlDocument("Redirecting",'Redirecting to <a href="'+i(l)+'">'+i(l)+"</a>");e.statusCode=301;e.setHeader("Content-Type","text/html; charset=UTF-8");e.setHeader("Content-Length",Buffer.byteLength(u));e.setHeader("Content-Security-Policy","default-src 'none'");e.setHeader("X-Content-Type-Options","nosniff");e.setHeader("Location",l);e.end(u)}}},414:e=>{"use strict";e.exports=Object.setPrototypeOf||({__proto__:[]}instanceof Array?setProtoOf:mixinProperties);function setProtoOf(e,n){e.__proto__=n;return e}function mixinProperties(e,n){for(var l in n){if(!e.hasOwnProperty(l)){e[l]=n[l]}}return e}},7415:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* statuses
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(855);e.exports=status;status.STATUS_CODES=t;status.codes=populateStatusesMap(status,t);status.redirect={300:true,301:true,302:true,303:true,305:true,307:true,308:true};status.empty={204:true,205:true,304:true};status.retry={502:true,503:true,504:true};function populateStatusesMap(e,n){var l=[];Object.keys(n).forEach((function forEachCode(t){var i=n[t];var a=Number(t);e[a]=i;e[i]=a;e[i.toLowerCase()]=a;l.push(a)}));return l}function status(e){if(typeof e==="number"){if(!status[e])throw new Error("invalid status code: "+e);return e}if(typeof e!=="string"){throw new TypeError("code must be a number or string")}var n=parseInt(e,10);if(!isNaN(n)){if(!status[n])throw new Error("invalid status code: "+n);return n}n=status[e.toLowerCase()];if(!n)throw new Error('invalid status message: "'+e+'"');return n}},2405:(e,n,l)=>{var t=l(2361).EventEmitter,i=l(3837).inherits;function jsmemcmp(e,n,l,t,i){for(var a=0;a<i;++a,++n,++t)if(e[n]!==l[t])return false;return true}function SBMH(e){if(typeof e==="string")e=new Buffer(e);var n,l,t=e.length;this.maxMatches=Infinity;this.matches=0;this._occ=new Array(256);this._lookbehind_size=0;this._needle=e;this._bufpos=0;this._lookbehind=new Buffer(t);for(l=0;l<256;++l)this._occ[l]=t;if(t>=1){for(n=0;n<t-1;++n)this._occ[e[n]]=t-1-n}}i(SBMH,t);SBMH.prototype.reset=function(){this._lookbehind_size=0;this.matches=0;this._bufpos=0};SBMH.prototype.push=function(e,n){var l,t;if(!Buffer.isBuffer(e))e=new Buffer(e,"binary");t=e.length;this._bufpos=n||0;while(l!==t&&this.matches<this.maxMatches)l=this._sbmh_feed(e);return l};SBMH.prototype._sbmh_feed=function(e){var n=e.length,l=this._needle,t=l.length;var i=-this._lookbehind_size,a=l[t-1],u=this._occ,o=this._lookbehind;if(i<0){while(i<0&&i<=n-t){var s=this._sbmh_lookup_char(e,i+t-1);if(s===a&&this._sbmh_memcmp(e,i,t-1)){this._lookbehind_size=0;++this.matches;if(i>-this._lookbehind_size)this.emit("info",true,o,0,this._lookbehind_size+i);else this.emit("info",true);this._bufpos=i+t;return i+t}else i+=u[s]}if(i<0){while(i<0&&!this._sbmh_memcmp(e,i,n-i))i++}if(i>=0){this.emit("info",false,o,0,this._lookbehind_size);this._lookbehind_size=0}else{var c=this._lookbehind_size+i;if(c>0){this.emit("info",false,o,0,c)}o.copy(o,0,c,this._lookbehind_size-c);this._lookbehind_size-=c;e.copy(o,this._lookbehind_size);this._lookbehind_size+=n;this._bufpos=n;return n}}if(i>=0)i+=this._bufpos;while(i<=n-t){var s=e[i+t-1];if(s===a&&e[i]===l[0]&&jsmemcmp(l,0,e,i,t-1)){++this.matches;if(i>0)this.emit("info",true,e,this._bufpos,i);else this.emit("info",true);this._bufpos=i+t;return i+t}else i+=u[s]}if(i<n){while(i<n&&(e[i]!==l[0]||!jsmemcmp(e,i,l,0,n-i))){++i}if(i<n){e.copy(o,0,i,i+(n-i));this._lookbehind_size=n-i}}if(i>0)this.emit("info",false,e,this._bufpos,i<n?i:n);this._bufpos=n;return n};SBMH.prototype._sbmh_lookup_char=function(e,n){if(n<0)return this._lookbehind[this._lookbehind_size+n];else return e[n]};SBMH.prototype._sbmh_memcmp=function(e,n,l){var t=0;while(t<l){if(this._sbmh_lookup_char(e,n+t)===this._needle[t])++t;else return false}return true};e.exports=SBMH},4841:(e,n,l)=>{"use strict";var t=l(1867).Buffer;var i=t.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var n;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(n)return;e=(""+e).toLowerCase();n=true}}}function normalizeEncoding(e){var n=_normalizeEncoding(e);if(typeof n!=="string"&&(t.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return n||e}n.s=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var n;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;n=4;break;case"utf8":this.fillLast=utf8FillLast;n=4;break;case"base64":this.text=base64Text;th
|
|
|
|
|
/*!
|
|
|
|
|
* toidentifier
|
|
|
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/
|
|
|
|
|
e.exports=toIdentifier;function toIdentifier(e){return e.split(" ").map((function(e){return e.slice(0,1).toUpperCase()+e.slice(1)})).join("").replace(/[^ _0-9a-z]/gi,"")}},1159:(e,n,l)=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* type-is
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/var t=l(9955);var i=l(3583);e.exports=typeofrequest;e.exports.is=typeis;e.exports.hasBody=hasbody;e.exports.normalize=normalize;e.exports.match=mimeMatch;function typeis(e,n){var l;var t=n;var i=tryNormalizeType(e);if(!i){return false}if(t&&!Array.isArray(t)){t=new Array(arguments.length-1);for(l=0;l<t.length;l++){t[l]=arguments[l+1]}}if(!t||!t.length){return i}var a;for(l=0;l<t.length;l++){if(mimeMatch(normalize(a=t[l]),i)){return a[0]==="+"||a.indexOf("*")!==-1?i:a}}return false}function hasbody(e){return e.headers["transfer-encoding"]!==undefined||!isNaN(e.headers["content-length"])}function typeofrequest(e,n){var l=n;if(!hasbody(e)){return null}if(arguments.length>2){l=new Array(arguments.length-1);for(var t=0;t<l.length;t++){l[t]=arguments[t+1]}}var i=e.headers["content-type"];return typeis(i,l)}function normalize(e){if(typeof e!=="string"){return false}switch(e){case"urlencoded":return"application/x-www-form-urlencoded";case"multipart":return"multipart/*"}if(e[0]==="+"){return"*/*"+e}return e.indexOf("/")===-1?i.lookup(e):e}function mimeMatch(e,n){if(e===false){return false}var l=n.split("/");var t=e.split("/");if(l.length!==2||t.length!==2){return false}if(t[0]!=="*"&&t[0]!==l[0]){return false}if(t[1].substr(0,2)==="*+"){return t[1].length<=l[1].length+1&&t[1].substr(1)===l[1].substr(1-t[1].length)}if(t[1]!=="*"&&t[1]!==l[1]){return false}return true}function normalizeType(e){var n=t.parse(e);n.parameters=undefined;return t.format(n)}function tryNormalizeType(e){if(!e){return null}try{return normalizeType(e)}catch(e){return null}}},5027:(e,n)=>{var l=void 0;var t=1e5;var i=function(){var e=Object.prototype.toString,n=Object.prototype.hasOwnProperty;return{Class:function(n){return e.call(n).replace(/^\[object *|\]$/g,"")},HasProperty:function(e,n){return n in e},HasOwnProperty:function(e,l){return n.call(e,l)},IsCallable:function(e){return typeof e==="function"},ToInt32:function(e){return e>>0},ToUint32:function(e){return e>>>0}}}();var a=Math.LN2,u=Math.abs,o=Math.floor,s=Math.log,c=Math.min,p=Math.pow,d=Math.round;function configureProperties(e){if(m&&f){var n=m(e),l;for(l=0;l<n.length;l+=1){f(e,n[l],{value:e[n[l]],writable:false,enumerable:false,configurable:false})}}}var f;if(Object.defineProperty&&function(){try{Object.defineProperty({},"x",{});return true}catch(e){return false}}()){f=Object.defineProperty}else{f=function(e,n,l){if(!e===Object(e))throw new TypeError("Object.defineProperty called on non-object");if(i.HasProperty(l,"get")&&Object.prototype.__defineGetter__){Object.prototype.__defineGetter__.call(e,n,l.get)}if(i.HasProperty(l,"set")&&Object.prototype.__defineSetter__){Object.prototype.__defineSetter__.call(e,n,l.set)}if(i.HasProperty(l,"value")){e[n]=l.value}return e}}var m=Object.getOwnPropertyNames||function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var n=[],l;for(l in e){if(i.HasOwnProperty(e,l)){n.push(l)}}return n};function makeArrayAccessors(e){if(!f){return}if(e.length>t)throw new RangeError("Array too large for polyfill");function makeArrayAccessor(n){f(e,n,{get:function(){return e._getter(n)},set:function(l){e._setter(n,l)},enumerable:true,configurable:false})}var n;for(n=0;n<e.length;n+=1){makeArrayAccessor(n)}}function as_signed(e,n){var l=32-n;return e<<l>>l}function as_unsigned(e,n){var l=32-n;return e<<l>>>l}function packI8(e){return[e&255]}function unpackI8(e){return as_signed(e[0],8)}function packU8(e){return[e&255]}function unpackU8(e){return as_unsigned(e[0],8)}function packU8Clamped(e){e=d(Number(e));return[e<0?0:e>255?255:e&255]}function packI16(e){return[e>>8&255,e&255]}function unpackI16(e){return as_signed(e[0]<<8|e[1],16)}function packU16(e){return[e>>8&255,e&255]}function unpackU16(e){return as_unsigned(e[0]<<8|e[1],16)}function packI32(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}function unpackI32(e){return as_signed(e[0]<<24|e[1]<<16|e[2]<<8|e[3],32)}function packU32(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}function unpackU32(e){return as_unsigned(e[0]<<24|e[1]<<16|e[2]<<8|e[3],32)}function packIEEE754(e,n,l){v
|
|
|
|
|
/*!
|
|
|
|
|
* unpipe
|
|
|
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=unpipe;function hasPipeDataListeners(e){var n=e.listeners("data");for(var l=0;l<n.length;l++){if(n[l].name==="ondata"){return true}}return false}function unpipe(e){if(!e){throw new TypeError("argument stream is required")}if(typeof e.unpipe==="function"){e.unpipe();return}if(!hasPipeDataListeners(e)){return}var n;var l=e.listeners("close");for(var t=0;t<l.length;t++){n=l[t];if(n.name!=="cleanup"&&n.name!=="onclose"){continue}n.call(e)}}},5278:(e,n,l)=>{e.exports=l(3837).deprecate},4429:(e,n)=>{n=e.exports=function(e,n){if(e&&n){for(var l in n){e[l]=n[l]}}return e}},5931:e=>{"use strict";
|
|
|
|
|
/*!
|
|
|
|
|
* vary
|
|
|
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/e.exports=vary;e.exports.append=append;var n=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function append(e,l){if(typeof e!=="string"){throw new TypeError("header argument is required")}if(!l){throw new TypeError("field argument is required")}var t=!Array.isArray(l)?parse(String(l)):l;for(var i=0;i<t.length;i++){if(!n.test(t[i])){throw new TypeError("field argument contains an invalid header name")}}if(e==="*"){return e}var a=e;var u=parse(e.toLowerCase());if(t.indexOf("*")!==-1||u.indexOf("*")!==-1){return"*"}for(var o=0;o<t.length;o++){var s=t[o].toLowerCase();if(u.indexOf(s)===-1){u.push(s);a=a?a+", "+t[o]:t[o]}}return a}function parse(e){var n=0;var l=[];var t=0;for(var i=0,a=e.length;i<a;i++){switch(e.charCodeAt(i)){case 32:if(t===n){t=n=i+1}break;case 44:l.push(e.substring(t,n));t=n=i+1;break;default:n=i+1;break}}l.push(e.substring(t,n));return l}function vary(e,n){if(!e||!e.getHeader||!e.setHeader){throw new TypeError("res argument is required")}var l=e.getHeader("Vary")||"";var t=Array.isArray(l)?l.join(", "):String(l);if(l=append(t,n)){e.setHeader("Vary",l)}}},1208:e=>{e.exports=extend;var n=Object.prototype.hasOwnProperty;function extend(){var e={};for(var l=0;l<arguments.length;l++){var t=arguments[l];for(var i in t){if(n.call(t,i)){e[i]=t[i]}}}return e}},1151:(e,n,l)=>{const t=l(1204);const i=t.Router();i.get("/",((e,n)=>{n.status(200).send({message:"Empty echo."})})).post("/",((e,n)=>{console.log("echo:post",JSON.stringify(e.body,undefined,2));const l=e.body.message??"No message.";n.status(200).send({message:l})}));e.exports=i},1266:(e,n,l)=>{const t=l(1204);const{dbJobAnvilSyncShared:i,dbQuery:a,dbSubRefreshTimestamp:u,dbWrite:o}=l(9274);const s=l(8173);const c=l(6876);const p=l(2415);const d=t.Router();d.delete("/:fileUUID",((e,n)=>{const{fileUUID:l}=e.params;const t="DELETED";const[[s]]=a(`SELECT file_type FROM files WHERE file_uuid = '${l}';`).stdout;if(s!==t){o(`UPDATE files\n SET\n file_type = '${t}',\n modified_date = '${u()}'\n WHERE file_uuid = '${l}';`).stdout;i("purge",`file_uuid=${l}`,"0136","0137",{jobHostUUID:"all"})}n.status(204).send()})).get("/",s).get("/:fileUUID",c).post("/",p.single("file"),(({file:e,body:n},l)=>{console.log("Receiving shared file.");if(e){console.log(`file: ${JSON.stringify(e,null,2)}`);console.log(`body: ${JSON.stringify(n,null,2)}`);i("move_incoming",`file=${e.path}`,"0132","0133");l.status(200).send()}})).put("/:fileUUID",((e,n)=>{console.log("Begin edit single file.");console.dir(e.body);const{fileUUID:l}=e.params;const{fileName:t,fileLocations:s,fileType:c}=e.body;const p=[];let d="";if(t){const[[e]]=a(`SELECT file_name FROM files WHERE file_uuid = '${l}';`).stdout;console.log(`oldFileName=[${e}],newFileName=[${t}]`);if(t!==e){d+=`\n UPDATE files\n SET\n file_name = '${t}',\n modified_date = '${u()}'\n WHERE file_uuid = '${l}';`;p.push((()=>i("rename",`file_uuid=${l}\nold_name=${e}\nnew_name=${t}`,"0138","0139",{jobHostUUID:"all"})))}}if(c){d+=`\n UPDATE files\n SET\n file_type = '${c}',\n modified_date = '${u()}'\n WHERE file_uuid = '${l}';`;p.push((()=>i("check_mode",`file_uuid=${l}`,"0143","0144",{jobHostUUID:"all"})))}if(s){s.forEach((({fileLocationUUID:e,isFileLocationActive:n})=>{let t=0;let o="purge";let s="0136";let c="0137";if(n){t=1;o="pull_file";s="0132";c="0133"}d+=`\n UPDATE file_locations\n SET\n file_location_active = '${t}',\n modified_date = '${u()}'\n WHERE file_location_uuid = '${e}';`;const f=a(`SELECT\n anv.anvil_node1_host_uuid,\n anv.anvil_node2_host_uuid,\n anv.anvil_dr1_host_uuid\n FROM anvils AS anv\n JOIN file_locations AS fil_loc\n ON anv.anvil_uuid = fil_loc.file_location_anvil_uuid\n WHERE fil_loc.file_location_uuid = '${e}';`).stdout;f.flat().forEach((e=>{if(e){p.push((()=>i(o,`file_uuid=${l}`,s,c,{jobHostUUID:e})))}}))}))}console.log(`Query (type=[${typeof d}]): [${d}]`);let f;try{({st
|