Parent Epic: #3436
Goal
Define the public contracts that make a Ts.ED application a native Fetch application while keeping the HTTP core independent from Node.js and framework-specific abstractions.
Scope
- Define the
TsEDFetchApp / Fetch handler contract.
- Define an optional runtime context for capabilities not represented by
Request.
- Revisit
PlatformContext for a Fetch-native HTTP model.
- Use standard Web primitives (
Request, Response, URL, Headers, FormData, ReadableStream, AbortSignal).
- Define request-scoped DI lifecycle around a Fetch request.
- Ensure the public contract does not expose
IncomingMessage, ServerResponse, Koa context, Express request/response, or equivalent wrappers.
Candidate API
interface TsEDFetchApp {
fetch(request: Request, context?: RuntimeContext): Response | Promise<Response>;
}
interface RuntimeContext<Env = unknown, Platform = unknown> {
env?: Env;
platform?: Platform;
waitUntil?(promise: Promise<unknown>): void;
}
The exact API is part of this story and may evolve during implementation.
Acceptance criteria
Parent Epic: #3436
Goal
Define the public contracts that make a Ts.ED application a native Fetch application while keeping the HTTP core independent from Node.js and framework-specific abstractions.
Scope
TsEDFetchApp/ Fetch handler contract.Request.PlatformContextfor a Fetch-native HTTP model.Request,Response,URL,Headers,FormData,ReadableStream,AbortSignal).IncomingMessage,ServerResponse, Koa context, Express request/response, or equivalent wrappers.Candidate API
The exact API is part of this story and may evolve during implementation.
Acceptance criteria
@tsed/platform-fetch.Request.Request.node:httptypes leak into the public Fetch contracts.