@fluojs/http 1.1.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +28 -8
- package/README.md +28 -8
- package/dist/context/request-context.d.ts +5 -3
- package/dist/context/request-context.d.ts.map +1 -1
- package/dist/context/request-context.js +61 -17
- package/dist/dispatch/dispatch-response-policy.d.ts +5 -4
- package/dist/dispatch/dispatch-response-policy.d.ts.map +1 -1
- package/dist/dispatch/dispatch-response-policy.js +58 -16
- package/dist/dispatch/dispatcher.d.ts.map +1 -1
- package/dist/dispatch/dispatcher.js +43 -11
- package/dist/dispatch/fast-path/fast-path-executor.d.ts +13 -0
- package/dist/dispatch/fast-path/fast-path-executor.d.ts.map +1 -1
- package/dist/dispatch/fast-path/fast-path-executor.js +15 -1
- package/dist/middleware/cors.d.ts.map +1 -1
- package/dist/middleware/cors.js +3 -1
- package/dist/types.d.ts +16 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -0
- package/package.json +4 -4
package/README.ko.md
CHANGED
|
@@ -41,6 +41,11 @@ class CreateUserDto {
|
|
|
41
41
|
name!: string;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
class FindUserParamsDto {
|
|
45
|
+
@FromPath('id')
|
|
46
|
+
id!: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
44
49
|
@Controller('/users')
|
|
45
50
|
export class UserController {
|
|
46
51
|
@Post('/')
|
|
@@ -50,8 +55,9 @@ export class UserController {
|
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
@Get('/:id')
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
@RequestDto(FindUserParamsDto)
|
|
59
|
+
getById(input: FindUserParamsDto) {
|
|
60
|
+
return { id: input.id, name: 'John Doe' };
|
|
55
61
|
}
|
|
56
62
|
}
|
|
57
63
|
```
|
|
@@ -67,6 +73,12 @@ export class UserController {
|
|
|
67
73
|
|
|
68
74
|
라우트 데코레이터는 `*`, `?`, `/(.*)`, `user-:id`, `:id.json` 같은 wildcard, regex 유사 문법, mixed segment를 지원하지 않습니다. 와일드카드 매칭은 계속 `forRoutes('/users/*')` 같은 미들웨어 설정에서만 지원됩니다.
|
|
69
75
|
|
|
76
|
+
Catch-all route grammar는 의도적으로 도입이 유예된 상태입니다.
|
|
77
|
+
[HTTP catch-all route grammar 결정](../../docs/architecture/http-catch-all-route-grammar.ko.md)은 검토한
|
|
78
|
+
syntax, provisional precedence 및 params shape, OpenAPI 제한, adapter native fast-path 제약, 이 HTTP
|
|
79
|
+
contract를 재검토하기 전에 필요한 evidence를 기록합니다. 해당 문서의 syntax는 현재 활성 route behavior가
|
|
80
|
+
아닙니다.
|
|
81
|
+
|
|
70
82
|
## 주요 패턴
|
|
71
83
|
|
|
72
84
|
### 가드와 인터셉터
|
|
@@ -96,7 +108,7 @@ function someDeepHelper() {
|
|
|
96
108
|
}
|
|
97
109
|
```
|
|
98
110
|
|
|
99
|
-
`runWithRequestContext(...)`는 호스트가 `globalThis.AsyncLocalStorage` 또는 Node 내장 `node:async_hooks` 모듈로 `AsyncLocalStorage`를 제공할 때 활성 컨텍스트를 `await` 이후까지 보존합니다. 루트 `@fluojs/http` import는 async-context storage를 probe하거나 instantiate하지 않습니다. Helper가 처음 사용될 때 storage를 lazy하게 해석하고, `process.getBuiltinModule(...)` 실패를 guard하며,
|
|
111
|
+
`runWithRequestContext(...)`는 호스트가 `globalThis.AsyncLocalStorage` 또는 Node 내장 `node:async_hooks` 모듈로 `AsyncLocalStorage`를 제공할 때 활성 컨텍스트를 `await` 이후까지 보존합니다. 루트 `@fluojs/http` import는 async-context storage를 probe하거나 instantiate하지 않습니다. Helper가 처음 사용될 때 storage를 lazy하게 해석하고, `process.getBuiltinModule(...)` 실패를 guard하며, Node async storage 해석이 끝나기 전에 등록된 promise continuation도 격리하면서 첫 호출의 동기 callback 반환 및 throw 동작은 그대로 유지합니다. 비동기 컨텍스트 primitive가 없는 비 Node 호스트에서는 동기 stack fallback을 사용하며, 겹치는 비동기 요청이 서로의 컨텍스트를 관찰하지 않도록 awaited continuation이 재개되기 전에 컨텍스트를 비웁니다.
|
|
100
112
|
|
|
101
113
|
### 프록시 뒤의 속도 제한
|
|
102
114
|
|
|
@@ -121,7 +133,9 @@ export class OrdersEventsController {
|
|
|
121
133
|
}
|
|
122
134
|
```
|
|
123
135
|
|
|
124
|
-
`@Sse(path)`는 `GET` 라우트를 등록하고 `text/event-stream` produced media type metadata를 선언합니다. Handler는 수동 stream 제어가 필요하면 `SseResponse`를 반환할 수 있고, managed streaming이 필요하면 `AsyncIterable<SseMessage<T> | T>`를 반환할 수 있습니다. Managed async iterable은 `SseResponse`와 같은 `encodeSseMessage(...)` 동작으로 변환됩니다. 일반 yield 값은 `data:` frame이 되고, `data` 필드가 있는 객체는 `event`, `id`, `retry`도 함께 제공할 수 있습니다. Dispatcher는 `RequestContext.request.signal`이 abort되거나 response stream이 닫히면 source 소비를 중단하고, write가 backpressure를 보고하면 `FrameworkResponseStream.waitForDrain()`을 기다리며, 완료 또는 source error 시 stream을
|
|
136
|
+
`@Sse(path)`는 `GET` 라우트를 등록하고 `text/event-stream` produced media type metadata를 선언합니다. Handler는 수동 stream 제어가 필요하면 `SseResponse`를 반환할 수 있고, managed streaming이 필요하면 `AsyncIterable<SseMessage<T> | T>`를 반환할 수 있습니다. Managed async iterable은 `SseResponse`와 같은 `encodeSseMessage(...)` 동작으로 변환됩니다. 일반 yield 값은 `data:` frame이 되고, `data` 필드가 있는 객체는 `event`, `id`, `retry`도 함께 제공할 수 있습니다. Dispatcher는 `RequestContext.request.signal`이 abort되거나 response stream이 닫히면 source 소비를 중단하고, write가 backpressure를 보고하면 `FrameworkResponseStream.waitForDrain()`을 기다리며, 완료 또는 source error 시 stream을 닫습니다. 취소 시에는 response stream을 즉시 닫고 request-scoped resource를 dispose하기 전에 source iterator의 `return()` cleanup을 기다립니다. Cleanup 실패는 이미 commit된 SSE response를 대체하지 않고 request observer와 dispatcher logger seam으로 보고됩니다. Source에서 던진 오류도 같은 committed-response error/observer 경계를 따릅니다. Observable 값은 계속 범위 밖이며 RxJS dependency는 필요하지 않습니다.
|
|
137
|
+
|
|
138
|
+
Managed SSE는 `FrameworkResponse.stream`을 노출하는 adapter가 필요합니다. 활성 adapter가 response stream을 제공하지 않으면 dispatcher는 response를 처리된 것으로 표시하기 전에 managed async iterable을 거부하고, stream이 처리된 것으로 조용히 보고하는 대신 표준 dispatch error 경로(request error observer와 구성된 error response writer)를 통해 실패를 전달합니다.
|
|
125
139
|
|
|
126
140
|
브라우저 쪽에서는 해당 연결을 소유하는 React effect 안에서 `EventSource`를 만들고 cleanup 함수에서 항상 닫아야 합니다. 그래야 route 변경, Strict Mode remount, component unmount가 중복 stream을 남기지 않습니다.
|
|
127
141
|
|
|
@@ -180,17 +194,23 @@ Fluo의 HTTP 데코레이터는 TC39 표준 데코레이터이며, runtime 또
|
|
|
180
194
|
|
|
181
195
|
디스패처는 활성 dispatch 동안에만 호스트 비동기 컨텍스트 저장소로 `RequestContext`를 바인딩합니다. 지원되는 Node 20+ 런타임을 포함해 `AsyncLocalStorage`가 있는 호스트에서는 컨텍스트가 awaited work 이후까지 유지됩니다. 비동기 컨텍스트 primitive가 없는 비 Node 호스트에서는 fallback 컨텍스트가 동기 프레임에만 유효하고, 겹치는 요청이 서로의 컨텍스트를 관찰하지 않도록 `await` 이후에는 의도적으로 사용할 수 없습니다. 요청이 controller graph, middleware, guard, interceptor, observer, DTO converter, custom binder 또는 수동 `getCurrentRequestContext()` / `assertRequestContext()` container 접근을 통해 request-scoped DI를 사용할 수 있으면, 디스패처는 요청 observer가 끝난 뒤 `finally` 경로에서 isolated request-scoped DI 컨테이너를 생성하고 dispose합니다. Singleton-only route는 `RequestContext.container`가 접근되기 전까지 이 컨테이너 lifecycle을 건너뛰어 baseline 경로의 불필요한 per-request allocation을 피하면서도, graph가 모호하거나 request-scoped이면 request-scoped provider isolation을 유지합니다. 따라서 공개 `RequestContext.container` 읽기는 request-scoped provider resolve에 항상 안전합니다. singleton-only fast path는 내부 dispatcher 최적화일 뿐, 공개 context가 root container를 노출한다는 약속이 아닙니다.
|
|
182
196
|
|
|
183
|
-
어댑터는 플랫폼이 제공한다면 `FrameworkRequest.signal`에 `AbortSignal`을
|
|
197
|
+
어댑터는 플랫폼이 제공한다면 `FrameworkRequest.signal`에 `AbortSignal`을 전달하고, signal allocation이 실용적이지 않다면 `isAborted()` probe를 제공해야 합니다. Dispatcher는 per-dispatch request clone에 두 abort surface를 모두 보존하고 handler 작업 전후에 검사하므로 `AbortSignal`이 없는 어댑터도 abandon된 요청을 중단할 수 있습니다. SSE에서는 가능하면 `FrameworkResponse.stream.onClose(...)`도 노출해야 합니다. `SseResponse`는 request abort와 raw stream close를 모두 구독하고, 멱등하게 닫히며, 어느 쪽이 먼저 종료되더라도 등록한 listener를 제거합니다.
|
|
198
|
+
|
|
199
|
+
Multipart upload를 parse하는 어댑터는 shared HTTP contract를 adapter-specific file type으로 augment하지 말고 runtime-neutral `FrameworkRequestFile` 값을 `FrameworkRequest.files`에 붙여야 합니다. 이 seam은 모든 HTTP adapter가 제공할 수 있는 portable field(`fieldname`, `originalname`, `mimetype`, `buffer`, `size`)만 의도적으로 모델링합니다. Platform package는 더 풍부한 native file object를 raw request surface에 유지할 수 있지만, guard, binder, middleware, interceptor, controller가 cross-runtime 동작을 필요로 하면 `RequestContext.request.files`를 통해 파일을 읽어야 합니다.
|
|
200
|
+
|
|
201
|
+
응답 content negotiation formatter는 `ResponseFormatter.format(...)`에서 `string` 또는 `Uint8Array`를 반환해야 합니다. Node.js `Buffer` 값은 `Buffer`가 `Uint8Array`를 구현하므로 계속 할당 가능하지만, formatter contract는 runtime-neutral byte 동작에만 의존해야 합니다.
|
|
184
202
|
|
|
185
203
|
## 공개 API
|
|
186
204
|
|
|
187
205
|
- **라우팅 데코레이터**: `Controller`, `Get`, `Sse`, `Post`, `Put`, `Patch`, `Delete`, `All`, `Options`, `Head`
|
|
188
206
|
- **바인딩 데코레이터**: `FromBody`, `FromQuery`, `FromPath`, `FromHeader`, `FromCookie`, `RequestDto`, `Optional`, `Convert`
|
|
189
207
|
- **실행 데코레이터**: `UseGuards`, `UseInterceptors`, `HttpCode`, `Version`, `Header`, `Redirect`, `Produces`
|
|
190
|
-
-
|
|
191
|
-
-
|
|
208
|
+
- **요청/응답 및 컨텍스트 타입**: `RequestContext`, `Principal`, `ContextKey`, `ControllerHandler`, `FrameworkRequest`, `FrameworkRequestFile`, `FrameworkResponse`, `FrameworkResponseStream`, `FrameworkResponseCompression`, `FrameworkResponseCompressionWriteOptions`, `SseResponse`, `SseMessage`
|
|
209
|
+
- **디스패처, 라우팅, 협상 타입**: `Dispatcher`, `CreateDispatcherOptions`, `ErrorHandler`, `DispatcherLogger`, `HandlerMapping`, `HandlerDescriptor`, `HandlerMatch`, `HandlerSource`, `RouteDefinition`, `HttpMethod`, `VersioningType`, `VersioningOptions`, `VersioningExtractor`, `VersioningExtractorResult`, `ContentNegotiationOptions`, `ResponseFormatter`, `FastPathEligibility`, `FastPathStats`
|
|
210
|
+
- **파이프라인 계약 타입**: `Middleware`, `MiddlewareLike`, `MiddlewareContext`, `MiddlewareRouteConfig`, `Next`, `Guard`, `GuardLike`, `GuardContext`, `Interceptor`, `InterceptorLike`, `InterceptorContext`, `CallHandler`, `RequestObserver`, `RequestObserverLike`, `RequestObservationContext`, `ArgumentResolverContext`, `Binder`, `Converter`, `ConverterLike`, `ConverterTarget`, `ValidationIssue`, `Validator`
|
|
211
|
+
- **Adapter API**: `HttpApplicationAdapter`, `HttpAdapterRealtimeCapability`, `ServerBackedHttpAdapterRealtimeCapability`, `FetchStyleHttpAdapterRealtimeCapability`, `UnsupportedHttpAdapterRealtimeCapability`, `createNoopHttpApplicationAdapter`, `createServerBackedHttpAdapterRealtimeCapability`, `createUnsupportedHttpAdapterRealtimeCapability`, `createFetchStyleHttpAdapterRealtimeCapability`
|
|
192
212
|
- **예외와 오류**: `HttpException`, `BadRequestException`, `UnauthorizedException`, `ForbiddenException`, `NotFoundException`, `ConflictException`, `NotAcceptableException`, `TooManyRequestsException`, `InternalServerErrorException`, `PayloadTooLargeException`, `createErrorResponse`, `RouteConflictError`, `InvalidRoutePathError`, `HandlerNotFoundError`, `RequestAbortedError`
|
|
193
|
-
- **헬퍼**: `createHandlerMapping`, `createDispatcher`, `forRoutes`, `normalizeRoutePattern`, `matchRoutePattern`, `isMiddlewareRouteConfig`, `createCorrelationMiddleware`, `createCorsMiddleware`, `createRateLimitMiddleware`, `createMemoryRateLimitStore`, `createSecurityHeadersMiddleware`, `runWithRequestContext`, `getCurrentRequestContext`, `assertRequestContext`, `createRequestContext`, `createContextKey`, `getContextValue`, `setContextValue`, `encodeSseComment`, `encodeSseMessage`, `isSseMessage`
|
|
213
|
+
- **헬퍼**: `createHandlerMapping`, `createDispatcher`, `forRoutes`, `normalizeRoutePattern`, `matchRoutePattern`, `isMiddlewareRouteConfig`, `createCorrelationMiddleware`, `createCorsMiddleware`, `createRateLimitMiddleware`, `createMemoryRateLimitStore`, `createSecurityHeadersMiddleware`, `runWithRequestContext`, `getCurrentRequestContext`, `assertRequestContext`, `createRequestContext`, `createContextKey`, `getContextValue`, `setContextValue`, `encodeSseComment`, `encodeSseMessage`, `isSseMessage`, `formatFastPathStats`, `getDispatcherFastPathStats`, `FAST_PATH_ELIGIBILITY_SYMBOL`, `FAST_PATH_STATS_SYMBOL`
|
|
194
214
|
- **Option 및 store type**: `CorsOptions`, `RateLimitOptions`, `RateLimitStore`, `RateLimitStoreEntry`, `SecurityHeadersOptions`, `SseSendOptions`
|
|
195
215
|
|
|
196
216
|
## 내부 서브경로 (`@fluojs/http/internal`)
|
package/README.md
CHANGED
|
@@ -43,6 +43,11 @@ class CreateUserDto {
|
|
|
43
43
|
name!: string;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
class FindUserParamsDto {
|
|
47
|
+
@FromPath('id')
|
|
48
|
+
id!: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
46
51
|
@Controller('/users')
|
|
47
52
|
export class UserController {
|
|
48
53
|
@Post('/')
|
|
@@ -52,8 +57,9 @@ export class UserController {
|
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
@Get('/:id')
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
@RequestDto(FindUserParamsDto)
|
|
61
|
+
getById(input: FindUserParamsDto) {
|
|
62
|
+
return { id: input.id, name: 'John Doe' };
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
65
|
```
|
|
@@ -69,6 +75,12 @@ Trailing slashes and duplicate slashes are normalized during route mapping, so `
|
|
|
69
75
|
|
|
70
76
|
Route decorators do **not** support wildcard, regex-like, or mixed-segment syntax such as `*`, `?`, `/(.*)`, `user-:id`, or `:id.json`. Wildcard matching remains middleware-only via `forRoutes('/users/*')`.
|
|
71
77
|
|
|
78
|
+
Catch-all route grammar is intentionally deferred. The
|
|
79
|
+
[HTTP catch-all route grammar decision](../../docs/architecture/http-catch-all-route-grammar.md)
|
|
80
|
+
records the evaluated syntaxes, provisional precedence and params shape, OpenAPI limitations,
|
|
81
|
+
adapter native fast-path constraints, and the evidence required before this HTTP contract can be
|
|
82
|
+
revisited. No syntax described there is active route behavior.
|
|
83
|
+
|
|
72
84
|
## Common Patterns
|
|
73
85
|
|
|
74
86
|
### Guards and interceptors
|
|
@@ -98,7 +110,7 @@ function someDeepHelper() {
|
|
|
98
110
|
}
|
|
99
111
|
```
|
|
100
112
|
|
|
101
|
-
`runWithRequestContext(...)` preserves the active context across awaited work when the host provides `AsyncLocalStorage` through `globalThis.AsyncLocalStorage` or Node's built-in `node:async_hooks` module. The root `@fluojs/http` import does not probe or instantiate async-context storage; helpers resolve storage lazily on first use, guard `process.getBuiltinModule(...)` failures, and
|
|
113
|
+
`runWithRequestContext(...)` preserves the active context across awaited work when the host provides `AsyncLocalStorage` through `globalThis.AsyncLocalStorage` or Node's built-in `node:async_hooks` module. The root `@fluojs/http` import does not probe or instantiate async-context storage; helpers resolve storage lazily on first use, guard `process.getBuiltinModule(...)` failures, and keep the first-call synchronous callback return and throw behavior unchanged while isolating promise continuations registered before Node async storage finishes resolving. Non-Node hosts without an async-context primitive use a synchronous stack fallback that clears the context before awaited continuations resume, avoiding cross-request leaks instead of pretending to isolate overlapping async work.
|
|
102
114
|
|
|
103
115
|
### Rate limiting behind proxies
|
|
104
116
|
|
|
@@ -123,7 +135,9 @@ export class OrdersEventsController {
|
|
|
123
135
|
}
|
|
124
136
|
```
|
|
125
137
|
|
|
126
|
-
`@Sse(path)` registers a `GET` route and declares `text/event-stream` produced media type metadata. Handlers may either return `SseResponse` for manual stream control or return `AsyncIterable<SseMessage<T> | T>` for managed streaming. Managed async iterables are converted with the same `encodeSseMessage(...)` behavior as `SseResponse`: plain yielded values become `data:` frames, while yielded objects with a `data` field may also provide `event`, `id`, and `retry`. The dispatcher stops consuming the source when `RequestContext.request.signal` aborts or the response stream closes, calls `FrameworkResponseStream.waitForDrain()` when a write reports backpressure, closes the stream on completion or source errors, and
|
|
138
|
+
`@Sse(path)` registers a `GET` route and declares `text/event-stream` produced media type metadata. Handlers may either return `SseResponse` for manual stream control or return `AsyncIterable<SseMessage<T> | T>` for managed streaming. Managed async iterables are converted with the same `encodeSseMessage(...)` behavior as `SseResponse`: plain yielded values become `data:` frames, while yielded objects with a `data` field may also provide `event`, `id`, and `retry`. The dispatcher stops consuming the source when `RequestContext.request.signal` aborts or the response stream closes, calls `FrameworkResponseStream.waitForDrain()` when a write reports backpressure, and closes the stream on completion or source errors. On cancellation, it closes the response stream promptly and awaits the source iterator's `return()` cleanup before disposing request-scoped resources. Cleanup failures are reported through the request observer and dispatcher logger seams without replacing the already-committed SSE response. Thrown source errors follow the same committed-response error/observer boundary. Observable values remain out of scope and no RxJS dependency is required.
|
|
139
|
+
|
|
140
|
+
Managed SSE requires an adapter that exposes `FrameworkResponse.stream`. When the active adapter does not provide a response stream, the dispatcher rejects the managed async iterable before marking the response handled and surfaces the failure through the standard dispatch error path (request error observers and the configured error response writer) instead of silently reporting the stream as handled.
|
|
127
141
|
|
|
128
142
|
On the browser side, create the `EventSource` inside the React effect that owns it and always close it from the cleanup function so route changes, Strict Mode remounts, and component unmounts do not leave duplicate streams open:
|
|
129
143
|
|
|
@@ -182,17 +196,23 @@ This compatibility path is an execution fallback for Bun bundle output; applicat
|
|
|
182
196
|
|
|
183
197
|
The dispatcher binds `RequestContext` with host async-context storage for the active dispatch only. On hosts with `AsyncLocalStorage`, including supported Node 20+ runtimes, the context remains available across awaited work. On non-Node hosts without an async-context primitive, the fallback context is synchronous-only and intentionally unavailable after `await` so overlapping requests cannot observe one another's context. When a request may use request-scoped DI through its controller graph, middleware, guards, interceptors, observers, DTO converters, a custom binder, or manual `getCurrentRequestContext()` / `assertRequestContext()` container access, the dispatcher creates and disposes an isolated request-scoped DI container from its `finally` path after request observers finish. Singleton-only routes skip that container lifecycle until `RequestContext.container` is accessed, so the baseline path avoids unnecessary per-request allocation while preserving request-scoped provider isolation whenever the graph is ambiguous or request-scoped. Public `RequestContext.container` reads are therefore always safe for resolving request-scoped providers; the singleton-only fast path is an internal dispatcher optimization, not a promise that the public context exposes the root container.
|
|
184
198
|
|
|
185
|
-
Adapters should pass an `AbortSignal` on `FrameworkRequest.signal` when the platform exposes one. For SSE, adapters should also expose `FrameworkResponse.stream.onClose(...)` when possible; `SseResponse` listens to both request abort and raw stream close, closes idempotently, and removes registered listeners when either side terminates first.
|
|
199
|
+
Adapters should pass an `AbortSignal` on `FrameworkRequest.signal` when the platform exposes one, or an `isAborted()` probe when allocating a signal is not practical. The dispatcher preserves both abort surfaces on its per-dispatch request clone and checks them before and after handler work so adapters without `AbortSignal` can still stop abandoned requests. For SSE, adapters should also expose `FrameworkResponse.stream.onClose(...)` when possible; `SseResponse` listens to both request abort and raw stream close, closes idempotently, and removes registered listeners when either side terminates first.
|
|
200
|
+
|
|
201
|
+
Adapters that parse multipart uploads should attach runtime-neutral `FrameworkRequestFile` values to `FrameworkRequest.files` rather than augmenting the shared HTTP contract with adapter-specific file types. The seam intentionally models the portable fields every HTTP adapter can provide (`fieldname`, `originalname`, `mimetype`, `buffer`, and `size`); platform packages may keep richer native file objects on their raw request surfaces, but guards, binders, middleware, interceptors, and controllers should read files through `RequestContext.request.files` when they need cross-runtime behavior.
|
|
202
|
+
|
|
203
|
+
Response content negotiation formatters must return `string` or `Uint8Array` from `ResponseFormatter.format(...)`. Node.js `Buffer` values remain assignable because `Buffer` implements `Uint8Array`, but formatter contracts should rely only on runtime-neutral byte behavior.
|
|
186
204
|
|
|
187
205
|
## Public API
|
|
188
206
|
|
|
189
207
|
- **Routing decorators**: `Controller`, `Get`, `Sse`, `Post`, `Put`, `Patch`, `Delete`, `All`, `Options`, `Head`
|
|
190
208
|
- **Binding decorators**: `FromBody`, `FromQuery`, `FromPath`, `FromHeader`, `FromCookie`, `RequestDto`, `Optional`, `Convert`
|
|
191
209
|
- **Execution decorators**: `UseGuards`, `UseInterceptors`, `HttpCode`, `Version`, `Header`, `Redirect`, `Produces`
|
|
192
|
-
- **
|
|
193
|
-
- **
|
|
210
|
+
- **Request/response and context types**: `RequestContext`, `Principal`, `ContextKey`, `ControllerHandler`, `FrameworkRequest`, `FrameworkRequestFile`, `FrameworkResponse`, `FrameworkResponseStream`, `FrameworkResponseCompression`, `FrameworkResponseCompressionWriteOptions`, `SseResponse`, `SseMessage`
|
|
211
|
+
- **Dispatcher, routing, and negotiation types**: `Dispatcher`, `CreateDispatcherOptions`, `ErrorHandler`, `DispatcherLogger`, `HandlerMapping`, `HandlerDescriptor`, `HandlerMatch`, `HandlerSource`, `RouteDefinition`, `HttpMethod`, `VersioningType`, `VersioningOptions`, `VersioningExtractor`, `VersioningExtractorResult`, `ContentNegotiationOptions`, `ResponseFormatter`, `FastPathEligibility`, `FastPathStats`
|
|
212
|
+
- **Pipeline contract types**: `Middleware`, `MiddlewareLike`, `MiddlewareContext`, `MiddlewareRouteConfig`, `Next`, `Guard`, `GuardLike`, `GuardContext`, `Interceptor`, `InterceptorLike`, `InterceptorContext`, `CallHandler`, `RequestObserver`, `RequestObserverLike`, `RequestObservationContext`, `ArgumentResolverContext`, `Binder`, `Converter`, `ConverterLike`, `ConverterTarget`, `ValidationIssue`, `Validator`
|
|
213
|
+
- **Adapter API**: `HttpApplicationAdapter`, `HttpAdapterRealtimeCapability`, `ServerBackedHttpAdapterRealtimeCapability`, `FetchStyleHttpAdapterRealtimeCapability`, `UnsupportedHttpAdapterRealtimeCapability`, `createNoopHttpApplicationAdapter`, `createServerBackedHttpAdapterRealtimeCapability`, `createUnsupportedHttpAdapterRealtimeCapability`, `createFetchStyleHttpAdapterRealtimeCapability`
|
|
194
214
|
- **Exceptions and errors**: `HttpException`, `BadRequestException`, `UnauthorizedException`, `ForbiddenException`, `NotFoundException`, `ConflictException`, `NotAcceptableException`, `TooManyRequestsException`, `InternalServerErrorException`, `PayloadTooLargeException`, `createErrorResponse`, `RouteConflictError`, `InvalidRoutePathError`, `HandlerNotFoundError`, `RequestAbortedError`
|
|
195
|
-
- **Helpers**: `createHandlerMapping`, `createDispatcher`, `forRoutes`, `normalizeRoutePattern`, `matchRoutePattern`, `isMiddlewareRouteConfig`, `createCorrelationMiddleware`, `createCorsMiddleware`, `createRateLimitMiddleware`, `createMemoryRateLimitStore`, `createSecurityHeadersMiddleware`, `runWithRequestContext`, `getCurrentRequestContext`, `assertRequestContext`, `createRequestContext`, `createContextKey`, `getContextValue`, `setContextValue`, `encodeSseComment`, `encodeSseMessage`, `isSseMessage`
|
|
215
|
+
- **Helpers**: `createHandlerMapping`, `createDispatcher`, `forRoutes`, `normalizeRoutePattern`, `matchRoutePattern`, `isMiddlewareRouteConfig`, `createCorrelationMiddleware`, `createCorsMiddleware`, `createRateLimitMiddleware`, `createMemoryRateLimitStore`, `createSecurityHeadersMiddleware`, `runWithRequestContext`, `getCurrentRequestContext`, `assertRequestContext`, `createRequestContext`, `createContextKey`, `getContextValue`, `setContextValue`, `encodeSseComment`, `encodeSseMessage`, `isSseMessage`, `formatFastPathStats`, `getDispatcherFastPathStats`, `FAST_PATH_ELIGIBILITY_SYMBOL`, `FAST_PATH_STATS_SYMBOL`
|
|
196
216
|
- **Option and store types**: `CorsOptions`, `RateLimitOptions`, `RateLimitStore`, `RateLimitStoreEntry`, `SecurityHeadersOptions`, `SseSendOptions`
|
|
197
217
|
|
|
198
218
|
## Internal Subpath (`@fluojs/http/internal`)
|
|
@@ -2,9 +2,11 @@ import type { ContextKey, RequestContext } from '../types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Runs a callback inside the request-scoped async context.
|
|
4
4
|
*
|
|
5
|
-
* Hosts with `AsyncLocalStorage` preserve the context across awaited work.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Hosts with `AsyncLocalStorage` preserve the context across awaited work. During lazy
|
|
6
|
+
* `AsyncLocalStorage` resolution, promise continuations registered before the store resolves keep
|
|
7
|
+
* their request context until the returned promise settles. Hosts without an async context primitive
|
|
8
|
+
* use a stack fallback that keeps the context only for the synchronous callback frame and clears it
|
|
9
|
+
* before awaited continuations resume.
|
|
8
10
|
*
|
|
9
11
|
* @param context Request context snapshot to bind to the current async execution chain.
|
|
10
12
|
* @param callback Callback executed with `context` available through request-context helpers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/context/request-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/context/request-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAoB9D;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAgBtF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,cAAc,GAAG,SAAS,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CAUrD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAK5E;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAKtE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAE7F;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAE9F"}
|
|
@@ -4,14 +4,17 @@ import { createStackRequestContextStore } from './request-context-stack-store.js
|
|
|
4
4
|
let requestContextStore;
|
|
5
5
|
let requestContextStoreResolution;
|
|
6
6
|
let fallbackRequestContextStore;
|
|
7
|
+
let originalPromiseThen;
|
|
8
|
+
let promiseThenPatchDepth = 0;
|
|
7
9
|
const dynamicResolutionFallbackStack = [];
|
|
8
|
-
|
|
9
10
|
/**
|
|
10
11
|
* Runs a callback inside the request-scoped async context.
|
|
11
12
|
*
|
|
12
|
-
* Hosts with `AsyncLocalStorage` preserve the context across awaited work.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* Hosts with `AsyncLocalStorage` preserve the context across awaited work. During lazy
|
|
14
|
+
* `AsyncLocalStorage` resolution, promise continuations registered before the store resolves keep
|
|
15
|
+
* their request context until the returned promise settles. Hosts without an async context primitive
|
|
16
|
+
* use a stack fallback that keeps the context only for the synchronous callback frame and clears it
|
|
17
|
+
* before awaited continuations resume.
|
|
15
18
|
*
|
|
16
19
|
* @param context Request context snapshot to bind to the current async execution chain.
|
|
17
20
|
* @param callback Callback executed with `context` available through request-context helpers.
|
|
@@ -143,26 +146,33 @@ function getFallbackRequestContextStore() {
|
|
|
143
146
|
}
|
|
144
147
|
function runWithDynamicResolutionFallbackContext(context, callback) {
|
|
145
148
|
dynamicResolutionFallbackStack.push(context);
|
|
149
|
+
installPromiseThenContextBridge();
|
|
150
|
+
let cleanedUp = false;
|
|
151
|
+
const cleanup = () => {
|
|
152
|
+
if (cleanedUp) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
cleanedUp = true;
|
|
156
|
+
removeDynamicResolutionFallbackContext(context);
|
|
157
|
+
restorePromiseThenContextBridge();
|
|
158
|
+
void resolveRequestContextStore();
|
|
159
|
+
};
|
|
146
160
|
try {
|
|
147
161
|
const result = callback();
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
});
|
|
162
|
+
if (isPromise(result)) {
|
|
163
|
+
const then = originalPromiseThen ?? Promise.prototype.then;
|
|
164
|
+
void then.call(result, cleanup, cleanup);
|
|
165
|
+
return result;
|
|
153
166
|
}
|
|
154
|
-
|
|
167
|
+
cleanup();
|
|
155
168
|
return result;
|
|
156
169
|
} catch (error) {
|
|
157
|
-
|
|
170
|
+
cleanup();
|
|
158
171
|
throw error;
|
|
159
172
|
}
|
|
160
173
|
}
|
|
161
174
|
function getDynamicResolutionFallbackContext() {
|
|
162
|
-
|
|
163
|
-
return undefined;
|
|
164
|
-
}
|
|
165
|
-
return dynamicResolutionFallbackStack[0];
|
|
175
|
+
return dynamicResolutionFallbackStack.at(-1);
|
|
166
176
|
}
|
|
167
177
|
function removeDynamicResolutionFallbackContext(context) {
|
|
168
178
|
const index = dynamicResolutionFallbackStack.lastIndexOf(context);
|
|
@@ -170,8 +180,42 @@ function removeDynamicResolutionFallbackContext(context) {
|
|
|
170
180
|
dynamicResolutionFallbackStack.splice(index, 1);
|
|
171
181
|
}
|
|
172
182
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
183
|
+
function installPromiseThenContextBridge() {
|
|
184
|
+
if (promiseThenPatchDepth === 0) {
|
|
185
|
+
originalPromiseThen = Promise.prototype.then;
|
|
186
|
+
Object.defineProperty(Promise.prototype, 'then', {
|
|
187
|
+
configurable: true,
|
|
188
|
+
value: createContextBridgePromiseThen(originalPromiseThen),
|
|
189
|
+
writable: true
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
promiseThenPatchDepth += 1;
|
|
193
|
+
}
|
|
194
|
+
function restorePromiseThenContextBridge() {
|
|
195
|
+
promiseThenPatchDepth -= 1;
|
|
196
|
+
if (promiseThenPatchDepth === 0 && originalPromiseThen) {
|
|
197
|
+
Object.defineProperty(Promise.prototype, 'then', {
|
|
198
|
+
configurable: true,
|
|
199
|
+
value: originalPromiseThen,
|
|
200
|
+
writable: true
|
|
201
|
+
});
|
|
202
|
+
originalPromiseThen = undefined;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function createContextBridgePromiseThen(originalThen) {
|
|
206
|
+
return function contextBridgePromiseThen(onfulfilled, onrejected) {
|
|
207
|
+
const context = getDynamicResolutionFallbackContext();
|
|
208
|
+
return originalThen.call(this, wrapPromiseCallback(context, onfulfilled), wrapPromiseCallback(context, onrejected));
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function wrapPromiseCallback(context, callback) {
|
|
212
|
+
if (!context || typeof callback !== 'function') {
|
|
213
|
+
return callback;
|
|
214
|
+
}
|
|
215
|
+
return value => runWithDynamicResolutionFallbackContext(context, () => callback(value));
|
|
216
|
+
}
|
|
217
|
+
function isPromise(value) {
|
|
218
|
+
return value instanceof Promise;
|
|
175
219
|
}
|
|
176
220
|
function isAsyncCallback(callback) {
|
|
177
221
|
return callback.constructor.name === 'AsyncFunction';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FrameworkRequest, FrameworkResponse, HandlerDescriptor, RequestContext } from '../types.js';
|
|
2
|
+
import { type ResolvedContentNegotiation, resolveContentNegotiation } from './dispatch-content-negotiation.js';
|
|
2
3
|
import { writeErrorResponse } from './dispatch-error-policy.js';
|
|
3
|
-
import type { FrameworkRequest, FrameworkResponse, HandlerDescriptor } from '../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Write success response.
|
|
6
6
|
*
|
|
@@ -9,9 +9,10 @@ import type { FrameworkRequest, FrameworkResponse, HandlerDescriptor } from '../
|
|
|
9
9
|
* @param response The response.
|
|
10
10
|
* @param value The value.
|
|
11
11
|
* @param contentNegotiation The content negotiation.
|
|
12
|
+
* @param requestContext The active request context passed to custom response writers.
|
|
12
13
|
* @returns The write success response result.
|
|
13
14
|
*/
|
|
14
|
-
export declare function writeSuccessResponse(handler: HandlerDescriptor, request: FrameworkRequest, response: FrameworkResponse, value: unknown, contentNegotiation: ResolvedContentNegotiation | undefined): ReturnType<FrameworkResponse['send']> | void;
|
|
15
|
-
export { resolveContentNegotiation, writeErrorResponse };
|
|
15
|
+
export declare function writeSuccessResponse(handler: HandlerDescriptor, request: FrameworkRequest, response: FrameworkResponse, value: unknown, contentNegotiation: ResolvedContentNegotiation | undefined, requestContext: RequestContext): ReturnType<FrameworkResponse['send']> | void;
|
|
16
16
|
export type { ResolvedContentNegotiation };
|
|
17
|
+
export { resolveContentNegotiation, writeErrorResponse };
|
|
17
18
|
//# sourceMappingURL=dispatch-response-policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch-response-policy.d.ts","sourceRoot":"","sources":["../../src/dispatch/dispatch-response-policy.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"dispatch-response-policy.d.ts","sourceRoot":"","sources":["../../src/dispatch/dispatch-response-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EAEf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,0BAA0B,EAC/B,yBAAyB,EAE1B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AA8GhE;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,OAAO,EACd,kBAAkB,EAAE,0BAA0B,GAAG,SAAS,EAC1D,cAAc,EAAE,cAAc,GAC7B,UAAU,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CA+C9C;AAED,YAAY,EAAE,0BAA0B,EAAE,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { resolveContentNegotiation, selectResponseFormatter } from './dispatch-content-negotiation.js';
|
|
2
2
|
import { writeErrorResponse } from './dispatch-error-policy.js';
|
|
3
|
+
const responseWriterKey = Symbol.for('fluo.http.responseWriter');
|
|
3
4
|
function resolveDefaultSuccessStatus(handler, value) {
|
|
4
5
|
switch (handler.route.method) {
|
|
5
6
|
case 'POST':
|
|
@@ -23,6 +24,13 @@ function isSimpleJsonResponseBody(value) {
|
|
|
23
24
|
}
|
|
24
25
|
return typeof value === 'object' && value !== null && Object.getPrototypeOf(value) === Object.prototype;
|
|
25
26
|
}
|
|
27
|
+
function readFrameworkResponseWriter(value) {
|
|
28
|
+
if (typeof value !== 'object' || value === null) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
const writer = Reflect.get(value, responseWriterKey);
|
|
32
|
+
return typeof writer === 'function' ? writer : undefined;
|
|
33
|
+
}
|
|
26
34
|
function isResponseBodyForbidden(status) {
|
|
27
35
|
return status === 204 || status === 205 || status === 304;
|
|
28
36
|
}
|
|
@@ -39,6 +47,25 @@ function readHeader(headers, name) {
|
|
|
39
47
|
function isJsonContentType(contentType) {
|
|
40
48
|
return contentType.toLowerCase().includes('application/json') || contentType.toLowerCase().endsWith('+json');
|
|
41
49
|
}
|
|
50
|
+
function applySuccessResponseMetadata(context) {
|
|
51
|
+
const {
|
|
52
|
+
formatter,
|
|
53
|
+
handler,
|
|
54
|
+
response,
|
|
55
|
+
value
|
|
56
|
+
} = context;
|
|
57
|
+
for (const header of handler.route.headers ?? []) {
|
|
58
|
+
response.setHeader(header.name, header.value);
|
|
59
|
+
}
|
|
60
|
+
if (formatter) {
|
|
61
|
+
response.setHeader('Content-Type', formatter.mediaType);
|
|
62
|
+
}
|
|
63
|
+
if (handler.route.successStatus !== undefined) {
|
|
64
|
+
response.setStatus(handler.route.successStatus);
|
|
65
|
+
} else if (response.statusSet !== true) {
|
|
66
|
+
response.setStatus(resolveDefaultSuccessStatus(handler, value));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
42
69
|
|
|
43
70
|
/**
|
|
44
71
|
* Write success response.
|
|
@@ -48,9 +75,10 @@ function isJsonContentType(contentType) {
|
|
|
48
75
|
* @param response The response.
|
|
49
76
|
* @param value The value.
|
|
50
77
|
* @param contentNegotiation The content negotiation.
|
|
78
|
+
* @param requestContext The active request context passed to custom response writers.
|
|
51
79
|
* @returns The write success response result.
|
|
52
80
|
*/
|
|
53
|
-
export function writeSuccessResponse(handler, request, response, value, contentNegotiation) {
|
|
81
|
+
export function writeSuccessResponse(handler, request, response, value, contentNegotiation, requestContext) {
|
|
54
82
|
if (response.committed) {
|
|
55
83
|
return;
|
|
56
84
|
}
|
|
@@ -62,22 +90,36 @@ export function writeSuccessResponse(handler, request, response, value, contentN
|
|
|
62
90
|
response.redirect(statusCode, url);
|
|
63
91
|
return;
|
|
64
92
|
}
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
93
|
+
const responseWriter = readFrameworkResponseWriter(value);
|
|
94
|
+
if (responseWriter) {
|
|
95
|
+
let successResponseMetadataApplied = false;
|
|
96
|
+
const applyWriterSuccessResponseMetadata = () => {
|
|
97
|
+
if (successResponseMetadataApplied) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
successResponseMetadataApplied = true;
|
|
101
|
+
applySuccessResponseMetadata({
|
|
102
|
+
formatter: undefined,
|
|
103
|
+
handler,
|
|
104
|
+
response,
|
|
105
|
+
value
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
return responseWriter({
|
|
109
|
+
applySuccessResponseMetadata: applyWriterSuccessResponseMetadata,
|
|
110
|
+
handler,
|
|
111
|
+
request,
|
|
112
|
+
requestContext,
|
|
113
|
+
response
|
|
114
|
+
});
|
|
80
115
|
}
|
|
116
|
+
const formatter = contentNegotiation ? selectResponseFormatter(handler, request, contentNegotiation) : undefined;
|
|
117
|
+
applySuccessResponseMetadata({
|
|
118
|
+
formatter,
|
|
119
|
+
handler,
|
|
120
|
+
response,
|
|
121
|
+
value
|
|
122
|
+
});
|
|
81
123
|
if (!formatter && hasSimpleJsonResponseWriter(response) && canUseSimpleJsonFastPath(response, value)) {
|
|
82
124
|
return response.sendSimpleJson(value);
|
|
83
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/dispatch/dispatcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAyB,MAAM,YAAY,CAAC;AAQnE,OAAO,KAAK,EACV,MAAM,EACN,yBAAyB,EACzB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAKjB,cAAc,EAEd,eAAe,EAEf,cAAc,EAId,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAKrB,OAAO,EAKL,KAAK,aAAa,EAOnB,MAAM,sBAAsB,CA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,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,qDAAqD;IACrD,aAAa,EAAE,SAAS,CAAC;IACzB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA++BD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,UAAU,CAuF7E;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,UAAU,GAAG,aAAa,GAAG,SAAS,CAE5F;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -18,6 +18,16 @@ export { FAST_PATH_ELIGIBILITY_SYMBOL, FAST_PATH_STATS_SYMBOL } from './fast-pat
|
|
|
18
18
|
|
|
19
19
|
const EMPTY_NATIVE_FAST_PATH_HANDLER_EXECUTION_PLANS = new WeakMap();
|
|
20
20
|
const EMPTY_NATIVE_FAST_PATH_OBSERVERS = [];
|
|
21
|
+
class ManagedSseCleanupError extends Error {
|
|
22
|
+
cleanupError;
|
|
23
|
+
constructor(cleanupError) {
|
|
24
|
+
super('Managed SSE iterator cleanup failed.', {
|
|
25
|
+
cause: cleanupError
|
|
26
|
+
});
|
|
27
|
+
this.name = 'ManagedSseCleanupError';
|
|
28
|
+
this.cleanupError = cleanupError;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
21
31
|
function logDispatchFailure(logger, message, error) {
|
|
22
32
|
if (logger) {
|
|
23
33
|
logger.error(message, error, 'HttpDispatcher');
|
|
@@ -45,6 +55,7 @@ function createDispatchRequest(request) {
|
|
|
45
55
|
raw: request.raw,
|
|
46
56
|
rawBody: request.rawBody,
|
|
47
57
|
requestId: request.requestId,
|
|
58
|
+
isAborted: request.isAborted,
|
|
48
59
|
signal: request.signal,
|
|
49
60
|
url: request.url
|
|
50
61
|
};
|
|
@@ -344,8 +355,8 @@ function resolveManagedSseFrame(value) {
|
|
|
344
355
|
options: {}
|
|
345
356
|
};
|
|
346
357
|
}
|
|
347
|
-
function
|
|
348
|
-
|
|
358
|
+
async function closeAsyncIterator(iterator) {
|
|
359
|
+
await iterator.return?.();
|
|
349
360
|
}
|
|
350
361
|
async function readManagedSseNext(request, stream, iterator) {
|
|
351
362
|
const abort = createManagedSseStopPromise(request, stream);
|
|
@@ -362,17 +373,23 @@ async function writeManagedSseIterable(handler, requestContext, source) {
|
|
|
362
373
|
if (!isSseRoute(handler)) {
|
|
363
374
|
return false;
|
|
364
375
|
}
|
|
365
|
-
const sse = new SseResponse(requestContext);
|
|
366
376
|
const stream = requestContext.response.stream;
|
|
367
377
|
if (!stream) {
|
|
368
|
-
|
|
378
|
+
throw new Error('Managed SSE requires adapter-provided response.stream support.');
|
|
369
379
|
}
|
|
380
|
+
const sse = new SseResponse(requestContext);
|
|
370
381
|
const iterator = source[Symbol.asyncIterator]();
|
|
382
|
+
let iteratorCleanup;
|
|
383
|
+
let iteratorCleanupFailure;
|
|
371
384
|
try {
|
|
372
|
-
while (
|
|
385
|
+
while (true) {
|
|
386
|
+
if (isRequestAborted(requestContext.request)) {
|
|
387
|
+
iteratorCleanup ??= closeAsyncIterator(iterator);
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
373
390
|
const next = await readManagedSseNext(requestContext.request, stream, iterator);
|
|
374
391
|
if (next === 'aborted') {
|
|
375
|
-
|
|
392
|
+
iteratorCleanup ??= closeAsyncIterator(iterator);
|
|
376
393
|
break;
|
|
377
394
|
}
|
|
378
395
|
if (next.done === true) {
|
|
@@ -386,6 +403,16 @@ async function writeManagedSseIterable(handler, requestContext, source) {
|
|
|
386
403
|
}
|
|
387
404
|
} finally {
|
|
388
405
|
sse.close();
|
|
406
|
+
if (iteratorCleanup) {
|
|
407
|
+
try {
|
|
408
|
+
await iteratorCleanup;
|
|
409
|
+
} catch (error) {
|
|
410
|
+
iteratorCleanupFailure = new ManagedSseCleanupError(error);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
if (iteratorCleanupFailure) {
|
|
415
|
+
throw iteratorCleanupFailure;
|
|
389
416
|
}
|
|
390
417
|
return true;
|
|
391
418
|
}
|
|
@@ -472,7 +499,7 @@ async function dispatchMatchedHandler(handler, executionPlan, requestContext, co
|
|
|
472
499
|
if (isAsyncIterable(result) && (await writeManagedSseIterable(handler, requestContext, result))) {
|
|
473
500
|
// Managed SSE streams are already committed and closed by writeManagedSseIterable.
|
|
474
501
|
} else if (!(result instanceof SseResponse) && !requestContext.response.committed) {
|
|
475
|
-
await writeSuccessResponse(handler, requestContext.request, requestContext.response, result, contentNegotiation);
|
|
502
|
+
await writeSuccessResponse(handler, requestContext.request, requestContext.response, result, contentNegotiation, requestContext);
|
|
476
503
|
}
|
|
477
504
|
await notifyObserversSafely(observers, requestContext, async (observer, context) => {
|
|
478
505
|
await observer.onRequestSuccess?.(context, result);
|
|
@@ -641,15 +668,20 @@ async function runDispatchPipeline(context) {
|
|
|
641
668
|
await runMiddlewareChain(appMiddleware, appMiddlewareContext, dispatchMatchedRoute);
|
|
642
669
|
}
|
|
643
670
|
async function handleDispatchError(context, error) {
|
|
644
|
-
|
|
671
|
+
const managedSseCleanupFailed = error instanceof ManagedSseCleanupError;
|
|
672
|
+
const dispatchError = managedSseCleanupFailed ? error.cleanupError : error;
|
|
673
|
+
if (!managedSseCleanupFailed && (error instanceof RequestAbortedError || isRequestAborted(context.requestContext.request))) {
|
|
645
674
|
return;
|
|
646
675
|
}
|
|
647
|
-
await notifyRequestError(context,
|
|
648
|
-
const handled = await context.options.onError?.(
|
|
676
|
+
await notifyRequestError(context, dispatchError);
|
|
677
|
+
const handled = await context.options.onError?.(dispatchError, context.requestContext.request, context.response, context.requestContext.requestId);
|
|
649
678
|
if (handled) {
|
|
650
679
|
return;
|
|
651
680
|
}
|
|
652
|
-
|
|
681
|
+
if (managedSseCleanupFailed) {
|
|
682
|
+
logDispatchFailure(context.options.logger, 'Managed SSE iterator cleanup threw an error.', dispatchError);
|
|
683
|
+
}
|
|
684
|
+
await writeErrorResponse(dispatchError, context.response, context.requestContext.requestId);
|
|
653
685
|
}
|
|
654
686
|
|
|
655
687
|
/**
|
|
@@ -13,7 +13,20 @@ interface ExecuteFastPathOptions {
|
|
|
13
13
|
requestContext: RequestContext;
|
|
14
14
|
response: FrameworkResponse;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Execute one handler through the compiled fast-path dispatcher plan.
|
|
18
|
+
*
|
|
19
|
+
* @param options Fast-path execution inputs for binding, handler invocation, and response writing.
|
|
20
|
+
* @returns The fast-path execution result, including a fallback error when the route cannot be executed safely.
|
|
21
|
+
*/
|
|
16
22
|
export declare function executeFastPath(options: ExecuteFastPathOptions): Promise<FastPathExecutionResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Determine whether a request may use the precompiled fast-path execution plan.
|
|
25
|
+
*
|
|
26
|
+
* @param eligibility The handler fast-path eligibility state computed during dispatcher setup.
|
|
27
|
+
* @param request The active request whose abort state can disable fast-path execution.
|
|
28
|
+
* @returns `true` when the request can use the fast-path executor.
|
|
29
|
+
*/
|
|
17
30
|
export declare function shouldUseFastPathForRequest(eligibility: {
|
|
18
31
|
executionPath: 'fast' | 'full';
|
|
19
32
|
} | undefined, request: FrameworkRequest): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fast-path-executor.d.ts","sourceRoot":"","sources":["../../../src/dispatch/fast-path/fast-path-executor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAOxD,OAAO,EAAE,KAAK,0BAA0B,EAAwB,MAAM,gCAAgC,CAAC;AACvG,OAAO,KAAK,EACV,MAAM,EACN,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AASxE,UAAU,sBAAsB;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IA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MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,KAAK,OAAO,CAAC;IACnF,OAAO,EAAE,gBAAgB,CAAC;IAC1B,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,uBAAuB,CAAC,CAoDlC;AASD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE;IAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,SAAS,EAC3D,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAWT"}
|
|
@@ -6,6 +6,12 @@ import { RequestAbortedError } from '../../errors.js';
|
|
|
6
6
|
import { writeSuccessResponse } from '../dispatch-response-policy.js';
|
|
7
7
|
const defaultBinder = new DefaultBinder();
|
|
8
8
|
const defaultValidator = new HttpDtoValidationAdapter();
|
|
9
|
+
/**
|
|
10
|
+
* Execute one handler through the compiled fast-path dispatcher plan.
|
|
11
|
+
*
|
|
12
|
+
* @param options Fast-path execution inputs for binding, handler invocation, and response writing.
|
|
13
|
+
* @returns The fast-path execution result, including a fallback error when the route cannot be executed safely.
|
|
14
|
+
*/
|
|
9
15
|
export async function executeFastPath(options) {
|
|
10
16
|
const {
|
|
11
17
|
binder,
|
|
@@ -44,7 +50,7 @@ export async function executeFastPath(options) {
|
|
|
44
50
|
throw new RequestAbortedError();
|
|
45
51
|
}
|
|
46
52
|
if (!(result instanceof SseResponse) && !response.committed) {
|
|
47
|
-
const writeResult = writeSuccessResponse(handler, request, response, result, contentNegotiation);
|
|
53
|
+
const writeResult = writeSuccessResponse(handler, request, response, result, contentNegotiation, requestContext);
|
|
48
54
|
if (isThenable(writeResult)) {
|
|
49
55
|
await writeResult;
|
|
50
56
|
}
|
|
@@ -63,6 +69,14 @@ export async function executeFastPath(options) {
|
|
|
63
69
|
function isThenable(value) {
|
|
64
70
|
return typeof value === 'object' && value !== null && 'then' in value && typeof value.then === 'function';
|
|
65
71
|
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Determine whether a request may use the precompiled fast-path execution plan.
|
|
75
|
+
*
|
|
76
|
+
* @param eligibility The handler fast-path eligibility state computed during dispatcher setup.
|
|
77
|
+
* @param request The active request whose abort state can disable fast-path execution.
|
|
78
|
+
* @returns `true` when the request can use the fast-path executor.
|
|
79
|
+
*/
|
|
66
80
|
export function shouldUseFastPathForRequest(eligibility, request) {
|
|
67
81
|
if (!eligibility) {
|
|
68
82
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../src/middleware/cors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;IACvF,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA4BD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,WAAgB,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../src/middleware/cors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;IACvF,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA4BD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,WAAgB,GAAG,UAAU,CA+D1E"}
|
package/dist/middleware/cors.js
CHANGED
|
@@ -57,7 +57,9 @@ export function createCorsMiddleware(options = {}) {
|
|
|
57
57
|
}
|
|
58
58
|
context.response.setHeader('Vary', varyValues.join(', '));
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
const requestedPreflightMethod = context.request.headers['access-control-request-method'];
|
|
61
|
+
const hasPreflightMethod = Array.isArray(requestedPreflightMethod) ? requestedPreflightMethod.length > 0 : requestedPreflightMethod !== undefined;
|
|
62
|
+
if (context.request.method === 'OPTIONS' && hasPreflightMethod) {
|
|
61
63
|
context.response.setStatus(204);
|
|
62
64
|
await context.response.send(undefined);
|
|
63
65
|
return;
|
package/dist/types.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export interface FrameworkRequest {
|
|
|
26
26
|
cookies: Readonly<Record<string, string | undefined>>;
|
|
27
27
|
params: Readonly<Record<string, string>>;
|
|
28
28
|
body?: unknown;
|
|
29
|
+
/** Adapter-provided multipart files exposed through the runtime-neutral request seam. */
|
|
30
|
+
files?: readonly FrameworkRequestFile[];
|
|
29
31
|
/** Adapter-snapshotted inbound request id used without forcing header normalization. */
|
|
30
32
|
requestId?: string;
|
|
31
33
|
rawBody?: Uint8Array;
|
|
@@ -34,6 +36,19 @@ export interface FrameworkRequest {
|
|
|
34
36
|
isAborted?: () => boolean;
|
|
35
37
|
signal?: AbortSignal;
|
|
36
38
|
}
|
|
39
|
+
/** Runtime-neutral multipart file shape attached by adapters that parse uploads. */
|
|
40
|
+
export interface FrameworkRequestFile {
|
|
41
|
+
/** Multipart form field name that carried this file. */
|
|
42
|
+
fieldname: string;
|
|
43
|
+
/** Client-provided original filename. */
|
|
44
|
+
originalname: string;
|
|
45
|
+
/** Media type reported for the uploaded file. */
|
|
46
|
+
mimetype: string;
|
|
47
|
+
/** Buffered file bytes. */
|
|
48
|
+
buffer: Uint8Array;
|
|
49
|
+
/** File size in bytes. */
|
|
50
|
+
size: number;
|
|
51
|
+
}
|
|
37
52
|
/**
|
|
38
53
|
* Adapter-normalized mutable response facade shared across dispatch stages.
|
|
39
54
|
*
|
|
@@ -75,7 +90,7 @@ export interface FrameworkResponseStream {
|
|
|
75
90
|
/** Serializer used during response content negotiation. */
|
|
76
91
|
export interface ResponseFormatter {
|
|
77
92
|
readonly mediaType: string;
|
|
78
|
-
format(body: unknown): string |
|
|
93
|
+
format(body: unknown): string | Uint8Array;
|
|
79
94
|
}
|
|
80
95
|
/** Response negotiation settings applied to one route or dispatcher instance. */
|
|
81
96
|
export interface ContentNegotiationOptions {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAErE,8EAA8E;AAC9E,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC;AAElG,qFAAqF;AACrF,oBAAY,cAAc;IACxB,GAAG,QAAQ;I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AED,+EAA+E;AAC/E,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,uBAAuB,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;CACjF;AAED,kFAAkF;AAClF,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;CACzE;AAED,qEAAqE;AACrE,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,qBAAqB,CAAC;AACpF,4EAA4E;AAC5E,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7C,kFAAkF;AAClF,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;AAC/D,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -17,6 +17,8 @@ export let VersioningType = /*#__PURE__*/function (VersioningType) {
|
|
|
17
17
|
* request objects.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
+
/** Runtime-neutral multipart file shape attached by adapters that parse uploads. */
|
|
21
|
+
|
|
20
22
|
/**
|
|
21
23
|
* Adapter-normalized mutable response facade shared across dispatch stages.
|
|
22
24
|
*
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"controller",
|
|
11
11
|
"rest"
|
|
12
12
|
],
|
|
13
|
-
"version": "
|
|
13
|
+
"version": "2.0.1",
|
|
14
14
|
"private": false,
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": {
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@fluojs/core": "^1.0
|
|
45
|
-
"@fluojs/validation": "^1.0.
|
|
46
|
-
"@fluojs/di": "^
|
|
44
|
+
"@fluojs/core": "^1.1.0",
|
|
45
|
+
"@fluojs/validation": "^1.0.6",
|
|
46
|
+
"@fluojs/di": "^2.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"vitest": "^3.2.4"
|