@fluojs/runtime 1.0.0-beta.1 → 1.0.0-beta.10

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.
Files changed (52) hide show
  1. package/README.ko.md +39 -3
  2. package/README.md +39 -3
  3. package/dist/adapters/request-response-factory.d.ts +9 -0
  4. package/dist/adapters/request-response-factory.d.ts.map +1 -1
  5. package/dist/adapters/request-response-factory.js +14 -0
  6. package/dist/bootstrap.d.ts.map +1 -1
  7. package/dist/bootstrap.js +327 -60
  8. package/dist/health/diagnostics.d.ts +38 -0
  9. package/dist/health/diagnostics.d.ts.map +1 -1
  10. package/dist/health/diagnostics.js +48 -0
  11. package/dist/health/health.d.ts +21 -0
  12. package/dist/health/health.d.ts.map +1 -1
  13. package/dist/health/health.js +27 -0
  14. package/dist/index.d.ts +2 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/logging/json-logger.d.ts +5 -0
  18. package/dist/logging/json-logger.d.ts.map +1 -1
  19. package/dist/logging/json-logger.js +6 -0
  20. package/dist/logging/logger.d.ts +26 -1
  21. package/dist/logging/logger.d.ts.map +1 -1
  22. package/dist/logging/logger.js +54 -5
  23. package/dist/module-graph.d.ts +16 -0
  24. package/dist/module-graph.d.ts.map +1 -1
  25. package/dist/module-graph.js +304 -8
  26. package/dist/node/internal-node-compression.d.ts +15 -0
  27. package/dist/node/internal-node-compression.d.ts.map +1 -1
  28. package/dist/node/internal-node-compression.js +16 -0
  29. package/dist/node/internal-node-request.d.ts +128 -0
  30. package/dist/node/internal-node-request.d.ts.map +1 -1
  31. package/dist/node/internal-node-request.js +321 -40
  32. package/dist/node/internal-node-response.d.ts +21 -1
  33. package/dist/node/internal-node-response.d.ts.map +1 -1
  34. package/dist/node/internal-node-response.js +42 -3
  35. package/dist/node/internal-node.d.ts +43 -6
  36. package/dist/node/internal-node.d.ts.map +1 -1
  37. package/dist/node/internal-node.js +65 -9
  38. package/dist/node/node-request.d.ts +1 -1
  39. package/dist/node/node-request.d.ts.map +1 -1
  40. package/dist/node/node-request.js +1 -1
  41. package/dist/platform-shell.d.ts +4 -0
  42. package/dist/platform-shell.d.ts.map +1 -1
  43. package/dist/platform-shell.js +72 -20
  44. package/dist/request-transaction.d.ts +28 -0
  45. package/dist/request-transaction.d.ts.map +1 -1
  46. package/dist/request-transaction.js +33 -0
  47. package/dist/types.d.ts +29 -0
  48. package/dist/types.d.ts.map +1 -1
  49. package/dist/web.d.ts +9 -1
  50. package/dist/web.d.ts.map +1 -1
  51. package/dist/web.js +207 -56
  52. package/package.json +6 -6
package/README.ko.md CHANGED
@@ -27,7 +27,7 @@ npm install @fluojs/runtime
27
27
  - **fluo 애플리케이션 부트스트랩**: 모듈을 실행 중인 HTTP 서버나 마이크로서비스로 변환할 때.
28
28
  - **DI 및 라이프사이클 오케스트레이션**: 모듈 그래프 컴파일, 프로바이더 연결 및 애플리케이션 훅(`onModuleInit`, `onApplicationBootstrap`)을 관리할 때.
29
29
  - **독립형 컨텍스트 생성**: HTTP 서버는 필요 없지만 DI가 필요한 CLI 태스크, 마이그레이션 또는 워커를 실행할 때.
30
- - **진단 및 검사**: 기계 읽기 가능한 형태나 Mermaid 기반의 모듈 그래프 토폴로지를 내보낼 때.
30
+ - **진단 및 검사**: CLI 내보내기와 Studio 소유 그래프 보기/렌더링을 위한 기계 읽기 가능한 플랫폼 snapshot을 생산할 때.
31
31
 
32
32
  ## 퀵 스타트
33
33
 
@@ -123,9 +123,23 @@ class UsersModule {}
123
123
  ## 동작 계약
124
124
 
125
125
  - 요청 바디 파싱은 Web 표준 요청과 Node 기반 요청 모두에서 바이트가 스트리밍되는 동안 `maxBodySize`를 강제합니다.
126
+ - `@fluojs/runtime/node`에서는 Node 요청 바디 파싱 전에 primary `content-type` media type을 normalize한 뒤 JSON 및 멀티파트 여부를 판단하므로, 대소문자가 섞인 JSON/멀티파트 헤더도 문서화된 파서 동작을 그대로 유지합니다.
127
+ - Node 기반 및 Web 표준 요청 wrapper는 바디 파싱 전에 저비용 요청 metadata를 snapshot으로 고정한 뒤 dispatch 경계에서 `body`/`rawBody`를 한 번 materialize하므로 userland는 계속 동기 parsed 값을 관찰합니다.
128
+ - Node 기반 쿠키/쿼리 값과 Web 표준 헤더는 요청 wrapper가 생성되는 시점에 snapshot으로 고정된 뒤 요청별로 lazy하게 normalize되고 memoize됩니다. 이후 upstream 객체가 변경되어도 `FrameworkRequest` view는 바뀌지 않습니다.
129
+ - `ApplicationContext.get()`과 `Application.get()`은 bootstrap 시점에 알려진 직접 root singleton class/factory provider 조회만 memoize하며, alias, request, transient, 종료 이후, multi-provider, `container.override()` 해석 의미는 그대로 유지합니다.
130
+ - `multi: true` provider token은 context cache에 memoize되지 않습니다. 각 `get()` 호출은 DI로 위임되어 컨테이너가 새로운 contribution 배열을 조립하며, 각 contribution 자체는 해당 provider scope에 따라 재사용됩니다.
131
+ - `duplicateProviderPolicy`가 `warn` 또는 `ignore`일 때 context cache 적격성과 lifecycle hook 실행은 bootstrap이 선택한 effective winning provider를 기준으로 결정됩니다. stale losing provider는 cache entry나 lifecycle hook을 만들지 않습니다.
132
+ - 애플리케이션 또는 컨텍스트 bootstrap이 런타임 리소스나 lifecycle instance 생성 이후 실패하면 fluo는 readiness를 초기화하고, 등록된 runtime cleanup callback을 실행하며, 그 시점까지 해석된 instance의 shutdown hook을 `bootstrap-failed`로 호출하고, 컨테이너를 dispose하고, cleanup 실패를 로그로 남긴 뒤 원래 bootstrap error를 다시 던집니다.
133
+ - 연결된 microservice는 부모 `Application`이 소유하는 child입니다. `startAllMicroservices()`는 순차적으로 시작하며 이후 child 시작이 실패하면 이미 시작된 child를 `bootstrap-failed`로 rollback하고, `Application.close(signal)`은 부모 lifecycle hook, adapter 종료, container dispose보다 먼저 연결된 child를 닫습니다.
134
+ - `FluoFactory.createMicroservice()`는 cleanup이 실패해도 원래 bootstrap/runtime 해석 오류를 보존하고 cleanup 실패는 별도로 로그로 남깁니다.
135
+ - Bootstrap은 독립적인 singleton lifecycle provider를 병렬로 해석한 뒤 lifecycle hook은 결정적인 provider 순서대로 실행합니다.
126
136
  - 멀티파트 파싱은 누적 바디 크기가 설정된 `multipart.maxTotalSize`를 넘으면 즉시 거부되며, 런타임 어댑터는 별도 재정의가 없으면 이 한도를 `maxBodySize`와 동일하게 맞춥니다.
137
+ - `createNodeHttpAdapter(...)`, `bootstrapNodeApplication(...)`, `runNodeApplication(...)`는 `maxBodySize`를 0 이상의 정수 바이트 수로만 받으며, 값이 잘못되면 어댑터 생성/부트스트랩 단계에서 즉시 실패합니다.
127
138
  - 응답 스트림 백프레셔 헬퍼는 `drain`, `close`, `error` 중 어느 경우에도 `waitForDrain()`을 완료시켜 끊어진 연결에서 스트리밍 작성기가 멈추지 않도록 합니다.
139
+ - 런타임 health 모듈은 bootstrap이 ready로 표시하기 전까지 `/ready`를 HTTP 503과 `starting`으로 보고하며, 애플리케이션/컨텍스트 종료가 시작되는 즉시, 종료 시도가 실패하더라도 다시 `starting`으로 내려갑니다.
128
140
  - 시그널 기반 종료 헬퍼는 bounded drain semantics를 유지하면서 timeout/실패 상황을 로그와 `process.exitCode`로 보고하지만, 최종 프로세스 종료 소유권은 주변 호스트 런타임에 남겨 둡니다.
141
+ - 플랫폼 snapshot 생산은 런타임에 남아 있고, 그래프 보기와 Mermaid 렌더링은 CLI 및 자동화 호출자가 소비하는 Studio 소유 계약입니다.
142
+ - 모듈 그래프 컴파일 결과 캐시는 `moduleGraphCache: true`를 통한 opt-in입니다. 캐시 항목은 root module identity, runtime provider, validation token, core metadata version, compile algorithm version으로 식별되며, 성공한 컴파일만 저장하고 호출자 mutation이 이후 bootstrap을 오염시키지 않도록 격리된 그래프 복사본을 반환합니다.
129
143
 
130
144
  ## 공개 API 개요
131
145
 
@@ -134,6 +148,7 @@ class UsersModule {}
134
148
  - `Application`: `ApplicationContext`를 확장하며 `listen()`, `dispatch()`, `state`를 포함합니다.
135
149
  - `ApplicationContext`: `get<T>(token)`, `close()` 기능을 제공하며 `container`와 `modules`에 접근할 수 있습니다.
136
150
  - `LifecycleHooks`: `OnModuleInit`, `OnApplicationBootstrap`, `OnModuleDestroy`, `OnApplicationShutdown`를 묶는 편의 union 타입입니다.
151
+ - `createHealthModule(options)`: bootstrap 및 shutdown 라이프사이클 전이에 맞춰 readiness marker를 관리하는 런타임 소유 `/health`, `/ready` 모듈 팩토리입니다.
137
152
  - `defineModule(cls, metadata)`: 프로그래밍 방식의 모듈 정의 헬퍼입니다.
138
153
  - `bootstrapApplication(options)`: 저수준 비동기 부트스트랩 함수입니다.
139
154
 
@@ -160,12 +175,32 @@ import {
160
175
  } from '@fluojs/runtime/node';
161
176
  ```
162
177
 
163
- - `createConsoleApplicationLogger()`: `process.stdout`/`process.stderr`를 사용하는 컬러 콘솔 로거.
178
+ ```typescript
179
+ const adapter = createNodeHttpAdapter({
180
+ port: 3000,
181
+ maxBodySize: 1_048_576,
182
+ });
183
+ ```
184
+
185
+ 공개 Node 런타임 surface에서 `maxBodySize`는 바이트 수를 나타내는 숫자만 허용합니다. `'1mb'` 같은 값은 나중에 암묵 변환되지 않고 어댑터 생성 시점에 즉시 거부됩니다.
186
+
187
+ - `createConsoleApplicationLogger()`: `process.stdout`/`process.stderr`를 사용하는 컬러 콘솔 로거입니다. 기본값은 기존 pretty 형식을 유지합니다. 더 간결한 `[fluo] LEVEL [context] message` 줄을 원하면 `{ mode: 'minimal' }`, 런타임 로거 출력을 숨기려면 `{ mode: 'silent' }`, 낮은 심각도 메시지를 걸러내려면 `{ level: 'warn' }` 같은 threshold, 결정적인 비컬러 출력을 원하면 `{ color: false }`를 전달하세요.
164
188
  - `createJsonApplicationLogger()`: `process.stdout`/`process.stderr`를 사용하는 구조화된 JSON 로거.
165
- - `createNodeHttpAdapter()`: 어댑터 우선 런타임 구성을 위한 raw Node `http`/`https` 어댑터 팩토리.
189
+ - `createNodeHttpAdapter()`: 어댑터 우선 런타임 구성을 위한 raw Node `http`/`https` 어댑터 팩토리입니다. primary Node 요청 `content-type`을 JSON/멀티파트 판별 전에 normalize하며, `maxBodySize`는 숫자 바이트 수만 받습니다.
166
190
  - `bootstrapNodeApplication()` / `runNodeApplication()`: 호환 패키지와 직접 Node 런타임 흐름에서 사용하는 Node 전용 부트스트랩 헬퍼.
167
191
  - `createNodeShutdownSignalRegistration()`, `defaultNodeShutdownSignals()`, `registerShutdownSignals()`: 호스트가 명시적으로 시그널 wiring을 제어할 때 쓰는 종료 등록 헬퍼.
168
192
 
193
+ 런타임 애플리케이션 로깅은 CLI lifecycle reporting과 별개입니다. 애플리케이션/런타임 자체가 내는 로그를 바꾸고 싶을 때 `ApplicationLogger`를 설정하세요:
194
+
195
+ ```typescript
196
+ import { createConsoleApplicationLogger, createJsonApplicationLogger } from '@fluojs/runtime/node';
197
+
198
+ const minimalLogger = createConsoleApplicationLogger({ mode: 'minimal', level: 'warn' });
199
+ const jsonLogger = createJsonApplicationLogger();
200
+ ```
201
+
202
+ 개발 명령의 raw child-process 출력이 필요하면 대신 `fluo dev --verbose` 같은 CLI reporter flag를 사용하세요.
203
+
169
204
  더 저수준의 Node compression internals는 공개 `@fluojs/runtime/node` 계약이 아니라 `@fluojs/runtime/internal-node` seam 뒤에 둡니다.
170
205
 
171
206
  ## 관련 패키지
@@ -174,6 +209,7 @@ import {
174
209
  - [@fluojs/di](../di): 의존성 주입(DI) 컨테이너 구현체.
175
210
  - [@fluojs/http](../http): HTTP 라우팅, 컨트롤러 및 디스패처.
176
211
  - [@fluojs/platform-nodejs](../platform-nodejs): 공식 Node.js HTTP 어댑터.
212
+ - [@fluojs/studio](../studio): 런타임이 생산한 snapshot을 위한 뷰어 및 렌더링 헬퍼.
177
213
 
178
214
  ## 예제 소스
179
215
 
package/README.md CHANGED
@@ -27,7 +27,7 @@ Use this package when you need to:
27
27
  - **Bootstrap a fluo application**: Convert your modules into a running HTTP server or microservice.
28
28
  - **Orchestrate DI and Lifecycle**: Manage module-graph compilation, provider wiring, and application hooks (`onModuleInit`, `onApplicationBootstrap`).
29
29
  - **Create Standalone Contexts**: Run CLI tasks, migrations, or workers that need DI but not an HTTP server.
30
- - **Diagnostic Inspection**: Export machine-readable or Mermaid-based module graph topology.
30
+ - **Diagnostic Inspection**: Produce machine-readable platform snapshots for CLI export and Studio-owned graph viewing/rendering.
31
31
 
32
32
  ## Quick Start
33
33
 
@@ -123,9 +123,23 @@ class UsersModule {}
123
123
  ## Behavioral Contracts
124
124
 
125
125
  - Request body parsing enforces `maxBodySize` while bytes are still streaming for both Web-standard and Node-backed requests.
126
+ - On `@fluojs/runtime/node`, Node request body parsing normalizes the primary `content-type` media type before JSON and multipart detection, so mixed-case JSON and multipart headers preserve the documented parser behavior.
127
+ - Node-backed and Web-standard request wrappers snapshot cheap request metadata before body parsing, then materialize `body`/`rawBody` once at the dispatch boundary so userland continues to observe synchronous parsed values.
128
+ - Node-backed cookies/query values and Web-standard headers are snapshotted when the request wrapper is created, then lazily normalized and memoized per request; later upstream object mutations do not change the `FrameworkRequest` view.
129
+ - `ApplicationContext.get()` and `Application.get()` memoize only direct root singleton class/factory provider lookups known at bootstrap, while preserving alias, request, transient, post-close, multi-provider, and `container.override()` resolution semantics.
130
+ - `multi: true` provider tokens are not context-cache memoized: each `get()` call delegates to DI so the container can assemble a fresh contribution array while still reusing each contribution according to its own provider scope.
131
+ - When `duplicateProviderPolicy` is `warn` or `ignore`, context-cache eligibility and lifecycle hook execution are based on the effective winning provider selected by bootstrap; stale losing providers do not seed cache entries or lifecycle hooks.
132
+ - If application or context bootstrap fails after runtime resources or lifecycle instances have been created, fluo resets readiness, runs registered runtime cleanup callbacks, invokes shutdown hooks for instances resolved so far with `bootstrap-failed`, disposes the container, logs cleanup failures, and rethrows the original bootstrap error.
133
+ - Connected microservices are owned children of their parent `Application`: `startAllMicroservices()` starts them sequentially and rolls back already-started children with `bootstrap-failed` if a later child fails, while `Application.close(signal)` closes connected children before parent lifecycle hooks, adapter shutdown, and container disposal.
134
+ - `FluoFactory.createMicroservice()` preserves the original bootstrap/runtime-resolution error when cleanup fails and logs cleanup failures separately.
135
+ - Bootstrap resolves independent singleton lifecycle providers concurrently, then runs lifecycle hooks in deterministic provider order.
126
136
  - Multipart parsing rejects payloads when the cumulative body size exceeds the configured `multipart.maxTotalSize`; runtime adapters default that limit to `maxBodySize` unless you override it.
137
+ - `createNodeHttpAdapter(...)`, `bootstrapNodeApplication(...)`, and `runNodeApplication(...)` accept `maxBodySize` only as a non-negative integer byte count and fail fast during adapter creation/bootstrap when the value is invalid.
127
138
  - Response stream backpressure helpers settle `waitForDrain()` on `drain`, `close`, or `error` so streaming writers do not hang on dead connections.
139
+ - Runtime health modules report `/ready` as `starting` with HTTP 503 until bootstrap marks them ready, and they return to `starting` as soon as application/context shutdown begins, including failed shutdown attempts.
128
140
  - Signal-driven shutdown helpers preserve bounded drain semantics, log timeout/failure conditions, and set `process.exitCode` when shutdown does not finish cleanly, but they leave final process termination ownership to the surrounding host runtime.
141
+ - Platform snapshot production stays in runtime; graph viewing and Mermaid rendering are Studio-owned contracts consumed by CLI and automation callers.
142
+ - Module graph compile-result caching is opt-in through `moduleGraphCache: true`; it keys entries by root module identity, runtime providers, validation tokens, core metadata versions, and the compile algorithm version, caches only successful compilations, and returns isolated graph copies so caller mutations cannot poison later bootstraps.
129
143
 
130
144
  ## Public API Overview
131
145
 
@@ -134,6 +148,7 @@ class UsersModule {}
134
148
  - `Application`: Extends `ApplicationContext` with `listen()`, `dispatch()`, and `state`.
135
149
  - `ApplicationContext`: Provides `get<T>(token)`, `close()`, and access to `container` and `modules`.
136
150
  - `LifecycleHooks`: Convenience union covering `OnModuleInit`, `OnApplicationBootstrap`, `OnModuleDestroy`, and `OnApplicationShutdown`.
151
+ - `createHealthModule(options)`: Runtime-owned `/health` and `/ready` module factory whose readiness marker follows bootstrap and shutdown lifecycle transitions.
137
152
  - `defineModule(cls, metadata)`: Programmatic module definition helper.
138
153
  - `bootstrapApplication(options)`: Lower-level async bootstrap function.
139
154
 
@@ -160,12 +175,32 @@ import {
160
175
  } from '@fluojs/runtime/node';
161
176
  ```
162
177
 
163
- - `createConsoleApplicationLogger()`: Colorized console logger using `process.stdout`/`process.stderr`.
178
+ ```typescript
179
+ const adapter = createNodeHttpAdapter({
180
+ port: 3000,
181
+ maxBodySize: 1_048_576,
182
+ });
183
+ ```
184
+
185
+ For the public Node runtime surface, `maxBodySize` is a byte-count number only. Values such as `'1mb'` are rejected immediately during adapter creation instead of being coerced later.
186
+
187
+ - `createConsoleApplicationLogger()`: Colorized console logger using `process.stdout`/`process.stderr`. The default remains the historical pretty format. Pass `{ mode: 'minimal' }` for concise `[fluo] LEVEL [context] message` lines, `{ mode: 'silent' }` to suppress runtime logger output, `{ level: 'warn' }` or another threshold to filter lower-severity messages, and `{ color: false }` when you need deterministic non-colored output.
164
188
  - `createJsonApplicationLogger()`: Structured JSON logger using `process.stdout`/`process.stderr`.
165
- - `createNodeHttpAdapter()`: Raw Node `http`/`https` adapter factory for adapter-first runtime setup.
189
+ - `createNodeHttpAdapter()`: Raw Node `http`/`https` adapter factory for adapter-first runtime setup. The helper normalizes the primary Node request `content-type` before JSON/multipart detection and accepts `maxBodySize` only as numeric bytes.
166
190
  - `bootstrapNodeApplication()` / `runNodeApplication()`: Node-specific bootstrap helpers used by compatibility packages and direct Node runtime flows.
167
191
  - `createNodeShutdownSignalRegistration()`, `defaultNodeShutdownSignals()`, `registerShutdownSignals()`: Shutdown registration helpers for hosts that need explicit signal wiring.
168
192
 
193
+ Runtime app logging is separate from CLI lifecycle reporting. Configure `ApplicationLogger` when you want to change logs emitted by the application/runtime itself:
194
+
195
+ ```typescript
196
+ import { createConsoleApplicationLogger, createJsonApplicationLogger } from '@fluojs/runtime/node';
197
+
198
+ const minimalLogger = createConsoleApplicationLogger({ mode: 'minimal', level: 'warn' });
199
+ const jsonLogger = createJsonApplicationLogger();
200
+ ```
201
+
202
+ Use CLI reporter flags such as `fluo dev --verbose` when you need raw child-process output from the development command instead.
203
+
169
204
  Lower-level Node compression internals stay behind the `@fluojs/runtime/internal-node` seam rather than the public `@fluojs/runtime/node` contract.
170
205
 
171
206
  ## Related Packages
@@ -174,6 +209,7 @@ Lower-level Node compression internals stay behind the `@fluojs/runtime/internal
174
209
  - [@fluojs/di](../di): Dependency injection container implementation.
175
210
  - [@fluojs/http](../http): HTTP routing, controllers, and dispatcher.
176
211
  - [@fluojs/platform-nodejs](../platform-nodejs): Official Node.js HTTP adapter.
212
+ - [@fluojs/studio](../studio): Viewer and rendering helpers for runtime-produced snapshots.
177
213
 
178
214
  ## Example Sources
179
215
 
@@ -1,11 +1,14 @@
1
1
  import type { Dispatcher, FrameworkRequest, FrameworkResponse } from '@fluojs/http';
2
+ /** Request/response factory seam used by shared HTTP adapter dispatch helpers. */
2
3
  export interface RequestResponseFactory<RawRequest, RawResponse, Response extends FrameworkResponse = FrameworkResponse> {
3
4
  createRequest(rawRequest: RawRequest, signal: AbortSignal): Promise<FrameworkRequest>;
4
5
  createRequestSignal(rawResponse: RawResponse): AbortSignal;
5
6
  createResponse(rawResponse: RawResponse, rawRequest: RawRequest): Response;
7
+ materializeRequest?(request: FrameworkRequest): Promise<void>;
6
8
  resolveRequestId(rawRequest: RawRequest): string | undefined;
7
9
  writeErrorResponse(error: unknown, response: Response, requestId?: string): Promise<void>;
8
10
  }
11
+ /** Options for dispatching one raw platform request through a request/response factory. */
9
12
  export interface DispatchWithRequestResponseFactoryOptions<RawRequest, RawResponse, Response extends FrameworkResponse = FrameworkResponse> {
10
13
  dispatcher?: Dispatcher;
11
14
  dispatcherNotReadyMessage: string;
@@ -13,5 +16,11 @@ export interface DispatchWithRequestResponseFactoryOptions<RawRequest, RawRespon
13
16
  rawRequest: RawRequest;
14
17
  rawResponse: RawResponse;
15
18
  }
19
+ /**
20
+ * Dispatches one raw platform request through the shared request/response factory lifecycle.
21
+ *
22
+ * @param options - Factory, dispatcher, and raw platform request/response values for one dispatch.
23
+ * @returns The framework response after dispatch, error serialization, or default finalization.
24
+ */
16
25
  export declare function dispatchWithRequestResponseFactory<RawRequest, RawResponse, Response extends FrameworkResponse = FrameworkResponse>({ dispatcher, dispatcherNotReadyMessage, factory, rawRequest, rawResponse, }: DispatchWithRequestResponseFactoryOptions<RawRequest, RawResponse, Response>): Promise<Response>;
17
26
  //# sourceMappingURL=request-response-factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request-response-factory.d.ts","sourceRoot":"","sources":["../../src/adapters/request-response-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEpF,MAAM,WAAW,sBAAsB,CACrC,UAAU,EACV,WAAW,EACX,QAAQ,SAAS,iBAAiB,GAAG,iBAAiB;IAEtD,aAAa,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACtF,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAAC;IAC3D,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC3E,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;IAC7D,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3F;AAED,MAAM,WAAW,yCAAyC,CACxD,UAAU,EACV,WAAW,EACX,QAAQ,SAAS,iBAAiB,GAAG,iBAAiB;IAEtD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,yBAAyB,EAAE,MAAM,CAAC;IAClC,OAAO,EAAE,sBAAsB,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IACnE,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAsB,kCA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,sBAAsB,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IACnE,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAsB,kCAAkC,CACtD,UAAU,EACV,WAAW,EACX,QAAQ,SAAS,iBAAiB,GAAG,iBAAiB,EACtD,EACA,UAAU,EACV,yBAAyB,EACzB,OAAO,EACP,UAAU,EACV,WAAW,GACZ,EAAE,yCAAyC,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CA+BlG"}
@@ -1,3 +1,13 @@
1
+ /** Request/response factory seam used by shared HTTP adapter dispatch helpers. */
2
+
3
+ /** Options for dispatching one raw platform request through a request/response factory. */
4
+
5
+ /**
6
+ * Dispatches one raw platform request through the shared request/response factory lifecycle.
7
+ *
8
+ * @param options - Factory, dispatcher, and raw platform request/response values for one dispatch.
9
+ * @returns The framework response after dispatch, error serialization, or default finalization.
10
+ */
1
11
  export async function dispatchWithRequestResponseFactory({
2
12
  dispatcher,
3
13
  dispatcherNotReadyMessage,
@@ -9,6 +19,10 @@ export async function dispatchWithRequestResponseFactory({
9
19
  const signal = factory.createRequestSignal(rawResponse);
10
20
  try {
11
21
  const frameworkRequest = await factory.createRequest(rawRequest, signal);
22
+ const materializeRequest = factory.materializeRequest;
23
+ if (materializeRequest) {
24
+ await materializeRequest(frameworkRequest);
25
+ }
12
26
  if (!dispatcher) {
13
27
  throw new Error(dispatcherNotReadyMessage);
14
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EAEX,uBAAuB,EAGvB,2BAA2B,EAC3B,sBAAsB,EACtB,eAAe,EAEf,wBAAwB,EACxB,+BAA+B,EAC/B,yBAAyB,EAEzB,gBAAgB,EAChB,U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