yinzerflow 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js.map CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../node_modules/dayjs/dayjs.min.js", "../app/core/YinzerFlow.ts", "../app/core/execution/RequestHandlerImpl.ts", "../app/constants/http.ts", "../app/core/utils/cors.ts", "../app/core/utils/networkLog.ts", "../app/core/utils/log.ts", "../app/core/execution/utils/parseJson.ts", "../app/core/execution/utils/parseMultipart.ts", "../app/core/execution/utils/parseUrlEncodedForm.ts", "../app/core/execution/utils/determineEncoding.ts", "../app/core/execution/utils/inferContentType.ts", "../app/core/execution/utils/parseBody.ts", "../app/core/utils/string.ts", "../app/core/execution/utils/parseHttpRequest.ts", "../app/core/execution/utils/parseQuery.ts", "../app/core/execution/utils/parseIpAddress.ts", "../app/core/execution/utils/extractBoundaryFromHeader.ts", "../app/core/execution/utils/parseRequestHeaders.ts", "../app/core/execution/RequestImpl.ts", "../app/core/execution/ResponseImpl.ts", "../app/core/execution/utils/formatBodyIntoString.ts", "../app/core/execution/utils/mapStatusCodeToMessage.ts", "../app/core/execution/utils/validateResponseHeaders.ts", "../app/core/execution/utils/determineContentLength.ts", "../app/core/execution/ContextImpl.ts", "../app/constants/log.ts", "../app/core/setup/utils/handleCustomConfiguration.ts", "../app/core/execution/HookRegistryImpl.ts", "../app/core/setup/utils/compileRoutePatter.ts", "../app/core/setup/utils/normalizeStringPatterns.ts", "../app/core/setup/utils/validateParameterNames.ts", "../app/core/setup/RouteRegistryImpl.ts", "../app/core/setup/utils/routeUtils.ts", "../app/core/setup/GroupApp.ts", "../app/core/setup/SetupImpl.ts"],
3
+ "sources": ["../node_modules/dayjs/dayjs.min.js", "../app/core/YinzerFlow.ts", "../app/core/execution/RequestHandlerImpl.ts", "../app/constants/http.ts", "../app/core/utils/cors.ts", "../app/core/utils/log.ts", "../app/constants/colors.ts", "../app/constants/log.ts", "../app/core/execution/utils/parseJson.ts", "../app/core/execution/utils/parseMultipart.ts", "../app/core/execution/utils/parseUrlEncodedForm.ts", "../app/core/execution/utils/determineEncoding.ts", "../app/core/execution/utils/inferContentType.ts", "../app/core/execution/utils/parseBody.ts", "../app/core/utils/string.ts", "../app/core/execution/utils/parseHttpRequest.ts", "../app/core/execution/utils/parseQuery.ts", "../app/core/execution/utils/parseIpAddress.ts", "../app/core/execution/utils/extractBoundaryFromHeader.ts", "../app/core/execution/utils/parseRequestHeaders.ts", "../app/core/execution/RequestImpl.ts", "../app/core/execution/ResponseImpl.ts", "../app/core/execution/utils/formatBodyIntoString.ts", "../app/core/execution/utils/mapStatusCodeToMessage.ts", "../app/core/execution/utils/validateResponseHeaders.ts", "../app/core/utils/calculateContentSizeInBytes.ts", "../app/core/execution/ContextImpl.ts", "../app/core/setup/utils/handleCustomConfiguration.ts", "../app/core/execution/HookRegistryImpl.ts", "../app/core/setup/utils/compileRoutePatter.ts", "../app/core/setup/utils/normalizeStringPatterns.ts", "../app/core/setup/utils/validateParameterNames.ts", "../app/core/setup/RouteRegistryImpl.ts", "../app/core/setup/utils/routeUtils.ts", "../app/core/setup/GroupApp.ts", "../app/core/setup/SetupImpl.ts", "../app/core/utils/networkLog.ts"],
4
4
  "sourcesContent": [
5
5
  "!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},g=\"en\",D={};D[g]=M;var p=\"$isDayjsObject\",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if(\"string\"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split(\"-\");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v=\"set\"+(this.$u?\"UTC\":\"\");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+\"Hours\",0);case u:return $(v+\"Minutes\",1);case s:return $(v+\"Seconds\",2);case i:return $(v+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f=\"set\"+(this.$u?\"UTC\":\"\"),l=(n={},n[a]=f+\"Date\",n[d]=f+\"Date\",n[c]=f+\"Month\",n[h]=f+\"FullYear\",n[u]=f+\"Hours\",n[s]=f+\"Minutes\",n[i]=f+\"Seconds\",n[r]=f+\"Milliseconds\",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||\"YYYY-MM-DDTHH:mm:ssZ\",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,\"0\")},$=f||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case\"YY\":return String(e.$y).slice(-2);case\"YYYY\":return b.s(e.$y,4,\"0\");case\"M\":return a+1;case\"MM\":return b.s(a+1,2,\"0\");case\"MMM\":return h(n.monthsShort,a,c,3);case\"MMMM\":return h(c,a);case\"D\":return e.$D;case\"DD\":return b.s(e.$D,2,\"0\");case\"d\":return String(e.$W);case\"dd\":return h(n.weekdaysMin,e.$W,o,2);case\"ddd\":return h(n.weekdaysShort,e.$W,o,3);case\"dddd\":return o[e.$W];case\"H\":return String(s);case\"HH\":return b.s(s,2,\"0\");case\"h\":return d(1);case\"hh\":return d(2);case\"a\":return $(s,u,!0);case\"A\":return $(s,u,!1);case\"m\":return String(u);case\"mm\":return b.s(u,2,\"0\");case\"s\":return String(e.$s);case\"ss\":return b.s(e.$s,2,\"0\");case\"SSS\":return b.s(e.$ms,3,\"0\");case\"Z\":return i}return null}(t)||i.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",c],[\"$y\",h],[\"$D\",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));",
6
- "import { createServer } from 'net';\nimport type { Socket } from 'net';\n\nimport { RequestHandlerImpl } from '@core/execution/RequestHandlerImpl.ts';\nimport { ContextImpl } from '@core/execution/ContextImpl.ts';\nimport { SetupImpl } from '@core/setup/SetupImpl.ts';\nimport { log } from '@core/utils/log.ts';\nimport { colors, networkLog } from '@core/utils/networkLog.ts';\nimport type { ServerConfiguration } from '@typedefs/public/Configuration.js';\n\n/**\n * Main YinzerFlow application class for building HTTP servers.\n *\n * YinzerFlow is a lightweight, high-performance HTTP server framework built on Node.js\n * that provides an elegant API for routing, middleware, and request handling. It extends\n * the Setup interface to provide all route configuration capabilities plus server management.\n *\n * ## Key Features\n *\n * - **High Performance**: Built on Node.js net module for maximum performance\n * - **Type Safety**: Full TypeScript support with generics for type-safe contexts\n * - **Route Groups**: Nested route organization with shared hooks and middleware\n * - **Global Hooks**: beforeAll/afterAll hooks for cross-cutting concerns\n * - **State Management**: Request-scoped state for sharing data between middleware\n * - **Graceful Shutdown**: Automatic graceful shutdown handling\n * - **Logging**: Built-in logging with custom logger support\n * - **Network Logging**: Request/response logging with performance metrics\n *\n * ## Basic Usage\n *\n * @example\n * ```typescript\n * import { YinzerFlow } from 'yinzerflow';\n *\n * // Create app with basic configuration\n * const app = new YinzerFlow({ port: 3000 });\n *\n * // Register routes\n * app.get('/api/users', async (ctx) => {\n * return { users: ['John', 'Jane'] };\n * });\n *\n * app.post('/api/users', async (ctx) => {\n * const { name, email } = ctx.request.body;\n * return { message: 'User created', name, email };\n * });\n *\n * // Set up global hooks\n * app.beforeAll([\n * async (ctx) => {\n * ctx.state.requestId = generateRequestId();\n * ctx.state.startTime = Date.now();\n * }\n * ]);\n *\n * app.afterAll([\n * async (ctx) => {\n * const processingTime = Date.now() - ctx.state.startTime;\n * ctx.response.addHeaders({\n * 'X-Processing-Time': `${processingTime}ms`,\n * 'X-Request-ID': ctx.state.requestId\n * });\n * }\n * ]);\n *\n * // Create route groups\n * app.group('/api/v1', (api) => {\n * api.group('/admin', (admin) => {\n * admin.get('/users', async (ctx) => {\n * return { adminUsers: ['Admin1', 'Admin2'] };\n * });\n * });\n * });\n *\n * // Start the server\n * app.listen();\n * ```\n *\n * ## Advanced Configuration\n *\n * @example\n * ```typescript\n * // Advanced configuration with custom logging\n * const app = new YinzerFlow({\n * port: 8080,\n * host: '0.0.0.0',\n * logLevel: 'debug',\n * networkLogs: true,\n * autoGracefulShutdown: true,\n * logger: {\n * info: (message, ...args) => console.log(`[INFO] ${message}`, ...args),\n * warn: (message, ...args) => console.warn(`[WARN] ${message}`, ...args),\n * error: (message, ...args) => console.error(`[ERROR] ${message}`, ...args),\n * debug: (message, ...args) => console.debug(`[DEBUG] ${message}`, ...args)\n * },\n * networkLogger: {\n * info: (message, ...args) => console.log(`[NETWORK] ${message}`, ...args)\n * }\n * });\n *\n * // Custom error handling\n * app.onError(async (ctx, error) => {\n * ctx.response.setStatusCode(500);\n * return {\n * error: 'Internal server error',\n * message: process.env.NODE_ENV === 'production' ? 'Something went wrong' : error.message\n * };\n * });\n *\n * // Custom not-found handling\n * app.onNotFound(async (ctx) => {\n * ctx.response.setStatusCode(404);\n * return {\n * error: 'Not found',\n * path: ctx.request.path,\n * availableEndpoints: ['/api/users', '/api/posts', '/health']\n * };\n * });\n * ```\n *\n * ## Server Lifecycle\n *\n * 1. **Initialization**: Constructor sets up logging and configuration\n * 2. **Route Setup**: Register routes, hooks, and middleware\n * 3. **Server Start**: Call `listen()` to start accepting connections\n * 4. **Request Processing**: Handle incoming HTTP requests\n * 5. **Graceful Shutdown**: Automatic cleanup on process termination\n *\n * @see {@link SetupImpl} for route configuration capabilities\n * @see {@link ServerConfiguration} for configuration options\n * @see {@link ContextImpl} for request context implementation\n * @see {@link RequestHandlerImpl} for request processing\n */\nexport class YinzerFlow extends SetupImpl {\n private _isListening = false;\n private _server?: ReturnType<typeof createServer>;\n\n constructor(configuration?: ServerConfiguration) {\n super(configuration);\n\n // Set custom logger if provided (routes all log calls to user's logger)\n if (this._configuration.logger) {\n log.setCustomLogger(this._configuration.logger);\n }\n\n // Set log level on built-in logger (always available)\n log.setLogLevel(this._configuration.logLevel);\n\n // Configure network logging - simple boolean toggle\n networkLog.setEnabled(this._configuration.networkLogs);\n\n // Set network logger if provided (optional - can be same as app logger or different)\n if (this._configuration.networkLogger) {\n networkLog.setNetworkLogger(this._configuration.networkLogger);\n }\n\n // This will route to custom logger if set, otherwise use built-in styling\n log.info(\n 'YinzerFlow initialized with logging enabled',\n `${colors.green}level: ${this._configuration.logLevel}, networkLogs: ${this._configuration.networkLogs}${colors.reset}`,\n );\n\n // Setup automatic graceful shutdown if enabled\n if (this._configuration.autoGracefulShutdown) {\n this._setupGracefulShutdown();\n }\n }\n\n /**\n * Setup server with all event listeners\n */\n private _setupServer(resolve: () => void, reject: (error: Error) => void, requestHandler: RequestHandlerImpl): void {\n if (!this._server) return;\n\n this._server.on('error', (error: Error) => {\n networkLog.serverError(this._configuration.port, this._configuration.host, error.message);\n reject(error);\n });\n\n this._server.on('listening', () => {\n this._isListening = true;\n networkLog.serverStart(this._configuration.port, this._configuration.host);\n resolve();\n });\n\n this._server.on('connection', (socket) => {\n this._handleConnection(socket, requestHandler);\n });\n }\n\n /**\n * Process incoming request data\n */\n private async _processRequest({\n data,\n socket,\n requestHandler,\n clientAddress,\n }: {\n data: Buffer;\n socket: Socket;\n requestHandler: RequestHandlerImpl;\n clientAddress: string;\n }): Promise<void> {\n const startTime = Date.now();\n\n log.info('Processing incoming request', `Client: ${clientAddress}, Data Size: ${data.length}`);\n\n const context = new ContextImpl(data, this, clientAddress);\n\n await requestHandler.handle(context);\n\n socket.write(context._response._stringBody);\n socket.end();\n\n const endTime = Date.now();\n const processingTime = endTime - startTime;\n\n // Log request\n networkLog.request(context, startTime, endTime);\n if (processingTime > 500) {\n log.warn('Slow request detected', {\n method: context.request.method,\n path: context.request.path,\n statusCode: context._response._statusCode,\n responseTime: `${processingTime}ms`,\n clientAddress,\n });\n }\n }\n\n /**\n * Handle socket connection and all its events\n */\n private _handleConnection(socket: Socket, requestHandler: RequestHandlerImpl): void {\n const clientAddress = socket.remoteAddress ?? 'unknown';\n\n networkLog.connection('connect', clientAddress);\n\n socket.on('data', (data) => {\n this._processRequest({ data, socket, requestHandler, clientAddress }).catch((error: unknown) => {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n networkLog.connection('error', clientAddress, `Unexpected error: ${errorMessage}`);\n socket.destroy();\n });\n });\n\n socket.on('error', (error: Error) => {\n networkLog.connection('error', clientAddress, error.message);\n });\n\n socket.on('close', () => {\n networkLog.connection('disconnect', clientAddress);\n });\n }\n\n async listen(): Promise<void> {\n if (this._isListening) {\n throw new Error('Server is already listening');\n }\n\n return new Promise((resolve, reject) => {\n const requestHandler = new RequestHandlerImpl(this);\n this._server = createServer();\n\n this._setupServer(resolve, reject, requestHandler);\n this._server.listen(this._configuration.port, this._configuration.host);\n });\n }\n\n async close(): Promise<void> {\n if (!this._isListening || !this._server) {\n return;\n }\n\n return new Promise((resolve) => {\n if (!this._server) {\n this._isListening = false; // Probably redundant but just in case\n resolve();\n return;\n }\n\n this._server.close(() => {\n this._isListening = false;\n networkLog.serverStop(this._configuration.port, this._configuration.host);\n resolve();\n });\n });\n }\n\n status(): {\n isListening: boolean;\n port: number | undefined;\n host: string | undefined;\n } {\n return {\n isListening: this._isListening,\n port: this._configuration.port,\n host: this._configuration.host,\n };\n }\n\n /**\n * Setup automatic graceful shutdown handlers\n */\n private _setupGracefulShutdown(): void {\n // Only setup if no handlers are already registered\n if (process.listenerCount('SIGTERM') === 0 && process.listenerCount('SIGINT') === 0) {\n const shutdown = (signal: string): void => {\n log.info(`🛑 Received ${signal}, shutting down gracefully...`);\n this.close()\n .then(() => {\n log.info('✅ Server shut down gracefully');\n process.exit(0);\n })\n .catch((error) => {\n log.error('❌ Error during graceful shutdown:', error);\n process.exit(1);\n });\n };\n\n process.on('SIGTERM', () => shutdown('SIGTERM'));\n process.on('SIGINT', () => shutdown('SIGINT'));\n }\n }\n}\n",
6
+ "import { createServer } from 'net';\nimport type { Socket } from 'net';\n\nimport { RequestHandlerImpl } from '@core/execution/RequestHandlerImpl.ts';\nimport { ContextImpl } from '@core/execution/ContextImpl.ts';\nimport { SetupImpl } from '@core/setup/SetupImpl.ts';\nimport { log } from '@core/utils/log.ts';\nimport type { ServerConfiguration } from '@typedefs/public/Configuration.js';\nimport { getStatusEmoji, logPerformanceDetails, networkLog } from '@core/utils/networkLog.ts';\nimport { calculateContentSizeInBytes } from '@core/utils/calculateContentSizeInBytes.ts';\n\n/**\n * Main YinzerFlow application class for building HTTP servers.\n *\n * YinzerFlow is a lightweight, high-performance HTTP server framework built on Node.js\n * that provides an elegant API for routing, middleware, and request handling. It extends\n * the Setup interface to provide all route configuration capabilities plus server management.\n *\n * ## Key Features\n *\n * - **High Performance**: Built on Node.js net module for maximum performance\n * - **Type Safety**: Full TypeScript support with generics for type-safe contexts\n * - **Route Groups**: Nested route organization with shared hooks and middleware\n * - **Global Hooks**: beforeAll/afterAll hooks for cross-cutting concerns\n * - **State Management**: Request-scoped state for sharing data between middleware\n * - **Graceful Shutdown**: Automatic graceful shutdown handling\n * - **Logging**: Built-in logging with custom logger support\n * - **Network Logging**: Request/response logging with performance metrics\n *\n * ## Basic Usage\n *\n * @example\n * ```typescript\n * import { YinzerFlow } from 'yinzerflow';\n *\n * // Create app with basic configuration\n * const app = new YinzerFlow({ port: 3000 });\n *\n * // Register routes\n * app.get('/api/users', async (ctx) => {\n * return { users: ['John', 'Jane'] };\n * });\n *\n * app.post('/api/users', async (ctx) => {\n * const { name, email } = ctx.request.body;\n * return { message: 'User created', name, email };\n * });\n *\n * // Set up global hooks\n * app.beforeAll([\n * async (ctx) => {\n * ctx.state.requestId = generateRequestId();\n * ctx.state.startTime = Date.now();\n * }\n * ]);\n *\n * app.afterAll([\n * async (ctx) => {\n * const processingTime = Date.now() - ctx.state.startTime;\n * ctx.response.addHeaders({\n * 'X-Processing-Time': `${processingTime}ms`,\n * 'X-Request-ID': ctx.state.requestId\n * });\n * }\n * ]);\n *\n * // Create route groups\n * app.group('/api/v1', (api) => {\n * api.group('/admin', (admin) => {\n * admin.get('/users', async (ctx) => {\n * return { adminUsers: ['Admin1', 'Admin2'] };\n * });\n * });\n * });\n *\n * // Start the server\n * app.listen();\n * ```\n *\n * ## Advanced Configuration\n *\n * @example\n * ```typescript\n * // Advanced configuration with custom logging\n * const app = new YinzerFlow({\n * port: 8080,\n * host: '0.0.0.0',\n * logLevel: 'debug',\n * networkLogs: true,\n * autoGracefulShutdown: true,\n * logger: {\n * info: (message, ...args) => console.log(`[INFO] ${message}`, ...args),\n * warn: (message, ...args) => console.warn(`[WARN] ${message}`, ...args),\n * error: (message, ...args) => console.error(`[ERROR] ${message}`, ...args),\n * debug: (message, ...args) => console.debug(`[DEBUG] ${message}`, ...args)\n * },\n * networkLogger: {\n * info: (message, ...args) => console.log(`[NETWORK] ${message}`, ...args)\n * }\n * });\n *\n * // Custom error handling\n * app.onError(async (ctx, error) => {\n * ctx.response.setStatusCode(500);\n * return {\n * error: 'Internal server error',\n * message: process.env.NODE_ENV === 'production' ? 'Something went wrong' : error.message\n * };\n * });\n *\n * // Custom not-found handling\n * app.onNotFound(async (ctx) => {\n * ctx.response.setStatusCode(404);\n * return {\n * error: 'Not found',\n * path: ctx.request.path,\n * availableEndpoints: ['/api/users', '/api/posts', '/health']\n * };\n * });\n * ```\n *\n * ## Server Lifecycle\n *\n * 1. **Initialization**: Constructor sets up logging and configuration\n * 2. **Route Setup**: Register routes, hooks, and middleware\n * 3. **Server Start**: Call `listen()` to start accepting connections\n * 4. **Request Processing**: Handle incoming HTTP requests\n * 5. **Graceful Shutdown**: Automatic cleanup on process termination\n *\n * @see {@link SetupImpl} for route configuration capabilities\n * @see {@link ServerConfiguration} for configuration options\n * @see {@link ContextImpl} for request context implementation\n * @see {@link RequestHandlerImpl} for request processing\n */\nexport class YinzerFlow extends SetupImpl {\n private _isListening = false;\n private _server?: ReturnType<typeof createServer>;\n\n constructor(configuration?: ServerConfiguration) {\n super(configuration);\n\n // Replace global logger if custom logger is provided\n if (this._configuration.logger) {\n // Replace the global log instance with the custom logger\n Object.assign(log, this._configuration.logger);\n }\n\n // Set network logger if provided (optional - can be same as app logger or different)\n if (this._configuration.networkLogs) {\n networkLog.enable(this._configuration.networkLogger);\n }\n\n // Setup automatic graceful shutdown if enabled\n if (this._configuration.autoGracefulShutdown) {\n this._setupGracefulShutdown();\n }\n }\n\n /**\n * Setup server with all event listeners\n */\n private _setupServer(resolve: () => void, reject: (error: Error) => void, requestHandler: RequestHandlerImpl): void {\n if (!this._server) return;\n\n this._server.on('error', (error: Error) => {\n networkLog.log.error(`YinzerFlow server error at ${this._configuration.host}:${this._configuration.port} - ${error.message}`);\n reject(error);\n });\n\n this._server.on('listening', () => {\n this._isListening = true;\n networkLog.log.info(`YinzerFlow server at ${this._configuration.host}:${this._configuration.port} is up and running`);\n resolve();\n });\n\n this._server.on('connection', (socket) => {\n this._handleConnection(socket, requestHandler);\n });\n }\n\n /**\n * Process incoming request data\n */\n private async _processRequest({\n data,\n socket,\n requestHandler,\n clientAddress,\n }: {\n data: Buffer;\n socket: Socket;\n requestHandler: RequestHandlerImpl;\n clientAddress: string;\n }): Promise<void> {\n const startTime = Date.now();\n\n // Log incoming request\n networkLog.log.info('Incoming request', `${clientAddress} ${calculateContentSizeInBytes(data)}bytes`);\n\n const context = new ContextImpl(data, this, clientAddress);\n\n await requestHandler.handle(context);\n\n socket.write(context._response._stringBody);\n socket.end();\n\n const endTime = Date.now();\n const processingTime = endTime - startTime;\n\n // Log request response\n networkLog.log.info(\n `${getStatusEmoji(context._response._statusCode)} ${clientAddress} \"${context.request.method} ${context.request.path} ${context.request.protocol}\" ${context._response._statusCode} ${calculateContentSizeInBytes(context._response._body)}bytes \"${context.request.headers.referer ?? '-'}\" \"${context.request.headers['user-agent'] ?? '-'}\" ${processingTime}ms`,\n );\n logPerformanceDetails(processingTime);\n }\n\n /**\n * Handle incoming TCP socket connections and their complete lifecycle\n *\n * This method manages both legitimate HTTP requests and various types of probes:\n * - Health checks from monitoring tools (Datadog, New Relic, etc.)\n * - Load balancer health probes\n * - API testing tools connectivity checks (Postman, Apidog, etc.)\n * - Potential security probes or DoS attempts\n */\n private _handleConnection(socket: Socket, requestHandler: RequestHandlerImpl): void {\n // Extract client information for logging and security tracking\n const clientAddress = socket.remoteAddress ?? 'unknown';\n const connectionStartTime = Date.now();\n\n // Track connection state to distinguish between probes and real requests\n let hasReceivedData = false;\n let dataReceiveTime: number | null = null;\n\n /**\n * Log every TCP connection for comprehensive network monitoring\n * This helps identify connection patterns, DoS attempts, and client behavior\n */\n networkLog.log.info(`New visitor from ${clientAddress}`);\n\n /**\n * Handle incoming data on the socket\n * This fires when the client sends HTTP request data\n */\n socket.on('data', (data) => {\n // Track first data receipt for timing analysis\n if (!hasReceivedData) {\n hasReceivedData = true;\n dataReceiveTime = Date.now();\n const connectionToDataDelay = dataReceiveTime - connectionStartTime;\n\n /**\n * Flag connections with unusual delays between connect and data\n * Normal HTTP clients send data immediately after connecting\n * Delays >100ms might indicate:\n * - Slow/problematic clients\n * - Potential reconnaissance attempts\n * - Network issues\n */\n if (connectionToDataDelay > 100) {\n networkLog.log.warn(`Delayed data from ${clientAddress} (${connectionToDataDelay}ms connection delay)`);\n }\n }\n\n /**\n * Process the HTTP request data\n * This handles parsing, routing, middleware, and response generation\n */\n this._processRequest({ data, socket, requestHandler, clientAddress }).catch((error: unknown) => {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n networkLog.log.error(`Visitor from ${clientAddress} experienced an error during request processing: ${errorMessage}`, error);\n socket.destroy(); // Force close on processing errors\n });\n });\n\n /**\n * Handle socket errors (network issues, malformed connections, etc.)\n * These are typically infrastructure problems, not application errors\n */\n socket.on('error', (error: Error) => {\n networkLog.log.error(`Visitor from ${clientAddress} experienced an error during socket connection: ${error.message}`, error);\n });\n\n /**\n * Handle socket closure - both graceful and forced disconnections\n * This is where we analyze connection patterns for security and diagnostics\n */\n socket.on('close', () => {\n const connectionDuration = Date.now() - connectionStartTime;\n\n if (hasReceivedData) {\n /**\n * Normal HTTP request lifecycle completed\n * Log successful completion with total connection time\n */\n networkLog.log.info(`Visitor from ${clientAddress} headed out (${connectionDuration}ms total)`);\n return;\n }\n\n // Connection closed without sending HTTP data - analyze the pattern\n if (connectionDuration < 10) {\n /**\n * Fast disconnect (< 10ms) = likely legitimate health check\n * Common with:\n * - Monitoring tools (Datadog, New Relic, Prometheus)\n * - Load balancers (AWS ALB, nginx, HAProxy)\n * - API testing tools (Postman, Apidog, Insomnia)\n */\n networkLog.log.info(`${clientAddress} quick connectivity check (${connectionDuration}ms) - health probe`);\n } else {\n /**\n * Slower disconnect without data = potentially suspicious\n * Could indicate:\n * - Port scanning attempts\n * - DoS reconnaissance\n * - Misconfigured clients\n * - Network connectivity issues\n */\n networkLog.log.warn(`${clientAddress} disconnected without sending data (${connectionDuration}ms) - potential probe`);\n }\n });\n }\n\n async listen(): Promise<void> {\n if (this._isListening) {\n throw new Error('Server is already listening');\n }\n\n return new Promise((resolve, reject) => {\n const requestHandler = new RequestHandlerImpl(this);\n this._server = createServer();\n\n this._setupServer(resolve, reject, requestHandler);\n this._server.listen(this._configuration.port, this._configuration.host);\n });\n }\n\n async close(): Promise<void> {\n if (!this._isListening || !this._server) {\n return;\n }\n\n return new Promise((resolve) => {\n if (!this._server) {\n this._isListening = false; // Probably redundant but just in case\n resolve();\n return;\n }\n\n this._server.close(() => {\n this._isListening = false;\n networkLog.log.warn(`YinzerFlow server at ${this._configuration.host}:${this._configuration.port} is shutting down - See yinz later`);\n resolve();\n });\n });\n }\n\n status(): {\n isListening: boolean;\n port: number | undefined;\n host: string | undefined;\n } {\n return {\n isListening: this._isListening,\n port: this._configuration.port,\n host: this._configuration.host,\n };\n }\n\n /**\n * Setup automatic graceful shutdown handlers\n */\n private _setupGracefulShutdown(): void {\n // Only setup if no handlers are already registered\n if (process.listenerCount('SIGTERM') === 0 && process.listenerCount('SIGINT') === 0) {\n const shutdown = (signal: string): void => {\n log.info(`🛑 Received ${signal}, shutting down gracefully...`);\n this.close()\n .then(() => {\n log.info('✅ Server shut down gracefully');\n process.exit(0);\n })\n .catch((error) => {\n log.error('❌ Error during graceful shutdown:', error);\n process.exit(1);\n });\n };\n\n process.on('SIGTERM', () => shutdown('SIGTERM'));\n process.on('SIGINT', () => shutdown('SIGINT'));\n }\n }\n}\n",
7
7
  "import dayjs from 'dayjs';\nimport type { SetupImpl } from '@core/setup/SetupImpl.ts';\nimport type { InternalContextImpl } from '@typedefs/internal/InternalContextImpl.ts';\nimport type { InternalSetupImpl } from '@typedefs/internal/InternalSetupImpl.js';\nimport { handleCors } from '@core/utils/cors.ts';\nimport { log } from '@core/utils/log.ts';\n\n/**\n * Handles the complete lifecycle of an HTTP request\n *\n * Flow:\n * 1. Receive parsed context (request + response builders)\n * 2. Match route and execute handlers\n * 3. Build final response in context\n * 4. Context.rawResponse is ready for sending\n */\nexport class RequestHandlerImpl {\n private readonly setup: InternalSetupImpl;\n\n constructor(setup: SetupImpl) {\n this.setup = setup;\n }\n\n /**\n * Process an HTTP request using the provided context\n */\n async handle(context: InternalContextImpl): Promise<void> {\n try {\n // 1. Handle CORS before anything else. The cors handler will handle return true if it was a preflight request, otherwise it will return false.\n const corsResult = handleCors(context, this.setup._configuration.cors);\n\n if (corsResult) {\n context._response._parseResponseIntoString(); // Needed so the YinzerFlow can send the response as a string\n return void 0;\n }\n\n // 2. Match route based on context.request.method + context.request.path\n const matchedRoute = this.setup._routeRegistry._findRoute(context.request.method, context.request.path);\n\n if (!matchedRoute) {\n const notFoundResponse = await this.setup._hooks._onNotFound(context);\n context._response._setBody(notFoundResponse);\n context._response._parseResponseIntoString(); // Needed so the YinzerFlow can send the response as a string\n return void 0;\n }\n\n // Set route params in the request context\n context.request.params = matchedRoute.params;\n\n const { handler, options } = matchedRoute;\n const { beforeHooks = [], afterHooks = [] } = options;\n\n // 3. Run beforeAll hooks\n const beforeAllHooks = this.setup._hooks._beforeAll;\n for (const hook of beforeAllHooks) await hook.handler(context);\n\n // 4. Run beforeGroup hooks and beforeRoute hooks\n // * The before group hooks and beforeRoute hooks are in the same array and ordered on route registration.\n for (const hook of beforeHooks) await hook(context);\n\n // 5. Execute route handler.\n // * We are saving the response to a variable because in this case we might not\n // * send a response to the client until after the after hooks since the after hooks might modify the response.\n let routeResponse: unknown = null;\n try {\n routeResponse = await handler(context);\n } catch (handlerError) {\n throw handlerError;\n }\n\n // 6. Run afterRoute hooks and afterGroup hooks\n // * The after group hooks and afterRoute hooks are in the same array and ordered on route registration.\n for (const hook of afterHooks) await hook(context);\n\n // 7. Run afterAll hooks\n const afterAllHooks = this.setup._hooks._afterAll;\n for (const hook of afterAllHooks) await hook.handler(context);\n\n // 8. Build response (set content-type, etc.)\n context._response._setBody(routeResponse);\n\n // 10. If this was a HEAD request, remove the body and convert it to a GET request.\n // Im waiting to do this until after the after hooks since the after hooks might modify the response, headers, etc.\n if (context.request.method === 'HEAD') {\n context._response._setBody(null);\n }\n\n // 11. Add default framework headers and parse the body into a string\n // This is done when we call context._response._parseResponseIntoString()\n context._response._parseResponseIntoString();\n\n return void 0;\n } catch (error) {\n // Use the error handler from setup\n await this.handleError(context, error);\n }\n }\n\n /**\n * Handle errors using the user-defined or default error handler\n * The error handler returns a response object that we apply to the context\n */\n private async handleError(context: InternalContextImpl, error: unknown): Promise<void> {\n try {\n // Get the error handler (user-defined or default)\n const errorHandler = this.setup._hooks._onError;\n\n // Call the error handler - it returns a response object\n const errorResponse = await errorHandler(context, error);\n\n // Apply the response to the context\n context._response._setBody(errorResponse);\n\n // Add CORS headers to error responses too\n handleCors(context, this.setup._configuration.cors);\n\n // Format the response for sending (same as normal flow)\n context._response._parseResponseIntoString();\n context._response._setHeadersIfNotSet({\n Date: dayjs().format('ddd, DD MMM YYYY HH:mm:ss [GMT]'),\n 'Content-Length': context._response._stringBody.split('\\n\\n')[1]?.length.toString() ?? '0',\n });\n } catch (errorHandlerError) {\n // If the error handler itself fails, fall back to basic response\n log.error('Error handler failed, this might be an internal error in the YinzerFlow framework: ', errorHandlerError);\n\n context.response.setStatusCode(500);\n context._response._setBody({\n success: false,\n message: 'Internal Server Error',\n });\n\n // Add CORS headers to fallback error responses too\n handleCors(context, this.setup._configuration.cors);\n\n // Format the fallback response too\n context._response._parseResponseIntoString();\n context._response._setHeadersIfNotSet({\n Date: dayjs().format('ddd, DD MMM YYYY HH:mm:ss [GMT]'),\n 'Content-Length': context._response._stringBody.split('\\n\\n')[1]?.length.toString() ?? '0',\n });\n }\n }\n}\n",
8
8
  "/**\n * HTTP Constants\n *\n * This file contains all HTTP-related constants used throughout the application.\n * Centralizing these constants makes them easier to maintain and ensures consistency.\n */\n\n/**\n * HTTP Status Text\n * Maps status codes to their standard text representations\n */\n// Use const assertions for better tree-shaking\nexport const httpStatus = {\n ok: 'OK',\n created: 'Created',\n accepted: 'Accepted',\n noContent: 'No Content',\n movedPermanently: 'Moved Permanently',\n found: 'Found',\n notModified: 'Not Modified',\n badRequest: 'Bad Request',\n unauthorized: 'Unauthorized',\n forbidden: 'Forbidden',\n notFound: 'Not Found',\n methodNotAllowed: 'Method Not Allowed',\n conflict: 'Conflict',\n unsupportedMediaType: 'Unsupported Media Type',\n tooManyRequests: 'Too Many Requests',\n internalServerError: 'Internal Server Error',\n} as const;\n\n/**\n * HTTP Status Codes\n * Standard HTTP status codes used in responses\n */\nexport const httpStatusCode = {\n ok: 200,\n created: 201,\n accepted: 202,\n noContent: 204,\n movedPermanently: 301,\n found: 302,\n notModified: 304,\n badRequest: 400,\n unauthorized: 401,\n forbidden: 403,\n notFound: 404,\n methodNotAllowed: 405,\n conflict: 409,\n unsupportedMediaType: 415,\n tooManyRequests: 429,\n internalServerError: 500,\n} as const;\n\n/**\n * HTTP Methods\n * Standard HTTP methods used in requests\n */\nexport const httpMethod = {\n delete: 'DELETE',\n get: 'GET',\n head: 'HEAD',\n post: 'POST',\n put: 'PUT',\n patch: 'PATCH',\n options: 'OPTIONS',\n} as const;\n\n/**\n * Common Content Types\n * Frequently used content types for HTTP communication\n */\nexport const contentType = {\n json: 'application/json',\n html: 'text/html',\n form: 'application/x-www-form-urlencoded',\n multipart: 'multipart/form-data',\n xml: 'application/xml',\n text: 'text/plain',\n csv: 'text/csv',\n yamlApplication: 'application/yaml',\n yamlText: 'text/yaml',\n urlEncodedJson: 'application/x-www-form-urlencoded+json',\n} as const;\n\n/**\n * HTTP header names organized by category\n * Use with CreateEnum to get type-safe header names with intellisense\n */\nexport const httpHeaders = {\n // Authentication & Authorization\n authorization: 'Authorization', // Bearer tokens, Basic auth, etc.\n proxyAuthorization: 'Proxy-Authorization', // Auth through proxy\n wwwAuthenticate: 'WWW-Authenticate', // Server auth challenge\n\n // Caching & Validation\n cacheControl: 'Cache-Control', // Cache directives\n etag: 'ETag', // Resource version identifier\n expires: 'Expires', // Cache expiration date\n lastModified: 'Last-Modified', // Resource modification date\n ifMatch: 'If-Match', // Conditional request based on ETag\n ifNoneMatch: 'If-None-Match', // Conditional request based on ETag\n ifModifiedSince: 'If-Modified-Since', // Conditional request based on date\n ifUnmodifiedSince: 'If-Unmodified-Since', // Conditional request based on date\n ifRange: 'If-Range', // Conditional range request\n age: 'Age', // Time in proxy cache\n vary: 'Vary', // Response varies based on headers\n\n // Content Information\n contentType: 'Content-Type', // Media type of content\n contentLength: 'Content-Length', // Size in bytes\n contentEncoding: 'Content-Encoding', // Compression method\n contentLanguage: 'Content-Language', // Natural language\n contentDisposition: 'Content-Disposition', // Inline vs attachment\n contentLocation: 'Content-Location', // Alternate location\n contentRange: 'Content-Range', // Partial content range\n\n // CORS (Cross-Origin Resource Sharing)\n accessControlAllowCredentials: 'Access-Control-Allow-Credentials', // Allow credentials in CORS\n accessControlAllowHeaders: 'Access-Control-Allow-Headers', // Allowed request headers\n accessControlAllowMethods: 'Access-Control-Allow-Methods', // Allowed HTTP methods\n accessControlAllowOrigin: 'Access-Control-Allow-Origin', // Allowed origins\n accessControlExposeHeaders: 'Access-Control-Expose-Headers', // Exposed response headers\n accessControlMaxAge: 'Access-Control-Max-Age', // Preflight cache duration\n accessControlRequestHeaders: 'Access-Control-Request-Headers', // Preflight request headers\n accessControlRequestMethod: 'Access-Control-Request-Method', // Preflight request method\n\n // Request Information\n accept: 'Accept', // Acceptable media types\n acceptEncoding: 'Accept-Encoding', // Acceptable encodings\n acceptLanguage: 'Accept-Language', // Acceptable languages\n acceptRanges: 'Accept-Ranges', // Server supports ranges\n host: 'Host', // Target host and port\n userAgent: 'User-Agent', // Client software info\n referer: 'Referer', // Previous page URL\n origin: 'Origin', // Request origin\n from: 'From', // User email address\n expect: 'Expect', // Server requirements\n\n // Response Information\n location: 'Location', // Redirect URL\n server: 'Server', // Server software info\n date: 'Date', // Message timestamp\n allow: 'Allow', // Supported HTTP methods\n retryAfter: 'Retry-After', // Retry delay\n\n // Range Requests\n range: 'Range', // Requested byte range\n\n // Security Headers\n contentSecurityPolicy: 'Content-Security-Policy', // CSP directives\n contentSecurityPolicyReportOnly: 'Content-Security-Policy-Report-Only', // CSP report mode\n strictTransportSecurity: 'Strict-Transport-Security', // HTTPS enforcement\n xContentTypeOptions: 'X-Content-Type-Options', // Prevent MIME sniffing\n xFrameOptions: 'X-Frame-Options', // Clickjacking protection\n xXSSProtection: 'X-XSS-Protection', // XSS filter control\n referrerPolicy: 'Referrer-Policy', // Referrer info policy\n permissionsPolicy: 'Permissions-Policy', // Feature permissions\n crossOriginEmbedderPolicy: 'Cross-Origin-Embedder-Policy', // Embedding control\n crossOriginOpenerPolicy: 'Cross-Origin-Opener-Policy', // Window opening control\n crossOriginResourcePolicy: 'Cross-Origin-Resource-Policy', // Resource sharing control\n\n // Cookies\n cookie: 'Cookie', // Client cookies\n setCookie: 'Set-Cookie', // Server cookie instructions\n\n // Connection Management\n connection: 'Connection', // Connection control\n keepAlive: 'Keep-Alive', // Keep-alive parameters\n upgrade: 'Upgrade', // Protocol upgrade\n upgradeInsecureRequests: 'Upgrade-Insecure-Requests', // HTTPS upgrade\n\n // Transfer & Encoding\n transferEncoding: 'Transfer-Encoding', // Transfer encoding method\n te: 'TE', // Acceptable transfer encodings\n trailer: 'Trailer', // Trailer field names\n\n // Proxy & Forwarding\n forwarded: 'Forwarded', // Proxy information\n xForwardedFor: 'X-Forwarded-For', // Proxy information\n via: 'Via', // Proxy chain info\n maxForwards: 'Max-Forwards', // Hop limit\n\n // Alternative Services\n altSvc: 'Alt-Svc', // Alternative services\n altUsed: 'Alt-Used', // Used alternative service\n\n // Timing & Performance\n timingAllowOrigin: 'Timing-Allow-Origin', // Timing API access\n serverTiming: 'Server-Timing', // Server performance metrics\n\n // Refresh & Links\n refresh: 'Refresh', // Auto-refresh directive\n link: 'Link', // Related resources\n\n // Custom & Extension Headers\n xPoweredBy: 'X-Powered-By', // Server technology\n xPermittedCrossDomainPolicies: 'X-Permitted-Cross-Domain-Policies', // Flash policy\n reportTo: 'Report-To', // Error reporting endpoint\n serviceWorkerAllowed: 'Service-Worker-Allowed', // Service worker scope\n sourceMap: 'SourceMap', // Source map location\n priority: 'Priority', // Request priority\n secGPC: 'Sec-GPC', // Global Privacy Control\n\n // Data & Clearing\n clearSiteData: 'Clear-Site-Data', // Clear browser data\n noVarySearch: 'No-Vary-Search', // Search param cache control\n} as const;\n\nexport const httpEncoding = {\n base64: 'base64',\n binary: 'binary',\n utf8: 'utf8',\n} as const;\n",
9
9
  "import { httpHeaders } from '@constants/http.ts';\nimport type { InternalContextImpl } from '@typedefs/internal/InternalContextImpl.js';\nimport type { CorsConfiguration } from '@typedefs/public/Configuration.js';\nimport type { InternalCorsEnabledConfiguration } from '@typedefs/internal/InternalConfiguration.js';\n\nexport const handleCors = (context: InternalContextImpl, config: CorsConfiguration): boolean => {\n if (!config.enabled) return false;\n\n if (context.request.method === 'OPTIONS') {\n // Validate origin is accepted - SECURITY CRITICAL: Actually use the result!\n const isOriginAllowed = _validateOrigin(context, config);\n\n if (!isOriginAllowed) {\n // Reject unauthorized CORS preflight requests\n context.response.setStatusCode(403);\n context._response._setBody({\n error: 'CORS: Origin not allowed',\n origin: context.request.headers.origin,\n });\n return true; // SECURITY: Return true to prevent RequestHandler from overwriting our rejection\n }\n\n // Set response headers ONLY for allowed origins\n context.response.setStatusCode(config.optionsSuccessStatus);\n\n // Determine the allowed origin to echo back\n const allowedOrigin = _determineAllowedOrigin(context, config);\n\n // Configure allowed methods and headers\n context._response._setHeadersIfNotSet({\n [httpHeaders.accessControlAllowOrigin]: allowedOrigin,\n [httpHeaders.accessControlAllowMethods]: config.methods.join(', '),\n [httpHeaders.accessControlAllowHeaders]: typeof config.allowedHeaders === 'string' ? config.allowedHeaders : config.allowedHeaders.join(', '),\n [httpHeaders.accessControlAllowCredentials]: config.credentials ? 'true' : 'false',\n [httpHeaders.accessControlExposeHeaders]: config.exposedHeaders.join(', '),\n [httpHeaders.accessControlMaxAge]: config.maxAge.toString(),\n });\n\n if (config.preflightContinue) {\n // Don't set body, let next handler run\n return false; // CORS did not handle, let next handler run\n }\n // Only set body if preflightContinue is false\n context._response._setBody('');\n return true; // CORS handled it\n }\n\n // For non-OPTIONS requests, still validate origin and set appropriate headers\n const isOriginAllowed = _validateOrigin(context, config);\n\n if (isOriginAllowed) {\n const allowedOrigin = _determineAllowedOrigin(context, config);\n context._response._setHeadersIfNotSet({\n [httpHeaders.accessControlAllowOrigin]: allowedOrigin,\n [httpHeaders.accessControlAllowCredentials]: config.credentials ? 'true' : 'false',\n });\n }\n\n return false; // Let normal request processing continue\n};\n\n/**\n * Determine the correct origin value to send back in Access-Control-Allow-Origin\n * SECURITY: Never echo back the request origin without validation\n */\nconst _determineAllowedOrigin = (context: InternalContextImpl, config: InternalCorsEnabledConfiguration): string => {\n if (config.origin === '*') {\n // SECURITY: Block dangerous wildcard + credentials combination (CORS spec violation)\n if (config.credentials) {\n throw new Error(\n 'CORS Security Error: origin: \"*\" with credentials: true is forbidden by CORS spec and creates security vulnerabilities. Use specific origins instead.',\n );\n }\n\n // SECURITY: For wildcard, always return literal '*', never echo back the request origin\n // Echoing back the request origin defeats the purpose of CORS validation\n return '*';\n }\n\n // For specific origins, echo back the validated request origin\n const requestOrigin = context.request.headers.origin;\n if (requestOrigin) {\n // At this point, validation should have already passed\n return requestOrigin;\n }\n\n // If no request origin (shouldn't happen for validated requests), return first configured origin\n if (typeof config.origin === 'string') {\n return config.origin;\n }\n\n if (Array.isArray(config.origin) && config.origin.length > 0) {\n const [firstOrigin] = config.origin;\n return firstOrigin ?? 'null';\n }\n\n // This shouldn't happen if validation passed, but safety fallback\n return 'null';\n};\n\nconst _validateOrigin = (context: InternalContextImpl, config: InternalCorsEnabledConfiguration): boolean => {\n if (config.origin === '*') return true;\n\n const normalizedOrigin = context.request.headers.origin?.toLowerCase() ?? '';\n\n if (typeof config.origin === 'function') {\n return Boolean(config.origin(normalizedOrigin, context.request));\n }\n\n if (typeof config.origin === 'string') {\n return normalizedOrigin === config.origin.toLowerCase();\n }\n\n if (Array.isArray(config.origin)) {\n return config.origin.some((origin) => normalizedOrigin === origin.toLowerCase());\n }\n\n if (config.origin instanceof RegExp) {\n return config.origin.test(normalizedOrigin);\n }\n\n return false;\n};\n",
10
- "import dayjs from 'dayjs';\nimport type { InternalContextImpl } from '@typedefs/internal/InternalContextImpl.ts';\nimport type { Logger } from '@typedefs/public/Logger.js';\n\n/**\n * YinzerFlow Network Logging System 🌐\n *\n * Separate network logging with Pittsburgh personality!\n * Boolean controlled, independent of main log levels.\n * Nginx-style access logs with performance tracking.\n */\n\n// Shared constants for both logging systems\nexport const logPrefix = 'YINZER';\n\n// Shared ANSI Color codes (reused from main log system)\nexport const colors = {\n reset: '\\x1b[0m',\n cyan: '\\x1b[96m', // Cyan for info\n yellow: '\\x1b[93m', // Yellow for warn\n red: '\\x1b[91m', // Red for error\n green: '\\x1b[92m', // Green for success\n magenta: '\\x1b[95m', // Magenta for performance\n gray: '\\x1b[90m', // Gray for network logs\n} as const;\n\nconst yinzerPhrases = {\n positive: [\"n'at!\", 'yinz are good!', \"that's the way!\", 'right on!', \"lookin' good!\", 'way to go!', 'keep it up!'],\n neutral: [\"n'at\", 'yinz know', \"just sayin'\", \"that's how it is\", 'what can ya do', 'it happens'],\n negative: ['aw jeez', \"that ain't right\", 'what a jagoff move', \"that's terrible n'at\", 'somebody messed up', 'this is bad news', 'yinz better fix this'],\n} as const;\n\n// Global network logging configuration\nlet networkLoggingEnabled = false;\nlet networkLogger: Logger | null = null;\n\n// Helper functions (shared utilities)\nexport const formatTimestamp = (): string => dayjs().format('YYYY-MM-DD HH:mm:ss.SSS');\n\nconst getRandomPhrase = (type: 'negative' | 'neutral' | 'positive'): string => {\n const phrases = yinzerPhrases[type];\n return phrases[Math.floor(Math.random() * phrases.length)] ?? '';\n};\n\n/**\n * Calculate response size for logging\n */\nconst _calculateResponseSize = (responseBody: unknown): number => {\n if (typeof responseBody === 'string') {\n return Buffer.byteLength(responseBody, 'utf8');\n }\n if (Buffer.isBuffer(responseBody)) {\n return responseBody.length;\n }\n if (typeof responseBody === 'object' && responseBody !== null) {\n try {\n return Buffer.byteLength(JSON.stringify(responseBody), 'utf8');\n } catch {\n return 0;\n }\n }\n return 0;\n};\n\n/**\n * Get status emoji for response codes\n */\nconst _getStatusEmoji = (statusCode: number): string => {\n if (statusCode >= 200 && statusCode < 300) return '✅';\n if (statusCode >= 300 && statusCode < 400) return '🔄';\n if (statusCode >= 400 && statusCode < 500) return '❌';\n if (statusCode >= 500) return '💥';\n return '❓';\n};\n\n/**\n * Get performance details for response time with Pittsburgh personality\n */\nconst _getPerformanceDetails = (timeMs: number): { emoji: string; phrase: string } => {\n // < 50ms: Truly instant, users can't perceive any delay\n if (timeMs < 50) {\n return {\n emoji: '⚡',\n phrase: Math.random() < 0.5 ? \"lightning quick n'at!\" : 'faster than a Stillers touchdown!',\n };\n }\n // 50-100ms: Still feels instant for most interactions\n if (timeMs < 100) {\n return {\n emoji: '🔥',\n phrase: Math.random() < 0.5 ? \"that's the way!\" : \"smooth as butter n'at!\",\n };\n }\n // 100-200ms: Google's \"good\" threshold, still very responsive\n if (timeMs < 200) {\n return {\n emoji: '✅',\n phrase: Math.random() < 0.5 ? 'not bad yinz!' : \"keepin' up just fine!\",\n };\n }\n // 200-500ms: Noticeable but acceptable for complex operations\n if (timeMs < 500) {\n return {\n emoji: '⚠️',\n phrase: Math.random() < 0.5 ? 'eh, could be better' : \"slowin' down a bit there\",\n };\n }\n // 500ms-1s: Users start getting impatient\n if (timeMs < 1000) {\n return {\n emoji: '🐌',\n phrase: Math.random() < 0.5 ? \"that's draggin' n'at\" : \"c'mon, pick up the pace!\",\n };\n }\n // > 1s: Definitely problematic, needs attention\n return {\n emoji: '💥',\n phrase: Math.random() < 0.5 ? 'what a jagoff response time!' : 'slower than traffic on the Parkway!',\n };\n};\n\n// =============================================================================\n// NETWORK LOGGING FUNCTIONS\n// =============================================================================\n\nconst connection = (event: 'connect' | 'disconnect' | 'error', clientIp?: string, details?: string): void => {\n if (!networkLoggingEnabled) return;\n\n const timestamp = formatTimestamp();\n const ip = clientIp ?? 'unknown';\n const eventDetails = details ? ` - ${details}` : '';\n\n let message = '';\n let level: 'error' | 'info' | 'warn' = 'info';\n\n if (event === 'connect') {\n message = `🤝 [NETWORK] New visitor from ${ip} - Welcome to the 'Burgh!`;\n } else if (event === 'disconnect') {\n message = `👋 [NETWORK] ${ip} headed out - Thanks for stopping by, yinz come back now!`;\n } else {\n message = `💥 [NETWORK] Connection trouble with ${ip}${eventDetails} - That's not good, n'at!`;\n level = 'error';\n }\n\n if (networkLogger) {\n // Route to custom network logger - let it handle timestamp formatting\n networkLogger[level](message);\n } else {\n // Use built-in styling with timestamp\n const color = level === 'error' ? colors.red : colors.gray;\n console.log(`${color}[${logPrefix}] [${timestamp}] ${message}${colors.reset}`);\n }\n};\n\nconst request = (context: InternalContextImpl, startTime: number, endTime: number): void => {\n if (!networkLoggingEnabled) return;\n\n const { request: req } = context;\n const response = context._response;\n const responseTimeMs = (endTime - startTime).toFixed(1);\n\n const clientIp = req.ipAddress || 'unknown';\n const { method, path, protocol } = req;\n const statusCode = response._statusCode;\n const responseSize = _calculateResponseSize(response._body);\n const referer = req.headers.referer ? `\"${req.headers.referer}\"` : '\"-\"';\n const userAgent = req.headers['user-agent'] ? `\"${req.headers['user-agent']}\"` : '\"-\"';\n const statusEmoji = _getStatusEmoji(statusCode);\n\n // Main nginx-style log entry\n const logEntry = `🏠 ${clientIp} - - [${formatTimestamp()}] \"${method} ${path} ${protocol}\" ${statusCode} ${responseSize}b ${referer} ${userAgent} ${responseTimeMs}ms ${statusEmoji}`;\n\n // Performance details\n const timeMs = parseFloat(responseTimeMs);\n const { emoji, phrase } = _getPerformanceDetails(timeMs);\n const perfEntry = `${emoji} [PERF] Response time: ${responseTimeMs}ms - ${phrase}`;\n\n if (networkLogger) {\n // Route to custom network logger - let it handle timestamp formatting\n networkLogger.info(`[NETWORK] ${logEntry}`);\n networkLogger.info(`[PERF] ${perfEntry}`);\n } else {\n // Use built-in styling with timestamp\n console.log(`${colors.gray}[${logPrefix}] [${formatTimestamp()}] [NETWORK] ${logEntry}${colors.reset}`);\n console.log(`${colors.magenta}[${logPrefix}] ${emoji} [${formatTimestamp()}] [PERF] Response time: ${responseTimeMs}ms - ${phrase}${colors.reset}`);\n }\n};\n\nconst serverStart = (port?: number, host?: string): void => {\n if (!networkLoggingEnabled) return;\n\n const timestamp = formatTimestamp();\n const address = port && host ? `${host}:${port}` : 'unknown';\n const phrase = getRandomPhrase('positive');\n const message = `🚀 [NETWORK] YinzerFlow server is up and running at ${address} - Ready to serve yinz all, ${phrase}!`;\n\n if (networkLogger) {\n // Route to custom network logger - let it handle timestamp formatting\n networkLogger.info(message);\n } else {\n // Use built-in styling with timestamp\n console.log(`${colors.gray}[${logPrefix}] [${timestamp}] ${message}${colors.reset}`);\n }\n};\n\nconst serverStop = (port?: number, host?: string): void => {\n if (!networkLoggingEnabled) return;\n\n const timestamp = formatTimestamp();\n const address = port && host ? `${host}:${port}` : 'unknown';\n const phrase = getRandomPhrase('neutral');\n const message = `🛑 [NETWORK] YinzerFlow server at ${address} is shutting down - See yinz later, ${phrase}!`;\n\n if (networkLogger) {\n // Route to custom network logger - let it handle timestamp formatting\n networkLogger.info(message);\n } else {\n // Use built-in styling with timestamp\n console.log(`${colors.gray}[${logPrefix}] [${timestamp}] ${message}${colors.reset}`);\n }\n};\n\nconst serverError = (port?: number, host?: string, details?: string): void => {\n if (!networkLoggingEnabled) return;\n\n const timestamp = formatTimestamp();\n const address = port && host ? `${host}:${port}` : 'unknown';\n const eventDetails = details ? ` - ${details}` : '';\n const phrase = getRandomPhrase('negative');\n const message = `💥 [NETWORK] Server error at ${address}${eventDetails} - Something's not right, ${phrase}!`;\n\n if (networkLogger) {\n // Route to custom network logger - let it handle timestamp formatting\n networkLogger.error(message);\n } else {\n // Use built-in styling with timestamp\n console.log(`${colors.red}[${logPrefix}] [${timestamp}] ${message}${colors.reset}`);\n }\n};\n\n// =============================================================================\n// CONFIGURATION & EXPORTS\n// =============================================================================\n\n/**\n * Enable or disable network logging (independent of main log level)\n */\nconst setEnabled = (enabled: boolean): void => {\n networkLoggingEnabled = enabled;\n};\n\n/**\n * Set a custom logger for network logging (optional)\n */\nconst setNetworkLogger = (logger: Logger): void => {\n networkLogger = logger;\n};\n\nexport const networkLog = {\n // Configuration\n setEnabled,\n setNetworkLogger,\n\n // Network logging functions\n connection,\n request,\n serverStart,\n serverStop,\n serverError,\n};\n",
11
- "import { colors, formatTimestamp, logPrefix } from '@core/utils/networkLog.ts';\nimport type { Logger } from '@typedefs/public/Logger.js';\n\n/**\n * YinzerFlow Main Logging System 🏗️\n *\n * Simple, clean logging with Pittsburgh personality!\n * - Numeric levels (0=off, 1=error, 2=warn, 3=info)\n * - Smart formatting: Objects get pretty JSON, strings get YinzerFlow colors\n * - Network logging is separate (see networkLog.ts)\n */\n\n// logPrefix imported from networkLog.ts\n\n// Internal numeric log levels for main logging\nconst internalLogLevels = {\n off: 0,\n error: 1,\n warn: 2,\n info: 3,\n} as const;\n\n// Colors are imported from networkLog.ts for consistency\n\nconst yinzerPhrases = {\n positive: [\"n'at!\", 'yinz are good!', \"that's the way!\", 'right on!', \"lookin' good!\", 'way to go!', 'keep it up!'],\n neutral: [\"n'at\", 'yinz know', \"just sayin'\", \"that's how it is\", 'what can ya do', 'it happens'],\n negative: ['aw jeez', \"that ain't right\", 'what a jagoff move', \"that's terrible n'at\", 'somebody messed up', 'this is bad news', 'yinz better fix this'],\n} as const;\n\n// Global configuration\nlet currentLogLevel: number = internalLogLevels.warn;\nlet customLogger: Logger | null = null;\n\n// Helper functions (formatTimestamp imported from networkLog.ts)\n\nconst getRandomPhrase = (type: 'negative' | 'neutral' | 'positive'): string => {\n const phrases = yinzerPhrases[type];\n return phrases[Math.floor(Math.random() * phrases.length)] ?? '';\n};\n\n// formatData function removed - using console.log's native formatting instead\n\n// =============================================================================\n// MAIN LOGGING SYSTEM (Numeric Levels)\n// =============================================================================\n\nconst info = (...args: Array<unknown>): void => {\n if (currentLogLevel < internalLogLevels.info) return;\n\n if (customLogger) {\n // Route to user's custom logger\n customLogger.info(...args);\n } else {\n // Use built-in YinzerFlow styling\n logWithStyle('info', ...args);\n }\n};\n\nconst warn = (...args: Array<unknown>): void => {\n if (currentLogLevel < internalLogLevels.warn) return;\n\n if (customLogger) {\n // Route to user's custom logger\n customLogger.warn(...args);\n } else {\n // Use built-in YinzerFlow styling\n logWithStyle('warn', ...args);\n }\n};\n\nconst error = (...args: Array<unknown>): void => {\n if (currentLogLevel < internalLogLevels.error) return;\n\n if (customLogger) {\n // Route to user's custom logger\n customLogger.error(...args);\n } else {\n // Use built-in YinzerFlow styling\n logWithStyle('error', ...args);\n }\n};\n\n// Verbose logging removed - just use info for detailed logging\n\nconst perf = (message: string, timeMs: number, data?: unknown): void => {\n if (currentLogLevel < internalLogLevels.info) return;\n const timestamp = formatTimestamp();\n\n // Performance-based emojis and phrases\n let emoji = '';\n let phrase = '';\n\n // < 50ms: Truly instant, users can't perceive any delay\n if (timeMs < 50) {\n emoji = '⚡ ';\n phrase = Math.random() < 0.5 ? \"lightning quick n'at!\" : 'faster than a Stillers touchdown!';\n // 50-100ms: Still feels instant for most interactions\n } else if (timeMs < 100) {\n emoji = '🔥 ';\n phrase = Math.random() < 0.5 ? \"that's the way!\" : \"smooth as butter n'at!\";\n // 100-200ms: Google's \"good\" threshold, still very responsive\n } else if (timeMs < 200) {\n emoji = '✅ ';\n phrase = Math.random() < 0.5 ? 'not bad yinz!' : \"keepin' up just fine!\";\n // 200-500ms: Noticeable but acceptable for complex operations\n } else if (timeMs < 500) {\n emoji = '⚠️ ';\n phrase = Math.random() < 0.5 ? 'eh, could be better' : \"slowin' down a bit there\";\n // 500ms-1s: Users start getting impatient\n } else if (timeMs < 1000) {\n emoji = '🐌 ';\n phrase = Math.random() < 0.5 ? \"that's draggin' n'at\" : \"c'mon, pick up the pace!\";\n // > 1s: Definitely problematic, needs attention\n } else {\n emoji = '💥 ';\n phrase = Math.random() < 0.5 ? 'what a jagoff response time!' : 'slower than traffic on the Parkway!';\n }\n\n const prefix = `${colors.magenta}[${logPrefix}] ${emoji} [${timestamp}] [PERF]${colors.reset}`;\n\n // Include timing in the data object for console.log's native formatting\n const perfData = data ? { ...data, executionTime: `${timeMs}ms` } : { executionTime: `${timeMs}ms` };\n console.log(`${prefix} ${message} -`, perfData, `- ${phrase}`);\n};\n\n// Network logging moved to networkLog.ts\n\n// =============================================================================\n// CONFIGURATION & EXPORTS\n// =============================================================================\n\n/**\n * Set the main log level using string values for intuitive configuration\n */\nconst setLogLevel = (level: 'error' | 'info' | 'off' | 'warn'): void => {\n const levelMap = {\n off: 0,\n error: 1,\n warn: 2,\n info: 3,\n } as const;\n\n currentLogLevel = levelMap[level];\n};\n\n/**\n * Set a custom logger for output routing\n */\nconst setCustomLogger = (logger: Logger): void => {\n customLogger = logger;\n};\n\n/**\n * Simple logging that mimics console.log behavior but with YinzerFlow styling\n */\nconst logWithStyle = (level: 'error' | 'info' | 'warn', ...args: Array<unknown>): void => {\n const timestamp = formatTimestamp();\n\n // Determine emoji, color, and phrase type based on level\n let emoji = '✅ ';\n let color: string = colors.cyan;\n let phraseType: 'negative' | 'neutral' | 'positive' = 'positive';\n let consoleMethod: 'error' | 'info' | 'warn' = 'info';\n\n if (level === 'error') {\n emoji = '❌ ';\n color = colors.red;\n phraseType = 'negative';\n consoleMethod = 'error';\n } else if (level === 'warn') {\n emoji = '⚠️ ';\n color = colors.yellow;\n phraseType = 'neutral';\n consoleMethod = 'warn';\n } else {\n emoji = '✅ ';\n color = colors.cyan;\n phraseType = 'positive';\n consoleMethod = 'info';\n }\n\n const phrase = getRandomPhrase(phraseType);\n const prefix = `${color}[${logPrefix}] ${emoji}[${timestamp}] [${level.toUpperCase()}]${colors.reset}`;\n\n // Let console.log handle all arguments naturally - just like console.log does\n // In production, this could be replaced with a no-op for zero bundle impact\n console[consoleMethod](`${prefix}`, ...args, `- ${phrase}`);\n};\n\nexport const log = {\n // Configuration\n setLogLevel,\n setCustomLogger,\n\n // Main logging functions with Pittsburgh personality\n info,\n warn,\n error,\n perf,\n\n // Constants for convenience\n levels: internalLogLevels,\n};\n\n// Export the Logger interface for custom implementations\nexport type { Logger } from '@typedefs/public/Logger.js';\n",
10
+ "import dayjs from 'dayjs';\nimport { colors } from '@constants/colors.ts';\nimport { logLevels } from '@constants/log.js';\nimport type { LogLevel } from '@typedefs/constants/log.ts';\nimport type { LoggerConfig } from '@typedefs/public/Logger.ts';\nimport type { Colors } from '@typedefs/constants/colors.js';\n\n/**\n * YinzerFlow Main Logging System 🏗️\n *\n * Simple, clean logging with Pittsburgh personality!\n * - Numeric levels (0=off, 1=error, 2=warn, 3=info)\n * - Smart formatting: Objects get pretty JSON, strings get YinzerFlow colors\n * - Network logging is separate (see networkLog.ts)\n */\n\nconst LOG_LEVELS = {\n off: 0,\n error: 1,\n warn: 2,\n info: 3,\n} as const;\n\nconst YINZER_PHRASES = {\n positive: [\"n'at!\", 'yinz are good!', \"that's the way!\", 'right on!', \"lookin' good!\", 'way to go!', 'keep it up!'],\n neutral: [\"n'at\", 'yinz know', \"just sayin'\", \"that's how it is\", 'what can ya do', 'it happens'],\n negative: ['aw jeez', \"that ain't right\", 'what a jagoff move', \"that's terrible n'at\", 'somebody messed up', 'this is bad news', 'yinz better fix this'],\n} as const;\n\nconst _getRandomPhrase = (type: 'negative' | 'neutral' | 'positive'): string => {\n const phrases = YINZER_PHRASES[type];\n return phrases[Math.floor(Math.random() * phrases.length)] ?? '';\n};\n\nconst _formatTimestamp = (): string => dayjs().format('YYYY-MM-DD HH:mm:ss.SSS');\n\nconst _logWithStyle = (level: LogLevel, prefix: string, ...args: Array<unknown>): void => {\n const timestamp = _formatTimestamp();\n let bodyColor: Colors = colors.reset;\n if (prefix === 'NETWORK') {\n bodyColor = colors.gray;\n }\n\n if (level === 'error') {\n const logPrefix = `${colors.red}[${prefix}] [${timestamp}] [ERROR]${colors.reset}`;\n console.error(`${logPrefix}`, `${bodyColor}`, ...args, `${colors.reset} - ${_getRandomPhrase('negative')}`);\n return;\n }\n\n if (level === 'warn') {\n const logPrefix = `${colors.yellow}[${prefix}] ⚠️ [${timestamp}] [WARN]${colors.reset}`;\n console.warn(`${logPrefix}`, `${bodyColor}`, ...args, `${colors.reset} - ${_getRandomPhrase('neutral')}`);\n return;\n }\n\n if (level === 'off') {\n return;\n }\n\n const logPrefix = `${colors.cyan}[${prefix}] [${timestamp}] [INFO]${colors.reset}`;\n console.info(`${logPrefix}`, `${bodyColor}`, ...args, `${colors.reset} - ${_getRandomPhrase('positive')}`);\n};\n\n/**\n * Creates a logger instance with isolated state\n *\n * @param initialConfig - Optional configuration for the logger\n * @returns Logger instance with logging methods\n */\nconst createLogger = (\n initialConfig?: LoggerConfig,\n): {\n info: (...args: Array<unknown>) => void;\n warn: (...args: Array<unknown>) => void;\n error: (...args: Array<unknown>) => void;\n levels: typeof LOG_LEVELS;\n} => {\n const state = {\n logLevel: initialConfig?.logLevel ?? logLevels.info,\n prefix: initialConfig?.prefix ?? 'YINZER',\n logger: initialConfig?.logger ?? null,\n };\n\n const _getNumericLevel = (level: string): number => (LOG_LEVELS as Record<string, number>)[level] ?? LOG_LEVELS.info;\n\n const info = (...args: Array<unknown>): void => {\n if (_getNumericLevel(state.logLevel) < LOG_LEVELS.info) return;\n\n if (state.logger) {\n state.logger.info(...args);\n return;\n }\n\n _logWithStyle('info', state.prefix, ...args);\n };\n\n const warn = (...args: Array<unknown>): void => {\n if (_getNumericLevel(state.logLevel) < LOG_LEVELS.warn) return;\n\n if (state.logger) {\n state.logger.warn(...args);\n return;\n }\n\n _logWithStyle('warn', state.prefix, ...args);\n };\n\n const error = (...args: Array<unknown>): void => {\n if (_getNumericLevel(state.logLevel) < LOG_LEVELS.error) return;\n\n if (state.logger) {\n state.logger.error(...args);\n return;\n }\n\n _logWithStyle('error', state.prefix, ...args);\n };\n\n return {\n info,\n warn,\n error,\n levels: LOG_LEVELS,\n };\n};\n\n// Default shared logger instance\nexport const log = createLogger();\n\n// Factory for creating custom logger instances\nexport { createLogger };\n",
11
+ "// Shared ANSI Color codes (reused from main log system)\nexport const colors = {\n reset: '\\x1b[0m',\n cyan: '\\x1b[96m', // Cyan for info\n yellow: '\\x1b[93m', // Yellow for warn\n red: '\\x1b[91m', // Red for error\n green: '\\x1b[92m', // Green for success\n magenta: '\\x1b[95m', // Magenta for performance\n gray: '\\x1b[90m', // Gray for network logs\n} as const;\n",
12
+ "/**\n * YinzerFlow Logging Levels\n *\n * String-based logging levels for intuitive configuration:\n * - 'off': No logging at all. Mainly used for network logging internally, but feel free to use it for other purposes.\n * - 'error': Only errors\n * - 'warn': Warnings and errors (includes security warnings, slow requests)\n * - 'info': Info, warnings, and errors (standard application logging)\n *\n * Network logging is controlled separately via boolean networkLogging config.\n */\nexport const logLevels = {\n off: 'off',\n error: 'error',\n warn: 'warn',\n info: 'info',\n} as const;\n",
12
13
  "import type { InternalJsonParserConfiguration } from '@typedefs/internal/InternalConfiguration.js';\nimport { log } from '@core/utils/log.ts';\n\n/**\n * Dangerous prototype properties that can lead to prototype pollution\n */\nconst DANGEROUS_PROPERTIES = ['__proto__', 'constructor', 'prototype'];\n\n/**\n * Parse JSON request body with comprehensive security protections\n *\n * Security Features:\n * - Request size validation\n * - Nesting depth limits to prevent stack overflow\n * - Prototype pollution protection\n * - Memory exhaustion protection (max keys, string length, array length)\n * - Proper error handling with security context\n */\nexport const parseApplicationJson = (body: string, config: InternalJsonParserConfiguration): unknown => {\n // Handle empty strings, whitespace, and null characters\n if (!body || !body.trim() || body.trim() === '\\0') {\n return undefined;\n }\n\n // SECURITY: Validate request body size to prevent DoS attacks\n const bodySize = Buffer.byteLength(body, 'utf8');\n if (bodySize > config.maxSize) {\n log.warn('[SECURITY] JSON request body too large', {\n size: bodySize,\n limit: config.maxSize,\n sizeMB: Math.round(bodySize / 1024 / 1024),\n });\n throw new Error(`Request body too large: ${bodySize} bytes exceeds limit of ${config.maxSize} bytes`);\n }\n\n let parsedData: unknown = null; // Initialize to fix linting\n\n try {\n // First pass: Parse JSON to get structure\n parsedData = JSON.parse(body);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`Invalid JSON syntax: ${message}`);\n }\n\n // SECURITY: Validate parsed data structure for security vulnerabilities\n try {\n _validateJsonStructure(parsedData, config, 1); // Start at depth 1 (root level)\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`JSON security validation failed: ${message}`);\n }\n\n return parsedData;\n};\n\n/**\n * Validate primitive values (strings, numbers, etc.)\n */\nconst _validatePrimitive = (data: unknown, config: InternalJsonParserConfiguration): void => {\n if (typeof data === 'string' && data.length > config.maxStringLength) {\n throw new Error(`String too long: ${data.length} characters exceeds limit of ${config.maxStringLength}`);\n }\n};\n\n/**\n * Validate array structure and elements\n */\nconst _validateArray = (data: Array<unknown>, config: InternalJsonParserConfiguration, depth: number): void => {\n // SECURITY: Check array length to prevent memory exhaustion\n if (data.length > config.maxArrayLength) {\n throw new Error(`Array too large: ${data.length} elements exceeds limit of ${config.maxArrayLength}`);\n }\n\n // Recursively validate array elements\n for (const item of data) {\n _validateJsonStructure(item, config, depth + 1);\n }\n};\n\n/**\n * Validate object keys for security issues\n */\nconst _validateObjectKeys = (keys: Array<string>, config: InternalJsonParserConfiguration): void => {\n // SECURITY: Check number of keys to prevent memory exhaustion\n if (keys.length > config.maxKeys) {\n throw new Error(`Object has too many keys: ${keys.length} exceeds limit of ${config.maxKeys}`);\n }\n\n // SECURITY: Check for prototype pollution attempts\n if (!config.allowPrototypeProperties) {\n for (const key of keys) {\n if (DANGEROUS_PROPERTIES.includes(key)) {\n log.warn('[SECURITY] Prototype pollution attempt detected', {\n property: key,\n dangerousProperties: DANGEROUS_PROPERTIES,\n });\n throw new Error(`Prototype pollution attempt detected: property '${key}' is not allowed`);\n }\n }\n }\n};\n\n/**\n * Validate object properties and values\n */\nconst _validateObjectProperties = (data: Record<string, unknown>, config: InternalJsonParserConfiguration, depth: number): void => {\n const keys = Object.keys(data);\n\n for (const key of keys) {\n // SECURITY: Check key length\n if (key.length > config.maxStringLength) {\n throw new Error(`Object key too long: '${key.substring(0, 50)}...' exceeds limit of ${config.maxStringLength}`);\n }\n\n const value = data[key];\n\n // SECURITY: Check string value length\n if (typeof value === 'string' && value.length > config.maxStringLength) {\n throw new Error(`String value too long: property '${key}' has ${value.length} characters, exceeds limit of ${config.maxStringLength}`);\n }\n\n // Recursively validate nested structures\n _validateJsonStructure(value, config, depth + 1);\n }\n};\n\n/**\n * Recursively validate JSON structure for security vulnerabilities\n *\n * @param data - Data to validate\n * @param config - Security configuration\n * @param depth - Current nesting depth (starts at 1 for root level)\n */\nconst _validateJsonStructure = (data: unknown, config: InternalJsonParserConfiguration, depth: number): void => {\n // SECURITY: Check nesting depth to prevent stack overflow attacks\n if (depth > config.maxDepth) {\n log.warn('[SECURITY] JSON nesting too deep - potential stack overflow attack', {\n currentDepth: depth,\n maxDepth: config.maxDepth,\n });\n throw new Error(`JSON nesting too deep: current depth ${depth} exceeds maximum depth of ${config.maxDepth}`);\n }\n\n // Handle null and primitives\n if (data === null || typeof data !== 'object') {\n _validatePrimitive(data, config);\n return;\n }\n\n // Handle arrays\n if (Array.isArray(data)) {\n _validateArray(data, config, depth);\n return;\n }\n\n // Handle objects\n const keys = Object.keys(data);\n _validateObjectKeys(keys, config);\n _validateObjectProperties(data as Record<string, unknown>, config, depth);\n};\n",
13
14
  "import type { InternalContentDisposition, InternalFileUpload, InternalMultipartFormData } from '@typedefs/internal/InternalRequestImpl.ts';\nimport type { InternalFileUploadConfiguration } from '@typedefs/internal/InternalConfiguration.js';\nimport { log } from '@core/utils/log.ts';\n\n/**\n * Split a multipart section into headers and content\n *\n * @example\n * ```ts\n * splitMultipartSection('Content-Disposition: form-data; name=\"file\"; filename=\"example.txt\"\\r\\nContent-Type: text/plain\\r\\n\\r\\nThis is the content of the file.\\r\\n');\n * // Returns ['Content-Disposition: form-data; name=\"file\"; filename=\"example.txt\"\\r\\nContent-Type: text/plain\\r\\n', 'This is the content of the file.\\r\\n']\n * ```\n */\nconst splitMultipartSection = (section: string): [string, string] => {\n const trimmedSection = section.startsWith('\\r\\n') ? section.slice(2) : section;\n const headerEndIndex = trimmedSection.indexOf('\\r\\n\\r\\n');\n\n if (headerEndIndex === -1) {\n return ['', ''];\n }\n\n const headers = trimmedSection.slice(0, headerEndIndex);\n const content = trimmedSection.slice(headerEndIndex + 4);\n return [headers, content];\n};\n\n/**\n * Simple Content-Disposition parser for multipart sections\n *\n * @example\n * ```ts\n * parseContentDisposition('Content-Disposition: form-data; name=\"file\"; filename=\"example.txt\"\\r\\nContent-Type: text/plain\\r\\n\\r\\nThis is the content of the file.\\r\\n');\n * // Returns { name: 'file', filename: 'example.txt' }\n * ```\n */\nconst parseContentDisposition = (headerLine: string): InternalContentDisposition => {\n const result: InternalContentDisposition = { name: '' };\n\n const nameMatch = /name=(?:\"(?<temp2>[^\"]*)\"|(?<temp1>[^;,\\s]+))/i.exec(headerLine);\n const filenameMatch = /filename=(?:\"(?<temp2>[^\"]*)\"|(?<temp1>[^;,\\s]+))/i.exec(headerLine);\n\n if (nameMatch) {\n result.name = nameMatch[1] ?? nameMatch[2] ?? '';\n }\n\n if (filenameMatch) {\n const filename = filenameMatch[1] ?? filenameMatch[2];\n if (filename) {\n result.filename = filename;\n }\n }\n\n return result;\n};\n\n/**\n * Extract Content-Type from multipart section headers\n *\n * @example\n * ```ts\n * extractSectionContentType('Content-Type: text/plain\\r\\n\\r\\nThis is the content of the file.\\r\\n');\n * // Returns 'text/plain'\n * ```\n */\nconst extractSectionContentType = (headers: string): string => {\n const lines = headers.split(/\\r?\\n/);\n const contentTypeLine = lines.find((line) => line.toLowerCase().startsWith('content-type:'));\n\n if (!contentTypeLine) return 'application/octet-stream';\n\n return (\n contentTypeLine\n .slice(contentTypeLine.indexOf(':') + 1)\n .trim()\n .split(';')[0]\n ?.trim() ?? 'application/octet-stream'\n );\n};\n\n/**\n * Determine if content should be treated as binary\n *\n * @example\n * ```ts\n * isBinaryContent('image/png');\n * // Returns true\n * ```\n */\nconst isBinaryContent = (contentTypeValue: string): boolean => {\n const binaryTypes = ['image/', 'audio/', 'video/', 'application/octet-stream', 'application/pdf', 'application/zip', 'application/x-'];\n\n return binaryTypes.some((type) => contentTypeValue.toLowerCase().startsWith(type));\n};\n\n/**\n * Calculate content length for string or Buffer\n *\n * @example\n * ```ts\n * calculateContentLength('Hello, world!');\n * // Returns 13\n * ```\n */\nconst calculateContentLength = (content: Buffer | string): number => (Buffer.isBuffer(content) ? content.length : Buffer.byteLength(content, 'utf8'));\n\n/**\n * Validate file against security configuration\n */\nconst _validateFileUpload = (file: InternalFileUpload, config?: InternalFileUploadConfiguration): void => {\n if (!config) return;\n\n // SECURITY: Check file size\n if (file.size > config.maxFileSize) {\n log.warn('[SECURITY] File upload too large', {\n filename: file.filename,\n size: file.size,\n limit: config.maxFileSize,\n sizeMB: Math.round(file.size / 1024 / 1024),\n });\n throw new Error(`File too large: ${file.filename} is ${file.size} bytes, exceeds limit of ${config.maxFileSize} bytes`);\n }\n\n // SECURITY: Check filename length\n if (file.filename && file.filename.length > config.maxFilenameLength) {\n throw new Error(`Filename too long: ${file.filename.length} characters exceeds limit of ${config.maxFilenameLength}`);\n }\n\n // SECURITY: Check file extension\n if (file.filename) {\n const extension = file.filename.toLowerCase().substring(file.filename.lastIndexOf('.'));\n\n // Check blocked extensions\n if (config.blockedExtensions.includes(extension)) {\n log.warn('[SECURITY] Blocked file type upload attempt', {\n filename: file.filename,\n extension,\n blockedExtensions: config.blockedExtensions,\n });\n throw new Error(`File type not allowed: ${extension} files are blocked for security reasons`);\n }\n\n // Check allowed extensions (if specified)\n if (config.allowedExtensions.length > 0 && !config.allowedExtensions.includes(extension)) {\n throw new Error(`File type not allowed: ${extension} is not in the allowed extensions list`);\n }\n }\n};\n\n/**\n * Handle file upload processing with binary support and security validation\n *\n * @example\n * ```ts\n * handleFileUpload({\n * contentDisposition: { name: 'file', filename: 'example.txt' },\n * contentSection: 'This is the content of the file.\\r\\n',\n * });\n * ```\n */\nconst handleFileUpload = ({\n contentDisposition,\n contentSection,\n headersSection,\n config,\n}: {\n contentDisposition: InternalContentDisposition;\n contentSection: string;\n headersSection: string;\n config?: InternalFileUploadConfiguration | undefined;\n}): InternalFileUpload => {\n const contentTypeValue = extractSectionContentType(headersSection);\n\n // Remove trailing \\r\\n that's part of the multipart boundary\n const trimmedContent = contentSection.endsWith('\\r\\n') ? contentSection.slice(0, -2) : contentSection;\n\n // For binary files, convert string to Buffer\n const content: Buffer | string = isBinaryContent(contentTypeValue) ? Buffer.from(trimmedContent, 'binary') : trimmedContent;\n\n const file: InternalFileUpload = {\n filename: contentDisposition.filename ?? '',\n contentType: contentTypeValue,\n size: calculateContentLength(content),\n content,\n };\n\n // SECURITY: Validate file against configuration\n _validateFileUpload(file, config);\n\n return file;\n};\n\n/**\n * Parse multipart form data request body with binary file support and security protections\n *\n * Security Features:\n * - File size validation per file and total\n * - File extension filtering (allow/block lists)\n * - Filename length validation\n * - File count limits\n *\n * @example\n * ```ts\n * const config = { maxFileSize: 10485760, maxFiles: 10, blockedExtensions: ['.exe'] };\n * parseMultipartFormData('...multipart body...', 'boundary123', config);\n * // Returns { fields: { ... }, files: [...] }\n * ```\n */\nexport const parseMultipartFormData = (body: string, boundary: string, config?: InternalFileUploadConfiguration): InternalMultipartFormData => {\n const result: InternalMultipartFormData = {\n fields: {},\n files: [],\n };\n\n // Split the body into parts using the boundary\n const parts = body.split(`--${boundary}`).slice(1); // Skip the first empty part\n\n let totalFileSize = 0;\n\n for (const part of parts) {\n // Skip empty parts and the final boundary marker\n if (!part || part.trim() === '' || part.trim() === '--') continue;\n\n // Parse the part headers and content\n const [headersSection, contentSection] = splitMultipartSection(part);\n if (!headersSection) continue; // Skip malformed parts\n\n // Find Content-Disposition header\n const lines = headersSection.split(/\\r?\\n/);\n const dispositionLine = lines.find((line) => line.toLowerCase().startsWith('content-disposition:'));\n if (!dispositionLine) continue;\n\n const contentDisposition = parseContentDisposition(dispositionLine);\n if (!contentDisposition.name) continue;\n\n // Handle file upload\n if (contentDisposition.filename !== undefined) {\n // SECURITY: Check file count limit\n if (config && result.files.length >= config.maxFiles) {\n log.warn('[SECURITY] Too many files in upload request', {\n fileCount: result.files.length,\n maxFiles: config.maxFiles,\n });\n throw new Error(`Too many files: maximum of ${config.maxFiles} files allowed per request`);\n }\n\n const file = handleFileUpload({\n contentDisposition,\n contentSection,\n headersSection,\n config,\n });\n\n totalFileSize += file.size;\n\n // SECURITY: Check total file size\n if (config && totalFileSize > config.maxTotalSize) {\n log.warn('[SECURITY] Total upload size too large', {\n totalSize: totalFileSize,\n limit: config.maxTotalSize,\n totalSizeMB: Math.round(totalFileSize / 1024 / 1024),\n });\n throw new Error(`Total file size too large: ${totalFileSize} bytes exceeds limit of ${config.maxTotalSize} bytes`);\n }\n\n result.files.push(file);\n }\n\n // Handle regular form field\n if (contentDisposition.filename === undefined) {\n // Remove trailing \\r\\n that's part of the multipart boundary\n const trimmedContent = contentSection.endsWith('\\r\\n') ? contentSection.slice(0, -2) : contentSection;\n result.fields[contentDisposition.name] = trimmedContent;\n }\n }\n\n return result;\n};\n",
14
15
  "import type { InternalUrlEncodedConfiguration } from '@typedefs/internal/InternalConfiguration.js';\n\n/**\n * Validate form field counts and basic structure\n */\nconst _validateFormStructure = (pairs: Array<string>, config: InternalUrlEncodedConfiguration): void => {\n // SECURITY: Check field count to prevent memory exhaustion\n if (pairs.length > config.maxFields) {\n throw new Error(`Too many form fields: ${pairs.length} exceeds limit of ${config.maxFields}`);\n }\n};\n\n/**\n * Validate individual field name and value lengths\n */\nconst _validateFieldLengths = (key: string, value: string | undefined, config: InternalUrlEncodedConfiguration): void => {\n // SECURITY: Check field name length\n if (key.length > config.maxFieldNameLength) {\n throw new Error(`Form field name too long: ${key.length} characters exceeds limit of ${config.maxFieldNameLength}`);\n }\n\n // SECURITY: Check field value length\n if (value && value.length > config.maxFieldLength) {\n throw new Error(`Form field value too long: field '${key}' has ${value.length} characters, exceeds limit of ${config.maxFieldLength}`);\n }\n};\n\n/**\n * Validate decoded field lengths (they may expand during decoding)\n */\nconst _validateDecodedLengths = (decodedKey: string, decodedValue: string, config: InternalUrlEncodedConfiguration): void => {\n // SECURITY: Check decoded field name length (could expand during decoding)\n if (decodedKey.length > config.maxFieldNameLength) {\n throw new Error(`Decoded form field name too long: ${decodedKey.length} characters exceeds limit of ${config.maxFieldNameLength}`);\n }\n\n // SECURITY: Check decoded field value length\n if (decodedValue.length > config.maxFieldLength) {\n throw new Error(\n `Decoded form field value too long: field '${decodedKey}' has ${decodedValue.length} characters, exceeds limit of ${config.maxFieldLength}`,\n );\n }\n};\n\n/**\n * Process a single form field pair with security validation\n */\nconst _processFieldPair = (pair: string, params: Record<string, string>, config?: InternalUrlEncodedConfiguration): void => {\n const [key, value] = pair.split('=');\n if (!key) return;\n\n // Validate field lengths if config provided\n if (config) {\n _validateFieldLengths(key, value, config);\n }\n\n try {\n const decodedKey = decodeURIComponent(key);\n const decodedValue = value ? decodeURIComponent(value) : '';\n\n // Validate decoded lengths if config provided\n if (config) {\n _validateDecodedLengths(decodedKey, decodedValue, config);\n }\n\n params[decodedKey] = decodedValue;\n } catch (error) {\n // Handle malformed URL encoding - check if it's a validation error or decoding error\n if (error instanceof Error && error.message.includes('exceeds limit')) {\n throw error; // Re-throw validation errors\n }\n\n // Handle malformed URL encoding gracefully by using original values\n params[key] = value ?? '';\n }\n};\n\n/**\n * Parse URL-encoded form data with security protections\n *\n * Security Features:\n * - Field count limits to prevent memory exhaustion\n * - Field name length validation\n * - Field value length validation\n * - Malformed URL encoding handling\n *\n * @example\n * ```ts\n * const config = { maxFields: 1000, maxFieldNameLength: 100, maxFieldLength: 1048576 };\n * parseUrlEncodedForm('name=John&age=30', config);\n * // Returns { name: 'John', age: '30' }\n * ```\n */\nexport const parseUrlEncodedForm = (body: string, config?: InternalUrlEncodedConfiguration): Record<string, string> => {\n const params: Record<string, string> = {};\n const pairs = body.split('&');\n\n // Validate form structure if config provided\n if (config) {\n _validateFormStructure(pairs, config);\n }\n\n // Process each field pair\n for (const pair of pairs) {\n _processFieldPair(pair, params, config);\n }\n\n return params;\n};\n",
@@ -22,24 +23,24 @@
22
23
  "/**\n * Extract the boundary from the content type header\n *\n * @example\n * ```ts\n * extractBoundaryFromHeader('multipart/form-data; boundary=----WebKitFormBoundary1234567890');\n * // Returns '----WebKitFormBoundary1234567890'\n * ```\n */\nexport const extractBoundaryFromHeader = (contentTypeHeader?: string): string | undefined => {\n if (!contentTypeHeader) return undefined;\n\n const boundaryMatch = /boundary\\s*=\\s*(?<temp1>[^;,\\s]*)/i.exec(contentTypeHeader);\n return boundaryMatch?.[1];\n};\n",
23
24
  "import type { InternalHttpHeaders } from '@typedefs/constants/http.js';\n\n// Security limits to prevent DoS attacks\nconst MAX_HEADERS = 100;\nconst MAX_HEADER_NAME_LENGTH = 200;\nconst MAX_HEADER_VALUE_LENGTH = 8192;\n\n/**\n * Parse incoming request headers from raw headers string with security validation\n *\n * This is the main orchestrator function that delegates to specialized helpers\n * for each processing step: validation → parsing → sanitization → security\n *\n * @example\n * ```ts\n * parseRequestHeaders('Host: example.com\\r\\nContent-Type: application/json\\r\\n\\r\\n');\n * // Returns { host: 'example.com', 'content-type': 'application/json' }\n * ```\n */\nexport const parseRequestHeaders = (rawHeaders: string): Partial<Record<InternalHttpHeaders, string>> => {\n if (!rawHeaders) return {};\n\n // Step 1: Pre-parse validation (format, DoS protection)\n validateRawHeaders(rawHeaders);\n\n // Step 2: Parse header structure into key-value pairs\n const parsedHeaders = parseHeaderStructure(rawHeaders);\n\n // Step 3: Sanitize header values (remove control chars, etc.)\n const sanitizedHeaders = sanitizeHeaders(parsedHeaders);\n\n // Step 4: Apply security policies (business logic, injection prevention)\n const securedHeaders = applySecurityPolicies(sanitizedHeaders);\n\n return securedHeaders;\n};\n\n/**\n * Step 1: Validate raw headers before parsing\n * Checks for DoS protection and basic format sanity\n */\nexport const validateRawHeaders = (rawHeaders: string): void => {\n // SECURITY: Limit number of potential headers to prevent DoS\n const headerLines = rawHeaders.split(/\\r\\n|\\r|\\n/);\n if (headerLines.length > MAX_HEADERS) {\n throw new Error(`Too many headers: maximum ${MAX_HEADERS} allowed`);\n }\n\n // Basic format validation could go here\n // (e.g., overall size limits, obvious malformation)\n};\n\n/**\n * Step 2: Parse header structure into key-value pairs\n * Handles line ending normalization and basic parsing\n */\nexport const parseHeaderStructure = (rawHeaders: string): Record<string, string> => {\n const headers: Record<string, string> = {};\n\n // Normalize line endings and split\n const normalizedHeaders = rawHeaders.replace(/\\r\\n|\\r|\\n/g, '\\n');\n const headerLines = normalizedHeaders.split('\\n');\n\n for (const line of headerLines) {\n if (!line.trim()) continue;\n\n const colonIndex = line.indexOf(':');\n if (colonIndex === -1) continue;\n\n const key = line.slice(0, colonIndex).trim();\n const value = line.slice(colonIndex + 1).trim();\n\n if (!key) continue;\n\n // SECURITY: Validate header name against RFC 7230\n if (!isValidHeaderName(key)) {\n throw new Error(`Invalid header name: ${key}`);\n }\n\n // SECURITY: Limit header name length\n if (key.length > MAX_HEADER_NAME_LENGTH) {\n throw new Error(`Header name too long: maximum ${MAX_HEADER_NAME_LENGTH} characters allowed`);\n }\n\n // SECURITY: Limit header value length\n if (value.length > MAX_HEADER_VALUE_LENGTH) {\n throw new Error(`Header value too long: maximum ${MAX_HEADER_VALUE_LENGTH} characters allowed`);\n }\n\n // Store with lowercase key for consistency\n headers[key.toLowerCase()] = value;\n }\n\n return headers;\n};\n\n/**\n * Step 3: Sanitize header values\n * Removes control characters and normalizes values\n */\nexport const sanitizeHeaders = (headers: Record<string, string>): Record<string, string> => {\n const sanitized: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(headers)) {\n sanitized[key] = sanitizeHeaderValue(value);\n }\n\n return sanitized;\n};\n\n/**\n * Step 4: Apply security policies\n * Business logic validation and injection prevention\n */\nexport const applySecurityPolicies = (headers: Record<string, string>): Record<string, string> =>\n // Note: CRLF injection detection would go here if we were setting response headers\n // For parsing incoming request headers, this step mainly handles business logic validation\n\n // Could add checks like:\n // - Suspicious header combinations\n // - Known attack patterns in values\n // - Business-specific header validation\n\n headers;\n\n/**\n * Validate header name according to RFC 7230\n */\nconst isValidHeaderName = (name: string): boolean => {\n // RFC 7230: header-name = token\n // token = 1*tchar\n // tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" / \"*\" / \"+\" / \"-\" / \".\" /\n // \"^\" / \"_\" / \"`\" / \"|\" / \"~\" / DIGIT / ALPHA\n const validHeaderNameRegex = /^[a-zA-Z0-9!#$%&'*+\\-.^_`|~]+$/;\n return validHeaderNameRegex.test(name);\n};\n\n/**\n * Sanitize header value to prevent injection attacks\n */\nconst sanitizeHeaderValue = (value: string): string => {\n // SECURITY: Remove control characters except horizontal tab\n // Allow printable ASCII, horizontal tab (0x09), and extended ASCII\n const sanitized = value.replace(/[\\x00-\\x08\\x0A-\\x1F\\x7F]/g, '');\n return sanitized;\n};\n",
24
25
  "import { parseBody } from './utils/parseBody.ts';\nimport type { InternalContentType, InternalHttpHeaders, InternalHttpMethod } from '@typedefs/constants/http.js';\nimport { parseHttpRequest } from '@core/execution/utils/parseHttpRequest.ts';\nimport { parseQuery } from '@core/execution/utils/parseQuery.ts';\nimport { parseIpAddress } from '@core/execution/utils/parseIpAddress.ts';\nimport { extractBoundaryFromHeader } from '@core/execution/utils/extractBoundaryFromHeader.ts';\nimport { parseRequestHeaders } from '@core/execution/utils/parseRequestHeaders.ts';\nimport type { Request } from '@typedefs/public/Request.ts';\nimport type { SetupImpl } from '@core/setup/SetupImpl.ts';\nimport type { InternalRequestImpl } from '@typedefs/internal/InternalRequestImpl.ts';\nimport type { InternalSetupImpl } from '@typedefs/internal/InternalSetupImpl.ts';\n\nexport class RequestImpl implements InternalRequestImpl {\n readonly _rawRequest: Buffer | string;\n readonly _setup: InternalSetupImpl;\n\n method: InternalHttpMethod;\n path: string;\n protocol: string;\n headers: Partial<Record<InternalHttpHeaders, string>>;\n body: unknown;\n query: Record<string, string>;\n params: Record<string, string>;\n ipAddress: string;\n rawBody: Buffer | string;\n\n constructor(rawRequest: Request['rawBody'], setup: SetupImpl, clientAddress?: string) {\n this._rawRequest = rawRequest;\n this._setup = setup;\n\n // Set initial IP address from socket, will be updated if headers provide better info\n this.ipAddress = clientAddress ?? '';\n\n const { method, path, protocol, headers, body, query, params, rawBody } = this._parseRequestIntoObject();\n\n this.method = method;\n this.path = path;\n this.protocol = protocol;\n this.headers = headers;\n this.body = body;\n this.query = query ?? {};\n this.params = params ?? {};\n this.rawBody = rawBody;\n\n // Update IP address if parsing from headers provides something\n const parsedIpAddress = parseIpAddress(this._setup, headers);\n if (parsedIpAddress) {\n this.ipAddress = parsedIpAddress;\n }\n }\n\n private _parseRequestIntoObject(): Omit<Request, 'ipAddress'> {\n const request = this._rawRequest.toString();\n\n const { method, path, protocol, headersRaw, rawBody } = parseHttpRequest(request);\n\n const headers = parseRequestHeaders(headersRaw);\n\n // Extract content type and boundary for body parsing\n const contentTypeHeader = headers['content-type'];\n const mainContentType = contentTypeHeader?.split(';')[0]?.trim().toLowerCase() as InternalContentType;\n const boundary = extractBoundaryFromHeader(contentTypeHeader);\n\n return {\n method,\n path,\n protocol,\n headers,\n body: parseBody(rawBody, {\n headerContentType: mainContentType,\n boundary,\n config: this._setup._configuration.bodyParser,\n }),\n query: parseQuery(path),\n params: {}, // Route params will be set in RequestHandlerImpl when route is matched\n rawBody,\n };\n }\n}\n",
25
- "import dayjs from 'dayjs';\nimport { formatBodyIntoString } from '@core/execution/utils/formatBodyIntoString.ts';\nimport { determineEncoding } from '@core/execution/utils/determineEncoding.ts';\nimport { inferContentType } from '@core/execution/utils/inferContentType.ts';\nimport { mapStatusCodeToMessage } from '@core/execution/utils/mapStatusCodeToMessage.ts';\nimport { filterAndValidateHeaders } from '@core/execution/utils/validateResponseHeaders.ts';\nimport { httpEncoding, httpStatus, httpStatusCode } from '@constants/http.ts';\nimport type { InternalHttpEncoding, InternalHttpHeaders, InternalHttpStatus, InternalHttpStatusCode } from '@typedefs/constants/http.js';\nimport type { Request } from '@typedefs/public/Request.ts';\nimport type { InternalResponseImpl } from '@typedefs/internal/InternalResponseImpl.d.ts';\nimport { determineContentLength } from '@core/execution/utils/determineContentLength.ts';\n\nexport class ResponseImpl implements InternalResponseImpl {\n readonly _request: Request;\n\n _statusCode: InternalHttpStatusCode = httpStatusCode.ok;\n _status: InternalHttpStatus = httpStatus.ok;\n _headers: Partial<Record<InternalHttpHeaders, string>> = {};\n _body: unknown = '';\n _stringBody = '';\n _encoding: InternalHttpEncoding = httpEncoding.utf8;\n\n constructor(request: Request) {\n this._request = request;\n this._setSecurityHeaders();\n }\n\n _parseResponseIntoString(): void {\n // Example: HTTP/1.1 200 OK\n const statusLine = `${this._request.protocol} ${this._statusCode} ${this._status}`;\n\n // Example: Content-Type: text/html\n const headerLines = Object.entries(this._headers).map(([key, value]) => `${key}: ${value}`);\n\n // Determine encoding based on Content-Type header and body content\n const encoding = determineEncoding(this._headers['content-type'], this._body);\n\n // Example: <html><body><h1>Hello, world!</h1></body></html> or { \"message\": \"Hello, world!\" }\n const body = formatBodyIntoString(this._body, { encoding });\n\n // Example: HTTP/1.1 200 OK\\nContent-Type: text/html\\n\\n<html><body><h1>Hello, world!</h1></body></html>\n this._encoding = encoding;\n\n // Fix: Handle the case when there are no headers properly\n const headersSection = headerLines.length > 0 ? `${headerLines.join('\\n')}\\n` : '';\n this._stringBody = `${statusLine}\\n${headersSection}\\n${body}`;\n\n const contentLength = determineContentLength(this._stringBody, this._encoding);\n this._setHeadersIfNotSet({\n Date: dayjs().format('ddd, DD MMM YYYY HH:mm:ss [GMT]'),\n 'Content-Length': contentLength,\n });\n }\n\n _setHeadersIfNotSet(headers: Partial<Record<InternalHttpHeaders, string>>): void {\n // SECURITY: Filter undefined values and validate response headers for CRLF injection\n // Only validate headers that aren't already set\n const headersToSet: Record<string, string> = {};\n for (const [key, value] of Object.entries(headers)) {\n if (value !== undefined && !(key in this._headers)) {\n headersToSet[key] = value;\n }\n }\n\n const validatedHeaders = filterAndValidateHeaders(headersToSet);\n\n // Set headers after validation passes\n Object.assign(this._headers, validatedHeaders);\n }\n\n _setBody(body: unknown): void {\n this._body = body;\n\n // Auto-set content-type if not already set\n if (!this._headers['content-type']) {\n const detectedContentType = inferContentType(body);\n this._setHeadersIfNotSet({\n 'Content-Type': detectedContentType,\n });\n }\n }\n\n setStatusCode(statusCode: InternalHttpStatusCode): void {\n this._statusCode = statusCode;\n this._status = mapStatusCodeToMessage(statusCode);\n }\n\n addHeaders(headers: Partial<Record<InternalHttpHeaders, string>>): void {\n // SECURITY: Filter undefined values and validate response headers for CRLF injection\n const validatedHeaders = filterAndValidateHeaders(headers);\n\n // Set headers after validation passes\n this._headers = { ...this._headers, ...validatedHeaders };\n }\n\n removeHeaders(headerNames: Array<InternalHttpHeaders>): void {\n for (const headerName of headerNames) {\n delete this._headers[headerName];\n }\n }\n\n /**\n * Set default security headers to protect against common vulnerabilities\n * These headers are set only if not already present, allowing users to override if needed\n */\n _setSecurityHeaders(): void {\n this._setHeadersIfNotSet({\n 'X-Content-Type-Options': 'nosniff',\n 'X-Frame-Options': 'DENY',\n 'X-XSS-Protection': '1; mode=block',\n 'Referrer-Policy': 'strict-origin-when-cross-origin',\n });\n }\n}\n",
26
+ "import dayjs from 'dayjs';\nimport { formatBodyIntoString } from '@core/execution/utils/formatBodyIntoString.ts';\nimport { determineEncoding } from '@core/execution/utils/determineEncoding.ts';\nimport { inferContentType } from '@core/execution/utils/inferContentType.ts';\nimport { mapStatusCodeToMessage } from '@core/execution/utils/mapStatusCodeToMessage.ts';\nimport { filterAndValidateHeaders } from '@core/execution/utils/validateResponseHeaders.ts';\nimport { httpEncoding, httpStatus, httpStatusCode } from '@constants/http.ts';\nimport type { InternalHttpEncoding, InternalHttpHeaders, InternalHttpStatus, InternalHttpStatusCode } from '@typedefs/constants/http.js';\nimport type { Request } from '@typedefs/public/Request.ts';\nimport type { InternalResponseImpl } from '@typedefs/internal/InternalResponseImpl.d.ts';\nimport { calculateContentSizeInBytes } from '@core/utils/calculateContentSizeInBytes.ts';\n\nexport class ResponseImpl implements InternalResponseImpl {\n readonly _request: Request;\n\n _statusCode: InternalHttpStatusCode = httpStatusCode.ok;\n _status: InternalHttpStatus = httpStatus.ok;\n _headers: Partial<Record<InternalHttpHeaders, string>> = {};\n _body: unknown = '';\n _stringBody = '';\n _encoding: InternalHttpEncoding = httpEncoding.utf8;\n\n constructor(request: Request) {\n this._request = request;\n this._setSecurityHeaders();\n }\n\n _parseResponseIntoString(): void {\n // Example: HTTP/1.1 200 OK\n const statusLine = `${this._request.protocol} ${this._statusCode} ${this._status}`;\n\n // Example: Content-Type: text/html\n const headerLines = Object.entries(this._headers).map(([key, value]) => `${key}: ${value}`);\n\n // Determine encoding based on Content-Type header and body content\n const encoding = determineEncoding(this._headers['content-type'], this._body);\n\n // Example: <html><body><h1>Hello, world!</h1></body></html> or { \"message\": \"Hello, world!\" }\n const body = formatBodyIntoString(this._body, { encoding });\n\n // Example: HTTP/1.1 200 OK\\nContent-Type: text/html\\n\\n<html><body><h1>Hello, world!</h1></body></html>\n this._encoding = encoding;\n\n // Fix: Handle the case when there are no headers properly\n const headersSection = headerLines.length > 0 ? `${headerLines.join('\\n')}\\n` : '';\n this._stringBody = `${statusLine}\\n${headersSection}\\n${body}`;\n\n const contentLength = calculateContentSizeInBytes(this._stringBody);\n this._setHeadersIfNotSet({\n Date: dayjs().format('ddd, DD MMM YYYY HH:mm:ss [GMT]'),\n 'Content-Length': String(contentLength),\n });\n }\n\n _setHeadersIfNotSet(headers: Partial<Record<InternalHttpHeaders, string>>): void {\n // SECURITY: Filter undefined values and validate response headers for CRLF injection\n // Only validate headers that aren't already set\n const headersToSet: Record<string, string> = {};\n for (const [key, value] of Object.entries(headers)) {\n if (value !== undefined && !(key in this._headers)) {\n headersToSet[key] = value;\n }\n }\n\n const validatedHeaders = filterAndValidateHeaders(headersToSet);\n\n // Set headers after validation passes\n Object.assign(this._headers, validatedHeaders);\n }\n\n _setBody(body: unknown): void {\n this._body = body;\n\n // Auto-set content-type if not already set\n if (!this._headers['content-type']) {\n const detectedContentType = inferContentType(body);\n this._setHeadersIfNotSet({\n 'Content-Type': detectedContentType,\n });\n }\n }\n\n setStatusCode(statusCode: InternalHttpStatusCode): void {\n this._statusCode = statusCode;\n this._status = mapStatusCodeToMessage(statusCode);\n }\n\n addHeaders(headers: Partial<Record<InternalHttpHeaders, string>>): void {\n // SECURITY: Filter undefined values and validate response headers for CRLF injection\n const validatedHeaders = filterAndValidateHeaders(headers);\n\n // Set headers after validation passes\n this._headers = { ...this._headers, ...validatedHeaders };\n }\n\n removeHeaders(headerNames: Array<InternalHttpHeaders>): void {\n for (const headerName of headerNames) {\n delete this._headers[headerName];\n }\n }\n\n /**\n * Set default security headers to protect against common vulnerabilities\n * These headers are set only if not already present, allowing users to override if needed\n */\n _setSecurityHeaders(): void {\n this._setHeadersIfNotSet({\n 'X-Content-Type-Options': 'nosniff',\n 'X-Frame-Options': 'DENY',\n 'X-XSS-Protection': '1; mode=block',\n 'Referrer-Policy': 'strict-origin-when-cross-origin',\n });\n }\n}\n",
26
27
  "/**\n * Format the body into a string for HTTP response transmission\n *\n * Handles various body types including:\n * - Objects/Arrays: JSON stringified\n * - Strings: returned as-is\n * - Binary data (Buffer/Uint8Array): converted to base64 or kept as binary string\n * - Primitives: converted to string\n * - null/undefined: empty string\n *\n * @example\n * ```typescript\n * // JSON object\n * const body = { message: 'Hello, world!' };\n * const formattedBody = formatBodyIntoString(body);\n * // formattedBody === '{\"message\":\"Hello, world!\"}'\n *\n * // Binary data\n * const binaryBody = Buffer.from('binary data');\n * const formattedBinary = formatBodyIntoString(binaryBody);\n * // formattedBinary === 'binary data' (as string)\n *\n * // Base64 encoding option for true binary\n * const imageBuffer = Buffer.from([0xFF, 0xD8, 0xFF]); // JPEG header\n * const base64Body = formatBodyIntoString(imageBuffer, { encoding: 'base64' });\n * // base64Body === '/9j/' (base64 encoded)\n * ```\n */\nexport const formatBodyIntoString = (body: unknown, options?: { encoding?: 'base64' | 'binary' | 'utf8' }): string => {\n const encoding = options?.encoding ?? 'utf8';\n\n // Handle null/undefined\n if (body === null || body === undefined) return '';\n\n // Handle binary data types\n if (Buffer.isBuffer(body)) return handleBuffer(body, encoding);\n if (body instanceof Uint8Array) return handleUint8Array(body, encoding);\n if (body instanceof ArrayBuffer) return handleArrayBuffer(body, encoding);\n\n // Handle strings\n if (typeof body === 'string') return body;\n\n // Handle objects and arrays (including Date, etc.)\n if (typeof body === 'object') return handleObjectsAndArrays(body);\n\n // Handle all primitives and functions - they all stringify the same way\n // This covers: number, boolean, bigint, symbol, function\n return String(body as string);\n};\n\nconst handleBuffer = (body: Buffer, encoding: 'base64' | 'binary' | 'utf8'): string => {\n if (encoding === 'base64') return body.toString('base64');\n if (encoding === 'binary') return body.toString('binary');\n return body.toString('utf8');\n};\n\nconst handleUint8Array = (body: Uint8Array, encoding: 'base64' | 'binary' | 'utf8'): string => {\n const buffer = Buffer.from(body);\n return handleBuffer(buffer, encoding);\n};\n\nconst handleArrayBuffer = (body: ArrayBuffer, encoding: 'base64' | 'binary' | 'utf8'): string => {\n const buffer = Buffer.from(body);\n return handleBuffer(buffer, encoding);\n};\n\nconst handleObjectsAndArrays = (body: unknown): string => {\n try {\n return JSON.stringify(body);\n } catch (_) {\n // Fallback for non-serializable objects (circular refs, etc.)\n // This will return something like \"[object Object]\" but that's better than crashing\n return String(body);\n }\n};\n",
27
28
  "import { httpStatus, httpStatusCode } from '@constants/http.ts';\nimport type { InternalHttpStatus, InternalHttpStatusCode } from '@typedefs/constants/http.js';\n\n/**\n * Map of status codes to their corresponding status messages\n * Built dynamically from the constants to ensure they stay in sync\n */\nconst statusCodeMap = new Map<number, string>();\n\n// Build the map from the constants\nfor (const [key, code] of Object.entries(httpStatusCode)) {\n const statusKey = key as keyof typeof httpStatus;\n const message = httpStatus[statusKey];\n\n statusCodeMap.set(code, message);\n}\n\n/**\n * Map a status code to its corresponding HTTP status message\n *\n * @param statusCode - The HTTP status code to map\n * @returns The corresponding HTTP status message\n *\n * @example\n * ```typescript\n * mapStatusCodeToMessage(200) // returns \"OK\"\n * mapStatusCodeToMessage(404) // returns \"Not Found\"\n * mapStatusCodeToMessage(500) // returns \"Internal Server Error\"\n * ```\n */\nexport const mapStatusCodeToMessage = (statusCode: InternalHttpStatusCode): InternalHttpStatus => {\n const message = statusCodeMap.get(statusCode);\n\n if (!message) {\n throw new Error(`Unknown status code: ${statusCode}`);\n }\n\n return message as InternalHttpStatus;\n};\n\n/**\n * Check if a status code is valid/supported\n *\n * @param statusCode - The status code to validate\n * @returns true if the status code is supported\n */\nexport const isValidStatusCode = (statusCode: number): statusCode is InternalHttpStatusCode => statusCodeMap.has(statusCode);\n",
28
29
  "/**\n * Response header validation utilities for security and format compliance\n *\n * This module contains security-focused header validation functions,\n * particularly for preventing CRLF injection attacks in outgoing response headers.\n */\n\n/**\n * Validate response header value for CRLF injection attempts\n * Use this when setting response headers with user input\n */\nexport const validateResponseHeaderValue = (headerName: string, headerValue: string): void => {\n // SECURITY: Check for CRLF injection in response header values\n // This is where CRLF injection actually matters - when setting response headers\n\n if (typeof headerValue !== 'string') {\n throw new Error(`Header value must be a string, got ${typeof headerValue}`);\n }\n\n // SECURITY: Detect CRLF injection patterns that could inject additional headers\n if (headerValue.includes('\\r') || headerValue.includes('\\n')) {\n throw new Error(`Header value contains invalid line break characters: ${headerName}`);\n }\n\n // SECURITY: Detect common injection patterns\n const suspiciousPatterns = [\n // Pattern: value\\r\\nSet-Cookie: or value\\nLocation: etc.\n /[\\r\\n](?:set-cookie|location|authorization|www-authenticate):/i,\n // Pattern: Double CRLF (could inject HTTP response)\n /\\r\\n\\r\\n|\\n\\n/,\n // Pattern: HTTP response line injection\n /[\\r\\n]http\\/\\d\\.\\d\\s+\\d+/i,\n ];\n\n for (const pattern of suspiciousPatterns) {\n if (pattern.test(headerValue)) {\n throw new Error(`Header value contains suspicious injection pattern: ${headerName}`);\n }\n }\n};\n\n/**\n * Validate multiple response header values\n * Convenience function for validating header objects\n */\nexport const validateResponseHeaders = (headers: Record<string, string>): void => {\n for (const [name, value] of Object.entries(headers)) {\n validateResponseHeaderValue(name, value);\n }\n};\n\n/**\n * Filter and validate headers, removing undefined values and validating security\n * Returns only valid, defined header entries\n */\nexport const filterAndValidateHeaders = (headers: Partial<Record<string, string | undefined>>): Record<string, string> => {\n // Filter out undefined values using simple, readable approach\n const definedHeaders: Record<string, string> = {};\n for (const [key, value] of Object.entries(headers)) {\n if (value !== undefined) {\n definedHeaders[key] = value;\n }\n }\n\n // Validate the filtered headers\n validateResponseHeaders(definedHeaders);\n\n return definedHeaders;\n};\n",
29
- "import type { InternalHttpEncoding } from '@typedefs/constants/http.js';\nimport { httpEncoding } from '@constants/http.ts';\n\n/**\n * Determine the Content-Length header value for a response body\n *\n * Calculates the byte length of the response body after it's been\n * formatted into a string for HTTP transmission. This accounts for\n * different encodings and body types.\n */\n\nexport const determineContentLength = (body: string | null | undefined, encoding?: InternalHttpEncoding): string => {\n if (!body) return '0';\n\n // Calculate byte length based on encoding\n let byteLength = 0;\n\n if (encoding === httpEncoding.base64) {\n // For base64, we need the length of the base64 string\n byteLength = Buffer.byteLength(body, 'utf8');\n }\n if (encoding === httpEncoding.binary) {\n // For binary encoding, each character represents one byte\n byteLength = body.length;\n }\n\n // For utf8 and default cases\n if (encoding === httpEncoding.utf8) {\n byteLength = Buffer.byteLength(body, 'utf8');\n }\n\n return String(byteLength);\n};\n",
30
+ "/**\n * Determine the Content-Length header value for a response body\n *\n * Calculates the byte length of the response body after it's been\n * formatted into a string for HTTP transmission. This accounts for\n * different encodings and body types.\n */\n\n/**\n * Calculates the byte size of a response body for Content-Length,\n * supporting Buffer (binary), string (utf8), and JSON-serializable objects.\n *\n * - Buffers: returns .length (raw binary)\n * - Strings: returns byte length in utf8 (handles text, base64, and \"binary\" as string)\n * - Objects: JSON.stringify, then utf8 byte length\n * - null/undefined/unknown: returns 0\n *\n * Yes, this covers binary data—if you pass a Buffer, you get the true binary size.\n * If you pass a \"binary\" string (e.g., '\\xFF\\xD8'), you get the utf8 byte length,\n * which matches Node's Content-Length calculation for string bodies.\n */\nexport const calculateContentSizeInBytes = (responseBody: unknown): number => {\n if (_isBuffer(responseBody)) {\n return responseBody.length;\n }\n\n if (typeof responseBody === 'string') {\n // Handles text, base64, and \"binary\" as string (e.g., '\\xFF\\xD8')\n return Buffer.byteLength(responseBody, 'utf8');\n }\n\n if (_isJsonSerializableObject(responseBody)) {\n try {\n const json = JSON.stringify(responseBody);\n return Buffer.byteLength(json, 'utf8');\n } catch {\n return 0;\n }\n }\n\n return 0;\n};\n\nconst _isBuffer = (val: unknown): val is Buffer =>\n // Node.js Buffer check (covers binary data)\n typeof Buffer !== 'undefined' && Buffer.isBuffer(val);\n\nconst _isJsonSerializableObject = (val: unknown): val is object => typeof val === 'object' && val !== null;\n",
30
31
  "import { RequestImpl } from '@core/execution/RequestImpl.ts';\nimport { ResponseImpl } from '@core/execution/ResponseImpl.ts';\nimport type { SetupImpl } from '@core/setup/SetupImpl.ts';\nimport type { InternalContextImpl } from '@typedefs/internal/InternalContextImpl.js';\nimport type { InternalRequestImpl } from '@typedefs/internal/InternalRequestImpl.js';\nimport type { InternalResponseImpl } from '@typedefs/internal/InternalResponseImpl.js';\nimport type { Request } from '@typedefs/public/Request.ts';\nimport type { Response } from '@typedefs/public/Response.ts';\n\n/**\n * ContextImpl is the core class that handles the building of the context.\n * It is responsible for building the request and response objects, plus\n * managing user-defined state data.\n *\n * ## What is ContextImpl?\n *\n * ContextImpl is the concrete implementation of the Context interface. It's\n * automatically created for each incoming request and provides a unified\n * interface for accessing request data, controlling responses, and managing\n * request-scoped state.\n *\n * ## How ContextImpl Works\n *\n * 1. **Construction**: Creates RequestImpl and ResponseImpl instances\n * 2. **State Initialization**: Initializes empty state object for user data\n * 3. **Request Processing**: Handles raw request data and builds structured request\n * 4. **Response Control**: Provides methods to control HTTP response behavior\n * 5. **State Management**: Allows middleware and handlers to store custom data\n * 6. **Cleanup**: Automatically manages memory and resource cleanup\n *\n * @example\n * ```typescript\n * // ContextImpl is automatically created for each request\n * const context = new ContextImpl(rawRequest, setup, clientAddress);\n *\n * // Access request data\n * const userId = context.request.params.id;\n * const userData = context.request.body;\n *\n * // Store custom state\n * context.state.user = { id: userId, name: 'John' };\n * context.state.requestId = generateRequestId();\n *\n * // Control response\n * context.response.setStatusCode(200);\n * context.response.addHeaders({ 'X-User-ID': userId });\n *\n * // Return response data\n * return { success: true, user: context.state.user };\n * ```\n *\n * @see {@link Context} for the public interface\n * @see {@link RequestImpl} for request implementation details\n * @see {@link ResponseImpl} for response implementation details\n * @see {@link InternalContextImpl} for internal interface details\n */\nexport class ContextImpl implements InternalContextImpl {\n readonly _request: InternalRequestImpl;\n readonly _response: InternalResponseImpl;\n\n /**\n * The incoming request object containing all request data and metadata.\n *\n * Provides access to headers, body, query parameters, route parameters,\n * and client information like IP address.\n *\n * @example\n * ```typescript\n * const handler: HandlerCallback = async (ctx) => {\n * // Access route parameters\n * const userId = ctx.request.params.id;\n *\n * // Access request body\n * const userData = ctx.request.body;\n *\n * // Access headers\n * const authToken = ctx.request.headers.authorization;\n *\n * // Access client information\n * const clientIp = ctx.request.ipAddress;\n *\n * return { userId, userData, hasAuth: !!authToken };\n * };\n * ```\n *\n * @see {@link Request} for complete request interface documentation\n */\n request: Request;\n\n /**\n * The outgoing response object for controlling HTTP response behavior.\n *\n * Provides methods to set status codes, add headers, and control\n * response formatting and content.\n *\n * @example\n * ```typescript\n * const handler: HandlerCallback = async (ctx) => {\n * const { request, response } = ctx;\n *\n * // Set successful status code\n * response.setStatusCode(201);\n *\n * // Add custom headers\n * response.addHeaders({\n * 'Location': `/api/users/${request.params.id}`,\n * 'X-User-ID': request.params.id,\n * 'Cache-Control': 'max-age=3600'\n * });\n *\n * // Return response body (Content-Type automatically set)\n * return { message: 'User created successfully' };\n * };\n * ```\n *\n * @see {@link Response} for complete response interface documentation\n */\n response: Response;\n\n /**\n * User-defined state data that persists throughout the request lifecycle.\n *\n * This property allows middleware and route handlers to store and share\n * custom data. The state is request-scoped and will be garbage collected\n * after the request completes.\n *\n * ## State Lifecycle\n *\n * 1. **Request Start**: State object is created as empty object\n * 2. **Global Hooks**: `beforeAll` hooks can populate state\n * 3. **Route Hooks**: `beforeHooks` can access and modify state\n * 4. **Route Handler**: Your handler can access and modify state\n * 5. **Route Hooks**: `afterHooks` can access state and modify response\n * 6. **Global Hooks**: `afterAll` hooks can access state and modify response\n * 7. **Request End**: State is automatically garbage collected\n *\n * @example\n * ```typescript\n * // Authentication middleware\n * const authMiddleware: HandlerCallback = async (ctx) => {\n * const token = ctx.request.headers.authorization;\n * const user = await validateToken(token);\n *\n * // Store user data in state for route handlers\n * ctx.state.user = user;\n * ctx.state.permissions = await getUserPermissions(user.id);\n * ctx.state.isAuthenticated = true;\n * };\n *\n * // Route that uses the authenticated state\n * app.get('/api/admin/users', authMiddleware, async (ctx) => {\n * // Access the user data set by middleware\n * const { user, permissions, isAuthenticated } = ctx.state;\n *\n * if (!permissions.includes('admin')) {\n * throw new Error('Insufficient permissions');\n * }\n *\n * // Add route-specific state\n * ctx.state.routeAccessed = true;\n * ctx.state.lastAccess = new Date();\n *\n * return { message: 'Admin access granted', user };\n * });\n * ```\n *\n * @see {@link Context} for complete context interface documentation\n */\n state: Record<string, unknown> = {};\n\n /**\n * Creates a new ContextImpl instance for handling a single request.\n *\n * @param rawRequest - The raw request data (Buffer or string) from the client\n * @param setup - The SetupImpl instance that manages routes and hooks\n * @param clientAddress - Optional client IP address for security and logging\n *\n * @example\n * ```typescript\n * // ContextImpl is typically created internally by YinzerFlow\n * const context = new ContextImpl(\n * Buffer.from('GET /api/users HTTP/1.1...'),\n * setupInstance,\n * '192.168.1.100'\n * );\n *\n * // Access the context properties\n * console.log(context.request.method); // \"GET\"\n * console.log(context.request.url); // \"/api/users\"\n * console.log(context.request.ipAddress); // \"192.168.1.100\"\n * ```\n *\n * @see {@link SetupImpl} for setup implementation details\n * @see {@link RequestImpl} for request building details\n * @see {@link ResponseImpl} for response building details\n */\n constructor(rawRequest: Buffer | string, setup: SetupImpl, clientAddress?: string) {\n this._request = new RequestImpl(rawRequest, setup, clientAddress);\n this._response = new ResponseImpl(this._request);\n\n this.request = this._request;\n this.response = this._response;\n }\n}\n",
31
- "/**\n * YinzerFlow Logging Levels\n *\n * String-based logging levels for intuitive configuration:\n * - 'off': No logging except errors\n * - 'error': Only errors\n * - 'warn': Warnings and errors (includes security warnings, slow requests)\n * - 'info': Info, warnings, and errors (standard application logging)\n *\n * Network logging is controlled separately via boolean networkLogging config.\n */\nexport const logLevels = {\n off: 'off',\n error: 'error',\n warn: 'warn',\n info: 'info',\n} as const;\n",
32
- "import type { ServerConfiguration } from '@typedefs/public/Configuration.js';\nimport type { InternalServerConfiguration } from '@typedefs/internal/InternalConfiguration.js';\nimport { logLevels } from '@constants/log.ts';\nimport { httpStatusCode } from '@constants/http.ts';\nimport { log } from '@core/utils/log.ts';\n\n/**\n * Default CORS configuration for when CORS is enabled\n */\nconst DEFAULT_CORS_ENABLED_CONFIG = {\n enabled: true,\n origin: '*',\n methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'],\n allowedHeaders: '*',\n exposedHeaders: [],\n credentials: false,\n maxAge: 86400, // 24 hours\n preflightContinue: false,\n optionsSuccessStatus: httpStatusCode.noContent,\n};\n\n/**\n * Default body parser configuration with secure defaults\n */\nconst DEFAULT_BODY_PARSER_CONFIG = {\n json: {\n maxSize: 262144, // 256KB - reasonable for JSON APIs (Express uses 100KB)\n maxDepth: 10, // Prevent deeply nested objects that can cause stack overflow\n allowPrototypeProperties: false, // SECURITY: Block prototype pollution by default\n maxKeys: 1000, // Prevent memory exhaustion from objects with too many keys\n maxStringLength: 1048576, // 1MB per string - prevent memory exhaustion\n maxArrayLength: 10000, // Prevent memory exhaustion from large arrays\n },\n fileUploads: {\n maxFileSize: 10485760, // 10MB per file - reasonable for documents/images\n maxTotalSize: 52428800, // 50MB total - prevent bulk upload attacks\n maxFiles: 10, // Reasonable number of files per request\n allowedExtensions: [], // Empty array = all extensions allowed\n blockedExtensions: ['.exe', '.bat', '.cmd', '.scr', '.pif', '.com'], // Block dangerous executables\n maxFilenameLength: 255, // Standard filesystem limit\n },\n urlEncoded: {\n maxSize: 1048576, // 1MB for form data\n maxFields: 1000, // Prevent field spam attacks\n maxFieldNameLength: 100, // Reasonable field name length\n maxFieldLength: 1048576, // 1MB per field value\n },\n};\n\n/**\n * Default IP security configuration with secure defaults\n */\nconst DEFAULT_IP_SECURITY_CONFIG = {\n trustedProxies: ['127.0.0.1', '::1'], // Localhost only by default\n allowPrivateIps: true, // Allow private IPs for internal usage\n headerPreference: ['x-forwarded-for', 'x-real-ip', 'cf-connecting-ip', 'x-client-ip', 'true-client-ip'],\n maxChainLength: 10, // Reasonable proxy chain length\n detectSpoofing: true, // Enable security by default\n};\n\n/**\n * Default configuration object\n */\nconst DEFAULT_CONFIGURATION: InternalServerConfiguration = {\n port: 5000,\n host: '0.0.0.0',\n logLevel: logLevels.warn,\n networkLogs: false,\n cors: {\n enabled: false, // Disabled by default\n },\n bodyParser: DEFAULT_BODY_PARSER_CONFIG,\n ipSecurity: DEFAULT_IP_SECURITY_CONFIG,\n connectionOptions: {\n socketTimeout: 30000,\n gracefulShutdownTimeout: 30000,\n keepAliveTimeout: 65000,\n headersTimeout: 66000,\n },\n autoGracefulShutdown: true, // Enabled by default\n};\n\n/**\n * Validate JSON parser configuration minimums\n */\nconst _validateJsonConfig = (config: InternalServerConfiguration['bodyParser']['json']): void => {\n if (config.maxSize < 1) {\n throw new Error('bodyParser.json.maxSize must be at least 1 byte');\n }\n\n if (config.maxDepth < 1) {\n throw new Error('bodyParser.json.maxDepth must be at least 1');\n }\n\n if (config.maxKeys < 1) {\n throw new Error('bodyParser.json.maxKeys must be at least 1');\n }\n\n if (config.maxStringLength < 1) {\n throw new Error('bodyParser.json.maxStringLength must be at least 1 byte');\n }\n\n if (config.maxArrayLength < 1) {\n throw new Error('bodyParser.json.maxArrayLength must be at least 1');\n }\n};\n\n/**\n * Validate file upload configuration minimums\n */\nconst _validateFileUploadConfig = (config: InternalServerConfiguration['bodyParser']['fileUploads']): void => {\n if (config.maxFileSize < 1) {\n throw new Error('bodyParser.fileUploads.maxFileSize must be at least 1 byte');\n }\n\n if (config.maxTotalSize < 1) {\n throw new Error('bodyParser.fileUploads.maxTotalSize must be at least 1 byte');\n }\n\n if (config.maxFiles < 1) {\n throw new Error('bodyParser.fileUploads.maxFiles must be at least 1');\n }\n\n if (config.maxFilenameLength < 1) {\n throw new Error('bodyParser.fileUploads.maxFilenameLength must be at least 1 character');\n }\n};\n\n/**\n * Validate URL-encoded configuration minimums\n */\nconst _validateUrlEncodedConfig = (config: InternalServerConfiguration['bodyParser']['urlEncoded']): void => {\n if (config.maxSize < 1) {\n throw new Error('bodyParser.urlEncoded.maxSize must be at least 1 byte');\n }\n\n if (config.maxFields < 1) {\n throw new Error('bodyParser.urlEncoded.maxFields must be at least 1');\n }\n\n if (config.maxFieldNameLength < 1) {\n throw new Error('bodyParser.urlEncoded.maxFieldNameLength must be at least 1 character');\n }\n\n if (config.maxFieldLength < 1) {\n throw new Error('bodyParser.urlEncoded.maxFieldLength must be at least 1 byte');\n }\n};\n\n/**\n * Validate IP security configuration minimums\n */\nconst _validateIpSecurityConfig = (config: InternalServerConfiguration['ipSecurity']): void => {\n if (!Array.isArray(config.trustedProxies)) {\n throw new Error('ipSecurity.trustedProxies must be an array');\n }\n\n if (!Array.isArray(config.headerPreference)) {\n throw new Error('ipSecurity.headerPreference must be an array');\n }\n\n if (config.headerPreference.length === 0) {\n throw new Error('ipSecurity.headerPreference must contain at least one header');\n }\n\n if (config.maxChainLength < 1) {\n throw new Error('ipSecurity.maxChainLength must be at least 1');\n }\n\n if (config.maxChainLength > 50) {\n throw new Error('ipSecurity.maxChainLength must not exceed 50 to prevent DoS attacks');\n }\n};\n\n/**\n * Issue security warnings for risky JSON configurations\n */\nconst _warnJsonConfig = (config: InternalServerConfiguration['bodyParser']['json']): void => {\n if (config.allowPrototypeProperties) {\n log.warn(\n '[SECURITY WARNING] bodyParser.json.allowPrototypeProperties is enabled. This allows prototype pollution attacks. ' +\n 'Only enable this if you absolutely need it and have other protections in place.',\n );\n }\n\n // Warn about very large JSON sizes (but don't block them)\n if (config.maxSize > 10485760) {\n // 10MB\n log.warn(\n `[SECURITY WARNING] bodyParser.json.maxSize is set to ${config.maxSize} bytes (${Math.round(config.maxSize / 1024 / 1024)}MB). ` +\n 'Large JSON payloads can cause memory exhaustion and DoS attacks. Consider if this size is necessary.',\n );\n }\n\n // Warn about very deep nesting (but don't block it)\n if (config.maxDepth > 50) {\n log.warn(\n `[SECURITY WARNING] bodyParser.json.maxDepth is set to ${config.maxDepth}. ` +\n 'Very deep JSON nesting can cause stack overflow attacks. Consider if this depth is necessary.',\n );\n }\n};\n\n/**\n * Issue security warnings for risky file upload configurations\n */\nconst _warnFileUploadConfig = (config: InternalServerConfiguration['bodyParser']['fileUploads']): void => {\n // Warn about very large file uploads (but don't block them)\n if (config.maxFileSize > 104857600) {\n // 100MB\n log.warn(\n `[SECURITY WARNING] bodyParser.fileUploads.maxFileSize is set to ${config.maxFileSize} bytes (${Math.round(config.maxFileSize / 1024 / 1024)}MB). ` +\n 'Large file uploads can consume significant server resources.',\n );\n }\n\n if (config.maxTotalSize > 1073741824) {\n // 1GB\n log.warn(\n `[SECURITY WARNING] bodyParser.fileUploads.maxTotalSize is set to ${config.maxTotalSize} bytes (${Math.round(config.maxTotalSize / 1024 / 1024 / 1024)}GB). ` +\n 'Very large total upload sizes can cause memory and disk space exhaustion.',\n );\n }\n\n // Validate file extension security\n const dangerousExtensions = ['.exe', '.bat', '.cmd', '.scr', '.pif', '.com', '.vbs', '.jar', '.app'];\n const allowedDangerous = config.allowedExtensions.filter((ext) => dangerousExtensions.includes(ext.toLowerCase()));\n\n if (allowedDangerous.length > 0) {\n log.warn(\n `[SECURITY WARNING] bodyParser.fileUploads.allowedExtensions includes dangerous file types: ${allowedDangerous.join(', ')}. ` +\n 'This could allow execution of malicious files. Only allow these if absolutely necessary.',\n );\n }\n\n // Warn if no blocked extensions and no allowed extensions (completely open)\n if (config.blockedExtensions.length === 0 && config.allowedExtensions.length === 0) {\n log.warn(\n '[SECURITY WARNING] File uploads have no extension restrictions (no blockedExtensions and no allowedExtensions). ' +\n 'Consider adding blockedExtensions or allowedExtensions to improve security.',\n );\n }\n};\n\n/**\n * Issue security warnings for risky IP security configurations\n */\nconst _warnIpSecurityConfig = (config: InternalServerConfiguration['ipSecurity']): void => {\n // Warn about wildcard or overly permissive trusted proxies\n if (config.trustedProxies.length === 0) {\n log.warn('[SECURITY WARNING] ipSecurity.trustedProxies is empty. No proxy headers will be trusted, which may prevent proper client IP detection.');\n }\n\n // Warn about very long proxy chains\n if (config.maxChainLength > 20) {\n log.warn(\n `[SECURITY WARNING] ipSecurity.maxChainLength is set to ${config.maxChainLength}. ` +\n 'Very long proxy chains can consume significant resources and may indicate amplification attacks.',\n );\n }\n\n // Warn if spoofing detection is disabled\n if (!config.detectSpoofing) {\n log.warn(\n '[SECURITY WARNING] ipSecurity.detectSpoofing is disabled. ' +\n 'This reduces protection against IP spoofing attacks. Only disable if you have other protective measures.',\n );\n }\n};\n\n/**\n * Handle CORS configuration merging\n */\nconst _handleCorsConfig = (defaultConfig: InternalServerConfiguration, userConfig?: ServerConfiguration): void => {\n if (userConfig?.cors?.enabled) {\n // When CORS is enabled, merge with enabled defaults\n // We ensure enabled is literally true to satisfy the type constraint\n defaultConfig.cors = {\n ...DEFAULT_CORS_ENABLED_CONFIG,\n ...userConfig.cors,\n enabled: true, // Override to ensure literal true type\n };\n }\n};\n\n/**\n * Handle body parser configuration merging and validation\n */\nconst _handleBodyParserConfig = (defaultConfig: InternalServerConfiguration, userConfig?: ServerConfiguration): void => {\n if (userConfig?.bodyParser) {\n defaultConfig.bodyParser = {\n json: {\n ...DEFAULT_BODY_PARSER_CONFIG.json,\n ...userConfig.bodyParser.json,\n },\n fileUploads: {\n ...DEFAULT_BODY_PARSER_CONFIG.fileUploads,\n ...userConfig.bodyParser.fileUploads,\n },\n urlEncoded: {\n ...DEFAULT_BODY_PARSER_CONFIG.urlEncoded,\n ...userConfig.bodyParser.urlEncoded,\n },\n };\n\n // Validate configuration for security\n _validateBodyParserConfig(defaultConfig.bodyParser);\n }\n};\n\n/**\n * Handle IP security configuration merging and validation\n */\nconst _handleIpSecurityConfig = (defaultConfig: InternalServerConfiguration, userConfig?: ServerConfiguration): void => {\n if (userConfig?.ipSecurity) {\n defaultConfig.ipSecurity = {\n ...DEFAULT_IP_SECURITY_CONFIG,\n ...userConfig.ipSecurity,\n };\n\n // Validate configuration for security\n _validateIpSecurityConfig(defaultConfig.ipSecurity);\n _warnIpSecurityConfig(defaultConfig.ipSecurity);\n }\n};\n\n/**\n * Validate port number\n */\nconst _validatePort = (defaultConfig: InternalServerConfiguration, userConfig?: ServerConfiguration): void => {\n if (userConfig?.port !== undefined) {\n const normalizedPort = Number(userConfig.port);\n if (isNaN(normalizedPort) || normalizedPort < 1 || normalizedPort > 65535) {\n throw new Error('Invalid port number');\n }\n defaultConfig.port = normalizedPort;\n }\n};\n\n/**\n * Validate body parser configuration to prevent broken settings and warn about risky configurations\n */\nconst _validateBodyParserConfig = (config: InternalServerConfiguration['bodyParser']): void => {\n // Validate minimums for all parser types\n _validateJsonConfig(config.json);\n _validateFileUploadConfig(config.fileUploads);\n _validateUrlEncodedConfig(config.urlEncoded);\n\n // Issue security warnings for risky configurations (but don't block them)\n _warnJsonConfig(config.json);\n _warnFileUploadConfig(config.fileUploads);\n};\n\n/**\n * Handle custom configuration\n */\nexport const handleCustomConfiguration = (configuration?: ServerConfiguration): InternalServerConfiguration => {\n // Start with default configuration\n const result = { ...DEFAULT_CONFIGURATION };\n\n // Merge user configuration with proper handling of nested objects\n Object.assign(result, configuration);\n\n // Handle special configuration sections\n _handleCorsConfig(result, configuration);\n _handleBodyParserConfig(result, configuration);\n _handleIpSecurityConfig(result, configuration);\n _validatePort(result, configuration);\n\n return result;\n};\n",
33
- "import { httpStatusCode } from '@constants/http.ts';\nimport { log } from '@core/utils/log.ts';\nimport { colors } from '@core/utils/networkLog.ts';\nimport type { InternalGlobalHookOptions, InternalHookRegistryImpl } from '@typedefs/internal/InternalHookRegistryImpl.js';\nimport type { HandlerCallback } from '@typedefs/public/Context.js';\n\nexport class HookRegistryImpl implements InternalHookRegistryImpl {\n readonly _beforeAll: Set<{\n handler: HandlerCallback;\n options?: InternalGlobalHookOptions;\n }>;\n readonly _afterAll: Set<{\n handler: HandlerCallback;\n options?: InternalGlobalHookOptions;\n }>;\n _onError: HandlerCallback;\n _onNotFound: HandlerCallback;\n\n constructor() {\n this._beforeAll = new Set();\n this._afterAll = new Set();\n this._onError = (ctx, error: unknown): unknown => {\n log.error('Error while handeling your request: ', error);\n ctx.response.setStatusCode(httpStatusCode.internalServerError);\n return { success: false, message: 'Internal Server Error' };\n };\n this._onNotFound = (ctx): unknown => {\n ctx.response.setStatusCode(httpStatusCode.notFound);\n return { success: false, message: '404 Not Found' };\n };\n }\n\n _addBeforeHooks(handlers: Array<HandlerCallback>, options?: InternalGlobalHookOptions): void {\n this._validateHandlersArray(handlers, 'beforeAll');\n for (const handler of handlers) this._beforeAll.add({ handler, options: options ?? { routesToExclude: [], routesToInclude: [] } });\n }\n\n _addAfterHooks(handlers: Array<HandlerCallback>, options?: InternalGlobalHookOptions): void {\n this._validateHandlersArray(handlers, 'afterAll');\n for (const handler of handlers) this._afterAll.add({ handler, options: options ?? { routesToExclude: [], routesToInclude: [] } });\n }\n\n private _validateHandlersArray(handlers: unknown, methodName: string): asserts handlers is Array<HandlerCallback> {\n if (!Array.isArray(handlers)) {\n const receivedType = typeof handlers;\n const isFunction = receivedType === 'function';\n\n throw new Error(\n `YinzerFlow: ${methodName}() expects an array of handler functions, but received ${receivedType}.${\n isFunction ?\n `\\n\\n❌ Incorrect: app.${methodName}${colors.red}(${colors.reset}(ctx) => { ... }${colors.red})${colors.reset}\\n✅ Correct: app.${methodName}${colors.green}([${colors.reset}(ctx) => { ... }${colors.green}])${colors.reset}\\n\\nNote: Wrap your handler function in ${colors.magenta}square brackets${colors.reset} to make it an array.\\n\\n`\n : `\\n\\n Expected: Array<HandlerCallback>\\n Received: ${receivedType}`\n }`,\n );\n }\n\n if (handlers.length === 0) {\n log.warn(`${methodName}() called with empty array. No hooks will be registered.`);\n return;\n }\n\n for (let i = 0; i < handlers.length; i++) {\n const handler = handlers[i] as unknown;\n if (typeof handler !== 'function') {\n throw new Error(`YinzerFlow: ${methodName}() array contains non-function at index ${i}. Expected: function, received: ${typeof handler}`);\n }\n }\n }\n\n _addOnError(handler: HandlerCallback): void {\n this._onError = handler;\n }\n\n _addOnNotFound(handler: HandlerCallback): void {\n this._onNotFound = handler;\n }\n}\n",
32
+ "import type { ServerConfiguration } from '@typedefs/public/Configuration.js';\nimport type { InternalServerConfiguration } from '@typedefs/internal/InternalConfiguration.js';\nimport { httpStatusCode } from '@constants/http.ts';\nimport { log } from '@core/utils/log.ts';\n\n/**\n * Default CORS configuration for when CORS is enabled\n */\nconst DEFAULT_CORS_ENABLED_CONFIG = {\n enabled: true,\n origin: '*',\n methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'],\n allowedHeaders: '*',\n exposedHeaders: [],\n credentials: false,\n maxAge: 86400, // 24 hours\n preflightContinue: false,\n optionsSuccessStatus: httpStatusCode.noContent,\n};\n\n/**\n * Default body parser configuration with secure defaults\n */\nconst DEFAULT_BODY_PARSER_CONFIG = {\n json: {\n maxSize: 262144, // 256KB - reasonable for JSON APIs (Express uses 100KB)\n maxDepth: 10, // Prevent deeply nested objects that can cause stack overflow\n allowPrototypeProperties: false, // SECURITY: Block prototype pollution by default\n maxKeys: 1000, // Prevent memory exhaustion from objects with too many keys\n maxStringLength: 1048576, // 1MB per string - prevent memory exhaustion\n maxArrayLength: 10000, // Prevent memory exhaustion from large arrays\n },\n fileUploads: {\n maxFileSize: 10485760, // 10MB per file - reasonable for documents/images\n maxTotalSize: 52428800, // 50MB total - prevent bulk upload attacks\n maxFiles: 10, // Reasonable number of files per request\n allowedExtensions: [], // Empty array = all extensions allowed\n blockedExtensions: ['.exe', '.bat', '.cmd', '.scr', '.pif', '.com'], // Block dangerous executables\n maxFilenameLength: 255, // Standard filesystem limit\n },\n urlEncoded: {\n maxSize: 1048576, // 1MB for form data\n maxFields: 1000, // Prevent field spam attacks\n maxFieldNameLength: 100, // Reasonable field name length\n maxFieldLength: 1048576, // 1MB per field value\n },\n};\n\n/**\n * Default IP security configuration with secure defaults\n */\nconst DEFAULT_IP_SECURITY_CONFIG = {\n trustedProxies: ['127.0.0.1', '::1'], // Localhost only by default\n allowPrivateIps: true, // Allow private IPs for internal usage\n headerPreference: ['x-forwarded-for', 'x-real-ip', 'cf-connecting-ip', 'x-client-ip', 'true-client-ip'],\n maxChainLength: 10, // Reasonable proxy chain length\n detectSpoofing: true, // Enable security by default\n};\n\n/**\n * Default configuration object\n */\nconst DEFAULT_CONFIGURATION: InternalServerConfiguration = {\n port: 5000,\n host: '0.0.0.0',\n networkLogs: false,\n cors: {\n enabled: false, // Disabled by default\n },\n bodyParser: DEFAULT_BODY_PARSER_CONFIG,\n ipSecurity: DEFAULT_IP_SECURITY_CONFIG,\n connectionOptions: {\n socketTimeout: 30000,\n gracefulShutdownTimeout: 30000,\n keepAliveTimeout: 65000,\n headersTimeout: 66000,\n },\n autoGracefulShutdown: true, // Enabled by default\n};\n\n/**\n * Validate JSON parser configuration minimums\n */\nconst _validateJsonConfig = (config: InternalServerConfiguration['bodyParser']['json']): void => {\n if (config.maxSize < 1) {\n throw new Error('bodyParser.json.maxSize must be at least 1 byte');\n }\n\n if (config.maxDepth < 1) {\n throw new Error('bodyParser.json.maxDepth must be at least 1');\n }\n\n if (config.maxKeys < 1) {\n throw new Error('bodyParser.json.maxKeys must be at least 1');\n }\n\n if (config.maxStringLength < 1) {\n throw new Error('bodyParser.json.maxStringLength must be at least 1 byte');\n }\n\n if (config.maxArrayLength < 1) {\n throw new Error('bodyParser.json.maxArrayLength must be at least 1');\n }\n};\n\n/**\n * Validate file upload configuration minimums\n */\nconst _validateFileUploadConfig = (config: InternalServerConfiguration['bodyParser']['fileUploads']): void => {\n if (config.maxFileSize < 1) {\n throw new Error('bodyParser.fileUploads.maxFileSize must be at least 1 byte');\n }\n\n if (config.maxTotalSize < 1) {\n throw new Error('bodyParser.fileUploads.maxTotalSize must be at least 1 byte');\n }\n\n if (config.maxFiles < 1) {\n throw new Error('bodyParser.fileUploads.maxFiles must be at least 1');\n }\n\n if (config.maxFilenameLength < 1) {\n throw new Error('bodyParser.fileUploads.maxFilenameLength must be at least 1 character');\n }\n};\n\n/**\n * Validate URL-encoded configuration minimums\n */\nconst _validateUrlEncodedConfig = (config: InternalServerConfiguration['bodyParser']['urlEncoded']): void => {\n if (config.maxSize < 1) {\n throw new Error('bodyParser.urlEncoded.maxSize must be at least 1 byte');\n }\n\n if (config.maxFields < 1) {\n throw new Error('bodyParser.urlEncoded.maxFields must be at least 1');\n }\n\n if (config.maxFieldNameLength < 1) {\n throw new Error('bodyParser.urlEncoded.maxFieldNameLength must be at least 1 character');\n }\n\n if (config.maxFieldLength < 1) {\n throw new Error('bodyParser.urlEncoded.maxFieldLength must be at least 1 byte');\n }\n};\n\n/**\n * Validate IP security configuration minimums\n */\nconst _validateIpSecurityConfig = (config: InternalServerConfiguration['ipSecurity']): void => {\n if (!Array.isArray(config.trustedProxies)) {\n throw new Error('ipSecurity.trustedProxies must be an array');\n }\n\n if (!Array.isArray(config.headerPreference)) {\n throw new Error('ipSecurity.headerPreference must be an array');\n }\n\n if (config.headerPreference.length === 0) {\n throw new Error('ipSecurity.headerPreference must contain at least one header');\n }\n\n if (config.maxChainLength < 1) {\n throw new Error('ipSecurity.maxChainLength must be at least 1');\n }\n\n if (config.maxChainLength > 50) {\n throw new Error('ipSecurity.maxChainLength must not exceed 50 to prevent DoS attacks');\n }\n};\n\n/**\n * Issue security warnings for risky JSON configurations\n */\nconst _warnJsonConfig = (config: InternalServerConfiguration['bodyParser']['json']): void => {\n if (config.allowPrototypeProperties) {\n log.warn(\n '[SECURITY WARNING] bodyParser.json.allowPrototypeProperties is enabled. This allows prototype pollution attacks. ' +\n 'Only enable this if you absolutely need it and have other protections in place.',\n );\n }\n\n // Warn about very large JSON sizes (but don't block them)\n if (config.maxSize > 10485760) {\n // 10MB\n log.warn(\n `[SECURITY WARNING] bodyParser.json.maxSize is set to ${config.maxSize} bytes (${Math.round(config.maxSize / 1024 / 1024)}MB). ` +\n 'Large JSON payloads can cause memory exhaustion and DoS attacks. Consider if this size is necessary.',\n );\n }\n\n // Warn about very deep nesting (but don't block it)\n if (config.maxDepth > 50) {\n log.warn(\n `[SECURITY WARNING] bodyParser.json.maxDepth is set to ${config.maxDepth}. ` +\n 'Very deep JSON nesting can cause stack overflow attacks. Consider if this depth is necessary.',\n );\n }\n};\n\n/**\n * Issue security warnings for risky file upload configurations\n */\nconst _warnFileUploadConfig = (config: InternalServerConfiguration['bodyParser']['fileUploads']): void => {\n // Warn about very large file uploads (but don't block them)\n if (config.maxFileSize > 104857600) {\n // 100MB\n log.warn(\n `[SECURITY WARNING] bodyParser.fileUploads.maxFileSize is set to ${config.maxFileSize} bytes (${Math.round(config.maxFileSize / 1024 / 1024)}MB). ` +\n 'Large file uploads can consume significant server resources.',\n );\n }\n\n if (config.maxTotalSize > 1073741824) {\n // 1GB\n log.warn(\n `[SECURITY WARNING] bodyParser.fileUploads.maxTotalSize is set to ${config.maxTotalSize} bytes (${Math.round(config.maxTotalSize / 1024 / 1024 / 1024)}GB). ` +\n 'Very large total upload sizes can cause memory and disk space exhaustion.',\n );\n }\n\n // Validate file extension security\n const dangerousExtensions = ['.exe', '.bat', '.cmd', '.scr', '.pif', '.com', '.vbs', '.jar', '.app'];\n const allowedDangerous = config.allowedExtensions.filter((ext) => dangerousExtensions.includes(ext.toLowerCase()));\n\n if (allowedDangerous.length > 0) {\n log.warn(\n `[SECURITY WARNING] bodyParser.fileUploads.allowedExtensions includes dangerous file types: ${allowedDangerous.join(', ')}. ` +\n 'This could allow execution of malicious files. Only allow these if absolutely necessary.',\n );\n }\n\n // Warn if no blocked extensions and no allowed extensions (completely open)\n if (config.blockedExtensions.length === 0 && config.allowedExtensions.length === 0) {\n log.warn(\n '[SECURITY WARNING] File uploads have no extension restrictions (no blockedExtensions and no allowedExtensions). ' +\n 'Consider adding blockedExtensions or allowedExtensions to improve security.',\n );\n }\n};\n\n/**\n * Issue security warnings for risky IP security configurations\n */\nconst _warnIpSecurityConfig = (config: InternalServerConfiguration['ipSecurity']): void => {\n // Warn about wildcard or overly permissive trusted proxies\n if (config.trustedProxies.length === 0) {\n log.warn('[SECURITY WARNING] ipSecurity.trustedProxies is empty. No proxy headers will be trusted, which may prevent proper client IP detection.');\n }\n\n // Warn about very long proxy chains\n if (config.maxChainLength > 20) {\n log.warn(\n `[SECURITY WARNING] ipSecurity.maxChainLength is set to ${config.maxChainLength}. ` +\n 'Very long proxy chains can consume significant resources and may indicate amplification attacks.',\n );\n }\n\n // Warn if spoofing detection is disabled\n if (!config.detectSpoofing) {\n log.warn(\n '[SECURITY WARNING] ipSecurity.detectSpoofing is disabled. ' +\n 'This reduces protection against IP spoofing attacks. Only disable if you have other protective measures.',\n );\n }\n};\n\n/**\n * Handle CORS configuration merging\n */\nconst _handleCorsConfig = (defaultConfig: InternalServerConfiguration, userConfig?: ServerConfiguration): void => {\n if (userConfig?.cors?.enabled) {\n // When CORS is enabled, merge with enabled defaults\n // We ensure enabled is literally true to satisfy the type constraint\n defaultConfig.cors = {\n ...DEFAULT_CORS_ENABLED_CONFIG,\n ...userConfig.cors,\n enabled: true, // Override to ensure literal true type\n };\n }\n};\n\n/**\n * Handle body parser configuration merging and validation\n */\nconst _handleBodyParserConfig = (defaultConfig: InternalServerConfiguration, userConfig?: ServerConfiguration): void => {\n if (userConfig?.bodyParser) {\n defaultConfig.bodyParser = {\n json: {\n ...DEFAULT_BODY_PARSER_CONFIG.json,\n ...userConfig.bodyParser.json,\n },\n fileUploads: {\n ...DEFAULT_BODY_PARSER_CONFIG.fileUploads,\n ...userConfig.bodyParser.fileUploads,\n },\n urlEncoded: {\n ...DEFAULT_BODY_PARSER_CONFIG.urlEncoded,\n ...userConfig.bodyParser.urlEncoded,\n },\n };\n\n // Validate configuration for security\n _validateBodyParserConfig(defaultConfig.bodyParser);\n }\n};\n\n/**\n * Handle IP security configuration merging and validation\n */\nconst _handleIpSecurityConfig = (defaultConfig: InternalServerConfiguration, userConfig?: ServerConfiguration): void => {\n if (userConfig?.ipSecurity) {\n defaultConfig.ipSecurity = {\n ...DEFAULT_IP_SECURITY_CONFIG,\n ...userConfig.ipSecurity,\n };\n\n // Validate configuration for security\n _validateIpSecurityConfig(defaultConfig.ipSecurity);\n _warnIpSecurityConfig(defaultConfig.ipSecurity);\n }\n};\n\n/**\n * Validate port number\n */\nconst _validatePort = (defaultConfig: InternalServerConfiguration, userConfig?: ServerConfiguration): void => {\n if (userConfig?.port !== undefined) {\n const normalizedPort = Number(userConfig.port);\n if (isNaN(normalizedPort) || normalizedPort < 1 || normalizedPort > 65535) {\n throw new Error('Invalid port number');\n }\n defaultConfig.port = normalizedPort;\n }\n};\n\n/**\n * Validate body parser configuration to prevent broken settings and warn about risky configurations\n */\nconst _validateBodyParserConfig = (config: InternalServerConfiguration['bodyParser']): void => {\n // Validate minimums for all parser types\n _validateJsonConfig(config.json);\n _validateFileUploadConfig(config.fileUploads);\n _validateUrlEncodedConfig(config.urlEncoded);\n\n // Issue security warnings for risky configurations (but don't block them)\n _warnJsonConfig(config.json);\n _warnFileUploadConfig(config.fileUploads);\n};\n\n/**\n * Handle custom configuration\n */\nexport const handleCustomConfiguration = (configuration?: ServerConfiguration): InternalServerConfiguration => {\n // Start with default configuration\n const result = { ...DEFAULT_CONFIGURATION };\n\n // Merge user configuration with proper handling of nested objects\n Object.assign(result, configuration);\n\n // Handle special configuration sections\n _handleCorsConfig(result, configuration);\n _handleBodyParserConfig(result, configuration);\n _handleIpSecurityConfig(result, configuration);\n _validatePort(result, configuration);\n\n return result;\n};\n",
33
+ "import { colors } from '@constants/colors.ts';\nimport { httpStatusCode } from '@constants/http.ts';\nimport { log } from '@core/utils/log.ts';\nimport type { InternalGlobalHookOptions, InternalHookRegistryImpl } from '@typedefs/internal/InternalHookRegistryImpl.js';\nimport type { HandlerCallback } from '@typedefs/public/Context.js';\n\nexport class HookRegistryImpl implements InternalHookRegistryImpl {\n readonly _beforeAll: Set<{\n handler: HandlerCallback;\n options?: InternalGlobalHookOptions;\n }>;\n readonly _afterAll: Set<{\n handler: HandlerCallback;\n options?: InternalGlobalHookOptions;\n }>;\n _onError: HandlerCallback;\n _onNotFound: HandlerCallback;\n\n constructor() {\n this._beforeAll = new Set();\n this._afterAll = new Set();\n this._onError = (ctx, error: unknown): unknown => {\n log.error('Error while handeling your request: ', error);\n ctx.response.setStatusCode(httpStatusCode.internalServerError);\n return { success: false, message: 'Internal Server Error' };\n };\n this._onNotFound = (ctx): unknown => {\n ctx.response.setStatusCode(httpStatusCode.notFound);\n return { success: false, message: '404 Not Found' };\n };\n }\n\n _addBeforeHooks(handlers: Array<HandlerCallback>, options?: InternalGlobalHookOptions): void {\n this._validateHandlersArray(handlers, 'beforeAll');\n for (const handler of handlers) this._beforeAll.add({ handler, options: options ?? { routesToExclude: [], routesToInclude: [] } });\n }\n\n _addAfterHooks(handlers: Array<HandlerCallback>, options?: InternalGlobalHookOptions): void {\n this._validateHandlersArray(handlers, 'afterAll');\n for (const handler of handlers) this._afterAll.add({ handler, options: options ?? { routesToExclude: [], routesToInclude: [] } });\n }\n\n private _validateHandlersArray(handlers: unknown, methodName: string): asserts handlers is Array<HandlerCallback> {\n if (!Array.isArray(handlers)) {\n const receivedType = typeof handlers;\n const isFunction = receivedType === 'function';\n\n throw new Error(\n `YinzerFlow: ${methodName}() expects an array of handler functions, but received ${receivedType}.${\n isFunction ?\n `\\n\\n❌ Incorrect: app.${methodName}${colors.red}(${colors.reset}(ctx) => { ... }${colors.red})${colors.reset}\\n✅ Correct: app.${methodName}${colors.green}([${colors.reset}(ctx) => { ... }${colors.green}])${colors.reset}\\n\\nNote: Wrap your handler function in ${colors.magenta}square brackets${colors.reset} to make it an array.\\n\\n`\n : `\\n\\n Expected: Array<HandlerCallback>\\n Received: ${receivedType}`\n }`,\n );\n }\n\n if (handlers.length === 0) {\n log.warn(`${methodName}() called with empty array. No hooks will be registered.`);\n return;\n }\n\n for (let i = 0; i < handlers.length; i++) {\n const handler = handlers[i] as unknown;\n if (typeof handler !== 'function') {\n throw new Error(`YinzerFlow: ${methodName}() array contains non-function at index ${i}. Expected: function, received: ${typeof handler}`);\n }\n }\n }\n\n _addOnError(handler: HandlerCallback): void {\n this._onError = handler;\n }\n\n _addOnNotFound(handler: HandlerCallback): void {\n this._onNotFound = handler;\n }\n}\n",
34
34
  "import type { InternalPreCompiledRoute, InternalRouteRegistry } from '@typedefs/internal/InternalRouteRegistryImpl.d.ts';\n\n/**\n * Compile a route pattern into a regular expression\n *\n * @example\n * ```ts\n * compileRoutePattern({ path: '/users/:id/posts/:postId' });\n * // Returns { pattern: /^users\\/([^/]+)\\/posts\\/([^/]+)$/, paramNames: ['id', 'postId'], isParameterized: true }\n * ```\n */\nexport const compileRoutePattern = (route: InternalRouteRegistry): InternalPreCompiledRoute => {\n const paramNames: Array<string> = [];\n\n // Convert route pattern to regex with capture groups\n // Example: /users/:id/posts/:postId → /users/([^/]+)/posts/([^/]+)\n const pattern = route.path\n .replace(/:\\w+/g, (match) => {\n const paramName = match.slice(1); // Remove the ':' prefix\n paramNames.push(paramName);\n return '([^/]+)'; // Capture group: match any characters except '/'\n })\n .replace(/\\//g, '\\\\/'); // Escape forward slashes for regex\n\n return {\n ...route,\n pattern: new RegExp(`^${pattern}$`), // ^ and $ ensure full string match\n paramNames,\n isParameterized: true,\n };\n};\n",
35
35
  "import { log } from '@core/utils/log.ts';\n\n/**\n * Normalize the path to ensure consistent format\n *\n * Handles common HTTP path variations for consistent route matching:\n * - Always starts with '/'\n * - No double slashes\n * - Consistent trailing slash handling\n * - Strips query parameters (for route matching)\n * - URL decodes encoded characters\n * - Resolves dot segments for security\n *\n * Examples:\n * - \"users\" → \"/users\"\n * - \"//users\" → \"/users\"\n * - \"/users/\" → \"/users\" (consistent - no trailing slash)\n * - \"/users?page=1\" → \"/users\"\n * - \"/users%20profile\" → \"/users profile\"\n * - \"/users/../admin\" → \"/admin\" (dot segment resolved)\n * - \"/api/./users\" → \"/api/users\" (current dir resolved)\n *\n * @example\n * ```ts\n * normalizePath('users');\n * // Returns \"/users\"\n * ```\n */\nexport const normalizePath = (path: string): string => {\n // Step 1: Strip query parameters and fragments for route matching\n // \"/users?page=1#section\" → \"/users\"\n let [normalizedPath] = path.split('?');\n if (!normalizedPath) return '';\n\n [normalizedPath] = normalizedPath.split('#');\n if (!normalizedPath) return '';\n\n // Step 2: URL decode encoded characters\n // \"/users%20profile\" → \"/users profile\"\n try {\n normalizedPath = decodeURIComponent(normalizedPath);\n } catch (_) {\n // If decoding fails (malformed URL), use original\n // This prevents crashes from malicious URLs\n log.warn('Failed to decode URL path', { path: normalizedPath });\n }\n\n // Step 3: Add leading slash if not present\n // \"users\" → \"/users\"\n normalizedPath = normalizedPath.startsWith('/') ? normalizedPath : `/${normalizedPath}`;\n\n // Step 4: Remove double slashes\n // \"//users\" → \"/users\"\n normalizedPath = normalizedPath.replace(/\\/\\/+/g, '/');\n\n // Step 5: Resolve dot segments for security and consistency\n // SECURITY CRITICAL: Prevents directory traversal attacks\n // \"/users/../admin\" → \"/admin\"\n // \"/api/./users\" → \"/api/users\"\n // \"/users/../../etc/passwd\" → \"/etc/passwd\" (contained within app context)\n normalizedPath = resolveDotSegments(normalizedPath);\n\n // Step 6: Remove trailing slash for consistency (except root path)\n // \"/users/\" → \"/users\", but \"/\" stays \"/\"\n if (normalizedPath.length > 1 && normalizedPath.endsWith('/')) {\n normalizedPath = normalizedPath.slice(0, -1);\n }\n\n return normalizedPath;\n};\n\n/**\n * Resolve dot segments according to RFC 3986 Section 5.2.4\n *\n * SECURITY PURPOSE: Prevents directory traversal attacks by resolving relative paths\n *\n * Dot segments are dangerous because they allow attackers to:\n * - Bypass access controls: \"/users/../admin\" → \"/admin\"\n * - Access system files: \"/api/../../etc/passwd\" → \"/etc/passwd\"\n * - Traverse outside intended directories\n *\n * ALGORITHM:\n * - \".\" (current directory) → remove completely\n * - \"..\" (parent directory) → remove this segment AND the previous segment\n * - Regular segments → keep as-is\n *\n * Examples:\n * - \"/users/./profile\" → \"/users/profile\"\n * - \"/users/../admin\" → \"/admin\"\n * - \"/a/b/c/../../d\" → \"/a/d\"\n * - \"/../secret\" → \"/secret\" (can't go above root)\n *\n * @param path - Path with potential dot segments\n * @returns Path with dot segments resolved\n */\nconst resolveDotSegments = (path: string): string => {\n // Split path into segments, preserving empty strings from leading slash\n const segments = path.split('/');\n const resolved: Array<string> = [];\n\n for (const segment of segments) {\n if (segment === '.' || segment === '') {\n // Current directory \".\" - skip completely\n // Empty segments from double slashes - also skip\n if (segment === '' && resolved.length === 0) {\n // Keep the first empty segment to maintain leading slash\n resolved.push(segment);\n }\n continue;\n }\n\n if (segment === '..') {\n // Parent directory \"..\" - go up one level\n if (resolved.length > 1) {\n // Remove last segment (go to parent)\n // But don't remove the leading empty string (which represents root \"/\")\n resolved.pop();\n }\n // If we're already at root, ignore \"..\" (can't go above root)\n } else {\n // Regular segment - keep it\n resolved.push(segment);\n }\n }\n\n // Rejoin segments\n const result = resolved.join('/');\n\n // Ensure we always have at least \"/\" for root\n return result || '/';\n};\n\n/**\n * Normalize route structure for conflict detection\n * Converts /users/:id and /users/:userId to the same structure: /users/:param\n */\nexport const normalizeRouteStructure = (path: string): string => path.replace(/:\\w+/g, ':param');\n",
36
36
  "/**\n * Validate that parameter names are unique within a single route\n *\n * WHY THIS MATTERS:\n * - Routes like \"/users/:id/jobs/:id\" are confusing and error-prone\n * - Multiple params with same name would overwrite each other: { id: \"lastValue\" }\n * - Forces developers to use descriptive, unique names: \"/users/:userId/jobs/:jobId\"\n * - Makes code self-documenting and prevents runtime bugs\n *\n * EXAMPLES OF PROBLEMS THIS PREVENTS:\n * - Bad: \"/users/:id/posts/:id\" → unclear which :id refers to what\n * - Good: \"/users/:userId/posts/:postId\" → crystal clear intent\n *\n * @example\n * ```ts\n * validateParameterNames('/users/:id/posts/:id');\n * // Throws error: \"Route /users/:id/posts/:id has duplicate parameter names: id. Parameter names must be unique within a route for clarity and to prevent conflicts.\"\n * ```\n */\nexport const validateParameterNames = (routePath: string): void => {\n // Extract all parameter names from the route\n // \"/users/:userId/posts/:postId\" → [\":userId\", \":postId\"] → [\"userId\", \"postId\"]\n const paramMatches = routePath.match(/:\\w+/g);\n if (!paramMatches) return; // No parameters to validate\n\n const paramNames = paramMatches.map((param) => param.slice(1)); // Remove ':' prefix\n const uniqueParamNames = new Set(paramNames);\n\n // Check for duplicates\n if (paramNames.length !== uniqueParamNames.size) {\n const duplicates = paramNames.filter((name, index) => paramNames.indexOf(name) !== index);\n throw new Error(\n `Route ${routePath} has duplicate parameter names: ${duplicates.join(', ')}. ` +\n 'Parameter names must be unique within a route for clarity and to prevent conflicts.',\n );\n }\n};\n",
37
37
  "import { compileRoutePattern } from '@core/setup/utils/compileRoutePatter.ts';\nimport { normalizePath, normalizeRouteStructure } from '@core/setup/utils/normalizeStringPatterns.ts';\nimport { validateParameterNames } from '@core/setup/utils/validateParameterNames.ts';\nimport type { InternalHttpMethod } from '@typedefs/constants/http.ts';\nimport type { InternalPreCompiledRoute, InternalRouteRegistry, InternalRouteRegistryImpl } from '@typedefs/internal/InternalRouteRegistryImpl.js';\n\n/**\n * RouteRegistry: Efficient route storage and matching\n *\n * DESIGN DECISION: Parameter extraction happens here (not in RequestImpl) because:\n * 1. We already compile regexes for route matching - reusing them for param extraction is free\n * 2. Avoids duplicate regex compilation at request time (performance critical)\n * 3. Single source of truth for route patterns and their compiled forms\n *\n * PERFORMANCE STRATEGY:\n * - Exact routes (no params): O(1) Map lookup\n * - Parameterized routes: O(n) iteration with pre-compiled regex matching\n * - Most apps have few parameterized routes, so O(n) is acceptable\n *\n * EXAMPLES:\n * - \"/users\" (exact) → stored in exactRoutes Map for instant lookup\n * - \"/users/:id\" (parameterized) → compiled to regex, stored in parameterizedRoutes Array\n */\nexport class RouteRegistryImpl implements InternalRouteRegistryImpl {\n /**\n * Fast O(1) lookup for routes without parameters\n * Example: GET /users, POST /login, etc.\n */\n readonly _exactRoutes = new Map<InternalHttpMethod, Map<string, InternalRouteRegistry>>();\n\n /**\n * Array of pre-compiled parameterized routes for O(n) matching\n * Example: GET /users/:id, POST /users/:id/posts/:postId, etc.\n *\n * We use an array because:\n * 1. Route patterns can't be used as Map keys (they're not exact matches)\n * 2. Most apps have relatively few parameterized routes\n * 3. Pre-compiled regexes make matching fast\n */\n readonly _parameterizedRoutes = new Map<InternalHttpMethod, Array<InternalPreCompiledRoute>>();\n\n /**\n * Register a new route\n *\n * PERFORMANCE NOTE: This happens at server startup, so we can afford\n * more expensive operations like regex compilation here.\n */\n _register({ method, path, handler, options }: InternalRouteRegistry): void {\n const normalizedPath = normalizePath(path);\n const isParameterized = normalizedPath.includes(':');\n\n // Validate route before registration\n if (isParameterized) {\n validateParameterNames(normalizedPath);\n }\n\n // Prevent duplicate route registration\n // We check for exact pattern duplicates, not request path matches\n if (this._hasExactRoutePattern(method, normalizedPath)) {\n throw new Error(`Route ${normalizedPath} already exists for method ${method}`);\n }\n\n const route = { method, path: normalizedPath, handler, options, params: {} };\n\n if (isParameterized) {\n // Store in parameterized routes with pre-compiled regex\n this._storeParameterizedRoute(method, route);\n } else {\n // Store in exact routes for O(1) lookup\n this._storeExactRoute(method, normalizedPath, route);\n }\n }\n\n /**\n * Find a route and extract parameters from the request path\n *\n * RUNTIME PERFORMANCE: This is called for every HTTP request, so it must be fast!\n * 1. Try exact match first (O(1) - fastest case)\n * 2. Fall back to parameterized routes (O(n) with pre-compiled regex)\n */\n _findRoute(method: InternalHttpMethod, path: string): InternalRouteRegistry | undefined {\n const normalizedPath = normalizePath(path);\n\n // FAST PATH: Try exact match first (most common case)\n const exactRoute = this._exactRoutes.get(method)?.get(normalizedPath);\n if (exactRoute) {\n return exactRoute;\n }\n\n // PARAMETERIZED PATH: Check routes with parameters\n const parameterizedRoute = this._findParameterizedRoute(method, normalizedPath);\n if (parameterizedRoute) {\n return parameterizedRoute;\n }\n\n return undefined;\n }\n\n /**\n * Check if a route pattern already exists (for conflict detection)\n * This is different from findRoute which matches request paths to patterns\n */\n private _hasExactRoutePattern(method: InternalHttpMethod, pattern: string): boolean {\n // Check exact routes\n if (this._exactRoutes.get(method)?.has(pattern)) {\n return true;\n }\n\n // For parameterized routes, check if the structure conflicts\n // Example: /users/:id conflicts with /users/:userId (same structure, different param names)\n if (pattern.includes(':')) {\n const normalizedPattern = normalizeRouteStructure(pattern);\n const paramRoutes = this._parameterizedRoutes.get(method);\n\n if (paramRoutes) {\n return paramRoutes.some((route) => normalizeRouteStructure(route.path) === normalizedPattern);\n }\n } else {\n // Check parameterized routes for exact pattern match\n const paramRoutes = this._parameterizedRoutes.get(method);\n if (paramRoutes) {\n return paramRoutes.some((route) => route.path === pattern);\n }\n }\n\n return false;\n }\n\n /**\n * Store an exact route (no parameters) for O(1) lookup\n */\n private _storeExactRoute(method: InternalHttpMethod, path: string, route: InternalRouteRegistry): void {\n if (!this._exactRoutes.has(method)) {\n this._exactRoutes.set(method, new Map());\n }\n\n this._exactRoutes.get(method)?.set(path, route);\n }\n\n /**\n * Store a parameterized route with pre-compiled regex pattern\n */\n private _storeParameterizedRoute(method: InternalHttpMethod, route: InternalRouteRegistry): void {\n if (!this._parameterizedRoutes.has(method)) {\n this._parameterizedRoutes.set(method, []);\n }\n\n /**\n * Compile a route pattern into a regex with parameter extraction\n *\n * This is the magic that converts route patterns to regexes:\n * - \"/users/:id\" → /^\\/users\\/([^\\/]+)$/\n * - \"/users/:id/posts/:postId\" → /^\\/users\\/([^\\/]+)\\/posts\\/([^\\/]+)$/\n *\n * WHY AT REGISTRATION TIME: Regex compilation is expensive, so we do it once\n * at server startup rather than on every request.\n */\n const compiled = compileRoutePattern(route);\n this._parameterizedRoutes.get(method)?.push(compiled);\n }\n\n /**\n * Find and match a parameterized route, extracting parameters\n * This is slower than the exact route match (O(n)) because it has to iterate through all the parameterized routes\n * and should only be used if the route is parameterized, otherwise it will be slower than the exact route match.\n */\n private _findParameterizedRoute(method: InternalHttpMethod, path: string): InternalRouteRegistry | undefined {\n const paramRoutes = this._parameterizedRoutes.get(method);\n if (!paramRoutes) return undefined;\n\n // Try each parameterized route until we find a match\n for (const compiledRoute of paramRoutes) {\n const match = path.match(compiledRoute.pattern);\n if (match) {\n const params: Record<string, string> = {};\n\n // Extract parameters from regex capture groups\n // match[0] is the full match, match[1+] are the captured groups\n for (let i = 0; i < compiledRoute.paramNames.length; i++) {\n const paramValue = match[i + 1];\n const paramName = compiledRoute.paramNames[i];\n\n if (paramValue !== undefined && paramName !== undefined) {\n params[paramName] = paramValue;\n }\n }\n\n return { ...compiledRoute, params };\n }\n }\n\n return undefined;\n }\n}\n",
38
- "import type { InternalRouteRegistryOptions } from '@typedefs/internal/InternalRouteRegistryImpl.js';\nimport type { InternalSetupMethod } from '@typedefs/internal/InternalSetupImpl.js';\nimport type { InternalGroupApp } from '@core/setup/GroupApp.js';\nimport type { httpMethod } from '@constants/http.ts';\n\n/**\n * Utility type that maps HTTP methods to their handler functions\n * Ensures consistency between SetupImpl and GroupApp\n */\nexport type HttpMethodHandlers = Record<Lowercase<keyof typeof httpMethod>, InternalSetupMethod>;\n\n/**\n * Route group method signature for consistent typing across interfaces\n * Used for both main setup and nested group registration\n */\nexport type RouteGroupMethod = (prefix: string, callback: (group: InternalGroupApp) => void, options?: InternalRouteRegistryOptions) => InternalGroupApp;\n\n/**\n * Ensure route options are complete by filling in missing optional properties\n * This allows developers to specify only the hooks they need while maintaining\n * internal compatibility with the system\n */\nexport const ensureCompleteRouteOptions = (options?: InternalRouteRegistryOptions): InternalRouteRegistryOptions => ({\n beforeHooks: options?.beforeHooks ?? [],\n afterHooks: options?.afterHooks ?? [],\n});\n\n/**\n * Merge route options with proper hook ordering\n * - beforeHooks: parent hooks first, then child hooks\n * - afterHooks: child hooks first, then parent hooks\n * Handles optional hooks gracefully\n */\nexport const mergeRouteOptions = (parentOptions: InternalRouteRegistryOptions, childOptions?: InternalRouteRegistryOptions): InternalRouteRegistryOptions => ({\n beforeHooks: [...(parentOptions.beforeHooks ?? []), ...(childOptions?.beforeHooks ?? [])],\n afterHooks: [...(childOptions?.afterHooks ?? []), ...(parentOptions.afterHooks ?? [])],\n});\n\n/**\n * Build a route path by joining prefix and path segments\n * Handles leading/trailing slashes intelligently\n */\nexport const buildRoutePath = (prefix: string, path: string): string => {\n const cleanPrefix = prefix.endsWith('/') ? prefix.slice(0, -1) : prefix;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return `${cleanPrefix}${cleanPath}`;\n};\n",
39
- "import { httpMethod } from '@constants/http.ts';\nimport type { InternalHttpMethod } from '@typedefs/constants/http.ts';\nimport type { InternalRouteRegistryOptions } from '@typedefs/internal/InternalRouteRegistryImpl.js';\nimport type { HandlerCallback } from '@typedefs/public/Context.js';\nimport type { InternalSetupImpl } from '@typedefs/internal/InternalSetupImpl.js';\nimport type { HttpMethodHandlers, RouteGroupMethod } from '@core/setup/utils/routeUtils.js';\nimport { buildRoutePath, ensureCompleteRouteOptions, mergeRouteOptions } from '@core/setup/utils/routeUtils.js';\n\nexport interface InternalGroupApp extends HttpMethodHandlers {\n readonly group: RouteGroupMethod;\n}\n\nexport class GroupApp implements InternalGroupApp {\n private readonly _setup: InternalSetupImpl;\n private readonly _prefix: string;\n private readonly _options: InternalRouteRegistryOptions;\n\n constructor(setup: InternalSetupImpl, prefix: string, options?: InternalRouteRegistryOptions) {\n this._setup = setup;\n this._prefix = prefix;\n this._options = ensureCompleteRouteOptions(options);\n }\n\n private _createRouteHandler(method: InternalHttpMethod) {\n return (path: string, handler: HandlerCallback<any>, routeOptions?: InternalRouteRegistryOptions): void => {\n const fullPath = buildRoutePath(this._prefix, path);\n const mergedOptions = mergeRouteOptions(this._options, routeOptions);\n\n this._setup._routeRegistry._register({\n method,\n handler,\n path: fullPath,\n options: mergedOptions,\n params: {},\n });\n\n // If this is a GET route, automatically register the corresponding HEAD route\n if (method === httpMethod.get) {\n this._setup._routeRegistry._register({\n method: httpMethod.head,\n handler,\n path: fullPath,\n options: mergedOptions,\n params: {},\n });\n }\n };\n }\n\n // HTTP method handlers - using the utility type to ensure consistency\n get = this._createRouteHandler(httpMethod.get);\n head = this._createRouteHandler(httpMethod.head);\n post = this._createRouteHandler(httpMethod.post);\n put = this._createRouteHandler(httpMethod.put);\n delete = this._createRouteHandler(httpMethod.delete);\n patch = this._createRouteHandler(httpMethod.patch);\n options = this._createRouteHandler(httpMethod.options);\n\n // Nested group support\n group(prefix: string, callback: (group: InternalGroupApp) => void, options?: InternalRouteRegistryOptions): InternalGroupApp {\n const nestedPrefix = buildRoutePath(this._prefix, prefix);\n const nestedOptions = mergeRouteOptions(this._options, options);\n\n const nestedGroup = new GroupApp(this._setup, nestedPrefix, nestedOptions);\n callback(nestedGroup);\n\n return nestedGroup;\n }\n}\n",
40
- "import { httpMethod } from '@constants/http.ts';\nimport { handleCustomConfiguration } from '@core/setup/utils/handleCustomConfiguration.ts';\nimport type { InternalSetupImpl } from '@typedefs/internal/InternalSetupImpl.ts';\nimport { HookRegistryImpl } from '@core/execution/HookRegistryImpl.ts';\nimport type { InternalGlobalHookOptions } from '@typedefs/internal/InternalHookRegistryImpl.js';\nimport type { InternalServerConfiguration } from '@typedefs/internal/InternalConfiguration.js';\nimport type { ServerConfiguration } from '@typedefs/public/Configuration.js';\nimport type { InternalRouteRegistryOptions } from '@typedefs/internal/InternalRouteRegistryImpl.js';\nimport { RouteRegistryImpl } from '@core/setup/RouteRegistryImpl.ts';\nimport type { HandlerCallback } from '@typedefs/public/Context.js';\nimport { GroupApp } from '@core/setup/GroupApp.ts';\nimport type { InternalGroupApp } from '@core/setup/GroupApp.ts';\nimport { ensureCompleteRouteOptions } from '@core/setup/utils/routeUtils.js';\n\nexport class SetupImpl implements InternalSetupImpl {\n readonly _configuration: InternalServerConfiguration;\n readonly _routeRegistry = new RouteRegistryImpl();\n readonly _hooks = new HookRegistryImpl();\n\n constructor(customConfiguration?: ServerConfiguration) {\n this._configuration = handleCustomConfiguration(customConfiguration);\n }\n\n // ===== Route Registration =====\n get(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n const routeOptions = ensureCompleteRouteOptions(options);\n // Register GET route\n this._routeRegistry._register({ method: httpMethod.get, handler, path, options: routeOptions, params: {} });\n // Automatically register corresponding HEAD route\n this._routeRegistry._register({ method: httpMethod.head, handler, path, options: routeOptions, params: {} });\n }\n\n head(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.head, handler, path, options: ensureCompleteRouteOptions(options), params: {} });\n }\n\n post(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.post, handler, path, options: ensureCompleteRouteOptions(options), params: {} });\n }\n\n put(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.put, handler, path, options: ensureCompleteRouteOptions(options), params: {} });\n }\n\n patch(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.patch, handler, path, options: ensureCompleteRouteOptions(options), params: {} });\n }\n\n delete(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.delete, handler, path, options: ensureCompleteRouteOptions(options), params: {} });\n }\n\n options(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.options, handler, path, options: ensureCompleteRouteOptions(options), params: {} });\n }\n\n group(prefix: string, callback: (group: InternalGroupApp) => void, options?: InternalRouteRegistryOptions): InternalGroupApp {\n // Create a group app that can handle nested groups and route registration\n const groupApp = new GroupApp(this, prefix, options);\n\n // Execute callback to register routes\n callback(groupApp);\n\n return groupApp;\n }\n\n /**\n * Hook Registration\n *\n * Note these are going to be called dynamically at run time, for now\n * we are just storing them in the server object until runtime. Although\n * it is slower during lookup, it is more flexible and memory efficient\n * allowing for more flexibility to include hook modification, conditional\n * hook execution, and better debugging.\n */\n beforeAll(handlers: Array<HandlerCallback<any>>, options?: InternalGlobalHookOptions): void {\n this._hooks._addBeforeHooks(handlers, options);\n }\n\n afterAll(handlers: Array<HandlerCallback<any>>, options?: InternalGlobalHookOptions): void {\n this._hooks._addAfterHooks(handlers, options);\n }\n\n onError(handler: HandlerCallback<any>): void {\n this._hooks._addOnError(handler);\n }\n\n onNotFound(handler: HandlerCallback<any>): void {\n this._hooks._addOnNotFound(handler);\n }\n}\n"
38
+ "import type { InternalRouteRegistryOptions } from '@typedefs/internal/InternalRouteRegistryImpl.js';\nimport type { InternalSetupMethod } from '@typedefs/internal/InternalSetupImpl.js';\nimport type { httpMethod } from '@constants/http.ts';\nimport type { RouteGroup } from '@typedefs/public/Setup.js';\n\n/**\n * Utility type that maps HTTP methods to their handler functions\n * Ensures consistency between SetupImpl and GroupApp\n */\nexport type HttpMethodHandlers = Record<Lowercase<keyof typeof httpMethod>, InternalSetupMethod>;\n\n/**\n * Route group method signature for consistent typing across interfaces\n * Used for both main setup and nested group registration\n */\nexport type RouteGroupMethod = (prefix: string, callback: (group: RouteGroup) => void, options?: InternalRouteRegistryOptions) => RouteGroup;\n\n/**\n * Ensure route options are complete by filling in missing optional properties\n * This allows developers to specify only the hooks they need while maintaining\n * internal compatibility with the system\n */\nexport const ensureCompleteRouteOptions = (options?: InternalRouteRegistryOptions): InternalRouteRegistryOptions => ({\n beforeHooks: options?.beforeHooks ?? [],\n afterHooks: options?.afterHooks ?? [],\n});\n\n/**\n * Merge route options with proper hook ordering\n * - beforeHooks: parent hooks first, then child hooks\n * - afterHooks: child hooks first, then parent hooks\n * Handles optional hooks gracefully\n */\nexport const mergeRouteOptions = (parentOptions: InternalRouteRegistryOptions, childOptions?: InternalRouteRegistryOptions): InternalRouteRegistryOptions => ({\n beforeHooks: [...(parentOptions.beforeHooks ?? []), ...(childOptions?.beforeHooks ?? [])],\n afterHooks: [...(childOptions?.afterHooks ?? []), ...(parentOptions.afterHooks ?? [])],\n});\n\n/**\n * Build a route path by joining prefix and path segments\n * Handles leading/trailing slashes intelligently\n */\nexport const buildRoutePath = (prefix: string, path: string): string => {\n const cleanPrefix = prefix.endsWith('/') ? prefix.slice(0, -1) : prefix;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return `${cleanPrefix}${cleanPath}`;\n};\n",
39
+ "import { httpMethod } from '@constants/http.ts';\nimport type { InternalHttpMethod } from '@typedefs/constants/http.ts';\nimport type { InternalRouteRegistryOptions } from '@typedefs/internal/InternalRouteRegistryImpl.js';\nimport type { HandlerCallback } from '@typedefs/public/Context.js';\nimport type { InternalSetupImpl } from '@typedefs/internal/InternalSetupImpl.js';\nimport type { HttpMethodHandlers, RouteGroupMethod } from '@core/setup/utils/routeUtils.js';\nimport { buildRoutePath, ensureCompleteRouteOptions, mergeRouteOptions } from '@core/setup/utils/routeUtils.js';\nimport type { RouteGroup } from '@typedefs/public/Setup.js';\n\nexport interface InternalGroupApp extends HttpMethodHandlers {\n readonly group: RouteGroupMethod;\n}\n\nexport class GroupApp implements InternalGroupApp {\n private readonly _setup: InternalSetupImpl;\n private readonly _prefix: string;\n private readonly _options: InternalRouteRegistryOptions;\n\n constructor(setup: InternalSetupImpl, prefix: string, options?: InternalRouteRegistryOptions) {\n this._setup = setup;\n this._prefix = prefix;\n this._options = ensureCompleteRouteOptions(options);\n }\n\n private _createRouteHandler(method: InternalHttpMethod) {\n return (path: string, handler: HandlerCallback<any>, routeOptions?: InternalRouteRegistryOptions): void => {\n const fullPath = buildRoutePath(this._prefix, path);\n const mergedOptions = mergeRouteOptions(this._options, routeOptions);\n\n this._setup._routeRegistry._register({\n method,\n handler,\n path: fullPath,\n options: mergedOptions,\n params: {},\n });\n\n // If this is a GET route, automatically register the corresponding HEAD route\n if (method === httpMethod.get) {\n this._setup._routeRegistry._register({\n method: httpMethod.head,\n handler,\n path: fullPath,\n options: mergedOptions,\n params: {},\n });\n }\n };\n }\n\n // HTTP method handlers - using the utility type to ensure consistency\n get = this._createRouteHandler(httpMethod.get);\n head = this._createRouteHandler(httpMethod.head);\n post = this._createRouteHandler(httpMethod.post);\n put = this._createRouteHandler(httpMethod.put);\n delete = this._createRouteHandler(httpMethod.delete);\n patch = this._createRouteHandler(httpMethod.patch);\n options = this._createRouteHandler(httpMethod.options);\n\n // Nested group support\n group(prefix: string, callback: (group: RouteGroup) => void, options?: InternalRouteRegistryOptions): RouteGroup {\n const nestedPrefix = buildRoutePath(this._prefix, prefix);\n const nestedOptions = mergeRouteOptions(this._options, options);\n\n const nestedGroup = new GroupApp(this._setup, nestedPrefix, nestedOptions);\n callback(nestedGroup);\n\n return nestedGroup;\n }\n}\n",
40
+ "import { httpMethod } from '@constants/http.ts';\nimport { handleCustomConfiguration } from '@core/setup/utils/handleCustomConfiguration.ts';\nimport type { InternalSetupImpl } from '@typedefs/internal/InternalSetupImpl.ts';\nimport { HookRegistryImpl } from '@core/execution/HookRegistryImpl.ts';\nimport type { InternalGlobalHookOptions } from '@typedefs/internal/InternalHookRegistryImpl.js';\nimport type { InternalServerConfiguration } from '@typedefs/internal/InternalConfiguration.js';\nimport type { ServerConfiguration } from '@typedefs/public/Configuration.js';\nimport type { InternalRouteRegistryOptions } from '@typedefs/internal/InternalRouteRegistryImpl.js';\nimport { RouteRegistryImpl } from '@core/setup/RouteRegistryImpl.ts';\nimport type { HandlerCallback } from '@typedefs/public/Context.js';\nimport { GroupApp } from '@core/setup/GroupApp.ts';\nimport { ensureCompleteRouteOptions } from '@core/setup/utils/routeUtils.js';\nimport type { RouteGroup } from '@typedefs/public/Setup.js';\n\nexport class SetupImpl implements InternalSetupImpl {\n readonly _configuration: InternalServerConfiguration;\n readonly _routeRegistry = new RouteRegistryImpl();\n readonly _hooks = new HookRegistryImpl();\n\n constructor(customConfiguration?: ServerConfiguration) {\n this._configuration = handleCustomConfiguration(customConfiguration);\n }\n\n // ===== Route Registration =====\n get(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n const routeOptions = ensureCompleteRouteOptions(options);\n // Register GET route\n this._routeRegistry._register({ method: httpMethod.get, handler, path, options: routeOptions, params: {} });\n // Automatically register corresponding HEAD route\n this._routeRegistry._register({ method: httpMethod.head, handler, path, options: routeOptions, params: {} });\n }\n\n head(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.head, handler, path, options: ensureCompleteRouteOptions(options), params: {} });\n }\n\n post(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.post, handler, path, options: ensureCompleteRouteOptions(options), params: {} });\n }\n\n put(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.put, handler, path, options: ensureCompleteRouteOptions(options), params: {} });\n }\n\n patch(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.patch, handler, path, options: ensureCompleteRouteOptions(options), params: {} });\n }\n\n delete(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.delete, handler, path, options: ensureCompleteRouteOptions(options), params: {} });\n }\n\n options(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.options, handler, path, options: ensureCompleteRouteOptions(options), params: {} });\n }\n\n group(prefix: string, callback: (group: RouteGroup) => void, options?: InternalRouteRegistryOptions): RouteGroup {\n // Create a group app that can handle nested groups and route registration\n const groupApp = new GroupApp(this, prefix, options);\n\n // Execute callback to register routes\n callback(groupApp);\n\n return groupApp;\n }\n\n /**\n * Hook Registration\n *\n * Note these are going to be called dynamically at run time, for now\n * we are just storing them in the server object until runtime. Although\n * it is slower during lookup, it is more flexible and memory efficient\n * allowing for more flexibility to include hook modification, conditional\n * hook execution, and better debugging.\n */\n beforeAll(handlers: Array<HandlerCallback<any>>, options?: InternalGlobalHookOptions): void {\n this._hooks._addBeforeHooks(handlers, options);\n }\n\n afterAll(handlers: Array<HandlerCallback<any>>, options?: InternalGlobalHookOptions): void {\n this._hooks._addAfterHooks(handlers, options);\n }\n\n onError(handler: HandlerCallback<any>): void {\n this._hooks._addOnError(handler);\n }\n\n onNotFound(handler: HandlerCallback<any>): void {\n this._hooks._addOnNotFound(handler);\n }\n}\n",
41
+ "import { colors } from '@constants/colors.ts';\nimport { logLevels } from '@constants/log.ts';\nimport { createLogger } from '@core/utils/log.ts';\nimport type { Logger, LoggerConfig } from '@typedefs/public/Logger.ts';\n\nconst baseConfig: LoggerConfig = {\n prefix: 'NETWORK',\n logLevel: 'off',\n logger: undefined,\n};\n\nexport const networkLog = {\n log: createLogger(baseConfig),\n enable: (customLogger?: Logger): void => {\n networkLog.log = createLogger({ ...baseConfig, logLevel: logLevels.info, logger: customLogger });\n },\n};\n\n/**\n * Get status emoji for response codes\n */\nexport const getStatusEmoji = (statusCode: number): string => {\n if (statusCode >= 200 && statusCode < 300) return '✅';\n if (statusCode >= 300 && statusCode < 400) return '🔄';\n if (statusCode >= 400 && statusCode < 500) return '❌';\n if (statusCode >= 500) return '💥';\n return '❓';\n};\n\n/**\n * Performance thresholds with Pittsburgh personality\n */\nconst PERFORMANCE_THRESHOLDS = [\n { maxTime: 50, emoji: '⚡', phrase: 'faster than a Stillers touchdown!' },\n { maxTime: 100, emoji: '🔥', phrase: \"smooth as butter n'at!\" },\n { maxTime: 200, emoji: '✅', phrase: 'not bad yinz!' },\n { maxTime: 500, emoji: '⚠️', phrase: \"slowin' down a bit there\" },\n { maxTime: 1000, emoji: '🐌', phrase: \"that's draggin' n'at\" },\n { maxTime: Infinity, emoji: '💥', phrase: 'what a jagoff response time!' },\n] as const;\n\n/**\n * Get performance details for response time with Pittsburgh personality\n */\nexport const logPerformanceDetails = (timeMs: number): void => {\n const threshold = PERFORMANCE_THRESHOLDS.find((t) => timeMs < t.maxTime) ?? PERFORMANCE_THRESHOLDS[PERFORMANCE_THRESHOLDS.length - 1];\n if (!threshold) throw new Error('No threshold found for performance details');\n\n networkLog.log.warn(`${colors.magenta} ${threshold.emoji} Response time: ${timeMs}ms - ${threshold.phrase}${colors.reset}`);\n};\n"
41
42
  ],
42
- "mappings": "uZAAC,QAAQ,CAAC,EAAE,EAAE,CAAW,OAAO,IAAjB,UAAuC,OAAO,IAApB,YAA2B,GAAO,QAAQ,EAAE,EAAc,OAAO,QAAnB,YAA2B,OAAO,IAAI,OAAO,CAAC,GAAG,EAAe,OAAO,YAApB,YAA+B,WAAW,GA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