@fluojs/http 1.1.2 → 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 +18 -4
- package/README.md +18 -4
- 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 +42 -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
|
@@ -73,6 +73,12 @@ export class UserController {
|
|
|
73
73
|
|
|
74
74
|
라우트 데코레이터는 `*`, `?`, `/(.*)`, `user-:id`, `:id.json` 같은 wildcard, regex 유사 문법, mixed segment를 지원하지 않습니다. 와일드카드 매칭은 계속 `forRoutes('/users/*')` 같은 미들웨어 설정에서만 지원됩니다.
|
|
75
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
|
+
|
|
76
82
|
## 주요 패턴
|
|
77
83
|
|
|
78
84
|
### 가드와 인터셉터
|
|
@@ -127,7 +133,9 @@ export class OrdersEventsController {
|
|
|
127
133
|
}
|
|
128
134
|
```
|
|
129
135
|
|
|
130
|
-
`@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)를 통해 실패를 전달합니다.
|
|
131
139
|
|
|
132
140
|
브라우저 쪽에서는 해당 연결을 소유하는 React effect 안에서 `EventSource`를 만들고 cleanup 함수에서 항상 닫아야 합니다. 그래야 route 변경, Strict Mode remount, component unmount가 중복 stream을 남기지 않습니다.
|
|
133
141
|
|
|
@@ -188,15 +196,21 @@ Fluo의 HTTP 데코레이터는 TC39 표준 데코레이터이며, runtime 또
|
|
|
188
196
|
|
|
189
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를 제거합니다.
|
|
190
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 동작에만 의존해야 합니다.
|
|
202
|
+
|
|
191
203
|
## 공개 API
|
|
192
204
|
|
|
193
205
|
- **라우팅 데코레이터**: `Controller`, `Get`, `Sse`, `Post`, `Put`, `Patch`, `Delete`, `All`, `Options`, `Head`
|
|
194
206
|
- **바인딩 데코레이터**: `FromBody`, `FromQuery`, `FromPath`, `FromHeader`, `FromCookie`, `RequestDto`, `Optional`, `Convert`
|
|
195
207
|
- **실행 데코레이터**: `UseGuards`, `UseInterceptors`, `HttpCode`, `Version`, `Header`, `Redirect`, `Produces`
|
|
196
|
-
-
|
|
197
|
-
-
|
|
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`
|
|
198
212
|
- **예외와 오류**: `HttpException`, `BadRequestException`, `UnauthorizedException`, `ForbiddenException`, `NotFoundException`, `ConflictException`, `NotAcceptableException`, `TooManyRequestsException`, `InternalServerErrorException`, `PayloadTooLargeException`, `createErrorResponse`, `RouteConflictError`, `InvalidRoutePathError`, `HandlerNotFoundError`, `RequestAbortedError`
|
|
199
|
-
- **헬퍼**: `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`
|
|
200
214
|
- **Option 및 store type**: `CorsOptions`, `RateLimitOptions`, `RateLimitStore`, `RateLimitStoreEntry`, `SecurityHeadersOptions`, `SseSendOptions`
|
|
201
215
|
|
|
202
216
|
## 내부 서브경로 (`@fluojs/http/internal`)
|
package/README.md
CHANGED
|
@@ -75,6 +75,12 @@ Trailing slashes and duplicate slashes are normalized during route mapping, so `
|
|
|
75
75
|
|
|
76
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/*')`.
|
|
77
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
|
+
|
|
78
84
|
## Common Patterns
|
|
79
85
|
|
|
80
86
|
### Guards and interceptors
|
|
@@ -129,7 +135,9 @@ export class OrdersEventsController {
|
|
|
129
135
|
}
|
|
130
136
|
```
|
|
131
137
|
|
|
132
|
-
`@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.
|
|
133
141
|
|
|
134
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:
|
|
135
143
|
|
|
@@ -190,15 +198,21 @@ The dispatcher binds `RequestContext` with host async-context storage for the ac
|
|
|
190
198
|
|
|
191
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.
|
|
192
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.
|
|
204
|
+
|
|
193
205
|
## Public API
|
|
194
206
|
|
|
195
207
|
- **Routing decorators**: `Controller`, `Get`, `Sse`, `Post`, `Put`, `Patch`, `Delete`, `All`, `Options`, `Head`
|
|
196
208
|
- **Binding decorators**: `FromBody`, `FromQuery`, `FromPath`, `FromHeader`, `FromCookie`, `RequestDto`, `Optional`, `Convert`
|
|
197
209
|
- **Execution decorators**: `UseGuards`, `UseInterceptors`, `HttpCode`, `Version`, `Header`, `Redirect`, `Produces`
|
|
198
|
-
- **
|
|
199
|
-
- **
|
|
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`
|
|
200
214
|
- **Exceptions and errors**: `HttpException`, `BadRequestException`, `UnauthorizedException`, `ForbiddenException`, `NotFoundException`, `ConflictException`, `NotAcceptableException`, `TooManyRequestsException`, `InternalServerErrorException`, `PayloadTooLargeException`, `createErrorResponse`, `RouteConflictError`, `InvalidRoutePathError`, `HandlerNotFoundError`, `RequestAbortedError`
|
|
201
|
-
- **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`
|
|
202
216
|
- **Option and store types**: `CorsOptions`, `RateLimitOptions`, `RateLimitStore`, `RateLimitStoreEntry`, `SecurityHeadersOptions`, `SseSendOptions`
|
|
203
217
|
|
|
204
218
|
## Internal Subpath (`@fluojs/http/internal`)
|
|
@@ -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,CAAC;AAE9B,YAAY,EAAE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AAgB,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');
|
|
@@ -345,8 +355,8 @@ function resolveManagedSseFrame(value) {
|
|
|
345
355
|
options: {}
|
|
346
356
|
};
|
|
347
357
|
}
|
|
348
|
-
function
|
|
349
|
-
|
|
358
|
+
async function closeAsyncIterator(iterator) {
|
|
359
|
+
await iterator.return?.();
|
|
350
360
|
}
|
|
351
361
|
async function readManagedSseNext(request, stream, iterator) {
|
|
352
362
|
const abort = createManagedSseStopPromise(request, stream);
|
|
@@ -363,17 +373,23 @@ async function writeManagedSseIterable(handler, requestContext, source) {
|
|
|
363
373
|
if (!isSseRoute(handler)) {
|
|
364
374
|
return false;
|
|
365
375
|
}
|
|
366
|
-
const sse = new SseResponse(requestContext);
|
|
367
376
|
const stream = requestContext.response.stream;
|
|
368
377
|
if (!stream) {
|
|
369
|
-
|
|
378
|
+
throw new Error('Managed SSE requires adapter-provided response.stream support.');
|
|
370
379
|
}
|
|
380
|
+
const sse = new SseResponse(requestContext);
|
|
371
381
|
const iterator = source[Symbol.asyncIterator]();
|
|
382
|
+
let iteratorCleanup;
|
|
383
|
+
let iteratorCleanupFailure;
|
|
372
384
|
try {
|
|
373
|
-
while (
|
|
385
|
+
while (true) {
|
|
386
|
+
if (isRequestAborted(requestContext.request)) {
|
|
387
|
+
iteratorCleanup ??= closeAsyncIterator(iterator);
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
374
390
|
const next = await readManagedSseNext(requestContext.request, stream, iterator);
|
|
375
391
|
if (next === 'aborted') {
|
|
376
|
-
|
|
392
|
+
iteratorCleanup ??= closeAsyncIterator(iterator);
|
|
377
393
|
break;
|
|
378
394
|
}
|
|
379
395
|
if (next.done === true) {
|
|
@@ -387,6 +403,16 @@ async function writeManagedSseIterable(handler, requestContext, source) {
|
|
|
387
403
|
}
|
|
388
404
|
} finally {
|
|
389
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;
|
|
390
416
|
}
|
|
391
417
|
return true;
|
|
392
418
|
}
|
|
@@ -473,7 +499,7 @@ async function dispatchMatchedHandler(handler, executionPlan, requestContext, co
|
|
|
473
499
|
if (isAsyncIterable(result) && (await writeManagedSseIterable(handler, requestContext, result))) {
|
|
474
500
|
// Managed SSE streams are already committed and closed by writeManagedSseIterable.
|
|
475
501
|
} else if (!(result instanceof SseResponse) && !requestContext.response.committed) {
|
|
476
|
-
await writeSuccessResponse(handler, requestContext.request, requestContext.response, result, contentNegotiation);
|
|
502
|
+
await writeSuccessResponse(handler, requestContext.request, requestContext.response, result, contentNegotiation, requestContext);
|
|
477
503
|
}
|
|
478
504
|
await notifyObserversSafely(observers, requestContext, async (observer, context) => {
|
|
479
505
|
await observer.onRequestSuccess?.(context, result);
|
|
@@ -642,15 +668,20 @@ async function runDispatchPipeline(context) {
|
|
|
642
668
|
await runMiddlewareChain(appMiddleware, appMiddlewareContext, dispatchMatchedRoute);
|
|
643
669
|
}
|
|
644
670
|
async function handleDispatchError(context, error) {
|
|
645
|
-
|
|
671
|
+
const managedSseCleanupFailed = error instanceof ManagedSseCleanupError;
|
|
672
|
+
const dispatchError = managedSseCleanupFailed ? error.cleanupError : error;
|
|
673
|
+
if (!managedSseCleanupFailed && (error instanceof RequestAbortedError || isRequestAborted(context.requestContext.request))) {
|
|
646
674
|
return;
|
|
647
675
|
}
|
|
648
|
-
await notifyRequestError(context,
|
|
649
|
-
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);
|
|
650
678
|
if (handled) {
|
|
651
679
|
return;
|
|
652
680
|
}
|
|
653
|
-
|
|
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);
|
|
654
685
|
}
|
|
655
686
|
|
|
656
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;IAChB,kBAAkB,CAAC,EAAE,0BAA0B,CAAC;IAChD,mBAAmB,EAAE,qBAAqB,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,cA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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;IACX,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,QAA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M,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"
|