yinzerflow 0.2.6 → 0.2.8
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/README.md +58 -0
- package/example/app/handlers/example.ts +0 -5
- package/example/app/index.ts +5 -8
- package/example/app/routes/group-example.ts +13 -0
- package/example/docker-compose.yml +8 -2
- package/index.d.ts +5 -5
- package/index.js +10 -10
- package/index.js.map +8 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# YinzerFlow
|
|
2
|
+
|
|
3
|
+
A lightweight, modular HTTP server framework for Node.js built with TypeScript. Features comprehensive security protections, Pittsburgh personality, and flexible configuration options.
|
|
4
|
+
|
|
5
|
+
## 🚀 Quick Start
|
|
6
|
+
|
|
7
|
+
For complete documentation and examples, see **[docs/start-here.md](docs/start-here.md)**.
|
|
8
|
+
|
|
9
|
+
## 📦 Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install yinzerflow
|
|
13
|
+
# or
|
|
14
|
+
bun add yinzerflow
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 🔧 Basic Usage
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { YinzerFlow } from 'yinzerflow';
|
|
21
|
+
|
|
22
|
+
const app = new YinzerFlow({ port: 3000 });
|
|
23
|
+
|
|
24
|
+
app.get('/hello', () => {
|
|
25
|
+
return { message: 'Hello, World!' };
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
await app.listen();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## ✨ Features
|
|
32
|
+
|
|
33
|
+
- **Security-first** - Built-in protections against common web vulnerabilities
|
|
34
|
+
- **TypeScript-first** - Full type safety and IntelliSense support
|
|
35
|
+
- **Pittsburgh personality** - Witty logging and error messages
|
|
36
|
+
- **Flexible configuration** - Comprehensive options for different use cases
|
|
37
|
+
- **Modular architecture** - Scales from simple APIs to complex applications
|
|
38
|
+
|
|
39
|
+
## 📚 Documentation
|
|
40
|
+
|
|
41
|
+
- **[Getting Started](docs/start-here.md)** - Complete guide and examples
|
|
42
|
+
- **[Routes](docs/routes.md)** - Routing system and handlers
|
|
43
|
+
- **[Request/Response](docs/request.md)** - Request and response objects
|
|
44
|
+
- **[Logging](docs/logging.md)** - Logging configuration and customization
|
|
45
|
+
- **[Advanced Configuration](docs/advanced-configuration-options.md)** - Detailed configuration options
|
|
46
|
+
|
|
47
|
+
## 🛡️ Security
|
|
48
|
+
|
|
49
|
+
YinzerFlow includes comprehensive security features:
|
|
50
|
+
- IP security and rate limiting
|
|
51
|
+
- CORS protection
|
|
52
|
+
- Body parsing with security limits
|
|
53
|
+
- Header validation and sanitization
|
|
54
|
+
- Prototype pollution protection
|
|
55
|
+
|
|
56
|
+
## 📄 License
|
|
57
|
+
|
|
58
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import type { HandlerCallback } from 'yinzerflow';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
4
|
export const exampleHandler: HandlerCallback<{
|
|
8
5
|
body: {
|
|
9
6
|
something: string;
|
|
@@ -15,11 +12,9 @@ export const exampleHandler: HandlerCallback<{
|
|
|
15
12
|
something: string;
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
}> = async ({ request }) => {
|
|
20
16
|
const { something } = request.body;
|
|
21
17
|
|
|
22
|
-
|
|
23
18
|
return {
|
|
24
19
|
success: true,
|
|
25
20
|
message: "Hello World",
|
package/example/app/index.ts
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { registerExampleRoutes } from "@app/routes/example.ts";
|
|
2
|
+
import { registerGroupExampleRoutes } from "@app/routes/group-example.ts";
|
|
2
3
|
import log from "app/util/customLogger.ts";
|
|
3
4
|
import { YinzerFlow, type HandlerCallback } from "yinzerflow";
|
|
4
5
|
|
|
5
6
|
const app = new YinzerFlow({
|
|
6
7
|
cors: {
|
|
7
8
|
enabled: true,
|
|
8
|
-
origin: "
|
|
9
|
+
origin: "http://localhost:8085",
|
|
9
10
|
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
10
11
|
allowedHeaders: ["Content-Type", "Authorization", "x-session-id"],
|
|
11
12
|
preflightContinue: false,
|
|
12
13
|
},
|
|
13
|
-
bodyParser: {
|
|
14
|
-
json: {
|
|
15
|
-
maxDepth: 500
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
},
|
|
19
14
|
logLevel: "info",
|
|
20
15
|
networkLogs: true,
|
|
21
16
|
// logger: log,
|
|
@@ -48,7 +43,7 @@ app.beforeAll([
|
|
|
48
43
|
|
|
49
44
|
app.afterAll([
|
|
50
45
|
(ctx) => {
|
|
51
|
-
ctx.response.setStatusCode(202);
|
|
46
|
+
// ctx.response.setStatusCode(202);
|
|
52
47
|
console.log("afterAll");
|
|
53
48
|
},
|
|
54
49
|
]);
|
|
@@ -105,6 +100,8 @@ app.group("/api", (app) => {
|
|
|
105
100
|
|
|
106
101
|
// Register example routes
|
|
107
102
|
registerExampleRoutes(app);
|
|
103
|
+
registerGroupExampleRoutes(app);
|
|
108
104
|
|
|
109
105
|
// Start the server AFTER defining all routes
|
|
110
106
|
await app.listen();
|
|
107
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { exampleHandler } from '@app/handlers/example.ts';
|
|
2
|
+
import type { YinzerFlow } from 'yinzerflow';
|
|
3
|
+
|
|
4
|
+
export const registerGroupExampleRoutes = (app: YinzerFlow): void => {
|
|
5
|
+
app.group('/admin', (group) => {
|
|
6
|
+
/**
|
|
7
|
+
* Get all users
|
|
8
|
+
*/
|
|
9
|
+
group.post('/get-users', exampleHandler);
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
});
|
|
13
|
+
};
|
|
@@ -7,10 +7,12 @@ services:
|
|
|
7
7
|
- .:/app/yinzerflow-local
|
|
8
8
|
- ../yinzerflow/lib:/app/yinzerflow/lib
|
|
9
9
|
ports:
|
|
10
|
-
- "
|
|
10
|
+
- "3000:5000"
|
|
11
11
|
command: sh -c "bun install && tail -f /dev/null"
|
|
12
12
|
tty: true
|
|
13
13
|
stdin_open: true
|
|
14
|
+
networks:
|
|
15
|
+
- yinzerflow-network
|
|
14
16
|
|
|
15
17
|
benchmark:
|
|
16
18
|
image: williamyeh/wrk
|
|
@@ -19,4 +21,8 @@ services:
|
|
|
19
21
|
depends_on:
|
|
20
22
|
- app
|
|
21
23
|
networks:
|
|
22
|
-
- yinzerflow-network
|
|
24
|
+
- yinzerflow-network
|
|
25
|
+
|
|
26
|
+
networks:
|
|
27
|
+
yinzerflow-network:
|
|
28
|
+
driver: bridge
|
package/index.d.ts
CHANGED
|
@@ -598,7 +598,7 @@ export interface Setup {
|
|
|
598
598
|
onError: (handler: HandlerCallback) => void;
|
|
599
599
|
onNotFound: (handler: HandlerCallback) => void;
|
|
600
600
|
}
|
|
601
|
-
export type InternalSetupMethod = (path: string, handler: HandlerCallback
|
|
601
|
+
export type InternalSetupMethod = (path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions) => void;
|
|
602
602
|
export interface InternalSetupImpl extends Setup {
|
|
603
603
|
readonly _configuration: InternalServerConfiguration;
|
|
604
604
|
readonly _routeRegistry: InternalRouteRegistryImpl;
|
|
@@ -651,10 +651,10 @@ declare class SetupImpl implements InternalSetupImpl {
|
|
|
651
651
|
delete(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void;
|
|
652
652
|
options(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void;
|
|
653
653
|
group(prefix: string, callback: (group: Record<Lowercase<InternalHttpMethod>, InternalSetupMethod>) => void, options?: InternalRouteRegistryOptions): void;
|
|
654
|
-
beforeAll(handlers: Array<HandlerCallback
|
|
655
|
-
afterAll(handlers: Array<HandlerCallback
|
|
656
|
-
onError(handler: HandlerCallback): void;
|
|
657
|
-
onNotFound(handler: HandlerCallback): void;
|
|
654
|
+
beforeAll(handlers: Array<HandlerCallback<any>>, options?: InternalGlobalHookOptions): void;
|
|
655
|
+
afterAll(handlers: Array<HandlerCallback<any>>, options?: InternalGlobalHookOptions): void;
|
|
656
|
+
onError(handler: HandlerCallback<any>): void;
|
|
657
|
+
onNotFound(handler: HandlerCallback<any>): void;
|
|
658
658
|
}
|
|
659
659
|
export declare class YinzerFlow extends SetupImpl {
|
|
660
660
|
private _isListening;
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var M1=Object.create;var{getPrototypeOf:U1,defineProperty:u$,getOwnPropertyNames:j1}=Object;var F1=Object.prototype.hasOwnProperty;var F$=($,W,Y)=>{Y=$!=null?M1(U1($)):{};let Z=W||!$||!$.__esModule?u$(Y,"default",{value:$,enumerable:!0}):Y;for(let D of j1($))if(!F1.call(Z,D))u$(Z,D,{get:()=>$[D],enumerable:!0});return Z};var _1=($,W)=>()=>(W||$((W={exports:{}}).exports,W),W.exports);var D$=_1((_$,V$)=>{(function($,W){typeof _$=="object"&&typeof V$!="undefined"?V$.exports=W():typeof define=="function"&&define.amd?define(W):($=typeof globalThis!="undefined"?globalThis:$||self).dayjs=W()})(_$,function(){var $=1000,W=60000,Y=3600000,Z="millisecond",D="second",Q="minute",X="hour",O="day",H="week",V="month",I="quarter",A="year",L="date",o="Invalid Date",M$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,e=/\[([^\]]+)]|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,U$={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(U){var G=["th","st","nd","rd"],J=U%100;return"["+U+(G[(J-20)%10]||G[J]||G[0])+"]"}},s=function(U,G,J){var M=String(U);return!M||M.length>=G?U:""+Array(G+1-M.length).join(J)+U},$$={s,z:function(U){var G=-U.utcOffset(),J=Math.abs(G),M=Math.floor(J/60),K=J%60;return(G<=0?"+":"-")+s(M,2,"0")+":"+s(K,2,"0")},m:function U(G,J){if(G.date()<J.date())return-U(J,G);var M=12*(J.year()-G.year())+(J.month()-G.month()),K=G.clone().add(M,V),j=J-K<0,F=G.clone().add(M+(j?-1:1),V);return+(-(M+(J-K)/(j?K-F:F-K))||0)},a:function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},p:function(U){return{M:V,y:A,w:H,d:O,D:L,h:X,m:Q,s:D,ms:Z,Q:I}[U]||String(U||"").toLowerCase().replace(/s$/,"")},u:function(U){return U===void 0}},m="en",f={};f[m]=U$;var C$="$isDayjsObject",j$=function(U){return U instanceof Y$||!(!U||!U[C$])},W$=function U(G,J,M){var K;if(!G)return m;if(typeof G=="string"){var j=G.toLowerCase();f[j]&&(K=j),J&&(f[j]=J,K=j);var F=G.split("-");if(!K&&F.length>1)return U(F[0])}else{var w=G.name;f[w]=G,K=w}return!M&&K&&(m=K),K||!M&&m},z=function(U,G){if(j$(U))return U.clone();var J=typeof G=="object"?G:{};return J.date=U,J.args=arguments,new Y$(J)},q=$$;q.l=W$,q.i=j$,q.w=function(U,G){return z(U,{locale:G.$L,utc:G.$u,x:G.$x,$offset:G.$offset})};var Y$=function(){function U(J){this.$L=W$(J.locale,null,!0),this.parse(J),this.$x=this.$x||J.x||{},this[C$]=!0}var G=U.prototype;return G.parse=function(J){this.$d=function(M){var{date:K,utc:j}=M;if(K===null)return new Date(NaN);if(q.u(K))return new Date;if(K instanceof Date)return new Date(K);if(typeof K=="string"&&!/Z$/i.test(K)){var F=K.match(M$);if(F){var w=F[2]-1||0,B=(F[7]||"0").substring(0,3);return j?new Date(Date.UTC(F[1],w,F[3]||1,F[4]||0,F[5]||0,F[6]||0,B)):new Date(F[1],w,F[3]||1,F[4]||0,F[5]||0,F[6]||0,B)}}return new Date(K)}(J),this.init()},G.init=function(){var J=this.$d;this.$y=J.getFullYear(),this.$M=J.getMonth(),this.$D=J.getDate(),this.$W=J.getDay(),this.$H=J.getHours(),this.$m=J.getMinutes(),this.$s=J.getSeconds(),this.$ms=J.getMilliseconds()},G.$utils=function(){return q},G.isValid=function(){return this.$d.toString()!==o},G.isSame=function(J,M){var K=z(J);return this.startOf(M)<=K&&K<=this.endOf(M)},G.isAfter=function(J,M){return z(J)<this.startOf(M)},G.isBefore=function(J,M){return this.endOf(M)<z(J)},G.$g=function(J,M,K){return q.u(J)?this[M]:this.set(K,J)},G.unix=function(){return Math.floor(this.valueOf()/1000)},G.valueOf=function(){return this.$d.getTime()},G.startOf=function(J,M){var K=this,j=!!q.u(M)||M,F=q.p(J),w=function(l,R){var h=q.w(K.$u?Date.UTC(K.$y,R,l):new Date(K.$y,R,l),K);return j?h:h.endOf(O)},B=function(l,R){return q.w(K.toDate()[l].apply(K.toDate("s"),(j?[0,0,0,0]:[23,59,59,999]).slice(R)),K)},S=this.$W,k=this.$M,T=this.$D,c="set"+(this.$u?"UTC":"");switch(F){case A:return j?w(1,0):w(31,11);case V:return j?w(1,k):w(0,k+1);case H:var p=this.$locale().weekStart||0,a=(S<p?S+7:S)-p;return w(j?T-a:T+(6-a),k);case O:case L:return B(c+"Hours",0);case X:return B(c+"Minutes",1);case Q:return B(c+"Seconds",2);case D:return B(c+"Milliseconds",3);default:return this.clone()}},G.endOf=function(J){return this.startOf(J,!1)},G.$set=function(J,M){var K,j=q.p(J),F="set"+(this.$u?"UTC":""),w=(K={},K[O]=F+"Date",K[L]=F+"Date",K[V]=F+"Month",K[A]=F+"FullYear",K[X]=F+"Hours",K[Q]=F+"Minutes",K[D]=F+"Seconds",K[Z]=F+"Milliseconds",K)[j],B=j===O?this.$D+(M-this.$W):M;if(j===V||j===A){var S=this.clone().set(L,1);S.$d[w](B),S.init(),this.$d=S.set(L,Math.min(this.$D,S.daysInMonth())).$d}else w&&this.$d[w](B);return this.init(),this},G.set=function(J,M){return this.clone().$set(J,M)},G.get=function(J){return this[q.p(J)]()},G.add=function(J,M){var K,j=this;J=Number(J);var F=q.p(M),w=function(k){var T=z(j);return q.w(T.date(T.date()+Math.round(k*J)),j)};if(F===V)return this.set(V,this.$M+J);if(F===A)return this.set(A,this.$y+J);if(F===O)return w(1);if(F===H)return w(7);var B=(K={},K[Q]=W,K[X]=Y,K[D]=$,K)[F]||1,S=this.$d.getTime()+J*B;return q.w(S,this)},G.subtract=function(J,M){return this.add(-1*J,M)},G.format=function(J){var M=this,K=this.$locale();if(!this.isValid())return K.invalidDate||o;var j=J||"YYYY-MM-DDTHH:mm:ssZ",F=q.z(this),w=this.$H,B=this.$m,S=this.$M,k=K.weekdays,T=K.months,c=K.meridiem,p=function(R,h,n,Z$){return R&&(R[h]||R(M,j))||n[h].slice(0,Z$)},a=function(R){return q.s(w%12||12,R,"0")},l=c||function(R,h,n){var Z$=R<12?"AM":"PM";return n?Z$.toLowerCase():Z$};return j.replace(e,function(R,h){return h||function(n){switch(n){case"YY":return String(M.$y).slice(-2);case"YYYY":return q.s(M.$y,4,"0");case"M":return S+1;case"MM":return q.s(S+1,2,"0");case"MMM":return p(K.monthsShort,S,T,3);case"MMMM":return p(T,S);case"D":return M.$D;case"DD":return q.s(M.$D,2,"0");case"d":return String(M.$W);case"dd":return p(K.weekdaysMin,M.$W,k,2);case"ddd":return p(K.weekdaysShort,M.$W,k,3);case"dddd":return k[M.$W];case"H":return String(w);case"HH":return q.s(w,2,"0");case"h":return a(1);case"hh":return a(2);case"a":return l(w,B,!0);case"A":return l(w,B,!1);case"m":return String(B);case"mm":return q.s(B,2,"0");case"s":return String(M.$s);case"ss":return q.s(M.$s,2,"0");case"SSS":return q.s(M.$ms,3,"0");case"Z":return F}return null}(R)||F.replace(":","")})},G.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},G.diff=function(J,M,K){var j,F=this,w=q.p(M),B=z(J),S=(B.utcOffset()-this.utcOffset())*W,k=this-B,T=function(){return q.m(F,B)};switch(w){case A:j=T()/12;break;case V:j=T();break;case I:j=T()/3;break;case H:j=(k-S)/604800000;break;case O:j=(k-S)/86400000;break;case X:j=k/Y;break;case Q:j=k/W;break;case D:j=k/$;break;default:j=k}return K?j:q.a(j)},G.daysInMonth=function(){return this.endOf(V).$D},G.$locale=function(){return f[this.$L]},G.locale=function(J,M){if(!J)return this.$L;var K=this.clone(),j=W$(J,M,!0);return j&&(K.$L=j),K},G.clone=function(){return q.w(this.$d,this)},G.toDate=function(){return new Date(this.valueOf())},G.toJSON=function(){return this.isValid()?this.toISOString():null},G.toISOString=function(){return this.$d.toISOString()},G.toString=function(){return this.$d.toUTCString()},U}(),b$=Y$.prototype;return z.prototype=b$,[["$ms",Z],["$s",D],["$m",Q],["$H",X],["$W",O],["$M",V],["$y",A],["$D",L]].forEach(function(U){b$[U[1]]=function(G){return this.$g(G,U[0],U[1])}}),z.extend=function(U,G){return U.$i||(U(G,Y$,z),U.$i=!0),z},z.locale=W$,z.isDayjs=j$,z.unix=function(U){return z(1000*U)},z.en=f[m],z.Ls=f,z.p={},z})});import{createServer as p0}from"net";var w$=F$(D$(),1);var Q$={ok:"OK",created:"Created",accepted:"Accepted",noContent:"No Content",movedPermanently:"Moved Permanently",found:"Found",notModified:"Not Modified",badRequest:"Bad Request",unauthorized:"Unauthorized",forbidden:"Forbidden",notFound:"Not Found",methodNotAllowed:"Method Not Allowed",conflict:"Conflict",unsupportedMediaType:"Unsupported Media Type",tooManyRequests:"Too Many Requests",internalServerError:"Internal Server Error"},b={ok:200,created:201,accepted:202,noContent:204,movedPermanently:301,found:302,notModified:304,badRequest:400,unauthorized:401,forbidden:403,notFound:404,methodNotAllowed:405,conflict:409,unsupportedMediaType:415,tooManyRequests:429,internalServerError:500},E={delete:"DELETE",get:"GET",head:"HEAD",post:"POST",put:"PUT",patch:"PATCH",options:"OPTIONS"},v={json:"application/json",html:"text/html",form:"application/x-www-form-urlencoded",multipart:"multipart/form-data",xml:"application/xml",text:"text/plain",csv:"text/csv",yamlApplication:"application/yaml",yamlText:"text/yaml",urlEncodedJson:"application/x-www-form-urlencoded+json"},u={authorization:"Authorization",proxyAuthorization:"Proxy-Authorization",wwwAuthenticate:"WWW-Authenticate",cacheControl:"Cache-Control",etag:"ETag",expires:"Expires",lastModified:"Last-Modified",ifMatch:"If-Match",ifNoneMatch:"If-None-Match",ifModifiedSince:"If-Modified-Since",ifUnmodifiedSince:"If-Unmodified-Since",ifRange:"If-Range",age:"Age",vary:"Vary",contentType:"Content-Type",contentLength:"Content-Length",contentEncoding:"Content-Encoding",contentLanguage:"Content-Language",contentDisposition:"Content-Disposition",contentLocation:"Content-Location",contentRange:"Content-Range",accessControlAllowCredentials:"Access-Control-Allow-Credentials",accessControlAllowHeaders:"Access-Control-Allow-Headers",accessControlAllowMethods:"Access-Control-Allow-Methods",accessControlAllowOrigin:"Access-Control-Allow-Origin",accessControlExposeHeaders:"Access-Control-Expose-Headers",accessControlMaxAge:"Access-Control-Max-Age",accessControlRequestHeaders:"Access-Control-Request-Headers",accessControlRequestMethod:"Access-Control-Request-Method",accept:"Accept",acceptEncoding:"Accept-Encoding",acceptLanguage:"Accept-Language",acceptRanges:"Accept-Ranges",host:"Host",userAgent:"User-Agent",referer:"Referer",origin:"Origin",from:"From",expect:"Expect",location:"Location",server:"Server",date:"Date",allow:"Allow",retryAfter:"Retry-After",range:"Range",contentSecurityPolicy:"Content-Security-Policy",contentSecurityPolicyReportOnly:"Content-Security-Policy-Report-Only",strictTransportSecurity:"Strict-Transport-Security",xContentTypeOptions:"X-Content-Type-Options",xFrameOptions:"X-Frame-Options",xXSSProtection:"X-XSS-Protection",referrerPolicy:"Referrer-Policy",permissionsPolicy:"Permissions-Policy",crossOriginEmbedderPolicy:"Cross-Origin-Embedder-Policy",crossOriginOpenerPolicy:"Cross-Origin-Opener-Policy",crossOriginResourcePolicy:"Cross-Origin-Resource-Policy",cookie:"Cookie",setCookie:"Set-Cookie",connection:"Connection",keepAlive:"Keep-Alive",upgrade:"Upgrade",upgradeInsecureRequests:"Upgrade-Insecure-Requests",transferEncoding:"Transfer-Encoding",te:"TE",trailer:"Trailer",forwarded:"Forwarded",xForwardedFor:"X-Forwarded-For",via:"Via",maxForwards:"Max-Forwards",altSvc:"Alt-Svc",altUsed:"Alt-Used",timingAllowOrigin:"Timing-Allow-Origin",serverTiming:"Server-Timing",refresh:"Refresh",link:"Link",xPoweredBy:"X-Powered-By",xPermittedCrossDomainPolicies:"X-Permitted-Cross-Domain-Policies",reportTo:"Report-To",serviceWorkerAllowed:"Service-Worker-Allowed",sourceMap:"SourceMap",priority:"Priority",secGPC:"Sec-GPC",clearSiteData:"Clear-Site-Data",noVarySearch:"No-Vary-Search"},r={base64:"base64",binary:"binary",utf8:"utf8"};var X$=($,W)=>{if(!W.enabled)return!1;if($.request.method==="OPTIONS"){if(!h$($,W))return $.response.setStatusCode(403),$._response._setBody({error:"CORS: Origin not allowed",origin:$.request.headers.origin}),!0;$.response.setStatusCode(W.optionsSuccessStatus);let D=y$($,W);if($._response._setHeadersIfNotSet({[u.accessControlAllowOrigin]:D,[u.accessControlAllowMethods]:W.methods.join(", "),[u.accessControlAllowHeaders]:typeof W.allowedHeaders==="string"?W.allowedHeaders:W.allowedHeaders.join(", "),[u.accessControlAllowCredentials]:W.credentials?"true":"false",[u.accessControlExposeHeaders]:W.exposedHeaders.join(", "),[u.accessControlMaxAge]:W.maxAge.toString()}),W.preflightContinue)return!1;return $._response._setBody(""),!0}if(h$($,W)){let Z=y$($,W);$._response._setHeadersIfNotSet({[u.accessControlAllowOrigin]:Z,[u.accessControlAllowCredentials]:W.credentials?"true":"false"})}return!0},y$=($,W)=>{if(W.origin==="*"){if(W.credentials)throw new Error('CORS Security Error: origin: "*" with credentials: true is forbidden by CORS spec and creates security vulnerabilities. Use specific origins instead.');return"*"}let Y=$.request.headers.origin;if(Y)return Y;if(typeof W.origin==="string")return W.origin;if(Array.isArray(W.origin)&&W.origin.length>0){let[Z]=W.origin;return Z??"null"}return"null"},h$=($,W)=>{if(W.origin==="*")return!0;let Y=$.request.headers.origin?.toLowerCase()??"";if(typeof W.origin==="function")return Boolean(W.origin(Y,$.request));if(typeof W.origin==="string")return Y===W.origin.toLowerCase();if(Array.isArray(W.origin))return W.origin.some((Z)=>Y===Z.toLowerCase());if(W.origin instanceof RegExp)return W.origin.test(Y);return!1};var m$=F$(D$(),1),y="YINZER",N={reset:"\x1B[0m",cyan:"\x1B[96m",yellow:"\x1B[93m",red:"\x1B[91m",green:"\x1B[92m",magenta:"\x1B[95m",gray:"\x1B[90m"},V1={positive:["n'at!","yinz are good!","that's the way!","right on!","lookin' good!","way to go!","keep it up!"],neutral:["n'at","yinz know","just sayin'","that's how it is","what can ya do","it happens"],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"]},d=!1,P=null,C=()=>m$.default().format("YYYY-MM-DD HH:mm:ss.SSS"),H$=($)=>{let W=V1[$];return W[Math.floor(Math.random()*W.length)]??""},H1=($)=>{if(typeof $==="string")return Buffer.byteLength($,"utf8");if(Buffer.isBuffer($))return $.length;if(typeof $==="object"&&$!==null)try{return Buffer.byteLength(JSON.stringify($),"utf8")}catch{return 0}return 0},q1=($)=>{if($>=200&&$<300)return"✅";if($>=300&&$<400)return"\uD83D\uDD04";if($>=400&&$<500)return"❌";if($>=500)return"\uD83D\uDCA5";return"❓"},w1=($)=>{if($<50)return{emoji:"⚡",phrase:Math.random()<0.5?"lightning quick n'at!":"faster than a Stillers touchdown!"};if($<100)return{emoji:"\uD83D\uDD25",phrase:Math.random()<0.5?"that's the way!":"smooth as butter n'at!"};if($<200)return{emoji:"✅",phrase:Math.random()<0.5?"not bad yinz!":"keepin' up just fine!"};if($<500)return{emoji:"⚠️",phrase:Math.random()<0.5?"eh, could be better":"slowin' down a bit there"};if($<1000)return{emoji:"\uD83D\uDC0C",phrase:Math.random()<0.5?"that's draggin' n'at":"c'mon, pick up the pace!"};return{emoji:"\uD83D\uDCA5",phrase:Math.random()<0.5?"what a jagoff response time!":"slower than traffic on the Parkway!"}},N1=($,W,Y)=>{if(!d)return;let Z=C(),D=W??"unknown",Q=Y?` - ${Y}`:"",X="",O="info";if($==="connect")X=`\uD83E\uDD1D [NETWORK] New visitor from ${D} - Welcome to the 'Burgh!`;else if($==="disconnect")X=`\uD83D\uDC4B [NETWORK] ${D} headed out - Thanks for stopping by, yinz come back now!`;else X=`\uD83D\uDCA5 [NETWORK] Connection trouble with ${D}${Q} - That's not good, n'at!`,O="error";if(P)P[O](X);else{let H=O==="error"?N.red:N.gray;console.log(`${H}[${y}] [${Z}] ${X}${N.reset}`)}},B1=($,W,Y)=>{if(!d)return;let{request:Z}=$,D=$._response,Q=(Y-W).toFixed(1),X=Z.ipAddress||"unknown",{method:O,path:H,protocol:V}=Z,I=D._statusCode,A=H1(D._body),L=Z.headers.referer?`"${Z.headers.referer}"`:'"-"',o=Z.headers["user-agent"]?`"${Z.headers["user-agent"]}"`:'"-"',M$=q1(I),e=`\uD83C\uDFE0 ${X} - - [${C()}] "${O} ${H} ${V}" ${I} ${A}b ${L} ${o} ${Q}ms ${M$}`,U$=parseFloat(Q),{emoji:s,phrase:$$}=w1(U$),m=`${s} [PERF] Response time: ${Q}ms - ${$$}`;if(P)P.info(`[NETWORK] ${e}`),P.info(`[PERF] ${m}`);else console.log(`${N.gray}[${y}] [${C()}] [NETWORK] ${e}${N.reset}`),console.log(`${N.magenta}[${y}] ${s} [${C()}] [PERF] Response time: ${Q}ms - ${$$}${N.reset}`)},E1=($,W)=>{if(!d)return;let Y=C(),Z=$&&W?`${W}:${$}`:"unknown",D=H$("positive"),Q=`\uD83D\uDE80 [NETWORK] YinzerFlow server is up and running at ${Z} - Ready to serve yinz all, ${D}!`;if(P)P.info(Q);else console.log(`${N.gray}[${y}] [${Y}] ${Q}${N.reset}`)},A1=($,W)=>{if(!d)return;let Y=C(),Z=$&&W?`${W}:${$}`:"unknown",D=H$("neutral"),Q=`\uD83D\uDED1 [NETWORK] YinzerFlow server at ${Z} is shutting down - See yinz later, ${D}!`;if(P)P.info(Q);else console.log(`${N.gray}[${y}] [${Y}] ${Q}${N.reset}`)},z1=($,W,Y)=>{if(!d)return;let Z=C(),D=$&&W?`${W}:${$}`:"unknown",Q=Y?` - ${Y}`:"",X=H$("negative"),O=`\uD83D\uDCA5 [NETWORK] Server error at ${D}${Q} - Something's not right, ${X}!`;if(P)P.error(O);else console.log(`${N.red}[${y}] [${Z}] ${O}${N.reset}`)},S1=($)=>{d=$},k1=($)=>{P=$},x={setEnabled:S1,setNetworkLogger:k1,connection:N1,request:B1,serverStart:E1,serverStop:A1,serverError:z1};var i={off:0,error:1,warn:2,info:3},I1={positive:["n'at!","yinz are good!","that's the way!","right on!","lookin' good!","way to go!","keep it up!"],neutral:["n'at","yinz know","just sayin'","that's how it is","what can ya do","it happens"],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"]},t=i.warn,g=null,L1=($)=>{let W=I1[$];return W[Math.floor(Math.random()*W.length)]??""},R1=(...$)=>{if(t<i.info)return;if(g)g.info(...$);else q$("info",...$)},T1=(...$)=>{if(t<i.warn)return;if(g)g.warn(...$);else q$("warn",...$)},v1=(...$)=>{if(t<i.error)return;if(g)g.error(...$);else q$("error",...$)},P1=($,W,Y)=>{if(t<i.info)return;let Z=C(),D="❓ ",Q="";if(W<50)D="⚡ ",Q=Math.random()<0.5?"lightning quick n'at!":"faster than a Stillers touchdown!";else if(W<100)D="\uD83D\uDD25 ",Q=Math.random()<0.5?"that's the way!":"smooth as butter n'at!";else if(W<200)D="✅ ",Q=Math.random()<0.5?"not bad yinz!":"keepin' up just fine!";else if(W<500)D="⚠️ ",Q=Math.random()<0.5?"eh, could be better":"slowin' down a bit there";else if(W<1000)D="\uD83D\uDC0C ",Q=Math.random()<0.5?"that's draggin' n'at":"c'mon, pick up the pace!";else D="\uD83D\uDCA5 ",Q=Math.random()<0.5?"what a jagoff response time!":"slower than traffic on the Parkway!";let X=`${N.magenta}[${y}] ${D} [${Z}] [PERF]${N.reset}`,O=Y?{...Y,executionTime:`${W}ms`}:{executionTime:`${W}ms`};console.log(`${X} ${$} -`,O,`- ${Q}`)},x1=($)=>{t={off:0,error:1,warn:2,info:3}[$]},C1=($)=>{g=$},q$=($,...W)=>{let Y=C(),Z="✅ ",D=N.cyan,Q="positive",X="log";if($==="error")Z="❌ ",D=N.red,Q="negative",X="error";else if($==="warn")Z="⚠️ ",D=N.yellow,Q="neutral",X="warn";else Z="✅ ",D=N.cyan,Q="positive",X="log";let O=L1(Q),H=`${D}[${y}] ${Z}[${Y}] [${$.toUpperCase()}]${N.reset}`;console[X](`${H}`,...W,`- ${O}`)},_={setLogLevel:x1,setCustomLogger:C1,info:R1,warn:T1,error:v1,perf:P1,levels:i};class N${setup;constructor($){this.setup=$}async handle($){try{if(X$($,this.setup._configuration.cors)){$._response._parseResponseIntoString();return}let W=this.setup._routeRegistry._findRoute($.request.method,$.request.path);if(!W){let V=await this.setup._hooks._onNotFound($);$._response._setBody(V),$._response._parseResponseIntoString();return}let{handler:Y,options:Z}=W,{beforeHooks:D,afterHooks:Q}=Z,X=this.setup._hooks._beforeAll;for(let V of X)await V.handler($);for(let V of D)await V($);let O=await Y($);for(let V of Q)await V($);let H=this.setup._hooks._afterAll;for(let V of H)await V.handler($);if($._response._setBody(O),$.request.method==="HEAD")$._response._setBody(null);$._response._parseResponseIntoString();return}catch(W){await this.handleError($,W)}}async handleError($,W){_.error("Request handling error",W);try{let Y=this.setup._hooks._onError,Z=await Y($);$._response._setBody(Z),X$($,this.setup._configuration.cors),$._response._parseResponseIntoString(),$._response._setHeadersIfNotSet({Date:w$.default().format("ddd, DD MMM YYYY HH:mm:ss [GMT]"),"Content-Length":$._response._stringBody.split(`
|
|
1
|
+
var M1=Object.create;var{getPrototypeOf:U1,defineProperty:u$,getOwnPropertyNames:j1}=Object;var F1=Object.prototype.hasOwnProperty;var F$=($,W,Y)=>{Y=$!=null?M1(U1($)):{};let Z=W||!$||!$.__esModule?u$(Y,"default",{value:$,enumerable:!0}):Y;for(let D of j1($))if(!F1.call(Z,D))u$(Z,D,{get:()=>$[D],enumerable:!0});return Z};var _1=($,W)=>()=>(W||$((W={exports:{}}).exports,W),W.exports);var D$=_1((_$,V$)=>{(function($,W){typeof _$=="object"&&typeof V$!="undefined"?V$.exports=W():typeof define=="function"&&define.amd?define(W):($=typeof globalThis!="undefined"?globalThis:$||self).dayjs=W()})(_$,function(){var $=1000,W=60000,Y=3600000,Z="millisecond",D="second",Q="minute",X="hour",O="day",V="week",B="month",w="quarter",z="year",L="date",o="Invalid Date",M$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,e=/\[([^\]]+)]|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,U$={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(U){var G=["th","st","nd","rd"],J=U%100;return"["+U+(G[(J-20)%10]||G[J]||G[0])+"]"}},s=function(U,G,J){var M=String(U);return!M||M.length>=G?U:""+Array(G+1-M.length).join(J)+U},$$={s,z:function(U){var G=-U.utcOffset(),J=Math.abs(G),M=Math.floor(J/60),K=J%60;return(G<=0?"+":"-")+s(M,2,"0")+":"+s(K,2,"0")},m:function U(G,J){if(G.date()<J.date())return-U(J,G);var M=12*(J.year()-G.year())+(J.month()-G.month()),K=G.clone().add(M,B),j=J-K<0,F=G.clone().add(M+(j?-1:1),B);return+(-(M+(J-K)/(j?K-F:F-K))||0)},a:function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},p:function(U){return{M:B,y:z,w:V,d:O,D:L,h:X,m:Q,s:D,ms:Z,Q:w}[U]||String(U||"").toLowerCase().replace(/s$/,"")},u:function(U){return U===void 0}},m="en",f={};f[m]=U$;var C$="$isDayjsObject",j$=function(U){return U instanceof Y$||!(!U||!U[C$])},W$=function U(G,J,M){var K;if(!G)return m;if(typeof G=="string"){var j=G.toLowerCase();f[j]&&(K=j),J&&(f[j]=J,K=j);var F=G.split("-");if(!K&&F.length>1)return U(F[0])}else{var q=G.name;f[q]=G,K=q}return!M&&K&&(m=K),K||!M&&m},S=function(U,G){if(j$(U))return U.clone();var J=typeof G=="object"?G:{};return J.date=U,J.args=arguments,new Y$(J)},H=$$;H.l=W$,H.i=j$,H.w=function(U,G){return S(U,{locale:G.$L,utc:G.$u,x:G.$x,$offset:G.$offset})};var Y$=function(){function U(J){this.$L=W$(J.locale,null,!0),this.parse(J),this.$x=this.$x||J.x||{},this[C$]=!0}var G=U.prototype;return G.parse=function(J){this.$d=function(M){var{date:K,utc:j}=M;if(K===null)return new Date(NaN);if(H.u(K))return new Date;if(K instanceof Date)return new Date(K);if(typeof K=="string"&&!/Z$/i.test(K)){var F=K.match(M$);if(F){var q=F[2]-1||0,E=(F[7]||"0").substring(0,3);return j?new Date(Date.UTC(F[1],q,F[3]||1,F[4]||0,F[5]||0,F[6]||0,E)):new Date(F[1],q,F[3]||1,F[4]||0,F[5]||0,F[6]||0,E)}}return new Date(K)}(J),this.init()},G.init=function(){var J=this.$d;this.$y=J.getFullYear(),this.$M=J.getMonth(),this.$D=J.getDate(),this.$W=J.getDay(),this.$H=J.getHours(),this.$m=J.getMinutes(),this.$s=J.getSeconds(),this.$ms=J.getMilliseconds()},G.$utils=function(){return H},G.isValid=function(){return this.$d.toString()!==o},G.isSame=function(J,M){var K=S(J);return this.startOf(M)<=K&&K<=this.endOf(M)},G.isAfter=function(J,M){return S(J)<this.startOf(M)},G.isBefore=function(J,M){return this.endOf(M)<S(J)},G.$g=function(J,M,K){return H.u(J)?this[M]:this.set(K,J)},G.unix=function(){return Math.floor(this.valueOf()/1000)},G.valueOf=function(){return this.$d.getTime()},G.startOf=function(J,M){var K=this,j=!!H.u(M)||M,F=H.p(J),q=function(l,T){var h=H.w(K.$u?Date.UTC(K.$y,T,l):new Date(K.$y,T,l),K);return j?h:h.endOf(O)},E=function(l,T){return H.w(K.toDate()[l].apply(K.toDate("s"),(j?[0,0,0,0]:[23,59,59,999]).slice(T)),K)},k=this.$W,I=this.$M,R=this.$D,c="set"+(this.$u?"UTC":"");switch(F){case z:return j?q(1,0):q(31,11);case B:return j?q(1,I):q(0,I+1);case V:var p=this.$locale().weekStart||0,a=(k<p?k+7:k)-p;return q(j?R-a:R+(6-a),I);case O:case L:return E(c+"Hours",0);case X:return E(c+"Minutes",1);case Q:return E(c+"Seconds",2);case D:return E(c+"Milliseconds",3);default:return this.clone()}},G.endOf=function(J){return this.startOf(J,!1)},G.$set=function(J,M){var K,j=H.p(J),F="set"+(this.$u?"UTC":""),q=(K={},K[O]=F+"Date",K[L]=F+"Date",K[B]=F+"Month",K[z]=F+"FullYear",K[X]=F+"Hours",K[Q]=F+"Minutes",K[D]=F+"Seconds",K[Z]=F+"Milliseconds",K)[j],E=j===O?this.$D+(M-this.$W):M;if(j===B||j===z){var k=this.clone().set(L,1);k.$d[q](E),k.init(),this.$d=k.set(L,Math.min(this.$D,k.daysInMonth())).$d}else q&&this.$d[q](E);return this.init(),this},G.set=function(J,M){return this.clone().$set(J,M)},G.get=function(J){return this[H.p(J)]()},G.add=function(J,M){var K,j=this;J=Number(J);var F=H.p(M),q=function(I){var R=S(j);return H.w(R.date(R.date()+Math.round(I*J)),j)};if(F===B)return this.set(B,this.$M+J);if(F===z)return this.set(z,this.$y+J);if(F===O)return q(1);if(F===V)return q(7);var E=(K={},K[Q]=W,K[X]=Y,K[D]=$,K)[F]||1,k=this.$d.getTime()+J*E;return H.w(k,this)},G.subtract=function(J,M){return this.add(-1*J,M)},G.format=function(J){var M=this,K=this.$locale();if(!this.isValid())return K.invalidDate||o;var j=J||"YYYY-MM-DDTHH:mm:ssZ",F=H.z(this),q=this.$H,E=this.$m,k=this.$M,I=K.weekdays,R=K.months,c=K.meridiem,p=function(T,h,n,Z$){return T&&(T[h]||T(M,j))||n[h].slice(0,Z$)},a=function(T){return H.s(q%12||12,T,"0")},l=c||function(T,h,n){var Z$=T<12?"AM":"PM";return n?Z$.toLowerCase():Z$};return j.replace(e,function(T,h){return h||function(n){switch(n){case"YY":return String(M.$y).slice(-2);case"YYYY":return H.s(M.$y,4,"0");case"M":return k+1;case"MM":return H.s(k+1,2,"0");case"MMM":return p(K.monthsShort,k,R,3);case"MMMM":return p(R,k);case"D":return M.$D;case"DD":return H.s(M.$D,2,"0");case"d":return String(M.$W);case"dd":return p(K.weekdaysMin,M.$W,I,2);case"ddd":return p(K.weekdaysShort,M.$W,I,3);case"dddd":return I[M.$W];case"H":return String(q);case"HH":return H.s(q,2,"0");case"h":return a(1);case"hh":return a(2);case"a":return l(q,E,!0);case"A":return l(q,E,!1);case"m":return String(E);case"mm":return H.s(E,2,"0");case"s":return String(M.$s);case"ss":return H.s(M.$s,2,"0");case"SSS":return H.s(M.$ms,3,"0");case"Z":return F}return null}(T)||F.replace(":","")})},G.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},G.diff=function(J,M,K){var j,F=this,q=H.p(M),E=S(J),k=(E.utcOffset()-this.utcOffset())*W,I=this-E,R=function(){return H.m(F,E)};switch(q){case z:j=R()/12;break;case B:j=R();break;case w:j=R()/3;break;case V:j=(I-k)/604800000;break;case O:j=(I-k)/86400000;break;case X:j=I/Y;break;case Q:j=I/W;break;case D:j=I/$;break;default:j=I}return K?j:H.a(j)},G.daysInMonth=function(){return this.endOf(B).$D},G.$locale=function(){return f[this.$L]},G.locale=function(J,M){if(!J)return this.$L;var K=this.clone(),j=W$(J,M,!0);return j&&(K.$L=j),K},G.clone=function(){return H.w(this.$d,this)},G.toDate=function(){return new Date(this.valueOf())},G.toJSON=function(){return this.isValid()?this.toISOString():null},G.toISOString=function(){return this.$d.toISOString()},G.toString=function(){return this.$d.toUTCString()},U}(),b$=Y$.prototype;return S.prototype=b$,[["$ms",Z],["$s",D],["$m",Q],["$H",X],["$W",O],["$M",B],["$y",z],["$D",L]].forEach(function(U){b$[U[1]]=function(G){return this.$g(G,U[0],U[1])}}),S.extend=function(U,G){return U.$i||(U(G,Y$,S),U.$i=!0),S},S.locale=W$,S.isDayjs=j$,S.unix=function(U){return S(1000*U)},S.en=f[m],S.Ls=f,S.p={},S})});import{createServer as p0}from"net";var w$=F$(D$(),1);var Q$={ok:"OK",created:"Created",accepted:"Accepted",noContent:"No Content",movedPermanently:"Moved Permanently",found:"Found",notModified:"Not Modified",badRequest:"Bad Request",unauthorized:"Unauthorized",forbidden:"Forbidden",notFound:"Not Found",methodNotAllowed:"Method Not Allowed",conflict:"Conflict",unsupportedMediaType:"Unsupported Media Type",tooManyRequests:"Too Many Requests",internalServerError:"Internal Server Error"},b={ok:200,created:201,accepted:202,noContent:204,movedPermanently:301,found:302,notModified:304,badRequest:400,unauthorized:401,forbidden:403,notFound:404,methodNotAllowed:405,conflict:409,unsupportedMediaType:415,tooManyRequests:429,internalServerError:500},A={delete:"DELETE",get:"GET",head:"HEAD",post:"POST",put:"PUT",patch:"PATCH",options:"OPTIONS"},v={json:"application/json",html:"text/html",form:"application/x-www-form-urlencoded",multipart:"multipart/form-data",xml:"application/xml",text:"text/plain",csv:"text/csv",yamlApplication:"application/yaml",yamlText:"text/yaml",urlEncodedJson:"application/x-www-form-urlencoded+json"},u={authorization:"Authorization",proxyAuthorization:"Proxy-Authorization",wwwAuthenticate:"WWW-Authenticate",cacheControl:"Cache-Control",etag:"ETag",expires:"Expires",lastModified:"Last-Modified",ifMatch:"If-Match",ifNoneMatch:"If-None-Match",ifModifiedSince:"If-Modified-Since",ifUnmodifiedSince:"If-Unmodified-Since",ifRange:"If-Range",age:"Age",vary:"Vary",contentType:"Content-Type",contentLength:"Content-Length",contentEncoding:"Content-Encoding",contentLanguage:"Content-Language",contentDisposition:"Content-Disposition",contentLocation:"Content-Location",contentRange:"Content-Range",accessControlAllowCredentials:"Access-Control-Allow-Credentials",accessControlAllowHeaders:"Access-Control-Allow-Headers",accessControlAllowMethods:"Access-Control-Allow-Methods",accessControlAllowOrigin:"Access-Control-Allow-Origin",accessControlExposeHeaders:"Access-Control-Expose-Headers",accessControlMaxAge:"Access-Control-Max-Age",accessControlRequestHeaders:"Access-Control-Request-Headers",accessControlRequestMethod:"Access-Control-Request-Method",accept:"Accept",acceptEncoding:"Accept-Encoding",acceptLanguage:"Accept-Language",acceptRanges:"Accept-Ranges",host:"Host",userAgent:"User-Agent",referer:"Referer",origin:"Origin",from:"From",expect:"Expect",location:"Location",server:"Server",date:"Date",allow:"Allow",retryAfter:"Retry-After",range:"Range",contentSecurityPolicy:"Content-Security-Policy",contentSecurityPolicyReportOnly:"Content-Security-Policy-Report-Only",strictTransportSecurity:"Strict-Transport-Security",xContentTypeOptions:"X-Content-Type-Options",xFrameOptions:"X-Frame-Options",xXSSProtection:"X-XSS-Protection",referrerPolicy:"Referrer-Policy",permissionsPolicy:"Permissions-Policy",crossOriginEmbedderPolicy:"Cross-Origin-Embedder-Policy",crossOriginOpenerPolicy:"Cross-Origin-Opener-Policy",crossOriginResourcePolicy:"Cross-Origin-Resource-Policy",cookie:"Cookie",setCookie:"Set-Cookie",connection:"Connection",keepAlive:"Keep-Alive",upgrade:"Upgrade",upgradeInsecureRequests:"Upgrade-Insecure-Requests",transferEncoding:"Transfer-Encoding",te:"TE",trailer:"Trailer",forwarded:"Forwarded",xForwardedFor:"X-Forwarded-For",via:"Via",maxForwards:"Max-Forwards",altSvc:"Alt-Svc",altUsed:"Alt-Used",timingAllowOrigin:"Timing-Allow-Origin",serverTiming:"Server-Timing",refresh:"Refresh",link:"Link",xPoweredBy:"X-Powered-By",xPermittedCrossDomainPolicies:"X-Permitted-Cross-Domain-Policies",reportTo:"Report-To",serviceWorkerAllowed:"Service-Worker-Allowed",sourceMap:"SourceMap",priority:"Priority",secGPC:"Sec-GPC",clearSiteData:"Clear-Site-Data",noVarySearch:"No-Vary-Search"},r={base64:"base64",binary:"binary",utf8:"utf8"};var X$=($,W)=>{if(!W.enabled)return!1;if($.request.method==="OPTIONS"){if(!h$($,W))return $.response.setStatusCode(403),$._response._setBody({error:"CORS: Origin not allowed",origin:$.request.headers.origin}),!0;$.response.setStatusCode(W.optionsSuccessStatus);let D=y$($,W);if($._response._setHeadersIfNotSet({[u.accessControlAllowOrigin]:D,[u.accessControlAllowMethods]:W.methods.join(", "),[u.accessControlAllowHeaders]:typeof W.allowedHeaders==="string"?W.allowedHeaders:W.allowedHeaders.join(", "),[u.accessControlAllowCredentials]:W.credentials?"true":"false",[u.accessControlExposeHeaders]:W.exposedHeaders.join(", "),[u.accessControlMaxAge]:W.maxAge.toString()}),W.preflightContinue)return!1;return $._response._setBody(""),!0}if(h$($,W)){let Z=y$($,W);$._response._setHeadersIfNotSet({[u.accessControlAllowOrigin]:Z,[u.accessControlAllowCredentials]:W.credentials?"true":"false"})}return!1},y$=($,W)=>{if(W.origin==="*"){if(W.credentials)throw new Error('CORS Security Error: origin: "*" with credentials: true is forbidden by CORS spec and creates security vulnerabilities. Use specific origins instead.');return"*"}let Y=$.request.headers.origin;if(Y)return Y;if(typeof W.origin==="string")return W.origin;if(Array.isArray(W.origin)&&W.origin.length>0){let[Z]=W.origin;return Z??"null"}return"null"},h$=($,W)=>{if(W.origin==="*")return!0;let Y=$.request.headers.origin?.toLowerCase()??"";if(typeof W.origin==="function")return Boolean(W.origin(Y,$.request));if(typeof W.origin==="string")return Y===W.origin.toLowerCase();if(Array.isArray(W.origin))return W.origin.some((Z)=>Y===Z.toLowerCase());if(W.origin instanceof RegExp)return W.origin.test(Y);return!1};var m$=F$(D$(),1),y="YINZER",N={reset:"\x1B[0m",cyan:"\x1B[96m",yellow:"\x1B[93m",red:"\x1B[91m",green:"\x1B[92m",magenta:"\x1B[95m",gray:"\x1B[90m"},V1={positive:["n'at!","yinz are good!","that's the way!","right on!","lookin' good!","way to go!","keep it up!"],neutral:["n'at","yinz know","just sayin'","that's how it is","what can ya do","it happens"],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"]},d=!1,P=null,C=()=>m$.default().format("YYYY-MM-DD HH:mm:ss.SSS"),H$=($)=>{let W=V1[$];return W[Math.floor(Math.random()*W.length)]??""},H1=($)=>{if(typeof $==="string")return Buffer.byteLength($,"utf8");if(Buffer.isBuffer($))return $.length;if(typeof $==="object"&&$!==null)try{return Buffer.byteLength(JSON.stringify($),"utf8")}catch{return 0}return 0},q1=($)=>{if($>=200&&$<300)return"✅";if($>=300&&$<400)return"\uD83D\uDD04";if($>=400&&$<500)return"❌";if($>=500)return"\uD83D\uDCA5";return"❓"},w1=($)=>{if($<50)return{emoji:"⚡",phrase:Math.random()<0.5?"lightning quick n'at!":"faster than a Stillers touchdown!"};if($<100)return{emoji:"\uD83D\uDD25",phrase:Math.random()<0.5?"that's the way!":"smooth as butter n'at!"};if($<200)return{emoji:"✅",phrase:Math.random()<0.5?"not bad yinz!":"keepin' up just fine!"};if($<500)return{emoji:"⚠️",phrase:Math.random()<0.5?"eh, could be better":"slowin' down a bit there"};if($<1000)return{emoji:"\uD83D\uDC0C",phrase:Math.random()<0.5?"that's draggin' n'at":"c'mon, pick up the pace!"};return{emoji:"\uD83D\uDCA5",phrase:Math.random()<0.5?"what a jagoff response time!":"slower than traffic on the Parkway!"}},N1=($,W,Y)=>{if(!d)return;let Z=C(),D=W??"unknown",Q=Y?` - ${Y}`:"",X="",O="info";if($==="connect")X=`\uD83E\uDD1D [NETWORK] New visitor from ${D} - Welcome to the 'Burgh!`;else if($==="disconnect")X=`\uD83D\uDC4B [NETWORK] ${D} headed out - Thanks for stopping by, yinz come back now!`;else X=`\uD83D\uDCA5 [NETWORK] Connection trouble with ${D}${Q} - That's not good, n'at!`,O="error";if(P)P[O](X);else{let V=O==="error"?N.red:N.gray;console.log(`${V}[${y}] [${Z}] ${X}${N.reset}`)}},B1=($,W,Y)=>{if(!d)return;let{request:Z}=$,D=$._response,Q=(Y-W).toFixed(1),X=Z.ipAddress||"unknown",{method:O,path:V,protocol:B}=Z,w=D._statusCode,z=H1(D._body),L=Z.headers.referer?`"${Z.headers.referer}"`:'"-"',o=Z.headers["user-agent"]?`"${Z.headers["user-agent"]}"`:'"-"',M$=q1(w),e=`\uD83C\uDFE0 ${X} - - [${C()}] "${O} ${V} ${B}" ${w} ${z}b ${L} ${o} ${Q}ms ${M$}`,U$=parseFloat(Q),{emoji:s,phrase:$$}=w1(U$),m=`${s} [PERF] Response time: ${Q}ms - ${$$}`;if(P)P.info(`[NETWORK] ${e}`),P.info(`[PERF] ${m}`);else console.log(`${N.gray}[${y}] [${C()}] [NETWORK] ${e}${N.reset}`),console.log(`${N.magenta}[${y}] ${s} [${C()}] [PERF] Response time: ${Q}ms - ${$$}${N.reset}`)},E1=($,W)=>{if(!d)return;let Y=C(),Z=$&&W?`${W}:${$}`:"unknown",D=H$("positive"),Q=`\uD83D\uDE80 [NETWORK] YinzerFlow server is up and running at ${Z} - Ready to serve yinz all, ${D}!`;if(P)P.info(Q);else console.log(`${N.gray}[${y}] [${Y}] ${Q}${N.reset}`)},A1=($,W)=>{if(!d)return;let Y=C(),Z=$&&W?`${W}:${$}`:"unknown",D=H$("neutral"),Q=`\uD83D\uDED1 [NETWORK] YinzerFlow server at ${Z} is shutting down - See yinz later, ${D}!`;if(P)P.info(Q);else console.log(`${N.gray}[${y}] [${Y}] ${Q}${N.reset}`)},z1=($,W,Y)=>{if(!d)return;let Z=C(),D=$&&W?`${W}:${$}`:"unknown",Q=Y?` - ${Y}`:"",X=H$("negative"),O=`\uD83D\uDCA5 [NETWORK] Server error at ${D}${Q} - Something's not right, ${X}!`;if(P)P.error(O);else console.log(`${N.red}[${y}] [${Z}] ${O}${N.reset}`)},S1=($)=>{d=$},k1=($)=>{P=$},x={setEnabled:S1,setNetworkLogger:k1,connection:N1,request:B1,serverStart:E1,serverStop:A1,serverError:z1};var i={off:0,error:1,warn:2,info:3},I1={positive:["n'at!","yinz are good!","that's the way!","right on!","lookin' good!","way to go!","keep it up!"],neutral:["n'at","yinz know","just sayin'","that's how it is","what can ya do","it happens"],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"]},t=i.warn,g=null,L1=($)=>{let W=I1[$];return W[Math.floor(Math.random()*W.length)]??""},T1=(...$)=>{if(t<i.info)return;if(g)g.info(...$);else q$("info",...$)},R1=(...$)=>{if(t<i.warn)return;if(g)g.warn(...$);else q$("warn",...$)},v1=(...$)=>{if(t<i.error)return;if(g)g.error(...$);else q$("error",...$)},P1=($,W,Y)=>{if(t<i.info)return;let Z=C(),D="❓ ",Q="";if(W<50)D="⚡ ",Q=Math.random()<0.5?"lightning quick n'at!":"faster than a Stillers touchdown!";else if(W<100)D="\uD83D\uDD25 ",Q=Math.random()<0.5?"that's the way!":"smooth as butter n'at!";else if(W<200)D="✅ ",Q=Math.random()<0.5?"not bad yinz!":"keepin' up just fine!";else if(W<500)D="⚠️ ",Q=Math.random()<0.5?"eh, could be better":"slowin' down a bit there";else if(W<1000)D="\uD83D\uDC0C ",Q=Math.random()<0.5?"that's draggin' n'at":"c'mon, pick up the pace!";else D="\uD83D\uDCA5 ",Q=Math.random()<0.5?"what a jagoff response time!":"slower than traffic on the Parkway!";let X=`${N.magenta}[${y}] ${D} [${Z}] [PERF]${N.reset}`,O=Y?{...Y,executionTime:`${W}ms`}:{executionTime:`${W}ms`};console.log(`${X} ${$} -`,O,`- ${Q}`)},x1=($)=>{t={off:0,error:1,warn:2,info:3}[$]},C1=($)=>{g=$},q$=($,...W)=>{let Y=C(),Z="✅ ",D=N.cyan,Q="positive",X="log";if($==="error")Z="❌ ",D=N.red,Q="negative",X="error";else if($==="warn")Z="⚠️ ",D=N.yellow,Q="neutral",X="warn";else Z="✅ ",D=N.cyan,Q="positive",X="log";let O=L1(Q),V=`${D}[${y}] ${Z}[${Y}] [${$.toUpperCase()}]${N.reset}`;console[X](`${V}`,...W,`- ${O}`)},_={setLogLevel:x1,setCustomLogger:C1,info:T1,warn:R1,error:v1,perf:P1,levels:i};class N${setup;constructor($){this.setup=$}async handle($){try{if(X$($,this.setup._configuration.cors)){$._response._parseResponseIntoString();return}let Y=this.setup._routeRegistry._findRoute($.request.method,$.request.path);if(!Y){let w=await this.setup._hooks._onNotFound($);$._response._setBody(w),$._response._parseResponseIntoString();return}$.request.params=Y.params;let{handler:Z,options:D}=Y,{beforeHooks:Q,afterHooks:X}=D,O=this.setup._hooks._beforeAll;for(let w of O)await w.handler($);for(let w of Q)await w($);let V=null;try{V=await Z($)}catch(w){throw w}for(let w of X)await w($);let B=this.setup._hooks._afterAll;for(let w of B)await w.handler($);if($._response._setBody(V),$.request.method==="HEAD")$._response._setBody(null);$._response._parseResponseIntoString();return}catch(W){await this.handleError($,W)}}async handleError($,W){try{_.error("Error in request handler",W);let Y=this.setup._hooks._onError,Z=await Y($);$._response._setBody(Z),X$($,this.setup._configuration.cors),$._response._parseResponseIntoString(),$._response._setHeadersIfNotSet({Date:w$.default().format("ddd, DD MMM YYYY HH:mm:ss [GMT]"),"Content-Length":$._response._stringBody.split(`
|
|
2
2
|
|
|
3
3
|
`)[1]?.length.toString()??"0"})}catch(Y){_.error("Error handler failed",Y),$.response.setStatusCode(500),$._response._setBody({success:!1,message:"Internal Server Error"}),X$($,this.setup._configuration.cors),$._response._parseResponseIntoString(),$._response._setHeadersIfNotSet({Date:w$.default().format("ddd, DD MMM YYYY HH:mm:ss [GMT]"),"Content-Length":$._response._stringBody.split(`
|
|
4
4
|
|
|
@@ -6,17 +6,17 @@ var M1=Object.create;var{getPrototypeOf:U1,defineProperty:u$,getOwnPropertyNames
|
|
|
6
6
|
`)?$.slice(2):$,Y=W.indexOf(`\r
|
|
7
7
|
\r
|
|
8
8
|
`);if(Y===-1)return["",""];let Z=W.slice(0,Y),D=W.slice(Y+4);return[Z,D]},f1=($)=>{let W={name:""},Y=/name=(?:"(?<temp2>[^"]*)"|(?<temp1>[^;,\s]+))/i.exec($),Z=/filename=(?:"(?<temp2>[^"]*)"|(?<temp1>[^;,\s]+))/i.exec($);if(Y)W.name=Y[1]??Y[2]??"";if(Z){let D=Z[1]??Z[2];if(D)W.filename=D}return W},p1=($)=>{let Y=$.split(/\r?\n/).find((Z)=>Z.toLowerCase().startsWith("content-type:"));if(!Y)return"application/octet-stream";return Y.slice(Y.indexOf(":")+1).trim().split(";")[0]?.trim()??"application/octet-stream"},l1=($)=>{return["image/","audio/","video/","application/octet-stream","application/pdf","application/zip","application/x-"].some((Y)=>$.toLowerCase().startsWith(Y))},g1=($)=>Buffer.isBuffer($)?$.length:Buffer.byteLength($,"utf8"),s1=($,W)=>{if(!W)return;if($.size>W.maxFileSize)throw _.warn("[SECURITY] File upload too large",{filename:$.filename,size:$.size,limit:W.maxFileSize,sizeMB:Math.round($.size/1024/1024)}),new Error(`File too large: ${$.filename} is ${$.size} bytes, exceeds limit of ${W.maxFileSize} bytes`);if($.filename&&$.filename.length>W.maxFilenameLength)throw new Error(`Filename too long: ${$.filename.length} characters exceeds limit of ${W.maxFilenameLength}`);if($.filename){let Y=$.filename.toLowerCase().substring($.filename.lastIndexOf("."));if(W.blockedExtensions.includes(Y))throw _.warn("[SECURITY] Blocked file type upload attempt",{filename:$.filename,extension:Y,blockedExtensions:W.blockedExtensions}),new Error(`File type not allowed: ${Y} files are blocked for security reasons`);if(W.allowedExtensions.length>0&&!W.allowedExtensions.includes(Y))throw new Error(`File type not allowed: ${Y} is not in the allowed extensions list`)}},c1=({contentDisposition:$,contentSection:W,headersSection:Y,config:Z})=>{let D=p1(Y),Q=W.endsWith(`\r
|
|
9
|
-
`)?W.slice(0,-2):W,X=l1(D)?Buffer.from(Q,"binary"):Q,O={filename:$.filename??"",contentType:D,size:g1(X),content:X};return s1(O,Z),O},l$=($,W,Y)=>{let Z={fields:{},files:[]},D=$.split(`--${W}`).slice(1),Q=0;for(let X of D){if(!X||X.trim()===""||X.trim()==="--")continue;let[O,
|
|
10
|
-
`)?
|
|
9
|
+
`)?W.slice(0,-2):W,X=l1(D)?Buffer.from(Q,"binary"):Q,O={filename:$.filename??"",contentType:D,size:g1(X),content:X};return s1(O,Z),O},l$=($,W,Y)=>{let Z={fields:{},files:[]},D=$.split(`--${W}`).slice(1),Q=0;for(let X of D){if(!X||X.trim()===""||X.trim()==="--")continue;let[O,V]=m1(X);if(!O)continue;let w=O.split(/\r?\n/).find((L)=>L.toLowerCase().startsWith("content-disposition:"));if(!w)continue;let z=f1(w);if(!z.name)continue;if(z.filename!==void 0){if(Y&&Z.files.length>=Y.maxFiles)throw _.warn("[SECURITY] Too many files in upload request",{fileCount:Z.files.length,maxFiles:Y.maxFiles}),new Error(`Too many files: maximum of ${Y.maxFiles} files allowed per request`);let L=c1({contentDisposition:z,contentSection:V,headersSection:O,config:Y});if(Q+=L.size,Y&&Q>Y.maxTotalSize)throw _.warn("[SECURITY] Total upload size too large",{totalSize:Q,limit:Y.maxTotalSize,totalSizeMB:Math.round(Q/1024/1024)}),new Error(`Total file size too large: ${Q} bytes exceeds limit of ${Y.maxTotalSize} bytes`);Z.files.push(L)}if(z.filename===void 0){let L=V.endsWith(`\r
|
|
10
|
+
`)?V.slice(0,-2):V;Z.fields[z.name]=L}}return Z};var r1=($,W)=>{if($.length>W.maxFields)throw new Error(`Too many form fields: ${$.length} exceeds limit of ${W.maxFields}`)},d1=($,W,Y)=>{if($.length>Y.maxFieldNameLength)throw new Error(`Form field name too long: ${$.length} characters exceeds limit of ${Y.maxFieldNameLength}`);if(W&&W.length>Y.maxFieldLength)throw new Error(`Form field value too long: field '${$}' has ${W.length} characters, exceeds limit of ${Y.maxFieldLength}`)},i1=($,W,Y)=>{if($.length>Y.maxFieldNameLength)throw new Error(`Decoded form field name too long: ${$.length} characters exceeds limit of ${Y.maxFieldNameLength}`);if(W.length>Y.maxFieldLength)throw new Error(`Decoded form field value too long: field '${$}' has ${W.length} characters, exceeds limit of ${Y.maxFieldLength}`)},a1=($,W,Y)=>{let[Z,D]=$.split("=");if(!Z)return;if(Y)d1(Z,D,Y);try{let Q=decodeURIComponent(Z),X=D?decodeURIComponent(D):"";if(Y)i1(Q,X,Y);W[Q]=X}catch(Q){if(Q instanceof Error&&Q.message.includes("exceeds limit"))throw Q;W[Z]=D??""}},g$=($,W)=>{let Y={},Z=$.split("&");if(W)r1(Z,W);for(let D of Z)a1(D,Y,W);return Y};var J$={JPEG:[255,216,255],PNG:[137,80,78,71],GIF87A:[71,73,70,56,55,97],GIF89A:[71,73,70,56,57,97],BMP:[66,77],TIFF_LE:[73,73,42,0],TIFF_BE:[77,77,0,42],WEBP:[82,73,70,70],ICO:[0,0,1,0],MP3_ID3:[73,68,51],MP3_FRAME:[255,251],WAV:[82,73,70,70],FLAC:[102,76,97,67],OGG:[79,103,103,83],MP4_FTYP:[0,0,0,24,102,116,121,112],MP4_FTYP_ALT:[0,0,0,28,102,116,121,112],AVI:[82,73,70,70],WEBM:[26,69,223,163],PDF:[37,80,68,70],ZIP:[80,75,3,4],ZIP_EMPTY:[80,75,5,6],ZIP_SPANNED:[80,75,7,8],RAR:[82,97,114,33,26,7,0],RAR5:[82,97,114,33,26,7,1,0],SEVENZ:[55,122,188,175,39,28],GZIP:[31,139],EXE:[77,90],ELF:[127,69,76,70],OFFICE_OLD:[208,207,17,224,161,177,26,225]},K$=($,W)=>{if($.length<W.length)return!1;return W.every((Y,Z)=>$[Z]===Y)},n1=($)=>{if(K$($,J$.WEBP)&&$.length>=12)return $.subarray(8,12).toString("ascii")==="WEBP";if(K$($,J$.WAV)&&$.length>=12)return $.subarray(8,12).toString("ascii")==="WAVE";if(K$($,J$.AVI)&&$.length>=12)return $.subarray(8,12).toString("ascii")==="AVI ";return!1},G$=($,W)=>{if(!$)return t1(W);let Y=$.toLowerCase();if(Y.startsWith("image/")||Y.startsWith("video/")||Y.startsWith("audio/")||Y==="application/pdf"||Y==="application/octet-stream"||Y.startsWith("application/zip")||Y.startsWith("application/x-"))return"base64";if(Y.startsWith("text/")||Y.startsWith("application/json")||Y.startsWith("application/xml")||Y.startsWith("application/javascript"))return"utf8";return"binary"},t1=($)=>{if(Buffer.isBuffer($))return o1($)?"base64":"utf8";if(typeof $==="object"&&$!==null)return"utf8";if(typeof $==="string")return"utf8";return"utf8"},o1=($)=>{if($.length===0)return!1;let W=Object.values(J$);for(let D of W)if(K$($,D))return!0;if(n1($))return!0;let Y=$.filter((D)=>D===0).length,Z=$.filter((D)=>D<32&&D!==9&&D!==10&&D!==13).length;return Y/$.length>0.1||Z/$.length>0.3};var e1=($)=>{if(!($.startsWith("{")&&$.endsWith("}")||$.startsWith("[")&&$.endsWith("]")))return!1;try{return JSON.parse($),!0}catch{return!1}},$0=($)=>$.includes("=")&&$.includes("&"),W0=($)=>$.includes("boundary="),Y0=($)=>typeof $==="object"&&$!==null&&!Buffer.isBuffer($)&&!($ instanceof Uint8Array)&&!($ instanceof ArrayBuffer)&&!($ instanceof Date),Z0=($)=>$ instanceof Date,D0=($)=>{if(Buffer.isBuffer($))return $;return Buffer.from($)},Q0=($)=>{return G$(void 0,$)==="base64"?"application/octet-stream":"text/plain"},E$=($)=>{let W=$.trim();if(e1(W))return v.json;if($0(W))return v.form;if(W0(W))return v.multipart;return"text/plain"},s$=($)=>{if($===null||$===void 0)return"text/plain";if(Z0($))return"text/plain";if(Y0($))return v.json;if(typeof $==="string")return E$($);if(Buffer.isBuffer($)||$ instanceof Uint8Array||$ instanceof ArrayBuffer){let W=D0($);return Q0(W)}return"text/plain"};var X0=($,W,Y)=>{let Z=Buffer.byteLength($,"utf8");if(W===v.json){if(Z>Y.json.maxSize)throw new Error(`JSON body too large: ${Z} bytes exceeds limit of ${Y.json.maxSize} bytes`)}else if(W===v.form){if(Z>Y.urlEncoded.maxSize)throw new Error(`URL-encoded body too large: ${Z} bytes exceeds limit of ${Y.urlEncoded.maxSize} bytes`)}else if(W===v.multipart){if(Z>Y.fileUploads.maxTotalSize)throw new Error(`Multipart body too large: ${Z} bytes exceeds limit of ${Y.fileUploads.maxTotalSize} bytes`)}},c$=($,W={})=>{let{headerContentType:Y,boundary:Z,config:D}=W;if(!$||!$.trim())return;let Q=Y??E$($);if(D)X0($,Q,D);if(Q===v.json){if(!D)throw new Error("Body parser configuration is required for JSON parsing");return p$($,D.json)}if(Q===v.multipart){if(!Z)throw new Error("Invalid multipart form data: missing boundary");return l$($,Z,D?.fileUploads)}if(Q===v.form)return g$($,D?.urlEncoded);return $};var A$=($,W)=>{let Y=$.indexOf(W);if(Y===-1)return[$,""];let Z=$.slice(0,Y),D=$.slice(Y+W.length);return[Z,D]};var r$=($)=>{if(!$||!$.trim())return{method:"GET",path:"/",protocol:"HTTP/1.1",headersRaw:"",rawBody:""};let[W,Y]=A$($,`\r
|
|
11
11
|
`),[Z,D,Q]=W.split(" ",3),[X,O]=A$(Y,`\r
|
|
12
12
|
\r
|
|
13
|
-
`);if(!Z||!Object.values(
|
|
13
|
+
`);if(!Z||!Object.values(A).includes(Z))return{method:"GET",path:D??"/",protocol:Q??"HTTP/1.1",headersRaw:X,rawBody:O};return{method:Z,path:D??"/",protocol:Q??"HTTP/1.1",headersRaw:X,rawBody:O}};var d$=($)=>{if(!$)return{};if(!$.includes("?"))return{};let[,W]=$.split("?");if(!W)return{};let Y={},Z=W.split("&");for(let D of Z){let[Q,X]=D.split("=");if(Q)try{let O=decodeURIComponent(Q),V=X?decodeURIComponent(X):"";Y[O]=V}catch{Y[Q]=X??""}}return Y};var J0=[/^(?<classA>10)\./,/^(?<classB>172)\.(?<classBRange>1[6-9]|2[0-9]|3[0-1])\./,/^(?<classC>192)\.(?<classCRange>168)\./,/^(?<linkLocal>169)\.(?<linkLocalRange>254)\./,/^(?<loopback>127)\./,/^(?<ipv6Loopback>::1)$/,/^(?<ipv6LinkLocal>fe80):/i,/^(?<ipv6UniqueLocalFC>fc00):/i,/^(?<ipv6UniqueLocalFD>fd00):/i],i$=($)=>{if(!$||typeof $!=="string")return!1;let W=$.replace(/^\[|\]$/g,"");if(/^(?<octet>(?<highByte>25[0-5]|(?<midByte>2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/.test(W)){let D=W.split(".");return D.length===4&&D.every((Q)=>{let X=parseInt(Q,10);return X>=0&&X<=255})}if(W.includes("::")&&(W.match(/::/g)??[]).length>1)return!1;return/^(?<ipv6Address>(?<fullAddress>(?<hexQuad>[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4})|(?<compressedAddress>(?<leadingPart>[0-9a-fA-F]{1,4}:){1,7}:)|(?<mixedCompression>(?<frontPart>[0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4})|(?<doubleColonOnly>::)|(?<linkLocal>fe80:(?<linkSuffix>:[0-9a-fA-F]{0,4}){0,4}(?<zoneId>%[0-9a-zA-Z]+)?)|(?<ipv4MappedFull>::ffff:(?<mappedIpv4>(?<mappedOctet>[0-9]{1,3}\.){3}[0-9]{1,3}))|(?<generalPattern>(?<segmentGroup>[0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}))$/.test(W)},a$=($)=>{if(!$)return!1;let W=$.replace(/^\[|\]$/g,"");return J0.some((Y)=>Y.test(W))},n$=($,W)=>{if(!$||!W.length)return!1;if(W.includes("*"))return!0;return W.includes($)},K0=($,W)=>{if(!W.detectSpoofing||$.length<=1)return!1;if($.length>W.maxChainLength)return!0;if(new Set($).size!==$.length)return!0;let Z=$.filter(i$).length;if(Z>0&&Z<$.length)return!0;return!1},G0=($,W)=>{if($.length<=1)return!0;let Y=$[$.length-1];return Boolean(Y&&n$(Y,W.trustedProxies))},O0=($,W)=>{if(W==="x-forwarded-for")return $[0];return $[$.length-1]},M0=($)=>{let{clientIp:W,headerName:Y,ipChain:Z,config:D}=$,Q=a$(W),X=Y==="x-forwarded-for"?n$(Z[Z.length-1]??"",D.trustedProxies):!0;return{ip:W,isValid:!0,isPrivate:Q,source:Y,trusted:X}},U0=()=>({ip:"",isValid:!1,isPrivate:!1,source:"socket",trusted:!1}),j0=($,W)=>{for(let Y of W.headerPreference){let Z=$[Y];if(!Z)continue;let D=Z.split(",").map((O)=>O.trim()).filter(Boolean);if(D.length===0)continue;if(K0(D,W))continue;if(Y==="x-forwarded-for"&&!G0(D,W))continue;let Q=O0(D,Y);if(!Q||!i$(Q))continue;if(a$(Q)&&!W.allowPrivateIps)continue;return M0({clientIp:Q,headerName:Y,ipChain:D,config:W})}return U0()},F0=($,W,Y={})=>{let D={...$._configuration.ipSecurity,...Y},Q=j0(W,D);if(Q.isValid)return Q;return{ip:"",isValid:!1,isPrivate:!1,source:"socket",trusted:!1}},t$=($,W)=>{return F0($,W).ip};var o$=($)=>{if(!$)return;return/boundary\s*=\s*(?<temp1>[^;,\s]*)/i.exec($)?.[1]};var e$=($)=>{if(!$)return{};_0($);let W=V0($),Y=H0(W);return q0(Y)},_0=($)=>{if($.split(/\r\n|\r|\n/).length>100)throw new Error("Too many headers: maximum 100 allowed")},V0=($)=>{let W={},Z=$.replace(/\r\n|\r|\n/g,`
|
|
14
14
|
`).split(`
|
|
15
|
-
`);for(let D of Z){if(!D.trim())continue;let Q=D.indexOf(":");if(Q===-1)continue;let X=D.slice(0,Q).trim(),O=D.slice(Q+1).trim();if(!X)continue;if(!w0(X))throw new Error(`Invalid header name: ${X}`);if(X.length>200)throw new Error("Header name too long: maximum 200 characters allowed");if(O.length>8192)throw new Error("Header value too long: maximum 8192 characters allowed");W[X.toLowerCase()]=O}return W},H0=($)=>{let W={};for(let[Y,Z]of Object.entries($))W[Y]=N0(Z);return W},q0=($)=>$,w0=($)=>{return/^[a-zA-Z0-9!#$%&'*+\-.^_`|~]+$/.test($)},N0=($)=>{return $.replace(/[\x00-\x08\x0A-\x1F\x7F]/g,"")};class z${_rawRequest;_setup;method;path;protocol;headers;body;query;params;ipAddress;rawBody;constructor($,W,Y){this._rawRequest=$,this._setup=W,this.ipAddress=Y??"";let{method:Z,path:D,protocol:Q,headers:X,body:O,query:
|
|
16
|
-
`))throw new Error(`Header value contains invalid line break characters: ${$}`);let Y=[/[\r\n](?:set-cookie|location|authorization|www-authenticate):/i,/\r\n\r\n|\n\n/,/[\r\n]http\/\d\.\d\s+\d+/i];for(let Z of Y)if(Z.test(W))throw new Error(`Header value contains suspicious injection pattern: ${$}`)},S0=($)=>{for(let[W,Y]of Object.entries($))z0(W,Y)},k$=($)=>{let W={};for(let[Y,Z]of Object.entries($))if(Z!==void 0)W[Y]=Z;return S0(W),W};var Z1=($,W)=>{if(!$)return"0";let Y=0;if(W===r.base64)Y=Buffer.byteLength($,"utf8");if(W===r.binary)Y=$.length;if(W===r.utf8)Y=Buffer.byteLength($,"utf8");return String(Y)};class I${_request;_statusCode=b.ok;_status=Q$.ok;_headers={};_body="";_stringBody="";_encoding=r.utf8;constructor($){this._request=$,this._setSecurityHeaders()}_parseResponseIntoString(){let $=`${this._request.protocol} ${this._statusCode} ${this._status}`,W=Object.entries(this._headers).map(([
|
|
17
|
-
${W.join(`
|
|
15
|
+
`);for(let D of Z){if(!D.trim())continue;let Q=D.indexOf(":");if(Q===-1)continue;let X=D.slice(0,Q).trim(),O=D.slice(Q+1).trim();if(!X)continue;if(!w0(X))throw new Error(`Invalid header name: ${X}`);if(X.length>200)throw new Error("Header name too long: maximum 200 characters allowed");if(O.length>8192)throw new Error("Header value too long: maximum 8192 characters allowed");W[X.toLowerCase()]=O}return W},H0=($)=>{let W={};for(let[Y,Z]of Object.entries($))W[Y]=N0(Z);return W},q0=($)=>$,w0=($)=>{return/^[a-zA-Z0-9!#$%&'*+\-.^_`|~]+$/.test($)},N0=($)=>{return $.replace(/[\x00-\x08\x0A-\x1F\x7F]/g,"")};class z${_rawRequest;_setup;method;path;protocol;headers;body;query;params;ipAddress;rawBody;constructor($,W,Y){this._rawRequest=$,this._setup=W,this.ipAddress=Y??"";let{method:Z,path:D,protocol:Q,headers:X,body:O,query:V,params:B,rawBody:w}=this._parseRequestIntoObject();this.method=Z,this.path=D,this.protocol=Q,this.headers=X,this.body=O,this.query=V??{},this.params=B??{},this.rawBody=w;let z=t$(this._setup,X);if(z)this.ipAddress=z}_parseRequestIntoObject(){let $=this._rawRequest.toString(),{method:W,path:Y,protocol:Z,headersRaw:D,rawBody:Q}=r$($),X=e$(D),O=X["content-type"],V=O?.split(";")[0]?.trim().toLowerCase(),B=o$(O);return{method:W,path:Y,protocol:Z,headers:X,body:c$(Q,{headerContentType:V,boundary:B,config:this._setup._configuration.bodyParser}),query:d$(Y),params:{},rawBody:Q}}}var D1=F$(D$(),1);var $1=($,W)=>{let Y=W?.encoding??"utf8";if($===null||$===void 0)return"";if(Buffer.isBuffer($))return S$($,Y);if($ instanceof Uint8Array)return B0($,Y);if($ instanceof ArrayBuffer)return E0($,Y);if(typeof $==="string")return $;if(typeof $==="object")return A0($);return String($)},S$=($,W)=>{if(W==="base64")return $.toString("base64");if(W==="binary")return $.toString("binary");return $.toString("utf8")},B0=($,W)=>{let Y=Buffer.from($);return S$(Y,W)},E0=($,W)=>{let Y=Buffer.from($);return S$(Y,W)},A0=($)=>{try{return JSON.stringify($)}catch(W){return String($)}};var W1=new Map;for(let[$,W]of Object.entries(b)){let Z=Q$[$];W1.set(W,Z)}var Y1=($)=>{let W=W1.get($);if(!W)throw new Error(`Unknown status code: ${$}`);return W};var z0=($,W)=>{if(typeof W!=="string")throw new Error(`Header value must be a string, got ${typeof W}`);if(W.includes("\r")||W.includes(`
|
|
16
|
+
`))throw new Error(`Header value contains invalid line break characters: ${$}`);let Y=[/[\r\n](?:set-cookie|location|authorization|www-authenticate):/i,/\r\n\r\n|\n\n/,/[\r\n]http\/\d\.\d\s+\d+/i];for(let Z of Y)if(Z.test(W))throw new Error(`Header value contains suspicious injection pattern: ${$}`)},S0=($)=>{for(let[W,Y]of Object.entries($))z0(W,Y)},k$=($)=>{let W={};for(let[Y,Z]of Object.entries($))if(Z!==void 0)W[Y]=Z;return S0(W),W};var Z1=($,W)=>{if(!$)return"0";let Y=0;if(W===r.base64)Y=Buffer.byteLength($,"utf8");if(W===r.binary)Y=$.length;if(W===r.utf8)Y=Buffer.byteLength($,"utf8");return String(Y)};class I${_request;_statusCode=b.ok;_status=Q$.ok;_headers={};_body="";_stringBody="";_encoding=r.utf8;constructor($){this._request=$,this._setSecurityHeaders()}_parseResponseIntoString(){let $=`${this._request.protocol} ${this._statusCode} ${this._status}`,W=Object.entries(this._headers).map(([X,O])=>`${X}: ${O}`),Y=G$(this._headers["content-type"],this._body),Z=$1(this._body,{encoding:Y});this._encoding=Y;let D=W.length>0?`${W.join(`
|
|
18
17
|
`)}
|
|
18
|
+
`:"";this._stringBody=`${$}
|
|
19
|
+
${D}
|
|
20
|
+
${Z}`;let Q=Z1(this._stringBody,this._encoding);this._setHeadersIfNotSet({Date:D1.default().format("ddd, DD MMM YYYY HH:mm:ss [GMT]"),"Content-Length":Q})}_setHeadersIfNotSet($){let W={};for(let[Z,D]of Object.entries($))if(D!==void 0&&!(Z in this._headers))W[Z]=D;let Y=k$(W);Object.assign(this._headers,Y)}_setBody($){if(this._body=$,!this._headers["content-type"]){let W=s$($);this._setHeadersIfNotSet({"Content-Type":W})}}setStatusCode($){this._statusCode=$,this._status=Y1($)}addHeaders($){let W=k$($);this._headers={...this._headers,...W}}removeHeaders($){for(let W of $)delete this._headers[W]}_setSecurityHeaders(){this._setHeadersIfNotSet({"X-Content-Type-Options":"nosniff","X-Frame-Options":"DENY","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin"})}}class L${_request;_response;request;response;constructor($,W,Y){this._request=new z$($,W,Y),this._response=new I$(this._request),this.request=this._request,this.response=this._response}}var Q1={off:"off",error:"error",warn:"warn",info:"info"};var k0={enabled:!0,origin:"*",methods:["GET","POST","PUT","DELETE","PATCH","OPTIONS"],allowedHeaders:"*",exposedHeaders:[],credentials:!1,maxAge:86400,preflightContinue:!1,optionsSuccessStatus:b.noContent},O$={json:{maxSize:262144,maxDepth:10,allowPrototypeProperties:!1,maxKeys:1000,maxStringLength:1048576,maxArrayLength:1e4},fileUploads:{maxFileSize:10485760,maxTotalSize:52428800,maxFiles:10,allowedExtensions:[],blockedExtensions:[".exe",".bat",".cmd",".scr",".pif",".com"],maxFilenameLength:255},urlEncoded:{maxSize:1048576,maxFields:1000,maxFieldNameLength:100,maxFieldLength:1048576}},X1={trustedProxies:["127.0.0.1","::1"],allowPrivateIps:!0,headerPreference:["x-forwarded-for","x-real-ip","cf-connecting-ip","x-client-ip","true-client-ip"],maxChainLength:10,detectSpoofing:!0},I0={port:5000,host:"0.0.0.0",logLevel:Q1.warn,networkLogs:!1,cors:{enabled:!1},bodyParser:O$,ipSecurity:X1,connectionOptions:{socketTimeout:30000,gracefulShutdownTimeout:30000,keepAliveTimeout:65000,headersTimeout:66000},autoGracefulShutdown:!0},L0=($)=>{if($.maxSize<1)throw new Error("bodyParser.json.maxSize must be at least 1 byte");if($.maxDepth<1)throw new Error("bodyParser.json.maxDepth must be at least 1");if($.maxKeys<1)throw new Error("bodyParser.json.maxKeys must be at least 1");if($.maxStringLength<1)throw new Error("bodyParser.json.maxStringLength must be at least 1 byte");if($.maxArrayLength<1)throw new Error("bodyParser.json.maxArrayLength must be at least 1")},T0=($)=>{if($.maxFileSize<1)throw new Error("bodyParser.fileUploads.maxFileSize must be at least 1 byte");if($.maxTotalSize<1)throw new Error("bodyParser.fileUploads.maxTotalSize must be at least 1 byte");if($.maxFiles<1)throw new Error("bodyParser.fileUploads.maxFiles must be at least 1");if($.maxFilenameLength<1)throw new Error("bodyParser.fileUploads.maxFilenameLength must be at least 1 character")},R0=($)=>{if($.maxSize<1)throw new Error("bodyParser.urlEncoded.maxSize must be at least 1 byte");if($.maxFields<1)throw new Error("bodyParser.urlEncoded.maxFields must be at least 1");if($.maxFieldNameLength<1)throw new Error("bodyParser.urlEncoded.maxFieldNameLength must be at least 1 character");if($.maxFieldLength<1)throw new Error("bodyParser.urlEncoded.maxFieldLength must be at least 1 byte")},v0=($)=>{if(!Array.isArray($.trustedProxies))throw new Error("ipSecurity.trustedProxies must be an array");if(!Array.isArray($.headerPreference))throw new Error("ipSecurity.headerPreference must be an array");if($.headerPreference.length===0)throw new Error("ipSecurity.headerPreference must contain at least one header");if($.maxChainLength<1)throw new Error("ipSecurity.maxChainLength must be at least 1");if($.maxChainLength>50)throw new Error("ipSecurity.maxChainLength must not exceed 50 to prevent DoS attacks")},P0=($)=>{if($.allowPrototypeProperties)_.warn("[SECURITY WARNING] bodyParser.json.allowPrototypeProperties is enabled. This allows prototype pollution attacks. Only enable this if you absolutely need it and have other protections in place.");if($.maxSize>10485760)_.warn(`[SECURITY WARNING] bodyParser.json.maxSize is set to ${$.maxSize} bytes (${Math.round($.maxSize/1024/1024)}MB). Large JSON payloads can cause memory exhaustion and DoS attacks. Consider if this size is necessary.`);if($.maxDepth>50)_.warn(`[SECURITY WARNING] bodyParser.json.maxDepth is set to ${$.maxDepth}. Very deep JSON nesting can cause stack overflow attacks. Consider if this depth is necessary.`)},x0=($)=>{if($.maxFileSize>104857600)_.warn(`[SECURITY WARNING] bodyParser.fileUploads.maxFileSize is set to ${$.maxFileSize} bytes (${Math.round($.maxFileSize/1024/1024)}MB). Large file uploads can consume significant server resources.`);if($.maxTotalSize>1073741824)_.warn(`[SECURITY WARNING] bodyParser.fileUploads.maxTotalSize is set to ${$.maxTotalSize} bytes (${Math.round($.maxTotalSize/1024/1024/1024)}GB). Very large total upload sizes can cause memory and disk space exhaustion.`);let W=[".exe",".bat",".cmd",".scr",".pif",".com",".vbs",".jar",".app"],Y=$.allowedExtensions.filter((Z)=>W.includes(Z.toLowerCase()));if(Y.length>0)_.warn(`[SECURITY WARNING] bodyParser.fileUploads.allowedExtensions includes dangerous file types: ${Y.join(", ")}. This could allow execution of malicious files. Only allow these if absolutely necessary.`);if($.blockedExtensions.length===0&&$.allowedExtensions.length===0)_.warn("[SECURITY WARNING] File uploads have no extension restrictions (no blockedExtensions and no allowedExtensions). Consider adding blockedExtensions or allowedExtensions to improve security.")},C0=($)=>{if($.trustedProxies.length===0)_.warn("[SECURITY WARNING] ipSecurity.trustedProxies is empty. No proxy headers will be trusted, which may prevent proper client IP detection.");if($.maxChainLength>20)_.warn(`[SECURITY WARNING] ipSecurity.maxChainLength is set to ${$.maxChainLength}. Very long proxy chains can consume significant resources and may indicate amplification attacks.`);if(!$.detectSpoofing)_.warn("[SECURITY WARNING] ipSecurity.detectSpoofing is disabled. This reduces protection against IP spoofing attacks. Only disable if you have other protective measures.")},b0=($,W)=>{if(W?.cors?.enabled)$.cors={...k0,...W.cors,enabled:!0}},u0=($,W)=>{if(W?.bodyParser)$.bodyParser={json:{...O$.json,...W.bodyParser.json},fileUploads:{...O$.fileUploads,...W.bodyParser.fileUploads},urlEncoded:{...O$.urlEncoded,...W.bodyParser.urlEncoded}},m0($.bodyParser)},y0=($,W)=>{if(W?.ipSecurity)$.ipSecurity={...X1,...W.ipSecurity},v0($.ipSecurity),C0($.ipSecurity)},h0=($,W)=>{if(W?.port!==void 0){let Y=Number(W.port);if(isNaN(Y)||Y<1||Y>65535)throw new Error("Invalid port number");$.port=Y}},m0=($)=>{L0($.json),T0($.fileUploads),R0($.urlEncoded),P0($.json),x0($.fileUploads)},J1=($)=>{let W={...I0};return Object.assign(W,$),b0(W,$),u0(W,$),y0(W,$),h0(W,$),W};class T${_beforeAll;_afterAll;_onError;_onNotFound;constructor(){this._beforeAll=new Set,this._afterAll=new Set,this._onError=($)=>{return $.response.setStatusCode(b.internalServerError),{success:!1,message:"Internal Server Error"}},this._onNotFound=($)=>{return $.response.setStatusCode(b.notFound),{success:!1,message:"404 Not Found"}}}_addBeforeHooks($,W){for(let Y of $)this._beforeAll.add({handler:Y,options:W??{routesToExclude:[],routesToInclude:[]}})}_addAfterHooks($,W){for(let Y of $)this._afterAll.add({handler:Y,options:W??{routesToExclude:[],routesToInclude:[]}})}_addOnError($){this._onError=$}_addOnNotFound($){this._onNotFound=$}}var K1=($)=>{let W=[],Y=$.path.replace(/:\w+/g,(Z)=>{let D=Z.slice(1);return W.push(D),"([^/]+)"}).replace(/\//g,"\\/");return{...$,pattern:new RegExp(`^${Y}$`),paramNames:W,isParameterized:!0}};var R$=($)=>{let[W]=$.split("?");if(!W)return"";if([W]=W.split("#"),!W)return"";try{W=decodeURIComponent(W)}catch(Y){_.warn("Failed to decode URL path",{path:W})}if(W=W.startsWith("/")?W:`/${W}`,W=W.replace(/\/\/+/g,"/"),W=f0(W),W.length>1&&W.endsWith("/"))W=W.slice(0,-1);return W},f0=($)=>{let W=$.split("/"),Y=[];for(let D of W){if(D==="."||D===""){if(D===""&&Y.length===0)Y.push(D);continue}if(D===".."){if(Y.length>1)Y.pop()}else Y.push(D)}return Y.join("/")||"/"},v$=($)=>$.replace(/:\w+/g,":param");var G1=($)=>{let W=$.match(/:\w+/g);if(!W)return;let Y=W.map((D)=>D.slice(1)),Z=new Set(Y);if(Y.length!==Z.size){let D=Y.filter((Q,X)=>Y.indexOf(Q)!==X);throw new Error(`Route ${$} has duplicate parameter names: ${D.join(", ")}. Parameter names must be unique within a route for clarity and to prevent conflicts.`)}};class P${_exactRoutes=new Map;_parameterizedRoutes=new Map;_register({method:$,path:W,handler:Y,options:Z}){let D=R$(W),Q=D.includes(":");if(Q)G1(D);if(this._hasExactRoutePattern($,D))throw new Error(`Route ${D} already exists for method ${$}`);let X={method:$,path:D,handler:Y,options:Z,params:{}};if(Q)this._storeParameterizedRoute($,X);else this._storeExactRoute($,D,X)}_findRoute($,W){let Y=R$(W),Z=this._exactRoutes.get($)?.get(Y);if(Z)return Z;let D=this._findParameterizedRoute($,Y);if(D)return D;return}_hasExactRoutePattern($,W){if(this._exactRoutes.get($)?.has(W))return!0;if(W.includes(":")){let Y=v$(W),Z=this._parameterizedRoutes.get($);if(Z)return Z.some((D)=>v$(D.path)===Y)}else{let Y=this._parameterizedRoutes.get($);if(Y)return Y.some((Z)=>Z.path===W)}return!1}_storeExactRoute($,W,Y){if(!this._exactRoutes.has($))this._exactRoutes.set($,new Map);this._exactRoutes.get($)?.set(W,Y)}_storeParameterizedRoute($,W){if(!this._parameterizedRoutes.has($))this._parameterizedRoutes.set($,[]);let Y=K1(W);this._parameterizedRoutes.get($)?.push(Y)}_findParameterizedRoute($,W){let Y=this._parameterizedRoutes.get($);if(!Y)return;for(let Z of Y){let D=W.match(Z.pattern);if(D){let Q={};for(let X=0;X<Z.paramNames.length;X++){let O=D[X+1],V=Z.paramNames[X];if(O!==void 0&&V!==void 0)Q[V]=O}return{...Z,params:Q}}}return}}class x${_configuration;_routeRegistry=new P$;_hooks=new T$;constructor($){this._configuration=J1($)}get($,W,Y){let Z=Y??{beforeHooks:[],afterHooks:[]};this._routeRegistry._register({method:A.get,handler:W,path:$,options:Z,params:{}}),this._routeRegistry._register({method:A.head,handler:W,path:$,options:Z,params:{}})}head($,W,Y){this._routeRegistry._register({method:A.head,handler:W,path:$,options:Y??{beforeHooks:[],afterHooks:[]},params:{}})}post($,W,Y){this._routeRegistry._register({method:A.post,handler:W,path:$,options:Y??{beforeHooks:[],afterHooks:[]},params:{}})}put($,W,Y){this._routeRegistry._register({method:A.put,handler:W,path:$,options:Y??{beforeHooks:[],afterHooks:[]},params:{}})}patch($,W,Y){this._routeRegistry._register({method:A.patch,handler:W,path:$,options:Y??{beforeHooks:[],afterHooks:[]},params:{}})}delete($,W,Y){this._routeRegistry._register({method:A.delete,handler:W,path:$,options:Y??{beforeHooks:[],afterHooks:[]},params:{}})}options($,W,Y){this._routeRegistry._register({method:A.options,handler:W,path:$,options:Y??{beforeHooks:[],afterHooks:[]},params:{}})}group($,W,Y){let Z=(Q)=>(X,O,V)=>{let B=`${$}${X}`,w={beforeHooks:[...Y?.beforeHooks??[],...V?.beforeHooks??[]],afterHooks:[...V?.afterHooks??[],...Y?.afterHooks??[]]};if(this._routeRegistry._register({method:Q,handler:O,path:B,options:w,params:{}}),Q===A.get)this._routeRegistry._register({method:A.head,handler:O,path:B,options:w,params:{}})},D={get:Z(A.get),head:Z(A.head),post:Z(A.post),put:Z(A.put),delete:Z(A.delete),patch:Z(A.patch),options:Z(A.options)};W(D)}beforeAll($,W){this._hooks._addBeforeHooks($,W)}afterAll($,W){this._hooks._addAfterHooks($,W)}onError($){this._hooks._addOnError($)}onNotFound($){this._hooks._addOnNotFound($)}}class O1 extends x${_isListening=!1;_server;constructor($){super($);if(this._configuration.logger)_.setCustomLogger(this._configuration.logger);if(_.setLogLevel(this._configuration.logLevel),x.setEnabled(this._configuration.networkLogs),this._configuration.networkLogger)x.setNetworkLogger(this._configuration.networkLogger);if(_.info("YinzerFlow initialized with logging enabled",`${N.green}level: ${this._configuration.logLevel}, networkLogs: ${this._configuration.networkLogs}${N.reset}`),this._configuration.autoGracefulShutdown)this._setupGracefulShutdown()}_setupServer($,W,Y){if(!this._server)return;this._server.on("error",(Z)=>{x.serverError(this._configuration.port,this._configuration.host,Z.message),W(Z)}),this._server.on("listening",()=>{this._isListening=!0,x.serverStart(this._configuration.port,this._configuration.host),$()}),this._server.on("connection",(Z)=>{this._handleConnection(Z,Y)})}async _processRequest({data:$,socket:W,requestHandler:Y,clientAddress:Z}){let D=Date.now();_.info("Processing incoming request",{clientAddress:Z,dataSize:$.length});let Q=new L$($,this,Z);await Y.handle(Q),W.write(Q._response._stringBody),W.end();let X=Date.now(),O=X-D;if(x.request(Q,D,X),O>500)_.warn("Slow request detected",{method:Q.request.method,path:Q.request.path,statusCode:Q._response._statusCode,responseTime:`${O}ms`,clientAddress:Z})}_handleConnection($,W){let Y=$.remoteAddress??"unknown";x.connection("connect",Y),$.on("data",(Z)=>{this._processRequest({data:Z,socket:$,requestHandler:W,clientAddress:Y}).catch((D)=>{let Q=D instanceof Error?D.message:"Unknown error";x.connection("error",Y,`Unexpected error: ${Q}`),$.destroy()})}),$.on("error",(Z)=>{x.connection("error",Y,Z.message)}),$.on("close",()=>{x.connection("disconnect",Y)})}async listen(){if(this._isListening)throw new Error("Server is already listening");return new Promise(($,W)=>{let Y=new N$(this);this._server=p0(),this._setupServer($,W,Y),this._server.listen(this._configuration.port,this._configuration.host)})}async close(){if(!this._isListening||!this._server)return;return new Promise(($)=>{if(!this._server){this._isListening=!1,$();return}this._server.close(()=>{this._isListening=!1,x.serverStop(this._configuration.port,this._configuration.host),$()})})}status(){return{isListening:this._isListening,port:this._configuration.port,host:this._configuration.host}}_setupGracefulShutdown(){if(process.listenerCount("SIGTERM")===0&&process.listenerCount("SIGINT")===0){let $=(W)=>{_.info(`\uD83D\uDED1 Received ${W}, shutting down gracefully...`),this.close().then(()=>{_.info("✅ Server shut down gracefully"),process.exit(0)}).catch((Y)=>{_.error("❌ Error during graceful shutdown:",Y),process.exit(1)})};process.on("SIGTERM",()=>$("SIGTERM")),process.on("SIGINT",()=>$("SIGINT"))}}}export{_ as log,O1 as YinzerFlow};
|
|
19
21
|
|
|
20
|
-
${Z}`;let D=Z1(this._stringBody,this._encoding);this._setHeadersIfNotSet({Date:D1.default().format("ddd, DD MMM YYYY HH:mm:ss [GMT]"),"Content-Length":D})}_setHeadersIfNotSet($){let W={};for(let[Z,D]of Object.entries($))if(D!==void 0&&!(Z in this._headers))W[Z]=D;let Y=k$(W);Object.assign(this._headers,Y)}_setBody($){if(this._body=$,!this._headers["content-type"]){let W=s$($);this._setHeadersIfNotSet({"Content-Type":W})}}setStatusCode($){this._statusCode=$,this._status=Y1($)}addHeaders($){let W=k$($);this._headers={...this._headers,...W}}removeHeaders($){for(let W of $)delete this._headers[W]}_setSecurityHeaders(){this._setHeadersIfNotSet({"X-Content-Type-Options":"nosniff","X-Frame-Options":"DENY","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin"})}}class L${_request;_response;request;response;constructor($,W,Y){this._request=new z$($,W,Y),this._response=new I$(this._request),this.request=this._request,this.response=this._response}}var Q1={off:"off",error:"error",warn:"warn",info:"info"};var k0={enabled:!0,origin:"*",methods:["GET","POST","PUT","DELETE","PATCH","OPTIONS"],allowedHeaders:"*",exposedHeaders:[],credentials:!1,maxAge:86400,preflightContinue:!1,optionsSuccessStatus:b.noContent},O$={json:{maxSize:262144,maxDepth:10,allowPrototypeProperties:!1,maxKeys:1000,maxStringLength:1048576,maxArrayLength:1e4},fileUploads:{maxFileSize:10485760,maxTotalSize:52428800,maxFiles:10,allowedExtensions:[],blockedExtensions:[".exe",".bat",".cmd",".scr",".pif",".com"],maxFilenameLength:255},urlEncoded:{maxSize:1048576,maxFields:1000,maxFieldNameLength:100,maxFieldLength:1048576}},X1={trustedProxies:["127.0.0.1","::1"],allowPrivateIps:!0,headerPreference:["x-forwarded-for","x-real-ip","cf-connecting-ip","x-client-ip","true-client-ip"],maxChainLength:10,detectSpoofing:!0},I0={port:5000,host:"0.0.0.0",logLevel:Q1.warn,networkLogs:!1,cors:{enabled:!1},bodyParser:O$,ipSecurity:X1,connectionOptions:{socketTimeout:30000,gracefulShutdownTimeout:30000,keepAliveTimeout:65000,headersTimeout:66000},autoGracefulShutdown:!0},L0=($)=>{if($.maxSize<1)throw new Error("bodyParser.json.maxSize must be at least 1 byte");if($.maxDepth<1)throw new Error("bodyParser.json.maxDepth must be at least 1");if($.maxKeys<1)throw new Error("bodyParser.json.maxKeys must be at least 1");if($.maxStringLength<1)throw new Error("bodyParser.json.maxStringLength must be at least 1 byte");if($.maxArrayLength<1)throw new Error("bodyParser.json.maxArrayLength must be at least 1")},R0=($)=>{if($.maxFileSize<1)throw new Error("bodyParser.fileUploads.maxFileSize must be at least 1 byte");if($.maxTotalSize<1)throw new Error("bodyParser.fileUploads.maxTotalSize must be at least 1 byte");if($.maxFiles<1)throw new Error("bodyParser.fileUploads.maxFiles must be at least 1");if($.maxFilenameLength<1)throw new Error("bodyParser.fileUploads.maxFilenameLength must be at least 1 character")},T0=($)=>{if($.maxSize<1)throw new Error("bodyParser.urlEncoded.maxSize must be at least 1 byte");if($.maxFields<1)throw new Error("bodyParser.urlEncoded.maxFields must be at least 1");if($.maxFieldNameLength<1)throw new Error("bodyParser.urlEncoded.maxFieldNameLength must be at least 1 character");if($.maxFieldLength<1)throw new Error("bodyParser.urlEncoded.maxFieldLength must be at least 1 byte")},v0=($)=>{if(!Array.isArray($.trustedProxies))throw new Error("ipSecurity.trustedProxies must be an array");if(!Array.isArray($.headerPreference))throw new Error("ipSecurity.headerPreference must be an array");if($.headerPreference.length===0)throw new Error("ipSecurity.headerPreference must contain at least one header");if($.maxChainLength<1)throw new Error("ipSecurity.maxChainLength must be at least 1");if($.maxChainLength>50)throw new Error("ipSecurity.maxChainLength must not exceed 50 to prevent DoS attacks")},P0=($)=>{if($.allowPrototypeProperties)_.warn("[SECURITY WARNING] bodyParser.json.allowPrototypeProperties is enabled. This allows prototype pollution attacks. Only enable this if you absolutely need it and have other protections in place.");if($.maxSize>10485760)_.warn(`[SECURITY WARNING] bodyParser.json.maxSize is set to ${$.maxSize} bytes (${Math.round($.maxSize/1024/1024)}MB). Large JSON payloads can cause memory exhaustion and DoS attacks. Consider if this size is necessary.`);if($.maxDepth>50)_.warn(`[SECURITY WARNING] bodyParser.json.maxDepth is set to ${$.maxDepth}. Very deep JSON nesting can cause stack overflow attacks. Consider if this depth is necessary.`)},x0=($)=>{if($.maxFileSize>104857600)_.warn(`[SECURITY WARNING] bodyParser.fileUploads.maxFileSize is set to ${$.maxFileSize} bytes (${Math.round($.maxFileSize/1024/1024)}MB). Large file uploads can consume significant server resources.`);if($.maxTotalSize>1073741824)_.warn(`[SECURITY WARNING] bodyParser.fileUploads.maxTotalSize is set to ${$.maxTotalSize} bytes (${Math.round($.maxTotalSize/1024/1024/1024)}GB). Very large total upload sizes can cause memory and disk space exhaustion.`);let W=[".exe",".bat",".cmd",".scr",".pif",".com",".vbs",".jar",".app"],Y=$.allowedExtensions.filter((Z)=>W.includes(Z.toLowerCase()));if(Y.length>0)_.warn(`[SECURITY WARNING] bodyParser.fileUploads.allowedExtensions includes dangerous file types: ${Y.join(", ")}. This could allow execution of malicious files. Only allow these if absolutely necessary.`);if($.blockedExtensions.length===0&&$.allowedExtensions.length===0)_.warn("[SECURITY WARNING] File uploads have no extension restrictions (no blockedExtensions and no allowedExtensions). Consider adding blockedExtensions or allowedExtensions to improve security.")},C0=($)=>{if($.trustedProxies.length===0)_.warn("[SECURITY WARNING] ipSecurity.trustedProxies is empty. No proxy headers will be trusted, which may prevent proper client IP detection.");if($.maxChainLength>20)_.warn(`[SECURITY WARNING] ipSecurity.maxChainLength is set to ${$.maxChainLength}. Very long proxy chains can consume significant resources and may indicate amplification attacks.`);if(!$.detectSpoofing)_.warn("[SECURITY WARNING] ipSecurity.detectSpoofing is disabled. This reduces protection against IP spoofing attacks. Only disable if you have other protective measures.")},b0=($,W)=>{if(W?.cors?.enabled)$.cors={...k0,...W.cors,enabled:!0}},u0=($,W)=>{if(W?.bodyParser)$.bodyParser={json:{...O$.json,...W.bodyParser.json},fileUploads:{...O$.fileUploads,...W.bodyParser.fileUploads},urlEncoded:{...O$.urlEncoded,...W.bodyParser.urlEncoded}},m0($.bodyParser)},y0=($,W)=>{if(W?.ipSecurity)$.ipSecurity={...X1,...W.ipSecurity},v0($.ipSecurity),C0($.ipSecurity)},h0=($,W)=>{if(W?.port!==void 0){let Y=Number(W.port);if(isNaN(Y)||Y<1||Y>65535)throw new Error("Invalid port number");$.port=Y}},m0=($)=>{L0($.json),R0($.fileUploads),T0($.urlEncoded),P0($.json),x0($.fileUploads)},J1=($)=>{let W={...I0};return Object.assign(W,$),b0(W,$),u0(W,$),y0(W,$),h0(W,$),W};class R${_beforeAll;_afterAll;_onError;_onNotFound;constructor(){this._beforeAll=new Set,this._afterAll=new Set,this._onError=($)=>{return $.response.setStatusCode(b.internalServerError),{success:!1,message:"Internal Server Error"}},this._onNotFound=($)=>{return $.response.setStatusCode(b.notFound),{success:!1,message:"404 Not Found"}}}_addBeforeHooks($,W){for(let Y of $)this._beforeAll.add({handler:Y,options:W??{routesToExclude:[],routesToInclude:[]}})}_addAfterHooks($,W){for(let Y of $)this._afterAll.add({handler:Y,options:W??{routesToExclude:[],routesToInclude:[]}})}_addOnError($){this._onError=$}_addOnNotFound($){this._onNotFound=$}}var K1=($)=>{let W=[],Y=$.path.replace(/:\w+/g,(Z)=>{let D=Z.slice(1);return W.push(D),"([^/]+)"}).replace(/\//g,"\\/");return{...$,pattern:new RegExp(`^${Y}$`),paramNames:W,isParameterized:!0}};var T$=($)=>{let[W]=$.split("?");if(!W)return"";if([W]=W.split("#"),!W)return"";try{W=decodeURIComponent(W)}catch(Y){_.warn("Failed to decode URL path",{path:W})}if(W=W.startsWith("/")?W:`/${W}`,W=W.replace(/\/\/+/g,"/"),W=f0(W),W.length>1&&W.endsWith("/"))W=W.slice(0,-1);return W},f0=($)=>{let W=$.split("/"),Y=[];for(let D of W){if(D==="."||D===""){if(D===""&&Y.length===0)Y.push(D);continue}if(D===".."){if(Y.length>1)Y.pop()}else Y.push(D)}return Y.join("/")||"/"},v$=($)=>$.replace(/:\w+/g,":param");var G1=($)=>{let W=$.match(/:\w+/g);if(!W)return;let Y=W.map((D)=>D.slice(1)),Z=new Set(Y);if(Y.length!==Z.size){let D=Y.filter((Q,X)=>Y.indexOf(Q)!==X);throw new Error(`Route ${$} has duplicate parameter names: ${D.join(", ")}. Parameter names must be unique within a route for clarity and to prevent conflicts.`)}};class P${_exactRoutes=new Map;_parameterizedRoutes=new Map;_register({method:$,path:W,handler:Y,options:Z}){let D=T$(W),Q=D.includes(":");if(Q)G1(D);if(this._hasExactRoutePattern($,D))throw new Error(`Route ${D} already exists for method ${$}`);let X={method:$,path:D,handler:Y,options:Z,params:{}};if(Q)this._storeParameterizedRoute($,X);else this._storeExactRoute($,D,X)}_findRoute($,W){let Y=T$(W),Z=this._exactRoutes.get($)?.get(Y);if(Z)return Z;return this._findParameterizedRoute($,Y)}_hasExactRoutePattern($,W){if(this._exactRoutes.get($)?.has(W))return!0;if(W.includes(":")){let Y=v$(W),Z=this._parameterizedRoutes.get($);if(Z)return Z.some((D)=>v$(D.path)===Y)}else{let Y=this._parameterizedRoutes.get($);if(Y)return Y.some((Z)=>Z.path===W)}return!1}_storeExactRoute($,W,Y){if(!this._exactRoutes.has($))this._exactRoutes.set($,new Map);this._exactRoutes.get($)?.set(W,Y)}_storeParameterizedRoute($,W){if(!this._parameterizedRoutes.has($))this._parameterizedRoutes.set($,[]);let Y=K1(W);this._parameterizedRoutes.get($)?.push(Y)}_findParameterizedRoute($,W){let Y=this._parameterizedRoutes.get($);if(!Y)return;for(let Z of Y){let D=W.match(Z.pattern);if(D){let Q={};for(let X=0;X<Z.paramNames.length;X++){let O=D[X+1],H=Z.paramNames[X];if(O!==void 0&&H!==void 0)Q[H]=O}return{...Z,params:Q}}}return}}class x${_configuration;_routeRegistry=new P$;_hooks=new R$;constructor($){this._configuration=J1($)}get($,W,Y){let Z=Y??{beforeHooks:[],afterHooks:[]};this._routeRegistry._register({method:E.get,handler:W,path:$,options:Z,params:{}}),this._routeRegistry._register({method:E.head,handler:W,path:$,options:Z,params:{}})}head($,W,Y){this._routeRegistry._register({method:E.head,handler:W,path:$,options:Y??{beforeHooks:[],afterHooks:[]},params:{}})}post($,W,Y){this._routeRegistry._register({method:E.post,handler:W,path:$,options:Y??{beforeHooks:[],afterHooks:[]},params:{}})}put($,W,Y){this._routeRegistry._register({method:E.put,handler:W,path:$,options:Y??{beforeHooks:[],afterHooks:[]},params:{}})}patch($,W,Y){this._routeRegistry._register({method:E.patch,handler:W,path:$,options:Y??{beforeHooks:[],afterHooks:[]},params:{}})}delete($,W,Y){this._routeRegistry._register({method:E.delete,handler:W,path:$,options:Y??{beforeHooks:[],afterHooks:[]},params:{}})}options($,W,Y){this._routeRegistry._register({method:E.options,handler:W,path:$,options:Y??{beforeHooks:[],afterHooks:[]},params:{}})}group($,W,Y){let Z=(Q)=>(X,O,H)=>{let V=`${$}${X}`,I={beforeHooks:[...Y?.beforeHooks??[],...H?.beforeHooks??[]],afterHooks:[...H?.afterHooks??[],...Y?.afterHooks??[]]};if(this._routeRegistry._register({method:Q,handler:O,path:V,options:I,params:{}}),Q===E.get)this._routeRegistry._register({method:E.head,handler:O,path:V,options:I,params:{}})},D={get:Z(E.get),head:Z(E.head),post:Z(E.post),put:Z(E.put),delete:Z(E.delete),patch:Z(E.patch),options:Z(E.options)};W(D)}beforeAll($,W){this._hooks._addBeforeHooks($,W)}afterAll($,W){this._hooks._addAfterHooks($,W)}onError($){this._hooks._addOnError($)}onNotFound($){this._hooks._addOnNotFound($)}}class O1 extends x${_isListening=!1;_server;constructor($){super($);if(this._configuration.logger)_.setCustomLogger(this._configuration.logger);if(_.setLogLevel(this._configuration.logLevel),x.setEnabled(this._configuration.networkLogs),this._configuration.networkLogger)x.setNetworkLogger(this._configuration.networkLogger);if(_.info("YinzerFlow initialized with logging enabled",`${N.green}level: ${this._configuration.logLevel}, networkLogs: ${this._configuration.networkLogs}${N.reset}`),this._configuration.autoGracefulShutdown)this._setupGracefulShutdown()}_setupServer($,W,Y){if(!this._server)return;this._server.on("error",(Z)=>{x.serverError(this._configuration.port,this._configuration.host,Z.message),W(Z)}),this._server.on("listening",()=>{this._isListening=!0,x.serverStart(this._configuration.port,this._configuration.host),$()}),this._server.on("connection",(Z)=>{this._handleConnection(Z,Y)})}async _processRequest({data:$,socket:W,requestHandler:Y,clientAddress:Z}){let D=Date.now();_.info("Processing incoming request",{clientAddress:Z,dataSize:$.length});let Q=new L$($,this,Z);await Y.handle(Q),W.write(Q._response._stringBody),W.end();let X=Date.now(),O=X-D;if(x.request(Q,D,X),O>500)_.warn("Slow request detected",{method:Q.request.method,path:Q.request.path,statusCode:Q._response._statusCode,responseTime:`${O}ms`,clientAddress:Z})}_handleConnection($,W){let Y=$.remoteAddress??"unknown";x.connection("connect",Y),$.on("data",(Z)=>{this._processRequest({data:Z,socket:$,requestHandler:W,clientAddress:Y}).catch((D)=>{let Q=D instanceof Error?D.message:"Unknown error";x.connection("error",Y,`Unexpected error: ${Q}`),$.destroy()})}),$.on("error",(Z)=>{x.connection("error",Y,Z.message)}),$.on("close",()=>{x.connection("disconnect",Y)})}async listen(){if(this._isListening)throw new Error("Server is already listening");return new Promise(($,W)=>{let Y=new N$(this);this._server=p0(),this._setupServer($,W,Y),this._server.listen(this._configuration.port,this._configuration.host)})}async close(){if(!this._isListening||!this._server)return;return new Promise(($)=>{if(!this._server){this._isListening=!1,$();return}this._server.close(()=>{this._isListening=!1,x.serverStop(this._configuration.port,this._configuration.host),$()})})}status(){return{isListening:this._isListening,port:this._configuration.port,host:this._configuration.host}}_setupGracefulShutdown(){if(process.listenerCount("SIGTERM")===0&&process.listenerCount("SIGINT")===0){let $=(W)=>{_.info(`\uD83D\uDED1 Received ${W}, shutting down gracefully...`),this.close().then(()=>{_.info("✅ Server shut down gracefully"),process.exit(0)}).catch((Y)=>{_.error("❌ Error during graceful shutdown:",Y),process.exit(1)})};process.on("SIGTERM",()=>$("SIGTERM")),process.on("SIGINT",()=>$("SIGINT"))}}}export{_ as log,O1 as YinzerFlow};
|
|
21
|
-
|
|
22
|
-
//# debugId=50EFC9AB50AA0C3264756E2164756E21
|
|
22
|
+
//# debugId=6D78F9449BE0A30064756E2164756E21
|
package/index.js.map
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
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
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\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', { clientAddress, dataSize: 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",
|
|
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
|
|
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 log.error('Error in request handler', error);\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);\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', 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
|
-
"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
|
|
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
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
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' | 'log' | 'warn' = 'log';\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 = 'log';\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",
|
|
12
12
|
"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",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"import type { InternalHttpHeaders } from '@typedefs/constants/http.js';\nimport type { InternalIpAddressResult } from '@typedefs/internal/InternalIpAddress.js';\nimport type { InternalIpValidationConfig } from '@typedefs/internal/InternalConfiguration.js';\nimport type { InternalSetupImpl } from '@typedefs/internal/InternalSetupImpl.ts';\n\n// Private IP ranges (RFC 1918, RFC 4193, RFC 3927)\nconst PRIVATE_IP_RANGES = [\n // IPv4 private ranges\n /^(?<classA>10)\\./,\n /^(?<classB>172)\\.(?<classBRange>1[6-9]|2[0-9]|3[0-1])\\./,\n /^(?<classC>192)\\.(?<classCRange>168)\\./,\n /^(?<linkLocal>169)\\.(?<linkLocalRange>254)\\./, // link-local\n /^(?<loopback>127)\\./, // loopback\n // IPv6 private ranges\n /^(?<ipv6Loopback>::1)$/, // loopback\n /^(?<ipv6LinkLocal>fe80):/i, // link-local\n /^(?<ipv6UniqueLocalFC>fc00):/i, // unique local\n /^(?<ipv6UniqueLocalFD>fd00):/i, // unique local\n];\n\n/**\n * Validates if an IP address is properly formatted\n */\nexport const isValidIpAddress = (ip: string): boolean => {\n if (!ip || typeof ip !== 'string') return false;\n\n // Remove brackets from IPv6 addresses\n const cleanIp = ip.replace(/^\\[|\\]$/g, '');\n\n // IPv4 validation with named capture groups\n const ipv4Regex = /^(?<octet>(?<highByte>25[0-5]|(?<midByte>2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}$/;\n if (ipv4Regex.test(cleanIp)) {\n const parts = cleanIp.split('.');\n return (\n parts.length === 4 &&\n parts.every((part) => {\n const num = parseInt(part, 10);\n return num >= 0 && num <= 255;\n })\n );\n }\n\n // IPv6 validation with named capture groups (simplified but robust)\n // First check for invalid patterns (multiple :: compression)\n if (cleanIp.includes('::') && (cleanIp.match(/::/g) ?? []).length > 1) {\n return false; // Multiple :: compression is invalid\n }\n\n const ipv6Regex =\n /^(?<ipv6Address>(?<fullAddress>(?<hexQuad>[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4})|(?<compressedAddress>(?<leadingPart>[0-9a-fA-F]{1,4}:){1,7}:)|(?<mixedCompression>(?<frontPart>[0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4})|(?<doubleColonOnly>::)|(?<linkLocal>fe80:(?<linkSuffix>:[0-9a-fA-F]{0,4}){0,4}(?<zoneId>%[0-9a-zA-Z]+)?)|(?<ipv4MappedFull>::ffff:(?<mappedIpv4>(?<mappedOctet>[0-9]{1,3}\\.){3}[0-9]{1,3}))|(?<generalPattern>(?<segmentGroup>[0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}))$/;\n\n return ipv6Regex.test(cleanIp);\n};\n\n/**\n * Checks if an IP address is in a private range\n */\nexport const isPrivateIp = (ip: string): boolean => {\n if (!ip) return false;\n const cleanIp = ip.replace(/^\\[|\\]$/g, '');\n return PRIVATE_IP_RANGES.some((range) => range.test(cleanIp));\n};\n\n/**\n * Checks if an IP is in the trusted proxy list\n * Supports '*' wildcard to trust any proxy\n */\nexport const isTrustedProxy = (ip: string, trustedProxies: Array<string>): boolean => {\n if (!ip || !trustedProxies.length) return false;\n\n // Support '*' wildcard to trust any proxy\n if (trustedProxies.includes('*')) return true;\n\n return trustedProxies.includes(ip);\n};\n\n/**\n * Detects potential IP spoofing patterns\n */\nexport const detectSpoofingPatterns = (chain: Array<string>, config: InternalIpValidationConfig): boolean => {\n if (!config.detectSpoofing || chain.length <= 1) return false;\n\n // Pattern 1: Too many hops (potential amplification attack)\n if (chain.length > config.maxChainLength) return true;\n\n // Pattern 2: Duplicate IPs in chain (suspicious)\n const uniqueIps = new Set(chain);\n if (uniqueIps.size !== chain.length) return true;\n\n // Pattern 3: Mix of invalid and valid IPs (obfuscation attempt)\n const validCount = chain.filter(isValidIpAddress).length;\n if (validCount > 0 && validCount < chain.length) return true;\n\n // Pattern 4: Reverse proxy spoofing detection disabled\n // Note: The pattern \"public_ip, private_ip\" is normal for legitimate X-Forwarded-For headers\n // More sophisticated detection would require knowledge of expected network topology\n\n return false;\n};\n\n/**\n * Validates X-Forwarded-For proxy chain\n */\nconst _validateXForwardedForChain = (ipChain: Array<string>, config: InternalIpValidationConfig): boolean => {\n if (ipChain.length <= 1) return true;\n\n const lastIp = ipChain[ipChain.length - 1];\n return Boolean(lastIp && isTrustedProxy(lastIp, config.trustedProxies));\n};\n\n/**\n * Extracts client IP from IP chain based on header type\n */\nconst _extractClientIp = (ipChain: Array<string>, headerName: string): string | undefined => {\n if (headerName === 'x-forwarded-for') {\n return ipChain[0]; // Client IP is first in X-Forwarded-For\n }\n return ipChain[ipChain.length - 1]; // For other headers, take the last value\n};\n\n/**\n * Creates a valid IP result object\n */\nconst _createValidIpResult = (options: {\n clientIp: string;\n headerName: string;\n ipChain: Array<string>;\n config: InternalIpValidationConfig;\n}): InternalIpAddressResult => {\n const { clientIp, headerName, ipChain, config } = options;\n const isPrivate = isPrivateIp(clientIp);\n const trusted = headerName === 'x-forwarded-for' ? isTrustedProxy(ipChain[ipChain.length - 1] ?? '', config.trustedProxies) : true;\n\n return {\n ip: clientIp,\n isValid: true,\n isPrivate,\n source: headerName,\n trusted,\n };\n};\n\n/**\n * Creates an invalid IP result object\n */\nconst _createInvalidIpResult = (): InternalIpAddressResult => ({\n ip: '',\n isValid: false,\n isPrivate: false,\n source: 'socket',\n trusted: false,\n});\n\n/**\n * Extracts and validates IP addresses from headers with security checks\n */\nconst _extractIpFromHeaders = (headers: Partial<Record<InternalHttpHeaders, string>>, config: InternalIpValidationConfig): InternalIpAddressResult => {\n // Try each header in preference order\n for (const headerName of config.headerPreference) {\n const headerValue = headers[headerName];\n if (!headerValue) continue;\n\n // Handle comma-separated IP chains\n const ipChain = headerValue\n .split(',')\n .map((ip) => ip.trim())\n .filter(Boolean);\n if (ipChain.length === 0) continue;\n\n // Detect spoofing patterns\n if (detectSpoofingPatterns(ipChain, config)) continue;\n\n // For X-Forwarded-For, validate the proxy chain\n if (headerName === 'x-forwarded-for' && !_validateXForwardedForChain(ipChain, config)) {\n continue;\n }\n\n // Extract the client IP\n const clientIp = _extractClientIp(ipChain, headerName);\n if (!clientIp || !isValidIpAddress(clientIp)) continue;\n\n // Check if private IPs are allowed\n const isPrivate = isPrivateIp(clientIp);\n if (isPrivate && !config.allowPrivateIps) continue;\n\n return _createValidIpResult({ clientIp, headerName, ipChain, config });\n }\n\n return _createInvalidIpResult();\n};\n\n/**\n * Advanced IP parsing with comprehensive security validation\n * Uses server-level IP security configuration with optional overrides\n */\nexport const parseIpAddressSecure = (\n setup: InternalSetupImpl,\n headers: Partial<Record<InternalHttpHeaders, string>>,\n configOverride: Partial<InternalIpValidationConfig> = {},\n): InternalIpAddressResult => {\n const serverConfig = setup._configuration.ipSecurity;\n const finalConfig = { ...serverConfig, ...configOverride };\n\n // Try to extract IP from headers first\n const headerResult = _extractIpFromHeaders(headers, finalConfig);\n if (headerResult.isValid) {\n return headerResult;\n }\n\n // No valid IP found from headers\n return {\n ip: '',\n isValid: false,\n isPrivate: false,\n source: 'socket',\n trusted: false,\n };\n};\n\n/**\n * Simple IP parsing function that returns just the IP address string\n * Provides backward compatibility for existing code\n */\nexport const parseIpAddress = (setup: InternalSetupImpl, headers: Partial<Record<InternalHttpHeaders, string>>): string => {\n const result = parseIpAddressSecure(setup, headers);\n return result.ip;\n};\n",
|
|
22
22
|
"/**\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
23
|
"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
|
-
"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
|
|
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
|
|
24
|
+
"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
26
|
"/**\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
27
|
"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
28
|
"/**\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",
|
|
@@ -34,10 +34,10 @@
|
|
|
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
|
-
"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
|
|
38
|
-
"import { httpMethod } from '@constants/http.ts';\nimport type { InternalHttpMethod } from '@typedefs/constants/http.ts';\nimport { handleCustomConfiguration } from '@core/setup/utils/handleCustomConfiguration.ts';\nimport type { InternalSetupImpl, InternalSetupMethod } 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';\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 = options ?? { beforeHooks: [], afterHooks: [] };\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: options ?? { beforeHooks: [], afterHooks: [] }, params: {} });\n }\n\n post(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.post, handler, path, options: options ?? { beforeHooks: [], afterHooks: [] }, params: {} });\n }\n\n put(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.put, handler, path, options: options ?? { beforeHooks: [], afterHooks: [] }, params: {} });\n }\n\n patch(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.patch, handler, path, options: options ?? { beforeHooks: [], afterHooks: [] }, params: {} });\n }\n\n delete(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.delete, handler, path, options: options ?? { beforeHooks: [], afterHooks: [] }, params: {} });\n }\n\n options(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.options, handler, path, options: options ?? { beforeHooks: [], afterHooks: [] }, params: {} });\n }\n\n group(\n prefix: string,\n callback: (group: Record<Lowercase<InternalHttpMethod>, InternalSetupMethod>) => void,\n options?: InternalRouteRegistryOptions, // These follow the same pattern as the individual route registration methods\n ): void {\n const createRouteHandler =\n (method: InternalHttpMethod) =>\n (path: string, handler: HandlerCallback<any>, routeOptions?: InternalRouteRegistryOptions): void => {\n const fullPath = `${prefix}${path}`;\n const mergedOptions = {\n beforeHooks: [...(options?.beforeHooks ?? []), ...(routeOptions?.beforeHooks ?? [])],\n afterHooks: [...(routeOptions?.afterHooks ?? []), ...(options?.afterHooks ?? [])],\n };\n\n this._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._routeRegistry._register({\n method: httpMethod.head,\n handler,\n path: fullPath,\n options: mergedOptions,\n params: {},\n });\n }\n };\n\n // Create a group app that registers routes with prefix and group hooks\n const group = {\n get: createRouteHandler(httpMethod.get),\n head: createRouteHandler(httpMethod.head),\n post: createRouteHandler(httpMethod.post),\n put: createRouteHandler(httpMethod.put),\n delete: createRouteHandler(httpMethod.delete),\n patch: createRouteHandler(httpMethod.patch),\n options: createRouteHandler(httpMethod.options),\n };\n\n // Execute callback to register routes\n callback(group);\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
|
|
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 { httpMethod } from '@constants/http.ts';\nimport type { InternalHttpMethod } from '@typedefs/constants/http.ts';\nimport { handleCustomConfiguration } from '@core/setup/utils/handleCustomConfiguration.ts';\nimport type { InternalSetupImpl, InternalSetupMethod } 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';\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 = options ?? { beforeHooks: [], afterHooks: [] };\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: options ?? { beforeHooks: [], afterHooks: [] }, params: {} });\n }\n\n post(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.post, handler, path, options: options ?? { beforeHooks: [], afterHooks: [] }, params: {} });\n }\n\n put(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.put, handler, path, options: options ?? { beforeHooks: [], afterHooks: [] }, params: {} });\n }\n\n patch(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.patch, handler, path, options: options ?? { beforeHooks: [], afterHooks: [] }, params: {} });\n }\n\n delete(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.delete, handler, path, options: options ?? { beforeHooks: [], afterHooks: [] }, params: {} });\n }\n\n options(path: string, handler: HandlerCallback<any>, options?: InternalRouteRegistryOptions): void {\n this._routeRegistry._register({ method: httpMethod.options, handler, path, options: options ?? { beforeHooks: [], afterHooks: [] }, params: {} });\n }\n\n group(\n prefix: string,\n callback: (group: Record<Lowercase<InternalHttpMethod>, InternalSetupMethod>) => void,\n options?: InternalRouteRegistryOptions, // These follow the same pattern as the individual route registration methods\n ): void {\n const createRouteHandler =\n (method: InternalHttpMethod) =>\n (path: string, handler: HandlerCallback<any>, routeOptions?: InternalRouteRegistryOptions): void => {\n const fullPath = `${prefix}${path}`;\n const mergedOptions = {\n beforeHooks: [...(options?.beforeHooks ?? []), ...(routeOptions?.beforeHooks ?? [])],\n afterHooks: [...(routeOptions?.afterHooks ?? []), ...(options?.afterHooks ?? [])],\n };\n\n this._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._routeRegistry._register({\n method: httpMethod.head,\n handler,\n path: fullPath,\n options: mergedOptions,\n params: {},\n });\n }\n };\n\n // Create a group app that registers routes with prefix and group hooks\n const group = {\n get: createRouteHandler(httpMethod.get),\n head: createRouteHandler(httpMethod.head),\n post: createRouteHandler(httpMethod.post),\n put: createRouteHandler(httpMethod.put),\n delete: createRouteHandler(httpMethod.delete),\n patch: createRouteHandler(httpMethod.patch),\n options: createRouteHandler(httpMethod.options),\n };\n\n // Execute callback to register routes\n callback(group);\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"
|
|
39
39
|
],
|
|
40
|
-
"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,GAAG,MAAM,MAAM,EAAE,IAAG,GAAM,QAAQ,EAAE,CAAc,IAAI,EAAE,KAAI,EAAE,MAAI,EAAE,QAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAE,6FAA6F,EAAE,sFAAsF,GAAE,CAAC,KAAK,KAAK,SAAS,2DAA2D,MAAM,GAAG,EAAE,OAAO,wFAAwF,MAAM,GAAG,EAAE,QAAQ,QAAQ,CAAC,EAAE,CAA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ACR,KAAK,IAAM,CACV,EAAI,KAAK,+BAA8B,EACvC,QAAQ,KAAK,CAAC,EACf,EACA,MAAM,CAAC,IAAU,CAChB,EAAI,MAAM,oCAAoC,CAAK,EACnD,QAAQ,KAAK,CAAC,EACf,GAGL,QAAQ,GAAG,UAAW,IAAM,EAAS,SAAS,CAAC,EAC/C,QAAQ,GAAG,SAAU,IAAM,EAAS,QAAQ,CAAC,GAGnD",
|
|
41
|
+
"debugId": "6D78F9449BE0A30064756E2164756E21",
|
|
42
42
|
"names": []
|
|
43
43
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yinzerflow",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"author": "Patrick Rizzardi <patrick@redact.digital> (https://redact.digital)",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"homepage": "https://github.com/yinzers/YinzerFlow.
|
|
6
|
+
"homepage": "https://github.com/yinzers/YinzerFlow/blob/main/docs/start-here.md",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/yinzers/YinzerFlow.git"
|