express-sweet 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +724 -705
- package/dist/build.cjs +1 -1
- package/dist/build.mjs +1 -1
- package/package.json +1 -1
package/dist/build.cjs
CHANGED
|
@@ -71,7 +71,7 @@ object-assign
|
|
|
71
71
|
* Copyright(c) 2014 Jonathan Ong
|
|
72
72
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
73
73
|
* MIT Licensed
|
|
74
|
-
*/morgan$2.exports=morgan,morgan$2.exports.compile=compile,morgan$2.exports.format=format,morgan$2.exports.token=token;var auth=basicAuthExports,debug=srcExports("morgan"),deprecate$1=depd_1$1("morgan"),onFinished=onFinishedExports,onHeaders=onHeaders_1,CLF_MONTH=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DEFAULT_BUFFER_DURATION=1e3;function morgan(e,t){var r=e,s=t||{};e&&"object"==typeof e&&(r=(s=e).format||"default",deprecate$1("morgan(options): use morgan("+("string"==typeof r?JSON.stringify(r):"format")+", options) instead")),void 0===r&&deprecate$1("undefined format: specify a format");var n=s.immediate,i=s.skip||!1,o="function"!=typeof r?getFormatFunction(r):r,a=s.buffer,c=s.stream||process.stdout;a&&(deprecate$1("buffer option"),c=createBufferStream(c,"number"!=typeof a?DEFAULT_BUFFER_DURATION:a));return function(e,t,r){function s(){if(!1!==i&&i(e,t))debug("skip request");else{var r=o(morgan,e,t);null!=r?(debug("log request"),c.write(r+"\n")):debug("skip line")}}e._startAt=void 0,e._startTime=void 0,e._remoteAddress=getip(e),t._startAt=void 0,t._startTime=void 0,recordStartTime.call(e),n?s():(onHeaders(t,recordStartTime),onFinished(t,s)),r()}}function clfdate(e){var t=e.getUTCDate(),r=e.getUTCHours(),s=e.getUTCMinutes(),n=e.getUTCSeconds(),i=e.getUTCFullYear(),o=CLF_MONTH[e.getUTCMonth()];return pad2(t)+"/"+o+"/"+i+":"+pad2(r)+":"+pad2(s)+":"+pad2(n)+" +0000"}function compile(e){if("string"!=typeof e)throw new TypeError("argument format must be a string");var t=' "use strict"\n return '+String(JSON.stringify(e)).replace(/:([-\w]{2,})(?:\[([^\]]+)\])?/g,(function(e,t,r){var s="req, res",n="tokens["+String(JSON.stringify(t))+"]";return void 0!==r&&(s+=", "+String(JSON.stringify(r))),'" +\n ('+n+"("+s+') || "-") + "'}));return new Function("tokens, req, res",t)}function createBufferStream(e,t){var r=[],s=null;function n(){s=null,e.write(r.join("")),r.length=0}return{write:function(e){null===s&&(s=setTimeout(n,t)),r.push(e)}}}function format(e,t){return morgan[e]=t,this}function getFormatFunction(e){var t=morgan[e]||e||morgan.default;return"function"!=typeof t?compile(t):t}function getip(e){return e.ip||e._remoteAddress||e.connection&&e.connection.remoteAddress||void 0}function headersSent(e){return"boolean"!=typeof e.headersSent?Boolean(e._header):e.headersSent}function pad2(e){var t=String(e);return(1===t.length?"0":"")+t}function recordStartTime(){this._startAt=process.hrtime(),this._startTime=new Date}function token(e,t){return morgan[e]=t,this}morgan.format("combined",':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'),morgan.format("common",':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length]'),morgan.format("default",':remote-addr - :remote-user [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'),deprecate$1.property(morgan,"default","default format: use combined format"),morgan.format("short",":remote-addr :remote-user :method :url HTTP/:http-version :status :res[content-length] - :response-time ms"),morgan.format("tiny",":method :url :status :res[content-length] - :response-time ms"),morgan.format("dev",(function e(t,r,s){var n=headersSent(s)?s.statusCode:void 0,i=n>=500?31:n>=400?33:n>=300?36:n>=200?32:0,o=e[i];return o||(o=e[i]=compile("[0m:method :url ["+i+"m:status[0m :response-time ms - :res[content-length][0m")),o(t,r,s)})),morgan.token("url",(function(e){return e.originalUrl||e.url})),morgan.token("method",(function(e){return e.method})),morgan.token("response-time",(function(e,t,r){if(e._startAt&&t._startAt)return(1e3*(t._startAt[0]-e._startAt[0])+1e-6*(t._startAt[1]-e._startAt[1])).toFixed(void 0===r?3:r)})),morgan.token("total-time",(function(e,t,r){if(e._startAt&&t._startAt){var s=process.hrtime(e._startAt);return(1e3*s[0]+1e-6*s[1]).toFixed(void 0===r?3:r)}})),morgan.token("date",(function(e,t,r){var s=new Date;switch(r||"web"){case"clf":return clfdate(s);case"iso":return s.toISOString();case"web":return s.toUTCString()}})),morgan.token("status",(function(e,t){return headersSent(t)?String(t.statusCode):void 0})),morgan.token("referrer",(function(e){return e.headers.referer||e.headers.referrer})),morgan.token("remote-addr",getip),morgan.token("remote-user",(function(e){var t=auth(e);return t?t.name:void 0})),morgan.token("http-version",(function(e){return e.httpVersionMajor+"."+e.httpVersionMinor})),morgan.token("user-agent",(function(e){return e.headers["user-agent"]})),morgan.token("req",(function(e,t,r){var s=e.headers[r.toLowerCase()];return Array.isArray(s)?s.join(", "):s})),morgan.token("res",(function(e,t,r){if(headersSent(t)){var s=t.getHeader(r);return Array.isArray(s)?s.join(", "):s}}));var morganExports=morgan$2.exports,morgan$1=getDefaultExportFromCjs(morganExports);class Http{static async mount(e){const t=await loadBasicConfig(),r=await loadLoggingConfig();e.use(morgan$1(r.format,{skip:r.skip})),e.use(express.json({limit:t.max_body_size})),e.use(express.urlencoded({extended:!0,limit:t.max_body_size}));const s=multer$1({limits:{fieldSize:1/0}});e.use(s.array("files")),e.use(cookieParser$1());const n=path$5.join(process.cwd(),"public");e.use(express.static(n))}}class CORS{static async mount(e){(await loadBasicConfig()).cors_enabled&&e.use(((e,t,r)=>{t.header("Access-Control-Allow-Origin",e.headers.origin),t.header("Access-Control-Allow-Headers","X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept"),t.header("Access-Control-Allow-Methods","GET, POST, PUT, DELETE"),t.header("Access-Control-Allow-Credentials","true"),r()}))}}class Local{static async mount(e){const t=await loadBasicConfig();e.use(((r,s,n)=>{if(e.locals.currentPath=new URL(`${r.protocol}://${r.get("host")}${r.originalUrl}`).pathname,r.headers.referer){const t=new URL(r.headers.referer);e.locals.baseUrl=t.origin}else e.locals.baseUrl="x-forwarded-proto"in r.headers?`${r.headers["x-forwarded-proto"]}://${r.headers.host}`:`//${r.headers.host}`;t.rewrite_base_url&&(e.locals.baseUrl=t.rewrite_base_url(e.locals.baseUrl)),n()}))}}var lib$3={exports:{}},pause$1=function(e){var t,r,s=[];return e.on("data",t=function(e,t){s.push(["data",e,t])}),e.on("end",r=function(e,t){s.push(["end",e,t])}),{end:function(){e.removeListener("data",t),e.removeListener("end",r)},resume:function(){this.end();for(var t=0,r=s.length;t<r;++t)e.emit.apply(e,s[t])}}},lib$2={exports:{}};function Strategy$2(){}Strategy$2.prototype.authenticate=function(e,t){throw new Error("Strategy#authenticate must be overridden by subclass")};var strategy$1=Strategy$2;!function(e,t){var r=strategy$1;(e.exports=r).Strategy=r}(lib$2,lib$2.exports);var libExports$3=lib$2.exports,pause=pause$1,util$3=require$$1$1,Strategy$1=libExports$3;function SessionStrategy$1(e,t){"function"==typeof e&&(t=e,e=void 0),e=e||{},Strategy$1.call(this),this.name="session",this._key=e.key||"passport",this._deserializeUser=t}util$3.inherits(SessionStrategy$1,Strategy$1),SessionStrategy$1.prototype.authenticate=function(e,t){if(!e.session)return this.error(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?"));t=t||{};var r,s=this;if(e.session[this._key]&&(r=e.session[this._key].user),r||0===r){var n=t.pauseStream?pause(e):null;this._deserializeUser(r,e,(function(t,r){if(t)return s.error(t);if(r){var i=e._userProperty||"user";e[i]=r}else delete e.session[s._key].user;s.pass(),n&&n.resume()}))}else s.pass()};var session$2=SessionStrategy$1,utilsMerge={exports:{}};utilsMerge.exports=function(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e};var utilsMergeExports=utilsMerge.exports,merge=utilsMergeExports;function SessionManager$1(e,t){"function"==typeof e&&(t=e,e=void 0),e=e||{},this._key=e.key||"passport",this._serializeUser=t}SessionManager$1.prototype.logIn=function(e,t,r,s){if("function"==typeof r&&(s=r,r={}),r=r||{},!e.session)return s(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?"));var n=this,i=e.session;e.session.regenerate((function(o){if(o)return s(o);n._serializeUser(t,e,(function(t,o){if(t)return s(t);r.keepSessionInfo&&merge(e.session,i),e.session[n._key]||(e.session[n._key]={}),e.session[n._key].user=o,e.session.save((function(e){if(e)return s(e);s()}))}))}))},SessionManager$1.prototype.logOut=function(e,t,r){if("function"==typeof t&&(r=t,t={}),t=t||{},!e.session)return r(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?"));e.session[this._key]&&delete e.session[this._key].user;var s=e.session;e.session.save((function(n){if(n)return r(n);e.session.regenerate((function(n){if(n)return r(n);t.keepSessionInfo&&merge(e.session,s),r()}))}))};var sessionmanager=SessionManager$1,connect={exports:{}},request={exports:{}},hasRequiredRequest,initialize,hasRequiredInitialize,authenticationerror,hasRequiredAuthenticationerror,authenticate,hasRequiredAuthenticate,hasRequiredConnect;function requireRequest(){return hasRequiredRequest||(hasRequiredRequest=1,(e=request.exports={}).login=e.logIn=function(e,t,r){"function"==typeof t&&(r=t,t={}),t=t||{};var s=this._userProperty||"user",n=void 0===t.session||t.session;if(this[s]=e,n&&this._sessionManager){if("function"!=typeof r)throw new Error("req#login requires a callback function");var i=this;this._sessionManager.logIn(this,e,t,(function(e){if(e)return i[s]=null,r(e);r()}))}else r&&r()},e.logout=e.logOut=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},this[this._userProperty||"user"]=null,this._sessionManager){if("function"!=typeof t)throw new Error("req#logout requires a callback function");this._sessionManager.logOut(this,e,t)}else t&&t()},e.isAuthenticated=function(){return!!this[this._userProperty||"user"]},e.isUnauthenticated=function(){return!this.isAuthenticated()}),request.exports;var e}function requireInitialize(){if(hasRequiredInitialize)return initialize;hasRequiredInitialize=1;var e=requireRequest();return initialize=function(t,r){return r=r||{},function(s,n,i){s.login=s.logIn=s.logIn||e.logIn,s.logout=s.logOut=s.logOut||e.logOut,s.isAuthenticated=s.isAuthenticated||e.isAuthenticated,s.isUnauthenticated=s.isUnauthenticated||e.isUnauthenticated,s._sessionManager=t._sm,r.userProperty&&(s._userProperty=r.userProperty),(void 0===r.compat||r.compat)&&(t._userProperty=r.userProperty||"user",s._passport={},s._passport.instance=t),i()}},initialize}function requireAuthenticationerror(){if(hasRequiredAuthenticationerror)return authenticationerror;function e(e,t){Error.call(this),Error.captureStackTrace(this,arguments.callee),this.name="AuthenticationError",this.message=e,this.status=t||401}return hasRequiredAuthenticationerror=1,e.prototype.__proto__=Error.prototype,authenticationerror=e}function requireAuthenticate(){if(hasRequiredAuthenticate)return authenticate;hasRequiredAuthenticate=1;var e=require$$0$a,t=requireRequest(),r=requireAuthenticationerror();return authenticate=function(s,n,i,o){"function"==typeof i&&(o=i,i={}),i=i||{};var a=!0;return Array.isArray(n)||(n=[n],a=!1),function(c,u,l){c.login=c.logIn=c.logIn||t.logIn,c.logout=c.logOut=c.logOut||t.logOut,c.isAuthenticated=c.isAuthenticated||t.isAuthenticated,c.isUnauthenticated=c.isUnauthenticated||t.isUnauthenticated,c._sessionManager=s._sm;var p=[];!function t(d){var h,m,f=n[d];if(!f)return function(){if(o){if(a){var t=p.map((function(e){return e.challenge})),s=p.map((function(e){return e.status}));return o(null,!1,t,s)}return o(null,!1,p[0].challenge,p[0].status)}var n,d=p[0]||{},h=d.challenge||{};if(i.failureFlash){var m=i.failureFlash;"string"==typeof m&&(m={type:"error",message:m}),m.type=m.type||"error";var f=m.type||h.type||"error";"string"==typeof(n=m.message||h.message||h)&&c.flash(f,n)}if(i.failureMessage&&("boolean"==typeof(n=i.failureMessage)&&(n=h.message||h),"string"==typeof n&&(c.session.messages=c.session.messages||[],c.session.messages.push(n))),i.failureRedirect)return u.redirect(i.failureRedirect);for(var _,E,g=[],S=0,R=p.length;S<R;S++)h=(d=p[S]).challenge,E=d.status,_=_||E,"string"==typeof h&&g.push(h);if(u.statusCode=_||401,401==u.statusCode&&g.length&&u.setHeader("WWW-Authenticate",g),i.failWithError)return l(new r(e.STATUS_CODES[u.statusCode],_));u.end(e.STATUS_CODES[u.statusCode])}();if("function"==typeof f.authenticate)h=f;else{if(!(m=s._strategy(f)))return l(new Error('Unknown authentication strategy "'+f+'"'));h=Object.create(m)}h.success=function(e,t){if(o)return o(null,e,t);var r;if(t=t||{},i.successFlash){var n=i.successFlash;"string"==typeof n&&(n={type:"success",message:n}),n.type=n.type||"success";var a=n.type||t.type||"success";"string"==typeof(r=n.message||t.message||t)&&c.flash(a,r)}if(i.successMessage&&("boolean"==typeof(r=i.successMessage)&&(r=t.message||t),"string"==typeof r&&(c.session.messages=c.session.messages||[],c.session.messages.push(r))),i.assignProperty)return c[i.assignProperty]=e,void(!1!==i.authInfo?s.transformAuthInfo(t,c,(function(e,t){if(e)return l(e);c.authInfo=t,l()})):l());c.logIn(e,i,(function(e){if(e)return l(e);function r(){if(i.successReturnToOrRedirect){var e=i.successReturnToOrRedirect;return c.session&&c.session.returnTo&&(e=c.session.returnTo,delete c.session.returnTo),u.redirect(e)}if(i.successRedirect)return u.redirect(i.successRedirect);l()}!1!==i.authInfo?s.transformAuthInfo(t,c,(function(e,t){if(e)return l(e);c.authInfo=t,r()})):r()}))},h.fail=function(e,r){"number"==typeof e&&(r=e,e=void 0),p.push({challenge:e,status:r}),t(d+1)},h.redirect=function(e,t){u.statusCode=t||302,u.setHeader("Location",e),u.setHeader("Content-Length","0"),u.end()},h.pass=function(){l()},h.error=function(e){if(o)return o(e);l(e)},h.authenticate(c,i)}(0)}},authenticate}function requireConnect(){return hasRequiredConnect||(hasRequiredConnect=1,function(e){var t=requireInitialize(),r=requireAuthenticate();e.exports=function(){return{initialize:t,authenticate:r}}}(connect)),connect.exports}var SessionStrategy=session$2,SessionManager=sessionmanager;function Authenticator(){this._key="passport",this._strategies={},this._serializers=[],this._deserializers=[],this._infoTransformers=[],this._framework=null,this.init()}Authenticator.prototype.init=function(){this.framework(requireConnect()()),this.use(new SessionStrategy({key:this._key},this.deserializeUser.bind(this))),this._sm=new SessionManager({key:this._key},this.serializeUser.bind(this))},Authenticator.prototype.use=function(e,t){if(t||(e=(t=e).name),!e)throw new Error("Authentication strategies must have a name");return this._strategies[e]=t,this},Authenticator.prototype.unuse=function(e){return delete this._strategies[e],this},Authenticator.prototype.framework=function(e){return this._framework=e,this},Authenticator.prototype.initialize=function(e){return e=e||{},this._framework.initialize(this,e)},Authenticator.prototype.authenticate=function(e,t,r){return this._framework.authenticate(this,e,t,r)},Authenticator.prototype.authorize=function(e,t,r){return(t=t||{}).assignProperty="account",(this._framework.authorize||this._framework.authenticate)(this,e,t,r)},Authenticator.prototype.session=function(e){return this.authenticate("session",e)},Authenticator.prototype.serializeUser=function(e,t,r){if("function"==typeof e)return this._serializers.push(e);var s=e;"function"==typeof t&&(r=t,t=void 0);var n=this._serializers;!function e(i,o,a){if("pass"===o&&(o=void 0),o||a||0===a)return r(o,a);var c=n[i];if(!c)return r(new Error("Failed to serialize user into session"));function u(t,r){e(i+1,t,r)}try{3==c.length?c(t,s,u):c(s,u)}catch(e){return r(e)}}(0)},Authenticator.prototype.deserializeUser=function(e,t,r){if("function"==typeof e)return this._deserializers.push(e);var s=e;"function"==typeof t&&(r=t,t=void 0);var n=this._deserializers;!function e(i,o,a){if("pass"===o&&(o=void 0),o||a)return r(o,a);if(null===a||!1===a)return r(null,!1);var c=n[i];if(!c)return r(new Error("Failed to deserialize user out of session"));function u(t,r){e(i+1,t,r)}try{3==c.length?c(t,s,u):c(s,u)}catch(e){return r(e)}}(0)},Authenticator.prototype.transformAuthInfo=function(e,t,r){if("function"==typeof e)return this._infoTransformers.push(e);var s=e;"function"==typeof t&&(r=t,t=void 0);var n=this._infoTransformers;!function e(i,o,a){if("pass"===o&&(o=void 0),o||a)return r(o,a);var c=n[i];if(!c)return r(null,s);function u(t,r){e(i+1,t,r)}try{var l=c.length;if(1==l)u(null,c(s));else 3==l?c(t,s,u):c(s,u)}catch(e){return r(e)}}(0)},Authenticator.prototype._strategy=function(e){return this._strategies[e]};var authenticator=Authenticator;!function(e,t){var r=authenticator,s=session$2;(t=e.exports=new r).Passport=t.Authenticator=r,t.Strategy=libExports$3,t.strategies={},t.strategies.SessionStrategy=s}(lib$3,lib$3.exports);var libExports$2=lib$3.exports,passport$1=getDefaultExportFromCjs(libExports$2),lib$1={exports:{}},utils$2={lookup:function(e,t){if(!e)return null;for(var r=t.split("]").join("").split("["),s=0,n=r.length;s<n;s++){var i=e[r[s]];if(void 0===i)return null;if("object"!=typeof i)return i;e=i}return null}},passport=libExports$3,util$2=require$$1$1,lookup$1=utils$2.lookup;function Strategy(e,t){if("function"==typeof e&&(t=e,e={}),!t)throw new TypeError("LocalStrategy requires a verify callback");this._usernameField=e.usernameField||"username",this._passwordField=e.passwordField||"password",passport.Strategy.call(this),this.name="local",this._verify=t,this._passReqToCallback=e.passReqToCallback}util$2.inherits(Strategy,passport.Strategy),Strategy.prototype.authenticate=function(e,t){t=t||{};var r=lookup$1(e.body,this._usernameField)||lookup$1(e.query,this._usernameField),s=lookup$1(e.body,this._passwordField)||lookup$1(e.query,this._passwordField);if(!r||!s)return this.fail({message:t.badRequestMessage||"Missing credentials"},400);var n=this;function i(e,t,r){return e?n.error(e):t?void n.success(t,r):n.fail(r)}try{n._passReqToCallback?this._verify(e,r,s,i):this._verify(r,s,i)}catch(e){return n.error(e)}};var strategy=Strategy;!function(e,t){var r=strategy;(e.exports=r).Strategy=r}(lib$1,lib$1.exports);var libExports$1=lib$1.exports,expressSession={exports:{}},parseurl$1={exports:{}},url=require$$0$b,parse=url.parse,Url=url.Url;function parseurl(e){var t=e.url;if(void 0!==t){var r=e._parsedUrl;return fresh(t,r)?r:((r=fastparse(t))._raw=t,e._parsedUrl=r)}}function originalurl(e){var t=e.originalUrl;if("string"!=typeof t)return parseurl(e);var r=e._parsedOriginalUrl;return fresh(t,r)?r:((r=fastparse(t))._raw=t,e._parsedOriginalUrl=r)}function fastparse(e){if("string"!=typeof e||47!==e.charCodeAt(0))return parse(e);for(var t=e,r=null,s=null,n=1;n<e.length;n++)switch(e.charCodeAt(n)){case 63:null===s&&(t=e.substring(0,n),r=e.substring(n+1),s=e.substring(n));break;case 9:case 10:case 12:case 13:case 32:case 35:case 160:case 65279:return parse(e)}var i=void 0!==Url?new Url:{};return i.path=e,i.href=e,i.pathname=t,null!==s&&(i.query=r,i.search=s),i}function fresh(e,t){return"object"==typeof t&&null!==t&&(void 0===Url||t instanceof Url)&&t._raw===e}parseurl$1.exports=parseurl,parseurl$1.exports.original=originalurl;var parseurlExports=parseurl$1.exports,cookieSignature={};!function(e){var t=require$$0$6;function r(e){return t.createHash("sha1").update(e).digest("hex")}e.sign=function(e,r){if("string"!=typeof e)throw new TypeError("Cookie value must be provided as a string.");if(null==r)throw new TypeError("Secret key must be provided.");return e+"."+t.createHmac("sha256",r).update(e).digest("base64").replace(/\=+$/,"")},e.unsign=function(t,s){if("string"!=typeof t)throw new TypeError("Signed cookie string must be provided.");if(null==s)throw new TypeError("Secret key must be provided.");var n=t.slice(0,t.lastIndexOf("."));return r(e.sign(n,s))==r(t)&&n}}(cookieSignature);var uidSafe={exports:{}},randomBytes$2={exports:{}},crypto=require$$0$6,generateAttempts=crypto.randomBytes===crypto.pseudoRandomBytes?1:3;function randomBytes$1(e,t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("argument callback must be a function");if(!t&&!commonjsGlobal.Promise)throw new TypeError("argument callback is required");return t?generateRandomBytes(e,generateAttempts,t):new Promise((function(t,r){generateRandomBytes(e,generateAttempts,(function(e,s){if(e)return r(e);t(s)}))}))}function randomBytesSync(e){for(var t=null,r=0;r<generateAttempts;r++)try{return crypto.randomBytes(e)}catch(e){t=e}throw t}function generateRandomBytes(e,t,r){crypto.randomBytes(e,(function(s,n){return s?--t?void setTimeout(generateRandomBytes.bind(null,e,t,r),10):r(s):r(null,n)}))}randomBytes$2.exports=randomBytes$1,randomBytes$2.exports.sync=randomBytesSync;var randomBytesExports=randomBytes$2.exports,randomBytes=randomBytesExports,EQUAL_END_REGEXP=/=+$/,PLUS_GLOBAL_REGEXP=/\+/g,SLASH_GLOBAL_REGEXP=/\//g;
|
|
74
|
+
*/morgan$2.exports=morgan,morgan$2.exports.compile=compile,morgan$2.exports.format=format,morgan$2.exports.token=token;var auth=basicAuthExports,debug=srcExports("morgan"),deprecate$1=depd_1$1("morgan"),onFinished=onFinishedExports,onHeaders=onHeaders_1,CLF_MONTH=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DEFAULT_BUFFER_DURATION=1e3;function morgan(e,t){var r=e,s=t||{};e&&"object"==typeof e&&(r=(s=e).format||"default",deprecate$1("morgan(options): use morgan("+("string"==typeof r?JSON.stringify(r):"format")+", options) instead")),void 0===r&&deprecate$1("undefined format: specify a format");var n=s.immediate,i=s.skip||!1,o="function"!=typeof r?getFormatFunction(r):r,a=s.buffer,c=s.stream||process.stdout;a&&(deprecate$1("buffer option"),c=createBufferStream(c,"number"!=typeof a?DEFAULT_BUFFER_DURATION:a));return function(e,t,r){function s(){if(!1!==i&&i(e,t))debug("skip request");else{var r=o(morgan,e,t);null!=r?(debug("log request"),c.write(r+"\n")):debug("skip line")}}e._startAt=void 0,e._startTime=void 0,e._remoteAddress=getip(e),t._startAt=void 0,t._startTime=void 0,recordStartTime.call(e),n?s():(onHeaders(t,recordStartTime),onFinished(t,s)),r()}}function clfdate(e){var t=e.getUTCDate(),r=e.getUTCHours(),s=e.getUTCMinutes(),n=e.getUTCSeconds(),i=e.getUTCFullYear(),o=CLF_MONTH[e.getUTCMonth()];return pad2(t)+"/"+o+"/"+i+":"+pad2(r)+":"+pad2(s)+":"+pad2(n)+" +0000"}function compile(e){if("string"!=typeof e)throw new TypeError("argument format must be a string");var t=' "use strict"\n return '+String(JSON.stringify(e)).replace(/:([-\w]{2,})(?:\[([^\]]+)\])?/g,(function(e,t,r){var s="req, res",n="tokens["+String(JSON.stringify(t))+"]";return void 0!==r&&(s+=", "+String(JSON.stringify(r))),'" +\n ('+n+"("+s+') || "-") + "'}));return new Function("tokens, req, res",t)}function createBufferStream(e,t){var r=[],s=null;function n(){s=null,e.write(r.join("")),r.length=0}return{write:function(e){null===s&&(s=setTimeout(n,t)),r.push(e)}}}function format(e,t){return morgan[e]=t,this}function getFormatFunction(e){var t=morgan[e]||e||morgan.default;return"function"!=typeof t?compile(t):t}function getip(e){return e.ip||e._remoteAddress||e.connection&&e.connection.remoteAddress||void 0}function headersSent(e){return"boolean"!=typeof e.headersSent?Boolean(e._header):e.headersSent}function pad2(e){var t=String(e);return(1===t.length?"0":"")+t}function recordStartTime(){this._startAt=process.hrtime(),this._startTime=new Date}function token(e,t){return morgan[e]=t,this}morgan.format("combined",':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'),morgan.format("common",':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length]'),morgan.format("default",':remote-addr - :remote-user [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'),deprecate$1.property(morgan,"default","default format: use combined format"),morgan.format("short",":remote-addr :remote-user :method :url HTTP/:http-version :status :res[content-length] - :response-time ms"),morgan.format("tiny",":method :url :status :res[content-length] - :response-time ms"),morgan.format("dev",(function e(t,r,s){var n=headersSent(s)?s.statusCode:void 0,i=n>=500?31:n>=400?33:n>=300?36:n>=200?32:0,o=e[i];return o||(o=e[i]=compile("[0m:method :url ["+i+"m:status[0m :response-time ms - :res[content-length][0m")),o(t,r,s)})),morgan.token("url",(function(e){return e.originalUrl||e.url})),morgan.token("method",(function(e){return e.method})),morgan.token("response-time",(function(e,t,r){if(e._startAt&&t._startAt)return(1e3*(t._startAt[0]-e._startAt[0])+1e-6*(t._startAt[1]-e._startAt[1])).toFixed(void 0===r?3:r)})),morgan.token("total-time",(function(e,t,r){if(e._startAt&&t._startAt){var s=process.hrtime(e._startAt);return(1e3*s[0]+1e-6*s[1]).toFixed(void 0===r?3:r)}})),morgan.token("date",(function(e,t,r){var s=new Date;switch(r||"web"){case"clf":return clfdate(s);case"iso":return s.toISOString();case"web":return s.toUTCString()}})),morgan.token("status",(function(e,t){return headersSent(t)?String(t.statusCode):void 0})),morgan.token("referrer",(function(e){return e.headers.referer||e.headers.referrer})),morgan.token("remote-addr",getip),morgan.token("remote-user",(function(e){var t=auth(e);return t?t.name:void 0})),morgan.token("http-version",(function(e){return e.httpVersionMajor+"."+e.httpVersionMinor})),morgan.token("user-agent",(function(e){return e.headers["user-agent"]})),morgan.token("req",(function(e,t,r){var s=e.headers[r.toLowerCase()];return Array.isArray(s)?s.join(", "):s})),morgan.token("res",(function(e,t,r){if(headersSent(t)){var s=t.getHeader(r);return Array.isArray(s)?s.join(", "):s}}));var morganExports=morgan$2.exports,morgan$1=getDefaultExportFromCjs(morganExports);class Http{static async mount(e){const t=await loadBasicConfig(),r=await loadLoggingConfig();e.use(morgan$1(r.format,{skip:r.skip})),e.use(express.json({limit:t.max_body_size})),e.use(express.urlencoded({extended:!0,limit:t.max_body_size}));const s=multer$1({limits:{fieldSize:1/0}});e.use(s.array("files")),e.use(cookieParser$1());const n=path$5.join(process.cwd(),"public");e.use(express.static(n))}}class CORS{static async mount(e){(await loadBasicConfig()).cors_enabled&&e.use(((e,t,r)=>{if(t.header("Access-Control-Allow-Origin",e.headers.origin),t.header("Access-Control-Allow-Headers",["X-Requested-With","X-HTTP-Method-Override","Content-Type","Accept","Authorization","Cache-Control","If-None-Match","If-Modified-Since","Range","X-CSRF-Token"].join(", ")),t.header("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),t.header("Access-Control-Allow-Credentials","true"),"OPTIONS"===e.method)return t.status(200).end();r()}))}}class Local{static async mount(e){const t=await loadBasicConfig();e.use(((r,s,n)=>{if(e.locals.currentPath=new URL(`${r.protocol}://${r.get("host")}${r.originalUrl}`).pathname,r.headers.referer){const t=new URL(r.headers.referer);e.locals.baseUrl=t.origin}else e.locals.baseUrl="x-forwarded-proto"in r.headers?`${r.headers["x-forwarded-proto"]}://${r.headers.host}`:`//${r.headers.host}`;t.rewrite_base_url&&(e.locals.baseUrl=t.rewrite_base_url(e.locals.baseUrl)),n()}))}}var lib$3={exports:{}},pause$1=function(e){var t,r,s=[];return e.on("data",t=function(e,t){s.push(["data",e,t])}),e.on("end",r=function(e,t){s.push(["end",e,t])}),{end:function(){e.removeListener("data",t),e.removeListener("end",r)},resume:function(){this.end();for(var t=0,r=s.length;t<r;++t)e.emit.apply(e,s[t])}}},lib$2={exports:{}};function Strategy$2(){}Strategy$2.prototype.authenticate=function(e,t){throw new Error("Strategy#authenticate must be overridden by subclass")};var strategy$1=Strategy$2;!function(e,t){var r=strategy$1;(e.exports=r).Strategy=r}(lib$2,lib$2.exports);var libExports$3=lib$2.exports,pause=pause$1,util$3=require$$1$1,Strategy$1=libExports$3;function SessionStrategy$1(e,t){"function"==typeof e&&(t=e,e=void 0),e=e||{},Strategy$1.call(this),this.name="session",this._key=e.key||"passport",this._deserializeUser=t}util$3.inherits(SessionStrategy$1,Strategy$1),SessionStrategy$1.prototype.authenticate=function(e,t){if(!e.session)return this.error(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?"));t=t||{};var r,s=this;if(e.session[this._key]&&(r=e.session[this._key].user),r||0===r){var n=t.pauseStream?pause(e):null;this._deserializeUser(r,e,(function(t,r){if(t)return s.error(t);if(r){var i=e._userProperty||"user";e[i]=r}else delete e.session[s._key].user;s.pass(),n&&n.resume()}))}else s.pass()};var session$2=SessionStrategy$1,utilsMerge={exports:{}};utilsMerge.exports=function(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e};var utilsMergeExports=utilsMerge.exports,merge=utilsMergeExports;function SessionManager$1(e,t){"function"==typeof e&&(t=e,e=void 0),e=e||{},this._key=e.key||"passport",this._serializeUser=t}SessionManager$1.prototype.logIn=function(e,t,r,s){if("function"==typeof r&&(s=r,r={}),r=r||{},!e.session)return s(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?"));var n=this,i=e.session;e.session.regenerate((function(o){if(o)return s(o);n._serializeUser(t,e,(function(t,o){if(t)return s(t);r.keepSessionInfo&&merge(e.session,i),e.session[n._key]||(e.session[n._key]={}),e.session[n._key].user=o,e.session.save((function(e){if(e)return s(e);s()}))}))}))},SessionManager$1.prototype.logOut=function(e,t,r){if("function"==typeof t&&(r=t,t={}),t=t||{},!e.session)return r(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?"));e.session[this._key]&&delete e.session[this._key].user;var s=e.session;e.session.save((function(n){if(n)return r(n);e.session.regenerate((function(n){if(n)return r(n);t.keepSessionInfo&&merge(e.session,s),r()}))}))};var sessionmanager=SessionManager$1,connect={exports:{}},request={exports:{}},hasRequiredRequest,initialize,hasRequiredInitialize,authenticationerror,hasRequiredAuthenticationerror,authenticate,hasRequiredAuthenticate,hasRequiredConnect;function requireRequest(){return hasRequiredRequest||(hasRequiredRequest=1,(e=request.exports={}).login=e.logIn=function(e,t,r){"function"==typeof t&&(r=t,t={}),t=t||{};var s=this._userProperty||"user",n=void 0===t.session||t.session;if(this[s]=e,n&&this._sessionManager){if("function"!=typeof r)throw new Error("req#login requires a callback function");var i=this;this._sessionManager.logIn(this,e,t,(function(e){if(e)return i[s]=null,r(e);r()}))}else r&&r()},e.logout=e.logOut=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},this[this._userProperty||"user"]=null,this._sessionManager){if("function"!=typeof t)throw new Error("req#logout requires a callback function");this._sessionManager.logOut(this,e,t)}else t&&t()},e.isAuthenticated=function(){return!!this[this._userProperty||"user"]},e.isUnauthenticated=function(){return!this.isAuthenticated()}),request.exports;var e}function requireInitialize(){if(hasRequiredInitialize)return initialize;hasRequiredInitialize=1;var e=requireRequest();return initialize=function(t,r){return r=r||{},function(s,n,i){s.login=s.logIn=s.logIn||e.logIn,s.logout=s.logOut=s.logOut||e.logOut,s.isAuthenticated=s.isAuthenticated||e.isAuthenticated,s.isUnauthenticated=s.isUnauthenticated||e.isUnauthenticated,s._sessionManager=t._sm,r.userProperty&&(s._userProperty=r.userProperty),(void 0===r.compat||r.compat)&&(t._userProperty=r.userProperty||"user",s._passport={},s._passport.instance=t),i()}},initialize}function requireAuthenticationerror(){if(hasRequiredAuthenticationerror)return authenticationerror;function e(e,t){Error.call(this),Error.captureStackTrace(this,arguments.callee),this.name="AuthenticationError",this.message=e,this.status=t||401}return hasRequiredAuthenticationerror=1,e.prototype.__proto__=Error.prototype,authenticationerror=e}function requireAuthenticate(){if(hasRequiredAuthenticate)return authenticate;hasRequiredAuthenticate=1;var e=require$$0$a,t=requireRequest(),r=requireAuthenticationerror();return authenticate=function(s,n,i,o){"function"==typeof i&&(o=i,i={}),i=i||{};var a=!0;return Array.isArray(n)||(n=[n],a=!1),function(c,u,l){c.login=c.logIn=c.logIn||t.logIn,c.logout=c.logOut=c.logOut||t.logOut,c.isAuthenticated=c.isAuthenticated||t.isAuthenticated,c.isUnauthenticated=c.isUnauthenticated||t.isUnauthenticated,c._sessionManager=s._sm;var p=[];!function t(d){var h,m,f=n[d];if(!f)return function(){if(o){if(a){var t=p.map((function(e){return e.challenge})),s=p.map((function(e){return e.status}));return o(null,!1,t,s)}return o(null,!1,p[0].challenge,p[0].status)}var n,d=p[0]||{},h=d.challenge||{};if(i.failureFlash){var m=i.failureFlash;"string"==typeof m&&(m={type:"error",message:m}),m.type=m.type||"error";var f=m.type||h.type||"error";"string"==typeof(n=m.message||h.message||h)&&c.flash(f,n)}if(i.failureMessage&&("boolean"==typeof(n=i.failureMessage)&&(n=h.message||h),"string"==typeof n&&(c.session.messages=c.session.messages||[],c.session.messages.push(n))),i.failureRedirect)return u.redirect(i.failureRedirect);for(var _,E,g=[],S=0,R=p.length;S<R;S++)h=(d=p[S]).challenge,E=d.status,_=_||E,"string"==typeof h&&g.push(h);if(u.statusCode=_||401,401==u.statusCode&&g.length&&u.setHeader("WWW-Authenticate",g),i.failWithError)return l(new r(e.STATUS_CODES[u.statusCode],_));u.end(e.STATUS_CODES[u.statusCode])}();if("function"==typeof f.authenticate)h=f;else{if(!(m=s._strategy(f)))return l(new Error('Unknown authentication strategy "'+f+'"'));h=Object.create(m)}h.success=function(e,t){if(o)return o(null,e,t);var r;if(t=t||{},i.successFlash){var n=i.successFlash;"string"==typeof n&&(n={type:"success",message:n}),n.type=n.type||"success";var a=n.type||t.type||"success";"string"==typeof(r=n.message||t.message||t)&&c.flash(a,r)}if(i.successMessage&&("boolean"==typeof(r=i.successMessage)&&(r=t.message||t),"string"==typeof r&&(c.session.messages=c.session.messages||[],c.session.messages.push(r))),i.assignProperty)return c[i.assignProperty]=e,void(!1!==i.authInfo?s.transformAuthInfo(t,c,(function(e,t){if(e)return l(e);c.authInfo=t,l()})):l());c.logIn(e,i,(function(e){if(e)return l(e);function r(){if(i.successReturnToOrRedirect){var e=i.successReturnToOrRedirect;return c.session&&c.session.returnTo&&(e=c.session.returnTo,delete c.session.returnTo),u.redirect(e)}if(i.successRedirect)return u.redirect(i.successRedirect);l()}!1!==i.authInfo?s.transformAuthInfo(t,c,(function(e,t){if(e)return l(e);c.authInfo=t,r()})):r()}))},h.fail=function(e,r){"number"==typeof e&&(r=e,e=void 0),p.push({challenge:e,status:r}),t(d+1)},h.redirect=function(e,t){u.statusCode=t||302,u.setHeader("Location",e),u.setHeader("Content-Length","0"),u.end()},h.pass=function(){l()},h.error=function(e){if(o)return o(e);l(e)},h.authenticate(c,i)}(0)}},authenticate}function requireConnect(){return hasRequiredConnect||(hasRequiredConnect=1,function(e){var t=requireInitialize(),r=requireAuthenticate();e.exports=function(){return{initialize:t,authenticate:r}}}(connect)),connect.exports}var SessionStrategy=session$2,SessionManager=sessionmanager;function Authenticator(){this._key="passport",this._strategies={},this._serializers=[],this._deserializers=[],this._infoTransformers=[],this._framework=null,this.init()}Authenticator.prototype.init=function(){this.framework(requireConnect()()),this.use(new SessionStrategy({key:this._key},this.deserializeUser.bind(this))),this._sm=new SessionManager({key:this._key},this.serializeUser.bind(this))},Authenticator.prototype.use=function(e,t){if(t||(e=(t=e).name),!e)throw new Error("Authentication strategies must have a name");return this._strategies[e]=t,this},Authenticator.prototype.unuse=function(e){return delete this._strategies[e],this},Authenticator.prototype.framework=function(e){return this._framework=e,this},Authenticator.prototype.initialize=function(e){return e=e||{},this._framework.initialize(this,e)},Authenticator.prototype.authenticate=function(e,t,r){return this._framework.authenticate(this,e,t,r)},Authenticator.prototype.authorize=function(e,t,r){return(t=t||{}).assignProperty="account",(this._framework.authorize||this._framework.authenticate)(this,e,t,r)},Authenticator.prototype.session=function(e){return this.authenticate("session",e)},Authenticator.prototype.serializeUser=function(e,t,r){if("function"==typeof e)return this._serializers.push(e);var s=e;"function"==typeof t&&(r=t,t=void 0);var n=this._serializers;!function e(i,o,a){if("pass"===o&&(o=void 0),o||a||0===a)return r(o,a);var c=n[i];if(!c)return r(new Error("Failed to serialize user into session"));function u(t,r){e(i+1,t,r)}try{3==c.length?c(t,s,u):c(s,u)}catch(e){return r(e)}}(0)},Authenticator.prototype.deserializeUser=function(e,t,r){if("function"==typeof e)return this._deserializers.push(e);var s=e;"function"==typeof t&&(r=t,t=void 0);var n=this._deserializers;!function e(i,o,a){if("pass"===o&&(o=void 0),o||a)return r(o,a);if(null===a||!1===a)return r(null,!1);var c=n[i];if(!c)return r(new Error("Failed to deserialize user out of session"));function u(t,r){e(i+1,t,r)}try{3==c.length?c(t,s,u):c(s,u)}catch(e){return r(e)}}(0)},Authenticator.prototype.transformAuthInfo=function(e,t,r){if("function"==typeof e)return this._infoTransformers.push(e);var s=e;"function"==typeof t&&(r=t,t=void 0);var n=this._infoTransformers;!function e(i,o,a){if("pass"===o&&(o=void 0),o||a)return r(o,a);var c=n[i];if(!c)return r(null,s);function u(t,r){e(i+1,t,r)}try{var l=c.length;if(1==l)u(null,c(s));else 3==l?c(t,s,u):c(s,u)}catch(e){return r(e)}}(0)},Authenticator.prototype._strategy=function(e){return this._strategies[e]};var authenticator=Authenticator;!function(e,t){var r=authenticator,s=session$2;(t=e.exports=new r).Passport=t.Authenticator=r,t.Strategy=libExports$3,t.strategies={},t.strategies.SessionStrategy=s}(lib$3,lib$3.exports);var libExports$2=lib$3.exports,passport$1=getDefaultExportFromCjs(libExports$2),lib$1={exports:{}},utils$2={lookup:function(e,t){if(!e)return null;for(var r=t.split("]").join("").split("["),s=0,n=r.length;s<n;s++){var i=e[r[s]];if(void 0===i)return null;if("object"!=typeof i)return i;e=i}return null}},passport=libExports$3,util$2=require$$1$1,lookup$1=utils$2.lookup;function Strategy(e,t){if("function"==typeof e&&(t=e,e={}),!t)throw new TypeError("LocalStrategy requires a verify callback");this._usernameField=e.usernameField||"username",this._passwordField=e.passwordField||"password",passport.Strategy.call(this),this.name="local",this._verify=t,this._passReqToCallback=e.passReqToCallback}util$2.inherits(Strategy,passport.Strategy),Strategy.prototype.authenticate=function(e,t){t=t||{};var r=lookup$1(e.body,this._usernameField)||lookup$1(e.query,this._usernameField),s=lookup$1(e.body,this._passwordField)||lookup$1(e.query,this._passwordField);if(!r||!s)return this.fail({message:t.badRequestMessage||"Missing credentials"},400);var n=this;function i(e,t,r){return e?n.error(e):t?void n.success(t,r):n.fail(r)}try{n._passReqToCallback?this._verify(e,r,s,i):this._verify(r,s,i)}catch(e){return n.error(e)}};var strategy=Strategy;!function(e,t){var r=strategy;(e.exports=r).Strategy=r}(lib$1,lib$1.exports);var libExports$1=lib$1.exports,expressSession={exports:{}},parseurl$1={exports:{}},url=require$$0$b,parse=url.parse,Url=url.Url;function parseurl(e){var t=e.url;if(void 0!==t){var r=e._parsedUrl;return fresh(t,r)?r:((r=fastparse(t))._raw=t,e._parsedUrl=r)}}function originalurl(e){var t=e.originalUrl;if("string"!=typeof t)return parseurl(e);var r=e._parsedOriginalUrl;return fresh(t,r)?r:((r=fastparse(t))._raw=t,e._parsedOriginalUrl=r)}function fastparse(e){if("string"!=typeof e||47!==e.charCodeAt(0))return parse(e);for(var t=e,r=null,s=null,n=1;n<e.length;n++)switch(e.charCodeAt(n)){case 63:null===s&&(t=e.substring(0,n),r=e.substring(n+1),s=e.substring(n));break;case 9:case 10:case 12:case 13:case 32:case 35:case 160:case 65279:return parse(e)}var i=void 0!==Url?new Url:{};return i.path=e,i.href=e,i.pathname=t,null!==s&&(i.query=r,i.search=s),i}function fresh(e,t){return"object"==typeof t&&null!==t&&(void 0===Url||t instanceof Url)&&t._raw===e}parseurl$1.exports=parseurl,parseurl$1.exports.original=originalurl;var parseurlExports=parseurl$1.exports,cookieSignature={};!function(e){var t=require$$0$6;function r(e){return t.createHash("sha1").update(e).digest("hex")}e.sign=function(e,r){if("string"!=typeof e)throw new TypeError("Cookie value must be provided as a string.");if(null==r)throw new TypeError("Secret key must be provided.");return e+"."+t.createHmac("sha256",r).update(e).digest("base64").replace(/\=+$/,"")},e.unsign=function(t,s){if("string"!=typeof t)throw new TypeError("Signed cookie string must be provided.");if(null==s)throw new TypeError("Secret key must be provided.");var n=t.slice(0,t.lastIndexOf("."));return r(e.sign(n,s))==r(t)&&n}}(cookieSignature);var uidSafe={exports:{}},randomBytes$2={exports:{}},crypto=require$$0$6,generateAttempts=crypto.randomBytes===crypto.pseudoRandomBytes?1:3;function randomBytes$1(e,t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("argument callback must be a function");if(!t&&!commonjsGlobal.Promise)throw new TypeError("argument callback is required");return t?generateRandomBytes(e,generateAttempts,t):new Promise((function(t,r){generateRandomBytes(e,generateAttempts,(function(e,s){if(e)return r(e);t(s)}))}))}function randomBytesSync(e){for(var t=null,r=0;r<generateAttempts;r++)try{return crypto.randomBytes(e)}catch(e){t=e}throw t}function generateRandomBytes(e,t,r){crypto.randomBytes(e,(function(s,n){return s?--t?void setTimeout(generateRandomBytes.bind(null,e,t,r),10):r(s):r(null,n)}))}randomBytes$2.exports=randomBytes$1,randomBytes$2.exports.sync=randomBytesSync;var randomBytesExports=randomBytes$2.exports,randomBytes=randomBytesExports,EQUAL_END_REGEXP=/=+$/,PLUS_GLOBAL_REGEXP=/\+/g,SLASH_GLOBAL_REGEXP=/\//g;
|
|
75
75
|
/*!
|
|
76
76
|
* uid-safe
|
|
77
77
|
* Copyright(c) 2014 Jonathan Ong
|
package/dist/build.mjs
CHANGED
|
@@ -71,7 +71,7 @@ object-assign
|
|
|
71
71
|
* Copyright(c) 2014 Jonathan Ong
|
|
72
72
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
73
73
|
* MIT Licensed
|
|
74
|
-
*/morgan$2.exports=morgan,morgan$2.exports.compile=compile,morgan$2.exports.format=format,morgan$2.exports.token=token;var auth=basicAuthExports,debug=srcExports("morgan"),deprecate$1=depd_1$1("morgan"),onFinished=onFinishedExports,onHeaders=onHeaders_1,CLF_MONTH=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DEFAULT_BUFFER_DURATION=1e3;function morgan(e,t){var r=e,s=t||{};e&&"object"==typeof e&&(r=(s=e).format||"default",deprecate$1("morgan(options): use morgan("+("string"==typeof r?JSON.stringify(r):"format")+", options) instead")),void 0===r&&deprecate$1("undefined format: specify a format");var n=s.immediate,i=s.skip||!1,o="function"!=typeof r?getFormatFunction(r):r,a=s.buffer,c=s.stream||process.stdout;a&&(deprecate$1("buffer option"),c=createBufferStream(c,"number"!=typeof a?DEFAULT_BUFFER_DURATION:a));return function(e,t,r){function s(){if(!1!==i&&i(e,t))debug("skip request");else{var r=o(morgan,e,t);null!=r?(debug("log request"),c.write(r+"\n")):debug("skip line")}}e._startAt=void 0,e._startTime=void 0,e._remoteAddress=getip(e),t._startAt=void 0,t._startTime=void 0,recordStartTime.call(e),n?s():(onHeaders(t,recordStartTime),onFinished(t,s)),r()}}function clfdate(e){var t=e.getUTCDate(),r=e.getUTCHours(),s=e.getUTCMinutes(),n=e.getUTCSeconds(),i=e.getUTCFullYear(),o=CLF_MONTH[e.getUTCMonth()];return pad2(t)+"/"+o+"/"+i+":"+pad2(r)+":"+pad2(s)+":"+pad2(n)+" +0000"}function compile(e){if("string"!=typeof e)throw new TypeError("argument format must be a string");var t=' "use strict"\n return '+String(JSON.stringify(e)).replace(/:([-\w]{2,})(?:\[([^\]]+)\])?/g,(function(e,t,r){var s="req, res",n="tokens["+String(JSON.stringify(t))+"]";return void 0!==r&&(s+=", "+String(JSON.stringify(r))),'" +\n ('+n+"("+s+') || "-") + "'}));return new Function("tokens, req, res",t)}function createBufferStream(e,t){var r=[],s=null;function n(){s=null,e.write(r.join("")),r.length=0}return{write:function(e){null===s&&(s=setTimeout(n,t)),r.push(e)}}}function format(e,t){return morgan[e]=t,this}function getFormatFunction(e){var t=morgan[e]||e||morgan.default;return"function"!=typeof t?compile(t):t}function getip(e){return e.ip||e._remoteAddress||e.connection&&e.connection.remoteAddress||void 0}function headersSent(e){return"boolean"!=typeof e.headersSent?Boolean(e._header):e.headersSent}function pad2(e){var t=String(e);return(1===t.length?"0":"")+t}function recordStartTime(){this._startAt=process.hrtime(),this._startTime=new Date}function token(e,t){return morgan[e]=t,this}morgan.format("combined",':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'),morgan.format("common",':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length]'),morgan.format("default",':remote-addr - :remote-user [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'),deprecate$1.property(morgan,"default","default format: use combined format"),morgan.format("short",":remote-addr :remote-user :method :url HTTP/:http-version :status :res[content-length] - :response-time ms"),morgan.format("tiny",":method :url :status :res[content-length] - :response-time ms"),morgan.format("dev",(function e(t,r,s){var n=headersSent(s)?s.statusCode:void 0,i=n>=500?31:n>=400?33:n>=300?36:n>=200?32:0,o=e[i];return o||(o=e[i]=compile("[0m:method :url ["+i+"m:status[0m :response-time ms - :res[content-length][0m")),o(t,r,s)})),morgan.token("url",(function(e){return e.originalUrl||e.url})),morgan.token("method",(function(e){return e.method})),morgan.token("response-time",(function(e,t,r){if(e._startAt&&t._startAt)return(1e3*(t._startAt[0]-e._startAt[0])+1e-6*(t._startAt[1]-e._startAt[1])).toFixed(void 0===r?3:r)})),morgan.token("total-time",(function(e,t,r){if(e._startAt&&t._startAt){var s=process.hrtime(e._startAt);return(1e3*s[0]+1e-6*s[1]).toFixed(void 0===r?3:r)}})),morgan.token("date",(function(e,t,r){var s=new Date;switch(r||"web"){case"clf":return clfdate(s);case"iso":return s.toISOString();case"web":return s.toUTCString()}})),morgan.token("status",(function(e,t){return headersSent(t)?String(t.statusCode):void 0})),morgan.token("referrer",(function(e){return e.headers.referer||e.headers.referrer})),morgan.token("remote-addr",getip),morgan.token("remote-user",(function(e){var t=auth(e);return t?t.name:void 0})),morgan.token("http-version",(function(e){return e.httpVersionMajor+"."+e.httpVersionMinor})),morgan.token("user-agent",(function(e){return e.headers["user-agent"]})),morgan.token("req",(function(e,t,r){var s=e.headers[r.toLowerCase()];return Array.isArray(s)?s.join(", "):s})),morgan.token("res",(function(e,t,r){if(headersSent(t)){var s=t.getHeader(r);return Array.isArray(s)?s.join(", "):s}}));var morganExports=morgan$2.exports,morgan$1=getDefaultExportFromCjs(morganExports);class Http{static async mount(e){const t=await loadBasicConfig(),r=await loadLoggingConfig();e.use(morgan$1(r.format,{skip:r.skip})),e.use(express.json({limit:t.max_body_size})),e.use(express.urlencoded({extended:!0,limit:t.max_body_size}));const s=multer$1({limits:{fieldSize:1/0}});e.use(s.array("files")),e.use(cookieParser$1());const n=path$5.join(process.cwd(),"public");e.use(express.static(n))}}class CORS{static async mount(e){(await loadBasicConfig()).cors_enabled&&e.use(((e,t,r)=>{t.header("Access-Control-Allow-Origin",e.headers.origin),t.header("Access-Control-Allow-Headers","X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept"),t.header("Access-Control-Allow-Methods","GET, POST, PUT, DELETE"),t.header("Access-Control-Allow-Credentials","true"),r()}))}}class Local{static async mount(e){const t=await loadBasicConfig();e.use(((r,s,n)=>{if(e.locals.currentPath=new URL(`${r.protocol}://${r.get("host")}${r.originalUrl}`).pathname,r.headers.referer){const t=new URL(r.headers.referer);e.locals.baseUrl=t.origin}else e.locals.baseUrl="x-forwarded-proto"in r.headers?`${r.headers["x-forwarded-proto"]}://${r.headers.host}`:`//${r.headers.host}`;t.rewrite_base_url&&(e.locals.baseUrl=t.rewrite_base_url(e.locals.baseUrl)),n()}))}}var lib$3={exports:{}},pause$1=function(e){var t,r,s=[];return e.on("data",t=function(e,t){s.push(["data",e,t])}),e.on("end",r=function(e,t){s.push(["end",e,t])}),{end:function(){e.removeListener("data",t),e.removeListener("end",r)},resume:function(){this.end();for(var t=0,r=s.length;t<r;++t)e.emit.apply(e,s[t])}}},lib$2={exports:{}};function Strategy$2(){}Strategy$2.prototype.authenticate=function(e,t){throw new Error("Strategy#authenticate must be overridden by subclass")};var strategy$1=Strategy$2;!function(e,t){var r=strategy$1;(e.exports=r).Strategy=r}(lib$2,lib$2.exports);var libExports$3=lib$2.exports,pause=pause$1,util$3=require$$1$1,Strategy$1=libExports$3;function SessionStrategy$1(e,t){"function"==typeof e&&(t=e,e=void 0),e=e||{},Strategy$1.call(this),this.name="session",this._key=e.key||"passport",this._deserializeUser=t}util$3.inherits(SessionStrategy$1,Strategy$1),SessionStrategy$1.prototype.authenticate=function(e,t){if(!e.session)return this.error(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?"));t=t||{};var r,s=this;if(e.session[this._key]&&(r=e.session[this._key].user),r||0===r){var n=t.pauseStream?pause(e):null;this._deserializeUser(r,e,(function(t,r){if(t)return s.error(t);if(r){var i=e._userProperty||"user";e[i]=r}else delete e.session[s._key].user;s.pass(),n&&n.resume()}))}else s.pass()};var session$2=SessionStrategy$1,utilsMerge={exports:{}};utilsMerge.exports=function(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e};var utilsMergeExports=utilsMerge.exports,merge=utilsMergeExports;function SessionManager$1(e,t){"function"==typeof e&&(t=e,e=void 0),e=e||{},this._key=e.key||"passport",this._serializeUser=t}SessionManager$1.prototype.logIn=function(e,t,r,s){if("function"==typeof r&&(s=r,r={}),r=r||{},!e.session)return s(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?"));var n=this,i=e.session;e.session.regenerate((function(o){if(o)return s(o);n._serializeUser(t,e,(function(t,o){if(t)return s(t);r.keepSessionInfo&&merge(e.session,i),e.session[n._key]||(e.session[n._key]={}),e.session[n._key].user=o,e.session.save((function(e){if(e)return s(e);s()}))}))}))},SessionManager$1.prototype.logOut=function(e,t,r){if("function"==typeof t&&(r=t,t={}),t=t||{},!e.session)return r(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?"));e.session[this._key]&&delete e.session[this._key].user;var s=e.session;e.session.save((function(n){if(n)return r(n);e.session.regenerate((function(n){if(n)return r(n);t.keepSessionInfo&&merge(e.session,s),r()}))}))};var sessionmanager=SessionManager$1,connect={exports:{}},request={exports:{}},hasRequiredRequest,initialize,hasRequiredInitialize,authenticationerror,hasRequiredAuthenticationerror,authenticate,hasRequiredAuthenticate,hasRequiredConnect;function requireRequest(){return hasRequiredRequest||(hasRequiredRequest=1,(e=request.exports={}).login=e.logIn=function(e,t,r){"function"==typeof t&&(r=t,t={}),t=t||{};var s=this._userProperty||"user",n=void 0===t.session||t.session;if(this[s]=e,n&&this._sessionManager){if("function"!=typeof r)throw new Error("req#login requires a callback function");var i=this;this._sessionManager.logIn(this,e,t,(function(e){if(e)return i[s]=null,r(e);r()}))}else r&&r()},e.logout=e.logOut=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},this[this._userProperty||"user"]=null,this._sessionManager){if("function"!=typeof t)throw new Error("req#logout requires a callback function");this._sessionManager.logOut(this,e,t)}else t&&t()},e.isAuthenticated=function(){return!!this[this._userProperty||"user"]},e.isUnauthenticated=function(){return!this.isAuthenticated()}),request.exports;var e}function requireInitialize(){if(hasRequiredInitialize)return initialize;hasRequiredInitialize=1;var e=requireRequest();return initialize=function(t,r){return r=r||{},function(s,n,i){s.login=s.logIn=s.logIn||e.logIn,s.logout=s.logOut=s.logOut||e.logOut,s.isAuthenticated=s.isAuthenticated||e.isAuthenticated,s.isUnauthenticated=s.isUnauthenticated||e.isUnauthenticated,s._sessionManager=t._sm,r.userProperty&&(s._userProperty=r.userProperty),(void 0===r.compat||r.compat)&&(t._userProperty=r.userProperty||"user",s._passport={},s._passport.instance=t),i()}},initialize}function requireAuthenticationerror(){if(hasRequiredAuthenticationerror)return authenticationerror;function e(e,t){Error.call(this),Error.captureStackTrace(this,arguments.callee),this.name="AuthenticationError",this.message=e,this.status=t||401}return hasRequiredAuthenticationerror=1,e.prototype.__proto__=Error.prototype,authenticationerror=e}function requireAuthenticate(){if(hasRequiredAuthenticate)return authenticate;hasRequiredAuthenticate=1;var e=require$$0$a,t=requireRequest(),r=requireAuthenticationerror();return authenticate=function(s,n,i,o){"function"==typeof i&&(o=i,i={}),i=i||{};var a=!0;return Array.isArray(n)||(n=[n],a=!1),function(c,u,l){c.login=c.logIn=c.logIn||t.logIn,c.logout=c.logOut=c.logOut||t.logOut,c.isAuthenticated=c.isAuthenticated||t.isAuthenticated,c.isUnauthenticated=c.isUnauthenticated||t.isUnauthenticated,c._sessionManager=s._sm;var p=[];!function t(d){var h,m,f=n[d];if(!f)return function(){if(o){if(a){var t=p.map((function(e){return e.challenge})),s=p.map((function(e){return e.status}));return o(null,!1,t,s)}return o(null,!1,p[0].challenge,p[0].status)}var n,d=p[0]||{},h=d.challenge||{};if(i.failureFlash){var m=i.failureFlash;"string"==typeof m&&(m={type:"error",message:m}),m.type=m.type||"error";var f=m.type||h.type||"error";"string"==typeof(n=m.message||h.message||h)&&c.flash(f,n)}if(i.failureMessage&&("boolean"==typeof(n=i.failureMessage)&&(n=h.message||h),"string"==typeof n&&(c.session.messages=c.session.messages||[],c.session.messages.push(n))),i.failureRedirect)return u.redirect(i.failureRedirect);for(var _,E,g=[],S=0,R=p.length;S<R;S++)h=(d=p[S]).challenge,E=d.status,_=_||E,"string"==typeof h&&g.push(h);if(u.statusCode=_||401,401==u.statusCode&&g.length&&u.setHeader("WWW-Authenticate",g),i.failWithError)return l(new r(e.STATUS_CODES[u.statusCode],_));u.end(e.STATUS_CODES[u.statusCode])}();if("function"==typeof f.authenticate)h=f;else{if(!(m=s._strategy(f)))return l(new Error('Unknown authentication strategy "'+f+'"'));h=Object.create(m)}h.success=function(e,t){if(o)return o(null,e,t);var r;if(t=t||{},i.successFlash){var n=i.successFlash;"string"==typeof n&&(n={type:"success",message:n}),n.type=n.type||"success";var a=n.type||t.type||"success";"string"==typeof(r=n.message||t.message||t)&&c.flash(a,r)}if(i.successMessage&&("boolean"==typeof(r=i.successMessage)&&(r=t.message||t),"string"==typeof r&&(c.session.messages=c.session.messages||[],c.session.messages.push(r))),i.assignProperty)return c[i.assignProperty]=e,void(!1!==i.authInfo?s.transformAuthInfo(t,c,(function(e,t){if(e)return l(e);c.authInfo=t,l()})):l());c.logIn(e,i,(function(e){if(e)return l(e);function r(){if(i.successReturnToOrRedirect){var e=i.successReturnToOrRedirect;return c.session&&c.session.returnTo&&(e=c.session.returnTo,delete c.session.returnTo),u.redirect(e)}if(i.successRedirect)return u.redirect(i.successRedirect);l()}!1!==i.authInfo?s.transformAuthInfo(t,c,(function(e,t){if(e)return l(e);c.authInfo=t,r()})):r()}))},h.fail=function(e,r){"number"==typeof e&&(r=e,e=void 0),p.push({challenge:e,status:r}),t(d+1)},h.redirect=function(e,t){u.statusCode=t||302,u.setHeader("Location",e),u.setHeader("Content-Length","0"),u.end()},h.pass=function(){l()},h.error=function(e){if(o)return o(e);l(e)},h.authenticate(c,i)}(0)}},authenticate}function requireConnect(){return hasRequiredConnect||(hasRequiredConnect=1,function(e){var t=requireInitialize(),r=requireAuthenticate();e.exports=function(){return{initialize:t,authenticate:r}}}(connect)),connect.exports}var SessionStrategy=session$2,SessionManager=sessionmanager;function Authenticator(){this._key="passport",this._strategies={},this._serializers=[],this._deserializers=[],this._infoTransformers=[],this._framework=null,this.init()}Authenticator.prototype.init=function(){this.framework(requireConnect()()),this.use(new SessionStrategy({key:this._key},this.deserializeUser.bind(this))),this._sm=new SessionManager({key:this._key},this.serializeUser.bind(this))},Authenticator.prototype.use=function(e,t){if(t||(e=(t=e).name),!e)throw new Error("Authentication strategies must have a name");return this._strategies[e]=t,this},Authenticator.prototype.unuse=function(e){return delete this._strategies[e],this},Authenticator.prototype.framework=function(e){return this._framework=e,this},Authenticator.prototype.initialize=function(e){return e=e||{},this._framework.initialize(this,e)},Authenticator.prototype.authenticate=function(e,t,r){return this._framework.authenticate(this,e,t,r)},Authenticator.prototype.authorize=function(e,t,r){return(t=t||{}).assignProperty="account",(this._framework.authorize||this._framework.authenticate)(this,e,t,r)},Authenticator.prototype.session=function(e){return this.authenticate("session",e)},Authenticator.prototype.serializeUser=function(e,t,r){if("function"==typeof e)return this._serializers.push(e);var s=e;"function"==typeof t&&(r=t,t=void 0);var n=this._serializers;!function e(i,o,a){if("pass"===o&&(o=void 0),o||a||0===a)return r(o,a);var c=n[i];if(!c)return r(new Error("Failed to serialize user into session"));function u(t,r){e(i+1,t,r)}try{3==c.length?c(t,s,u):c(s,u)}catch(e){return r(e)}}(0)},Authenticator.prototype.deserializeUser=function(e,t,r){if("function"==typeof e)return this._deserializers.push(e);var s=e;"function"==typeof t&&(r=t,t=void 0);var n=this._deserializers;!function e(i,o,a){if("pass"===o&&(o=void 0),o||a)return r(o,a);if(null===a||!1===a)return r(null,!1);var c=n[i];if(!c)return r(new Error("Failed to deserialize user out of session"));function u(t,r){e(i+1,t,r)}try{3==c.length?c(t,s,u):c(s,u)}catch(e){return r(e)}}(0)},Authenticator.prototype.transformAuthInfo=function(e,t,r){if("function"==typeof e)return this._infoTransformers.push(e);var s=e;"function"==typeof t&&(r=t,t=void 0);var n=this._infoTransformers;!function e(i,o,a){if("pass"===o&&(o=void 0),o||a)return r(o,a);var c=n[i];if(!c)return r(null,s);function u(t,r){e(i+1,t,r)}try{var l=c.length;if(1==l)u(null,c(s));else 3==l?c(t,s,u):c(s,u)}catch(e){return r(e)}}(0)},Authenticator.prototype._strategy=function(e){return this._strategies[e]};var authenticator=Authenticator;!function(e,t){var r=authenticator,s=session$2;(t=e.exports=new r).Passport=t.Authenticator=r,t.Strategy=libExports$3,t.strategies={},t.strategies.SessionStrategy=s}(lib$3,lib$3.exports);var libExports$2=lib$3.exports,passport$1=getDefaultExportFromCjs(libExports$2),lib$1={exports:{}},utils$2={lookup:function(e,t){if(!e)return null;for(var r=t.split("]").join("").split("["),s=0,n=r.length;s<n;s++){var i=e[r[s]];if(void 0===i)return null;if("object"!=typeof i)return i;e=i}return null}},passport=libExports$3,util$2=require$$1$1,lookup$1=utils$2.lookup;function Strategy(e,t){if("function"==typeof e&&(t=e,e={}),!t)throw new TypeError("LocalStrategy requires a verify callback");this._usernameField=e.usernameField||"username",this._passwordField=e.passwordField||"password",passport.Strategy.call(this),this.name="local",this._verify=t,this._passReqToCallback=e.passReqToCallback}util$2.inherits(Strategy,passport.Strategy),Strategy.prototype.authenticate=function(e,t){t=t||{};var r=lookup$1(e.body,this._usernameField)||lookup$1(e.query,this._usernameField),s=lookup$1(e.body,this._passwordField)||lookup$1(e.query,this._passwordField);if(!r||!s)return this.fail({message:t.badRequestMessage||"Missing credentials"},400);var n=this;function i(e,t,r){return e?n.error(e):t?void n.success(t,r):n.fail(r)}try{n._passReqToCallback?this._verify(e,r,s,i):this._verify(r,s,i)}catch(e){return n.error(e)}};var strategy=Strategy;!function(e,t){var r=strategy;(e.exports=r).Strategy=r}(lib$1,lib$1.exports);var libExports$1=lib$1.exports,expressSession={exports:{}},parseurl$1={exports:{}},url=require$$0$b,parse=url.parse,Url=url.Url;function parseurl(e){var t=e.url;if(void 0!==t){var r=e._parsedUrl;return fresh(t,r)?r:((r=fastparse(t))._raw=t,e._parsedUrl=r)}}function originalurl(e){var t=e.originalUrl;if("string"!=typeof t)return parseurl(e);var r=e._parsedOriginalUrl;return fresh(t,r)?r:((r=fastparse(t))._raw=t,e._parsedOriginalUrl=r)}function fastparse(e){if("string"!=typeof e||47!==e.charCodeAt(0))return parse(e);for(var t=e,r=null,s=null,n=1;n<e.length;n++)switch(e.charCodeAt(n)){case 63:null===s&&(t=e.substring(0,n),r=e.substring(n+1),s=e.substring(n));break;case 9:case 10:case 12:case 13:case 32:case 35:case 160:case 65279:return parse(e)}var i=void 0!==Url?new Url:{};return i.path=e,i.href=e,i.pathname=t,null!==s&&(i.query=r,i.search=s),i}function fresh(e,t){return"object"==typeof t&&null!==t&&(void 0===Url||t instanceof Url)&&t._raw===e}parseurl$1.exports=parseurl,parseurl$1.exports.original=originalurl;var parseurlExports=parseurl$1.exports,cookieSignature={};!function(e){var t=require$$0$6;function r(e){return t.createHash("sha1").update(e).digest("hex")}e.sign=function(e,r){if("string"!=typeof e)throw new TypeError("Cookie value must be provided as a string.");if(null==r)throw new TypeError("Secret key must be provided.");return e+"."+t.createHmac("sha256",r).update(e).digest("base64").replace(/\=+$/,"")},e.unsign=function(t,s){if("string"!=typeof t)throw new TypeError("Signed cookie string must be provided.");if(null==s)throw new TypeError("Secret key must be provided.");var n=t.slice(0,t.lastIndexOf("."));return r(e.sign(n,s))==r(t)&&n}}(cookieSignature);var uidSafe={exports:{}},randomBytes$2={exports:{}},crypto=require$$0$6,generateAttempts=crypto.randomBytes===crypto.pseudoRandomBytes?1:3;function randomBytes$1(e,t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("argument callback must be a function");if(!t&&!commonjsGlobal.Promise)throw new TypeError("argument callback is required");return t?generateRandomBytes(e,generateAttempts,t):new Promise((function(t,r){generateRandomBytes(e,generateAttempts,(function(e,s){if(e)return r(e);t(s)}))}))}function randomBytesSync(e){for(var t=null,r=0;r<generateAttempts;r++)try{return crypto.randomBytes(e)}catch(e){t=e}throw t}function generateRandomBytes(e,t,r){crypto.randomBytes(e,(function(s,n){return s?--t?void setTimeout(generateRandomBytes.bind(null,e,t,r),10):r(s):r(null,n)}))}randomBytes$2.exports=randomBytes$1,randomBytes$2.exports.sync=randomBytesSync;var randomBytesExports=randomBytes$2.exports,randomBytes=randomBytesExports,EQUAL_END_REGEXP=/=+$/,PLUS_GLOBAL_REGEXP=/\+/g,SLASH_GLOBAL_REGEXP=/\//g;
|
|
74
|
+
*/morgan$2.exports=morgan,morgan$2.exports.compile=compile,morgan$2.exports.format=format,morgan$2.exports.token=token;var auth=basicAuthExports,debug=srcExports("morgan"),deprecate$1=depd_1$1("morgan"),onFinished=onFinishedExports,onHeaders=onHeaders_1,CLF_MONTH=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DEFAULT_BUFFER_DURATION=1e3;function morgan(e,t){var r=e,s=t||{};e&&"object"==typeof e&&(r=(s=e).format||"default",deprecate$1("morgan(options): use morgan("+("string"==typeof r?JSON.stringify(r):"format")+", options) instead")),void 0===r&&deprecate$1("undefined format: specify a format");var n=s.immediate,i=s.skip||!1,o="function"!=typeof r?getFormatFunction(r):r,a=s.buffer,c=s.stream||process.stdout;a&&(deprecate$1("buffer option"),c=createBufferStream(c,"number"!=typeof a?DEFAULT_BUFFER_DURATION:a));return function(e,t,r){function s(){if(!1!==i&&i(e,t))debug("skip request");else{var r=o(morgan,e,t);null!=r?(debug("log request"),c.write(r+"\n")):debug("skip line")}}e._startAt=void 0,e._startTime=void 0,e._remoteAddress=getip(e),t._startAt=void 0,t._startTime=void 0,recordStartTime.call(e),n?s():(onHeaders(t,recordStartTime),onFinished(t,s)),r()}}function clfdate(e){var t=e.getUTCDate(),r=e.getUTCHours(),s=e.getUTCMinutes(),n=e.getUTCSeconds(),i=e.getUTCFullYear(),o=CLF_MONTH[e.getUTCMonth()];return pad2(t)+"/"+o+"/"+i+":"+pad2(r)+":"+pad2(s)+":"+pad2(n)+" +0000"}function compile(e){if("string"!=typeof e)throw new TypeError("argument format must be a string");var t=' "use strict"\n return '+String(JSON.stringify(e)).replace(/:([-\w]{2,})(?:\[([^\]]+)\])?/g,(function(e,t,r){var s="req, res",n="tokens["+String(JSON.stringify(t))+"]";return void 0!==r&&(s+=", "+String(JSON.stringify(r))),'" +\n ('+n+"("+s+') || "-") + "'}));return new Function("tokens, req, res",t)}function createBufferStream(e,t){var r=[],s=null;function n(){s=null,e.write(r.join("")),r.length=0}return{write:function(e){null===s&&(s=setTimeout(n,t)),r.push(e)}}}function format(e,t){return morgan[e]=t,this}function getFormatFunction(e){var t=morgan[e]||e||morgan.default;return"function"!=typeof t?compile(t):t}function getip(e){return e.ip||e._remoteAddress||e.connection&&e.connection.remoteAddress||void 0}function headersSent(e){return"boolean"!=typeof e.headersSent?Boolean(e._header):e.headersSent}function pad2(e){var t=String(e);return(1===t.length?"0":"")+t}function recordStartTime(){this._startAt=process.hrtime(),this._startTime=new Date}function token(e,t){return morgan[e]=t,this}morgan.format("combined",':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'),morgan.format("common",':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length]'),morgan.format("default",':remote-addr - :remote-user [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'),deprecate$1.property(morgan,"default","default format: use combined format"),morgan.format("short",":remote-addr :remote-user :method :url HTTP/:http-version :status :res[content-length] - :response-time ms"),morgan.format("tiny",":method :url :status :res[content-length] - :response-time ms"),morgan.format("dev",(function e(t,r,s){var n=headersSent(s)?s.statusCode:void 0,i=n>=500?31:n>=400?33:n>=300?36:n>=200?32:0,o=e[i];return o||(o=e[i]=compile("[0m:method :url ["+i+"m:status[0m :response-time ms - :res[content-length][0m")),o(t,r,s)})),morgan.token("url",(function(e){return e.originalUrl||e.url})),morgan.token("method",(function(e){return e.method})),morgan.token("response-time",(function(e,t,r){if(e._startAt&&t._startAt)return(1e3*(t._startAt[0]-e._startAt[0])+1e-6*(t._startAt[1]-e._startAt[1])).toFixed(void 0===r?3:r)})),morgan.token("total-time",(function(e,t,r){if(e._startAt&&t._startAt){var s=process.hrtime(e._startAt);return(1e3*s[0]+1e-6*s[1]).toFixed(void 0===r?3:r)}})),morgan.token("date",(function(e,t,r){var s=new Date;switch(r||"web"){case"clf":return clfdate(s);case"iso":return s.toISOString();case"web":return s.toUTCString()}})),morgan.token("status",(function(e,t){return headersSent(t)?String(t.statusCode):void 0})),morgan.token("referrer",(function(e){return e.headers.referer||e.headers.referrer})),morgan.token("remote-addr",getip),morgan.token("remote-user",(function(e){var t=auth(e);return t?t.name:void 0})),morgan.token("http-version",(function(e){return e.httpVersionMajor+"."+e.httpVersionMinor})),morgan.token("user-agent",(function(e){return e.headers["user-agent"]})),morgan.token("req",(function(e,t,r){var s=e.headers[r.toLowerCase()];return Array.isArray(s)?s.join(", "):s})),morgan.token("res",(function(e,t,r){if(headersSent(t)){var s=t.getHeader(r);return Array.isArray(s)?s.join(", "):s}}));var morganExports=morgan$2.exports,morgan$1=getDefaultExportFromCjs(morganExports);class Http{static async mount(e){const t=await loadBasicConfig(),r=await loadLoggingConfig();e.use(morgan$1(r.format,{skip:r.skip})),e.use(express.json({limit:t.max_body_size})),e.use(express.urlencoded({extended:!0,limit:t.max_body_size}));const s=multer$1({limits:{fieldSize:1/0}});e.use(s.array("files")),e.use(cookieParser$1());const n=path$5.join(process.cwd(),"public");e.use(express.static(n))}}class CORS{static async mount(e){(await loadBasicConfig()).cors_enabled&&e.use(((e,t,r)=>{if(t.header("Access-Control-Allow-Origin",e.headers.origin),t.header("Access-Control-Allow-Headers",["X-Requested-With","X-HTTP-Method-Override","Content-Type","Accept","Authorization","Cache-Control","If-None-Match","If-Modified-Since","Range","X-CSRF-Token"].join(", ")),t.header("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),t.header("Access-Control-Allow-Credentials","true"),"OPTIONS"===e.method)return t.status(200).end();r()}))}}class Local{static async mount(e){const t=await loadBasicConfig();e.use(((r,s,n)=>{if(e.locals.currentPath=new URL(`${r.protocol}://${r.get("host")}${r.originalUrl}`).pathname,r.headers.referer){const t=new URL(r.headers.referer);e.locals.baseUrl=t.origin}else e.locals.baseUrl="x-forwarded-proto"in r.headers?`${r.headers["x-forwarded-proto"]}://${r.headers.host}`:`//${r.headers.host}`;t.rewrite_base_url&&(e.locals.baseUrl=t.rewrite_base_url(e.locals.baseUrl)),n()}))}}var lib$3={exports:{}},pause$1=function(e){var t,r,s=[];return e.on("data",t=function(e,t){s.push(["data",e,t])}),e.on("end",r=function(e,t){s.push(["end",e,t])}),{end:function(){e.removeListener("data",t),e.removeListener("end",r)},resume:function(){this.end();for(var t=0,r=s.length;t<r;++t)e.emit.apply(e,s[t])}}},lib$2={exports:{}};function Strategy$2(){}Strategy$2.prototype.authenticate=function(e,t){throw new Error("Strategy#authenticate must be overridden by subclass")};var strategy$1=Strategy$2;!function(e,t){var r=strategy$1;(e.exports=r).Strategy=r}(lib$2,lib$2.exports);var libExports$3=lib$2.exports,pause=pause$1,util$3=require$$1$1,Strategy$1=libExports$3;function SessionStrategy$1(e,t){"function"==typeof e&&(t=e,e=void 0),e=e||{},Strategy$1.call(this),this.name="session",this._key=e.key||"passport",this._deserializeUser=t}util$3.inherits(SessionStrategy$1,Strategy$1),SessionStrategy$1.prototype.authenticate=function(e,t){if(!e.session)return this.error(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?"));t=t||{};var r,s=this;if(e.session[this._key]&&(r=e.session[this._key].user),r||0===r){var n=t.pauseStream?pause(e):null;this._deserializeUser(r,e,(function(t,r){if(t)return s.error(t);if(r){var i=e._userProperty||"user";e[i]=r}else delete e.session[s._key].user;s.pass(),n&&n.resume()}))}else s.pass()};var session$2=SessionStrategy$1,utilsMerge={exports:{}};utilsMerge.exports=function(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e};var utilsMergeExports=utilsMerge.exports,merge=utilsMergeExports;function SessionManager$1(e,t){"function"==typeof e&&(t=e,e=void 0),e=e||{},this._key=e.key||"passport",this._serializeUser=t}SessionManager$1.prototype.logIn=function(e,t,r,s){if("function"==typeof r&&(s=r,r={}),r=r||{},!e.session)return s(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?"));var n=this,i=e.session;e.session.regenerate((function(o){if(o)return s(o);n._serializeUser(t,e,(function(t,o){if(t)return s(t);r.keepSessionInfo&&merge(e.session,i),e.session[n._key]||(e.session[n._key]={}),e.session[n._key].user=o,e.session.save((function(e){if(e)return s(e);s()}))}))}))},SessionManager$1.prototype.logOut=function(e,t,r){if("function"==typeof t&&(r=t,t={}),t=t||{},!e.session)return r(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?"));e.session[this._key]&&delete e.session[this._key].user;var s=e.session;e.session.save((function(n){if(n)return r(n);e.session.regenerate((function(n){if(n)return r(n);t.keepSessionInfo&&merge(e.session,s),r()}))}))};var sessionmanager=SessionManager$1,connect={exports:{}},request={exports:{}},hasRequiredRequest,initialize,hasRequiredInitialize,authenticationerror,hasRequiredAuthenticationerror,authenticate,hasRequiredAuthenticate,hasRequiredConnect;function requireRequest(){return hasRequiredRequest||(hasRequiredRequest=1,(e=request.exports={}).login=e.logIn=function(e,t,r){"function"==typeof t&&(r=t,t={}),t=t||{};var s=this._userProperty||"user",n=void 0===t.session||t.session;if(this[s]=e,n&&this._sessionManager){if("function"!=typeof r)throw new Error("req#login requires a callback function");var i=this;this._sessionManager.logIn(this,e,t,(function(e){if(e)return i[s]=null,r(e);r()}))}else r&&r()},e.logout=e.logOut=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},this[this._userProperty||"user"]=null,this._sessionManager){if("function"!=typeof t)throw new Error("req#logout requires a callback function");this._sessionManager.logOut(this,e,t)}else t&&t()},e.isAuthenticated=function(){return!!this[this._userProperty||"user"]},e.isUnauthenticated=function(){return!this.isAuthenticated()}),request.exports;var e}function requireInitialize(){if(hasRequiredInitialize)return initialize;hasRequiredInitialize=1;var e=requireRequest();return initialize=function(t,r){return r=r||{},function(s,n,i){s.login=s.logIn=s.logIn||e.logIn,s.logout=s.logOut=s.logOut||e.logOut,s.isAuthenticated=s.isAuthenticated||e.isAuthenticated,s.isUnauthenticated=s.isUnauthenticated||e.isUnauthenticated,s._sessionManager=t._sm,r.userProperty&&(s._userProperty=r.userProperty),(void 0===r.compat||r.compat)&&(t._userProperty=r.userProperty||"user",s._passport={},s._passport.instance=t),i()}},initialize}function requireAuthenticationerror(){if(hasRequiredAuthenticationerror)return authenticationerror;function e(e,t){Error.call(this),Error.captureStackTrace(this,arguments.callee),this.name="AuthenticationError",this.message=e,this.status=t||401}return hasRequiredAuthenticationerror=1,e.prototype.__proto__=Error.prototype,authenticationerror=e}function requireAuthenticate(){if(hasRequiredAuthenticate)return authenticate;hasRequiredAuthenticate=1;var e=require$$0$a,t=requireRequest(),r=requireAuthenticationerror();return authenticate=function(s,n,i,o){"function"==typeof i&&(o=i,i={}),i=i||{};var a=!0;return Array.isArray(n)||(n=[n],a=!1),function(c,u,l){c.login=c.logIn=c.logIn||t.logIn,c.logout=c.logOut=c.logOut||t.logOut,c.isAuthenticated=c.isAuthenticated||t.isAuthenticated,c.isUnauthenticated=c.isUnauthenticated||t.isUnauthenticated,c._sessionManager=s._sm;var p=[];!function t(d){var h,m,f=n[d];if(!f)return function(){if(o){if(a){var t=p.map((function(e){return e.challenge})),s=p.map((function(e){return e.status}));return o(null,!1,t,s)}return o(null,!1,p[0].challenge,p[0].status)}var n,d=p[0]||{},h=d.challenge||{};if(i.failureFlash){var m=i.failureFlash;"string"==typeof m&&(m={type:"error",message:m}),m.type=m.type||"error";var f=m.type||h.type||"error";"string"==typeof(n=m.message||h.message||h)&&c.flash(f,n)}if(i.failureMessage&&("boolean"==typeof(n=i.failureMessage)&&(n=h.message||h),"string"==typeof n&&(c.session.messages=c.session.messages||[],c.session.messages.push(n))),i.failureRedirect)return u.redirect(i.failureRedirect);for(var _,E,g=[],S=0,R=p.length;S<R;S++)h=(d=p[S]).challenge,E=d.status,_=_||E,"string"==typeof h&&g.push(h);if(u.statusCode=_||401,401==u.statusCode&&g.length&&u.setHeader("WWW-Authenticate",g),i.failWithError)return l(new r(e.STATUS_CODES[u.statusCode],_));u.end(e.STATUS_CODES[u.statusCode])}();if("function"==typeof f.authenticate)h=f;else{if(!(m=s._strategy(f)))return l(new Error('Unknown authentication strategy "'+f+'"'));h=Object.create(m)}h.success=function(e,t){if(o)return o(null,e,t);var r;if(t=t||{},i.successFlash){var n=i.successFlash;"string"==typeof n&&(n={type:"success",message:n}),n.type=n.type||"success";var a=n.type||t.type||"success";"string"==typeof(r=n.message||t.message||t)&&c.flash(a,r)}if(i.successMessage&&("boolean"==typeof(r=i.successMessage)&&(r=t.message||t),"string"==typeof r&&(c.session.messages=c.session.messages||[],c.session.messages.push(r))),i.assignProperty)return c[i.assignProperty]=e,void(!1!==i.authInfo?s.transformAuthInfo(t,c,(function(e,t){if(e)return l(e);c.authInfo=t,l()})):l());c.logIn(e,i,(function(e){if(e)return l(e);function r(){if(i.successReturnToOrRedirect){var e=i.successReturnToOrRedirect;return c.session&&c.session.returnTo&&(e=c.session.returnTo,delete c.session.returnTo),u.redirect(e)}if(i.successRedirect)return u.redirect(i.successRedirect);l()}!1!==i.authInfo?s.transformAuthInfo(t,c,(function(e,t){if(e)return l(e);c.authInfo=t,r()})):r()}))},h.fail=function(e,r){"number"==typeof e&&(r=e,e=void 0),p.push({challenge:e,status:r}),t(d+1)},h.redirect=function(e,t){u.statusCode=t||302,u.setHeader("Location",e),u.setHeader("Content-Length","0"),u.end()},h.pass=function(){l()},h.error=function(e){if(o)return o(e);l(e)},h.authenticate(c,i)}(0)}},authenticate}function requireConnect(){return hasRequiredConnect||(hasRequiredConnect=1,function(e){var t=requireInitialize(),r=requireAuthenticate();e.exports=function(){return{initialize:t,authenticate:r}}}(connect)),connect.exports}var SessionStrategy=session$2,SessionManager=sessionmanager;function Authenticator(){this._key="passport",this._strategies={},this._serializers=[],this._deserializers=[],this._infoTransformers=[],this._framework=null,this.init()}Authenticator.prototype.init=function(){this.framework(requireConnect()()),this.use(new SessionStrategy({key:this._key},this.deserializeUser.bind(this))),this._sm=new SessionManager({key:this._key},this.serializeUser.bind(this))},Authenticator.prototype.use=function(e,t){if(t||(e=(t=e).name),!e)throw new Error("Authentication strategies must have a name");return this._strategies[e]=t,this},Authenticator.prototype.unuse=function(e){return delete this._strategies[e],this},Authenticator.prototype.framework=function(e){return this._framework=e,this},Authenticator.prototype.initialize=function(e){return e=e||{},this._framework.initialize(this,e)},Authenticator.prototype.authenticate=function(e,t,r){return this._framework.authenticate(this,e,t,r)},Authenticator.prototype.authorize=function(e,t,r){return(t=t||{}).assignProperty="account",(this._framework.authorize||this._framework.authenticate)(this,e,t,r)},Authenticator.prototype.session=function(e){return this.authenticate("session",e)},Authenticator.prototype.serializeUser=function(e,t,r){if("function"==typeof e)return this._serializers.push(e);var s=e;"function"==typeof t&&(r=t,t=void 0);var n=this._serializers;!function e(i,o,a){if("pass"===o&&(o=void 0),o||a||0===a)return r(o,a);var c=n[i];if(!c)return r(new Error("Failed to serialize user into session"));function u(t,r){e(i+1,t,r)}try{3==c.length?c(t,s,u):c(s,u)}catch(e){return r(e)}}(0)},Authenticator.prototype.deserializeUser=function(e,t,r){if("function"==typeof e)return this._deserializers.push(e);var s=e;"function"==typeof t&&(r=t,t=void 0);var n=this._deserializers;!function e(i,o,a){if("pass"===o&&(o=void 0),o||a)return r(o,a);if(null===a||!1===a)return r(null,!1);var c=n[i];if(!c)return r(new Error("Failed to deserialize user out of session"));function u(t,r){e(i+1,t,r)}try{3==c.length?c(t,s,u):c(s,u)}catch(e){return r(e)}}(0)},Authenticator.prototype.transformAuthInfo=function(e,t,r){if("function"==typeof e)return this._infoTransformers.push(e);var s=e;"function"==typeof t&&(r=t,t=void 0);var n=this._infoTransformers;!function e(i,o,a){if("pass"===o&&(o=void 0),o||a)return r(o,a);var c=n[i];if(!c)return r(null,s);function u(t,r){e(i+1,t,r)}try{var l=c.length;if(1==l)u(null,c(s));else 3==l?c(t,s,u):c(s,u)}catch(e){return r(e)}}(0)},Authenticator.prototype._strategy=function(e){return this._strategies[e]};var authenticator=Authenticator;!function(e,t){var r=authenticator,s=session$2;(t=e.exports=new r).Passport=t.Authenticator=r,t.Strategy=libExports$3,t.strategies={},t.strategies.SessionStrategy=s}(lib$3,lib$3.exports);var libExports$2=lib$3.exports,passport$1=getDefaultExportFromCjs(libExports$2),lib$1={exports:{}},utils$2={lookup:function(e,t){if(!e)return null;for(var r=t.split("]").join("").split("["),s=0,n=r.length;s<n;s++){var i=e[r[s]];if(void 0===i)return null;if("object"!=typeof i)return i;e=i}return null}},passport=libExports$3,util$2=require$$1$1,lookup$1=utils$2.lookup;function Strategy(e,t){if("function"==typeof e&&(t=e,e={}),!t)throw new TypeError("LocalStrategy requires a verify callback");this._usernameField=e.usernameField||"username",this._passwordField=e.passwordField||"password",passport.Strategy.call(this),this.name="local",this._verify=t,this._passReqToCallback=e.passReqToCallback}util$2.inherits(Strategy,passport.Strategy),Strategy.prototype.authenticate=function(e,t){t=t||{};var r=lookup$1(e.body,this._usernameField)||lookup$1(e.query,this._usernameField),s=lookup$1(e.body,this._passwordField)||lookup$1(e.query,this._passwordField);if(!r||!s)return this.fail({message:t.badRequestMessage||"Missing credentials"},400);var n=this;function i(e,t,r){return e?n.error(e):t?void n.success(t,r):n.fail(r)}try{n._passReqToCallback?this._verify(e,r,s,i):this._verify(r,s,i)}catch(e){return n.error(e)}};var strategy=Strategy;!function(e,t){var r=strategy;(e.exports=r).Strategy=r}(lib$1,lib$1.exports);var libExports$1=lib$1.exports,expressSession={exports:{}},parseurl$1={exports:{}},url=require$$0$b,parse=url.parse,Url=url.Url;function parseurl(e){var t=e.url;if(void 0!==t){var r=e._parsedUrl;return fresh(t,r)?r:((r=fastparse(t))._raw=t,e._parsedUrl=r)}}function originalurl(e){var t=e.originalUrl;if("string"!=typeof t)return parseurl(e);var r=e._parsedOriginalUrl;return fresh(t,r)?r:((r=fastparse(t))._raw=t,e._parsedOriginalUrl=r)}function fastparse(e){if("string"!=typeof e||47!==e.charCodeAt(0))return parse(e);for(var t=e,r=null,s=null,n=1;n<e.length;n++)switch(e.charCodeAt(n)){case 63:null===s&&(t=e.substring(0,n),r=e.substring(n+1),s=e.substring(n));break;case 9:case 10:case 12:case 13:case 32:case 35:case 160:case 65279:return parse(e)}var i=void 0!==Url?new Url:{};return i.path=e,i.href=e,i.pathname=t,null!==s&&(i.query=r,i.search=s),i}function fresh(e,t){return"object"==typeof t&&null!==t&&(void 0===Url||t instanceof Url)&&t._raw===e}parseurl$1.exports=parseurl,parseurl$1.exports.original=originalurl;var parseurlExports=parseurl$1.exports,cookieSignature={};!function(e){var t=require$$0$6;function r(e){return t.createHash("sha1").update(e).digest("hex")}e.sign=function(e,r){if("string"!=typeof e)throw new TypeError("Cookie value must be provided as a string.");if(null==r)throw new TypeError("Secret key must be provided.");return e+"."+t.createHmac("sha256",r).update(e).digest("base64").replace(/\=+$/,"")},e.unsign=function(t,s){if("string"!=typeof t)throw new TypeError("Signed cookie string must be provided.");if(null==s)throw new TypeError("Secret key must be provided.");var n=t.slice(0,t.lastIndexOf("."));return r(e.sign(n,s))==r(t)&&n}}(cookieSignature);var uidSafe={exports:{}},randomBytes$2={exports:{}},crypto=require$$0$6,generateAttempts=crypto.randomBytes===crypto.pseudoRandomBytes?1:3;function randomBytes$1(e,t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("argument callback must be a function");if(!t&&!commonjsGlobal.Promise)throw new TypeError("argument callback is required");return t?generateRandomBytes(e,generateAttempts,t):new Promise((function(t,r){generateRandomBytes(e,generateAttempts,(function(e,s){if(e)return r(e);t(s)}))}))}function randomBytesSync(e){for(var t=null,r=0;r<generateAttempts;r++)try{return crypto.randomBytes(e)}catch(e){t=e}throw t}function generateRandomBytes(e,t,r){crypto.randomBytes(e,(function(s,n){return s?--t?void setTimeout(generateRandomBytes.bind(null,e,t,r),10):r(s):r(null,n)}))}randomBytes$2.exports=randomBytes$1,randomBytes$2.exports.sync=randomBytesSync;var randomBytesExports=randomBytes$2.exports,randomBytes=randomBytesExports,EQUAL_END_REGEXP=/=+$/,PLUS_GLOBAL_REGEXP=/\+/g,SLASH_GLOBAL_REGEXP=/\//g;
|
|
75
75
|
/*!
|
|
76
76
|
* uid-safe
|
|
77
77
|
* Copyright(c) 2014 Jonathan Ong
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-sweet",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "EXPRESS SWEET is a powerful Express.js extension that streamlines your workflow and boosts productivity with a suite of utilities and enhancements.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/build.cjs",
|