Skip to main content

Interface: HttpRequest

Defined in: service-core/src/http/types.ts:13

Framework-agnostic HTTP request interface. Mirrors the Express Request surface used throughout this codebase so that route handlers, middleware, and utilities require no changes when the underlying HTTP server changes.

Extended by​

Indexable​

[key: string]: any

Allow arbitrary per-request properties (e.g. req.websocket, req.wsHandled).

Properties​

authPayload?​

optional authPayload?: any

Defined in: service-core/src/http/types.ts:59

Full decoded JWT payload, set by JWT auth middleware.


authToken?​

optional authToken?: string

Defined in: service-core/src/http/types.ts:61

Raw JWT token string, set by JWT auth middleware.


body​

body: any

Defined in: service-core/src/http/types.ts:20


bodyStream?​

optional bodyStream?: Readable

Defined in: service-core/src/http/types.ts:40

The raw request body as a Node Readable stream, populated instead of body/rawBody for a route registered with { streamingBody: true } (see HttpRouteOptions) — e.g. via the @StreamingBody() decorator. undefined for every ordinary route, where body/rawBody are populated as before.

The stream yields Buffer chunks and supports for await (const chunk of req.bodyStream) as well as .pipe(). Backpressure is enforced end-to-end by both adapters — a slow consumer throttles how fast bytes are read off the underlying connection rather than buffering unbounded data in memory — which is the entire point of opting into streaming (e.g. a multi-GB file upload). The stream is destroyed (with an error) if the client disconnects mid-upload; a handler consuming it via for await sees that as a thrown error and should clean up (e.g. delete a partially-written temp file) in a catch/finally.

A streaming route does NOT get the framework's default maxBodySize enforcement — that check only runs as part of the ordinary buffering path. The handler is responsible for enforcing whatever size limit makes sense for the route itself.


cookies​

cookies: Record<string, string>

Defined in: service-core/src/http/types.ts:41


headers​

headers: Record<string, string | string[] | undefined>

Defined in: service-core/src/http/types.ts:17


method​

method: string

Defined in: service-core/src/http/types.ts:14


params​

params: Record<string, string>

Defined in: service-core/src/http/types.ts:18


path​

path: string

Defined in: service-core/src/http/types.ts:15


query​

query: Record<string, string | string[]>

Defined in: service-core/src/http/types.ts:19


rawBody?​

optional rawBody?: Buffer<ArrayBufferLike>

Defined in: service-core/src/http/types.ts:21


routePattern?​

optional routePattern?: string

Defined in: service-core/src/http/types.ts:68

The registered route pattern that matched this request (e.g. /items/:id), set by the router before any middleware runs. undefined when no application route matched, i.e. the request is handled by the router's own not-found or CORS preflight fallback. Unlike path, the set of possible values is bounded by the application's routes, so it is safe to use as a metrics label.


session?​

optional session?: Record<string, any>

Defined in: service-core/src/http/types.ts:47

Populated by the optional session middleware (see SessionManager). Undefined when no session middleware is registered (i.e. the session config block is absent).


sessionIsNew?​

optional sessionIsNew?: boolean

Defined in: service-core/src/http/types.ts:53

Set by the session middleware. true when session is not backed by a stored session yet (the request carried no valid session cookie): nothing is stored and no cookie is sent unless a handler writes to session. Bookkeeping-only writes (last access time, IP address, ...) should be skipped while this is true.


signedCookies​

signedCookies: Record<string, string>

Defined in: service-core/src/http/types.ts:42


socket​

socket: object

Defined in: service-core/src/http/types.ts:55

Minimal socket interface; populated with remote address for IP extraction.

remoteAddress?​

optional remoteAddress?: string


url​

url: string

Defined in: service-core/src/http/types.ts:16


user?​

optional user?: JWTUser

Defined in: service-core/src/http/types.ts:57

Set by JWT auth middleware after successful token verification.