@effect/platform 0.57.8 → 0.58.0
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/Cookies/package.json +6 -0
- package/Etag/package.json +6 -0
- package/Headers/package.json +6 -0
- package/HttpApp/package.json +6 -0
- package/HttpBody/package.json +6 -0
- package/HttpClientError/package.json +6 -0
- package/HttpClientRequest/package.json +6 -0
- package/HttpClientResponse/package.json +6 -0
- package/HttpIncomingMessage/package.json +6 -0
- package/HttpMethod/package.json +6 -0
- package/HttpMiddleware/package.json +6 -0
- package/HttpMultiplex/package.json +6 -0
- package/HttpPlatform/package.json +6 -0
- package/HttpRouter/package.json +6 -0
- package/HttpServerError/package.json +6 -0
- package/HttpServerRequest/package.json +6 -0
- package/HttpServerResponse/package.json +6 -0
- package/HttpTraceContext/package.json +6 -0
- package/Multipart/package.json +6 -0
- package/README.md +403 -330
- package/UrlParams/package.json +6 -0
- package/dist/cjs/{Http/Cookies.js → Cookies.js} +6 -6
- package/dist/cjs/Cookies.js.map +1 -0
- package/dist/cjs/{Http/Etag.js → Etag.js} +1 -1
- package/dist/cjs/Etag.js.map +1 -0
- package/dist/cjs/{Http/Headers.js → Headers.js} +2 -2
- package/dist/cjs/Headers.js.map +1 -0
- package/dist/cjs/{Http/App.js → HttpApp.js} +8 -8
- package/dist/cjs/HttpApp.js.map +1 -0
- package/dist/cjs/{Http/Body.js → HttpBody.js} +6 -6
- package/dist/cjs/HttpBody.js.map +1 -0
- package/dist/cjs/HttpClient.js +182 -17
- package/dist/cjs/HttpClient.js.map +1 -1
- package/dist/cjs/{Http/ClientError.js → HttpClientError.js} +2 -2
- package/dist/cjs/{Http/ClientError.js.map → HttpClientError.js.map} +1 -1
- package/dist/cjs/{Http/ClientRequest.js → HttpClientRequest.js} +3 -3
- package/dist/cjs/HttpClientRequest.js.map +1 -0
- package/dist/cjs/{Http/ClientResponse.js → HttpClientResponse.js} +9 -9
- package/dist/cjs/HttpClientResponse.js.map +1 -0
- package/dist/cjs/{Http/IncomingMessage.js → HttpIncomingMessage.js} +4 -4
- package/dist/cjs/{Http/IncomingMessage.js.map → HttpIncomingMessage.js.map} +1 -1
- package/dist/cjs/{Http/Method.js → HttpMethod.js} +1 -1
- package/dist/cjs/HttpMethod.js.map +1 -0
- package/dist/cjs/{Http/Middleware.js → HttpMiddleware.js} +2 -2
- package/dist/cjs/{Http/Middleware.js.map → HttpMiddleware.js.map} +1 -1
- package/dist/cjs/{Http/Multiplex.js → HttpMultiplex.js} +2 -2
- package/dist/cjs/{Http/Multiplex.js.map → HttpMultiplex.js.map} +1 -1
- package/dist/cjs/{Http/Platform.js → HttpPlatform.js} +4 -4
- package/dist/cjs/HttpPlatform.js.map +1 -0
- package/dist/cjs/{Http/Router.js → HttpRouter.js} +2 -2
- package/dist/cjs/HttpRouter.js.map +1 -0
- package/dist/cjs/HttpServer.js +52 -31
- package/dist/cjs/HttpServer.js.map +1 -1
- package/dist/cjs/{Http/ServerError.js → HttpServerError.js} +3 -3
- package/dist/cjs/{Http/ServerError.js.map → HttpServerError.js.map} +1 -1
- package/dist/cjs/{Http/ServerRequest.js → HttpServerRequest.js} +6 -6
- package/dist/cjs/HttpServerRequest.js.map +1 -0
- package/dist/cjs/{Http/ServerResponse.js → HttpServerResponse.js} +3 -3
- package/dist/cjs/HttpServerResponse.js.map +1 -0
- package/dist/cjs/{Http/TraceContext.js → HttpTraceContext.js} +1 -1
- package/dist/cjs/{Http/TraceContext.js.map → HttpTraceContext.js.map} +1 -1
- package/dist/cjs/{Http/Multipart.js → Multipart.js} +1 -1
- package/dist/cjs/Multipart.js.map +1 -0
- package/dist/cjs/UrlParams.js.map +1 -0
- package/dist/cjs/index.js +41 -1
- package/dist/cjs/internal/{http/etag.js → etag.js} +2 -2
- package/dist/cjs/internal/etag.js.map +1 -0
- package/dist/cjs/internal/{http/body.js → httpBody.js} +16 -16
- package/dist/cjs/internal/httpBody.js.map +1 -0
- package/dist/cjs/internal/{http/client.js → httpClient.js} +16 -16
- package/dist/cjs/internal/{http/client.js.map → httpClient.js.map} +1 -1
- package/dist/cjs/internal/{http/clientError.js → httpClientError.js} +2 -2
- package/dist/cjs/internal/httpClientError.js.map +1 -0
- package/dist/cjs/internal/{http/clientRequest.js → httpClientRequest.js} +7 -7
- package/dist/cjs/internal/httpClientRequest.js.map +1 -0
- package/dist/cjs/internal/{http/clientResponse.js → httpClientResponse.js} +8 -8
- package/dist/cjs/internal/{http/clientResponse.js.map → httpClientResponse.js.map} +1 -1
- package/dist/cjs/internal/{http/middleware.js → httpMiddleware.js} +11 -11
- package/dist/cjs/internal/httpMiddleware.js.map +1 -0
- package/dist/cjs/internal/{http/multiplex.js → httpMultiplex.js} +6 -6
- package/dist/cjs/internal/httpMultiplex.js.map +1 -0
- package/dist/cjs/internal/{http/platform.js → httpPlatform.js} +6 -6
- package/dist/cjs/internal/{http/platform.js.map → httpPlatform.js.map} +1 -1
- package/dist/cjs/internal/{http/router.js → httpRouter.js} +13 -13
- package/dist/cjs/internal/httpRouter.js.map +1 -0
- package/dist/cjs/internal/{http/server.js → httpServer.js} +3 -3
- package/dist/cjs/internal/{http/server.js.map → httpServer.js.map} +1 -1
- package/dist/cjs/internal/{http/serverError.js → httpServerError.js} +3 -3
- package/dist/cjs/internal/httpServerError.js.map +1 -0
- package/dist/cjs/internal/{http/serverRequest.js → httpServerRequest.js} +12 -12
- package/dist/cjs/internal/httpServerRequest.js.map +1 -0
- package/dist/cjs/internal/{http/serverResponse.js → httpServerResponse.js} +11 -11
- package/dist/cjs/internal/httpServerResponse.js.map +1 -0
- package/dist/cjs/internal/{http/multipart.js → multipart.js} +13 -13
- package/dist/cjs/internal/multipart.js.map +1 -0
- package/dist/dts/Cookies.d.ts.map +1 -0
- package/dist/dts/{Http/Etag.d.ts → Etag.d.ts} +3 -3
- package/dist/dts/Etag.d.ts.map +1 -0
- package/dist/dts/Headers.d.ts.map +1 -0
- package/dist/dts/{Http/App.d.ts → HttpApp.d.ts} +9 -9
- package/dist/dts/HttpApp.d.ts.map +1 -0
- package/dist/dts/{Http/Body.d.ts → HttpBody.d.ts} +20 -20
- package/dist/dts/HttpBody.d.ts.map +1 -0
- package/dist/dts/HttpClient.d.ts +330 -41
- package/dist/dts/HttpClient.d.ts.map +1 -1
- package/dist/dts/{Http/ClientError.d.ts → HttpClientError.d.ts} +6 -6
- package/dist/dts/HttpClientError.d.ts.map +1 -0
- package/dist/dts/HttpClientRequest.d.ts +350 -0
- package/dist/dts/HttpClientRequest.d.ts.map +1 -0
- package/dist/dts/{Http/ClientResponse.d.ts → HttpClientResponse.d.ts} +18 -18
- package/dist/dts/HttpClientResponse.d.ts.map +1 -0
- package/dist/dts/{Http/IncomingMessage.d.ts → HttpIncomingMessage.d.ts} +10 -10
- package/dist/dts/HttpIncomingMessage.d.ts.map +1 -0
- package/dist/dts/HttpMethod.d.ts +10 -0
- package/dist/dts/HttpMethod.d.ts.map +1 -0
- package/dist/dts/{Http/Middleware.d.ts → HttpMiddleware.d.ts} +11 -11
- package/dist/dts/HttpMiddleware.d.ts.map +1 -0
- package/dist/dts/HttpMultiplex.d.ts +115 -0
- package/dist/dts/HttpMultiplex.d.ts.map +1 -0
- package/dist/dts/HttpPlatform.d.ts +44 -0
- package/dist/dts/HttpPlatform.d.ts.map +1 -0
- package/dist/dts/{Http/Router.d.ts → HttpRouter.d.ts} +72 -72
- package/dist/dts/HttpRouter.d.ts.map +1 -0
- package/dist/dts/HttpServer.d.ts +71 -76
- package/dist/dts/HttpServer.d.ts.map +1 -1
- package/dist/dts/{Http/ServerError.d.ts → HttpServerError.d.ts} +7 -7
- package/dist/dts/HttpServerError.d.ts.map +1 -0
- package/dist/dts/{Http/ServerRequest.d.ts → HttpServerRequest.d.ts} +23 -23
- package/dist/dts/HttpServerRequest.d.ts.map +1 -0
- package/dist/dts/{Http/ServerResponse.d.ts → HttpServerResponse.d.ts} +49 -49
- package/dist/dts/HttpServerResponse.d.ts.map +1 -0
- package/dist/dts/{Http/TraceContext.d.ts → HttpTraceContext.d.ts} +1 -1
- package/dist/dts/{Http/TraceContext.d.ts.map → HttpTraceContext.d.ts.map} +1 -1
- package/dist/dts/{Http/Multipart.d.ts → Multipart.d.ts} +2 -2
- package/dist/dts/Multipart.d.ts.map +1 -0
- package/dist/dts/UrlParams.d.ts.map +1 -0
- package/dist/dts/index.d.ts +81 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/internal/{http/etag.d.ts.map → etag.d.ts.map} +1 -1
- package/dist/dts/internal/httpBody.d.ts +2 -0
- package/dist/dts/internal/httpBody.d.ts.map +1 -0
- package/dist/dts/internal/httpClient.d.ts +2 -0
- package/dist/dts/internal/httpClient.d.ts.map +1 -0
- package/dist/dts/internal/httpClientError.d.ts +2 -0
- package/dist/dts/internal/httpClientError.d.ts.map +1 -0
- package/dist/dts/internal/httpClientRequest.d.ts +2 -0
- package/dist/dts/internal/httpClientRequest.d.ts.map +1 -0
- package/dist/dts/internal/httpClientResponse.d.ts +2 -0
- package/dist/dts/internal/httpClientResponse.d.ts.map +1 -0
- package/dist/dts/internal/httpMiddleware.d.ts +2 -0
- package/dist/dts/internal/httpMiddleware.d.ts.map +1 -0
- package/dist/dts/internal/httpMultiplex.d.ts +2 -0
- package/dist/dts/internal/httpMultiplex.d.ts.map +1 -0
- package/dist/dts/internal/httpPlatform.d.ts +2 -0
- package/dist/dts/internal/httpPlatform.d.ts.map +1 -0
- package/dist/dts/internal/httpRouter.d.ts +4 -0
- package/dist/dts/internal/httpRouter.d.ts.map +1 -0
- package/dist/dts/internal/httpServer.d.ts +2 -0
- package/dist/dts/internal/httpServer.d.ts.map +1 -0
- package/dist/dts/internal/httpServerError.d.ts +2 -0
- package/dist/dts/internal/httpServerError.d.ts.map +1 -0
- package/dist/dts/internal/httpServerRequest.d.ts +2 -0
- package/dist/dts/internal/httpServerRequest.d.ts.map +1 -0
- package/dist/dts/internal/httpServerResponse.d.ts +2 -0
- package/dist/dts/internal/httpServerResponse.d.ts.map +1 -0
- package/dist/dts/internal/multipart.d.ts.map +1 -0
- package/dist/esm/{Http/Cookies.js → Cookies.js} +6 -6
- package/dist/esm/Cookies.js.map +1 -0
- package/dist/esm/{Http/Etag.js → Etag.js} +1 -1
- package/dist/esm/Etag.js.map +1 -0
- package/dist/esm/{Http/Headers.js → Headers.js} +2 -2
- package/dist/esm/Headers.js.map +1 -0
- package/dist/esm/{Http/App.js → HttpApp.js} +8 -8
- package/dist/esm/HttpApp.js.map +1 -0
- package/dist/esm/{Http/Body.js → HttpBody.js} +4 -4
- package/dist/esm/HttpBody.js.map +1 -0
- package/dist/esm/HttpClient.js +154 -41
- package/dist/esm/HttpClient.js.map +1 -1
- package/dist/esm/{Http/ClientError.js → HttpClientError.js} +2 -2
- package/dist/esm/{Http/ClientError.js.map → HttpClientError.js.map} +1 -1
- package/dist/esm/{Http/ClientRequest.js → HttpClientRequest.js} +3 -3
- package/dist/esm/HttpClientRequest.js.map +1 -0
- package/dist/esm/{Http/ClientResponse.js → HttpClientResponse.js} +3 -3
- package/dist/esm/HttpClientResponse.js.map +1 -0
- package/dist/esm/{Http/IncomingMessage.js → HttpIncomingMessage.js} +4 -4
- package/dist/esm/{Http/IncomingMessage.js.map → HttpIncomingMessage.js.map} +1 -1
- package/dist/esm/{Http/Method.js → HttpMethod.js} +1 -1
- package/dist/esm/HttpMethod.js.map +1 -0
- package/dist/esm/{Http/Middleware.js → HttpMiddleware.js} +2 -2
- package/dist/esm/HttpMiddleware.js.map +1 -0
- package/dist/esm/{Http/Multiplex.js → HttpMultiplex.js} +2 -2
- package/dist/esm/HttpMultiplex.js.map +1 -0
- package/dist/esm/{Http/Platform.js → HttpPlatform.js} +3 -3
- package/dist/esm/HttpPlatform.js.map +1 -0
- package/dist/esm/{Http/Router.js → HttpRouter.js} +2 -2
- package/dist/esm/HttpRouter.js.map +1 -0
- package/dist/esm/HttpServer.js +21 -94
- package/dist/esm/HttpServer.js.map +1 -1
- package/dist/esm/{Http/ServerError.js → HttpServerError.js} +3 -3
- package/dist/esm/{Http/ServerError.js.map → HttpServerError.js.map} +1 -1
- package/dist/esm/{Http/ServerRequest.js → HttpServerRequest.js} +4 -4
- package/dist/esm/HttpServerRequest.js.map +1 -0
- package/dist/esm/{Http/ServerResponse.js → HttpServerResponse.js} +3 -3
- package/dist/esm/HttpServerResponse.js.map +1 -0
- package/dist/esm/{Http/TraceContext.js → HttpTraceContext.js} +1 -1
- package/dist/esm/{Http/TraceContext.js.map → HttpTraceContext.js.map} +1 -1
- package/dist/esm/{Http/Multipart.js → Multipart.js} +1 -1
- package/dist/esm/Multipart.js.map +1 -0
- package/dist/esm/UrlParams.js.map +1 -0
- package/dist/esm/index.js +81 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/{http/etag.js → etag.js} +2 -2
- package/dist/esm/internal/etag.js.map +1 -0
- package/dist/esm/internal/{http/body.js → httpBody.js} +14 -14
- package/dist/esm/internal/httpBody.js.map +1 -0
- package/dist/esm/internal/{http/client.js → httpClient.js} +16 -16
- package/dist/esm/internal/httpClient.js.map +1 -0
- package/dist/esm/internal/{http/clientError.js → httpClientError.js} +2 -2
- package/dist/esm/internal/httpClientError.js.map +1 -0
- package/dist/esm/internal/{http/clientRequest.js → httpClientRequest.js} +7 -7
- package/dist/esm/internal/httpClientRequest.js.map +1 -0
- package/dist/esm/internal/{http/clientResponse.js → httpClientResponse.js} +8 -8
- package/dist/esm/internal/httpClientResponse.js.map +1 -0
- package/dist/esm/internal/{http/middleware.js → httpMiddleware.js} +11 -11
- package/dist/esm/internal/httpMiddleware.js.map +1 -0
- package/dist/esm/internal/{http/multiplex.js → httpMultiplex.js} +6 -6
- package/dist/esm/internal/httpMultiplex.js.map +1 -0
- package/dist/esm/internal/{http/platform.js → httpPlatform.js} +6 -6
- package/dist/esm/internal/httpPlatform.js.map +1 -0
- package/dist/esm/internal/{http/router.js → httpRouter.js} +13 -13
- package/dist/esm/internal/httpRouter.js.map +1 -0
- package/dist/esm/internal/{http/server.js → httpServer.js} +3 -3
- package/dist/esm/internal/httpServer.js.map +1 -0
- package/dist/esm/internal/{http/serverError.js → httpServerError.js} +3 -3
- package/dist/esm/internal/httpServerError.js.map +1 -0
- package/dist/esm/internal/{http/serverRequest.js → httpServerRequest.js} +12 -12
- package/dist/esm/internal/httpServerRequest.js.map +1 -0
- package/dist/esm/internal/{http/serverResponse.js → httpServerResponse.js} +12 -12
- package/dist/esm/internal/httpServerResponse.js.map +1 -0
- package/dist/esm/internal/{http/multipart.js → multipart.js} +13 -13
- package/dist/esm/internal/multipart.js.map +1 -0
- package/package.json +150 -166
- package/src/{Http/Cookies.ts → Cookies.ts} +6 -6
- package/src/{Http/Etag.ts → Etag.ts} +4 -4
- package/src/{Http/Headers.ts → Headers.ts} +2 -2
- package/src/{Http/App.ts → HttpApp.ts} +19 -19
- package/src/{Http/Body.ts → HttpBody.ts} +20 -20
- package/src/HttpClient.ts +501 -54
- package/src/{Http/ClientError.ts → HttpClientError.ts} +6 -6
- package/src/{Http/ClientRequest.ts → HttpClientRequest.ts} +82 -82
- package/src/{Http/ClientResponse.ts → HttpClientResponse.ts} +22 -19
- package/src/{Http/IncomingMessage.ts → HttpIncomingMessage.ts} +11 -11
- package/src/{Http/Method.ts → HttpMethod.ts} +2 -2
- package/src/{Http/Middleware.ts → HttpMiddleware.ts} +11 -11
- package/src/{Http/Multiplex.ts → HttpMultiplex.ts} +37 -34
- package/src/{Http/Platform.ts → HttpPlatform.ts} +14 -14
- package/src/{Http/Router.ts → HttpRouter.ts} +100 -100
- package/src/HttpServer.ts +191 -122
- package/src/{Http/ServerError.ts → HttpServerError.ts} +8 -8
- package/src/{Http/ServerRequest.ts → HttpServerRequest.ts} +23 -23
- package/src/{Http/ServerResponse.ts → HttpServerResponse.ts} +58 -55
- package/src/{Http/Multipart.ts → Multipart.ts} +3 -3
- package/src/index.ts +101 -0
- package/src/internal/{http/etag.ts → etag.ts} +3 -3
- package/src/internal/{http/body.ts → httpBody.ts} +19 -19
- package/src/internal/{http/client.ts → httpClient.ts} +132 -132
- package/src/internal/httpClientError.ts +6 -0
- package/src/internal/{http/clientRequest.ts → httpClientRequest.ts} +94 -81
- package/src/internal/{http/clientResponse.ts → httpClientResponse.ts} +24 -24
- package/src/internal/{http/middleware.ts → httpMiddleware.ts} +21 -21
- package/src/internal/{http/multiplex.ts → httpMultiplex.ts} +50 -46
- package/src/internal/{http/platform.ts → httpPlatform.ts} +12 -12
- package/src/internal/{http/router.ts → httpRouter.ts} +95 -93
- package/src/internal/{http/server.ts → httpServer.ts} +29 -29
- package/src/internal/{http/serverError.ts → httpServerError.ts} +3 -3
- package/src/internal/{http/serverRequest.ts → httpServerRequest.ts} +24 -22
- package/src/internal/{http/serverResponse.ts → httpServerResponse.ts} +74 -64
- package/src/internal/{http/multipart.ts → multipart.ts} +14 -14
- package/Http/App/package.json +0 -6
- package/Http/Body/package.json +0 -6
- package/Http/Client/package.json +0 -6
- package/Http/ClientError/package.json +0 -6
- package/Http/ClientRequest/package.json +0 -6
- package/Http/ClientResponse/package.json +0 -6
- package/Http/Cookies/package.json +0 -6
- package/Http/Etag/package.json +0 -6
- package/Http/Headers/package.json +0 -6
- package/Http/IncomingMessage/package.json +0 -6
- package/Http/Method/package.json +0 -6
- package/Http/Middleware/package.json +0 -6
- package/Http/Multipart/package.json +0 -6
- package/Http/Multiplex/package.json +0 -6
- package/Http/Platform/package.json +0 -6
- package/Http/Router/package.json +0 -6
- package/Http/Server/package.json +0 -6
- package/Http/ServerError/package.json +0 -6
- package/Http/ServerRequest/package.json +0 -6
- package/Http/ServerResponse/package.json +0 -6
- package/Http/TraceContext/package.json +0 -6
- package/Http/UrlParams/package.json +0 -6
- package/dist/cjs/Http/App.js.map +0 -1
- package/dist/cjs/Http/Body.js.map +0 -1
- package/dist/cjs/Http/Client.js +0 -213
- package/dist/cjs/Http/Client.js.map +0 -1
- package/dist/cjs/Http/ClientRequest.js.map +0 -1
- package/dist/cjs/Http/ClientResponse.js.map +0 -1
- package/dist/cjs/Http/Cookies.js.map +0 -1
- package/dist/cjs/Http/Etag.js.map +0 -1
- package/dist/cjs/Http/Headers.js.map +0 -1
- package/dist/cjs/Http/Method.js.map +0 -1
- package/dist/cjs/Http/Multipart.js.map +0 -1
- package/dist/cjs/Http/Platform.js.map +0 -1
- package/dist/cjs/Http/Router.js.map +0 -1
- package/dist/cjs/Http/Server.js +0 -83
- package/dist/cjs/Http/Server.js.map +0 -1
- package/dist/cjs/Http/ServerRequest.js.map +0 -1
- package/dist/cjs/Http/ServerResponse.js.map +0 -1
- package/dist/cjs/Http/UrlParams.js.map +0 -1
- package/dist/cjs/internal/http/body.js.map +0 -1
- package/dist/cjs/internal/http/clientError.js.map +0 -1
- package/dist/cjs/internal/http/clientRequest.js.map +0 -1
- package/dist/cjs/internal/http/etag.js.map +0 -1
- package/dist/cjs/internal/http/middleware.js.map +0 -1
- package/dist/cjs/internal/http/multipart.js.map +0 -1
- package/dist/cjs/internal/http/multiplex.js.map +0 -1
- package/dist/cjs/internal/http/router.js.map +0 -1
- package/dist/cjs/internal/http/serverError.js.map +0 -1
- package/dist/cjs/internal/http/serverRequest.js.map +0 -1
- package/dist/cjs/internal/http/serverResponse.js.map +0 -1
- package/dist/dts/Http/App.d.ts.map +0 -1
- package/dist/dts/Http/Body.d.ts.map +0 -1
- package/dist/dts/Http/Client.d.ts +0 -358
- package/dist/dts/Http/Client.d.ts.map +0 -1
- package/dist/dts/Http/ClientError.d.ts.map +0 -1
- package/dist/dts/Http/ClientRequest.d.ts +0 -350
- package/dist/dts/Http/ClientRequest.d.ts.map +0 -1
- package/dist/dts/Http/ClientResponse.d.ts.map +0 -1
- package/dist/dts/Http/Cookies.d.ts.map +0 -1
- package/dist/dts/Http/Etag.d.ts.map +0 -1
- package/dist/dts/Http/Headers.d.ts.map +0 -1
- package/dist/dts/Http/IncomingMessage.d.ts.map +0 -1
- package/dist/dts/Http/Method.d.ts +0 -10
- package/dist/dts/Http/Method.d.ts.map +0 -1
- package/dist/dts/Http/Middleware.d.ts.map +0 -1
- package/dist/dts/Http/Multipart.d.ts.map +0 -1
- package/dist/dts/Http/Multiplex.d.ts +0 -112
- package/dist/dts/Http/Multiplex.d.ts.map +0 -1
- package/dist/dts/Http/Platform.d.ts +0 -44
- package/dist/dts/Http/Platform.d.ts.map +0 -1
- package/dist/dts/Http/Router.d.ts.map +0 -1
- package/dist/dts/Http/Server.d.ts +0 -120
- package/dist/dts/Http/Server.d.ts.map +0 -1
- package/dist/dts/Http/ServerError.d.ts.map +0 -1
- package/dist/dts/Http/ServerRequest.d.ts.map +0 -1
- package/dist/dts/Http/ServerResponse.d.ts.map +0 -1
- package/dist/dts/Http/UrlParams.d.ts.map +0 -1
- package/dist/dts/internal/http/body.d.ts +0 -2
- package/dist/dts/internal/http/body.d.ts.map +0 -1
- package/dist/dts/internal/http/client.d.ts +0 -2
- package/dist/dts/internal/http/client.d.ts.map +0 -1
- package/dist/dts/internal/http/clientError.d.ts +0 -2
- package/dist/dts/internal/http/clientError.d.ts.map +0 -1
- package/dist/dts/internal/http/clientRequest.d.ts +0 -2
- package/dist/dts/internal/http/clientRequest.d.ts.map +0 -1
- package/dist/dts/internal/http/clientResponse.d.ts +0 -2
- package/dist/dts/internal/http/clientResponse.d.ts.map +0 -1
- package/dist/dts/internal/http/middleware.d.ts +0 -2
- package/dist/dts/internal/http/middleware.d.ts.map +0 -1
- package/dist/dts/internal/http/multipart.d.ts.map +0 -1
- package/dist/dts/internal/http/multiplex.d.ts +0 -2
- package/dist/dts/internal/http/multiplex.d.ts.map +0 -1
- package/dist/dts/internal/http/platform.d.ts +0 -2
- package/dist/dts/internal/http/platform.d.ts.map +0 -1
- package/dist/dts/internal/http/router.d.ts +0 -4
- package/dist/dts/internal/http/router.d.ts.map +0 -1
- package/dist/dts/internal/http/server.d.ts +0 -2
- package/dist/dts/internal/http/server.d.ts.map +0 -1
- package/dist/dts/internal/http/serverError.d.ts +0 -2
- package/dist/dts/internal/http/serverError.d.ts.map +0 -1
- package/dist/dts/internal/http/serverRequest.d.ts +0 -2
- package/dist/dts/internal/http/serverRequest.d.ts.map +0 -1
- package/dist/dts/internal/http/serverResponse.d.ts +0 -2
- package/dist/dts/internal/http/serverResponse.d.ts.map +0 -1
- package/dist/esm/Http/App.js.map +0 -1
- package/dist/esm/Http/Body.js.map +0 -1
- package/dist/esm/Http/Client.js +0 -182
- package/dist/esm/Http/Client.js.map +0 -1
- package/dist/esm/Http/ClientRequest.js.map +0 -1
- package/dist/esm/Http/ClientResponse.js.map +0 -1
- package/dist/esm/Http/Cookies.js.map +0 -1
- package/dist/esm/Http/Etag.js.map +0 -1
- package/dist/esm/Http/Headers.js.map +0 -1
- package/dist/esm/Http/Method.js.map +0 -1
- package/dist/esm/Http/Middleware.js.map +0 -1
- package/dist/esm/Http/Multipart.js.map +0 -1
- package/dist/esm/Http/Multiplex.js.map +0 -1
- package/dist/esm/Http/Platform.js.map +0 -1
- package/dist/esm/Http/Router.js.map +0 -1
- package/dist/esm/Http/Server.js +0 -52
- package/dist/esm/Http/Server.js.map +0 -1
- package/dist/esm/Http/ServerRequest.js.map +0 -1
- package/dist/esm/Http/ServerResponse.js.map +0 -1
- package/dist/esm/Http/UrlParams.js.map +0 -1
- package/dist/esm/internal/http/body.js.map +0 -1
- package/dist/esm/internal/http/client.js.map +0 -1
- package/dist/esm/internal/http/clientError.js.map +0 -1
- package/dist/esm/internal/http/clientRequest.js.map +0 -1
- package/dist/esm/internal/http/clientResponse.js.map +0 -1
- package/dist/esm/internal/http/etag.js.map +0 -1
- package/dist/esm/internal/http/middleware.js.map +0 -1
- package/dist/esm/internal/http/multipart.js.map +0 -1
- package/dist/esm/internal/http/multiplex.js.map +0 -1
- package/dist/esm/internal/http/platform.js.map +0 -1
- package/dist/esm/internal/http/router.js.map +0 -1
- package/dist/esm/internal/http/server.js.map +0 -1
- package/dist/esm/internal/http/serverError.js.map +0 -1
- package/dist/esm/internal/http/serverRequest.js.map +0 -1
- package/dist/esm/internal/http/serverResponse.js.map +0 -1
- package/src/Http/Client.ts +0 -490
- package/src/Http/Server.ts +0 -187
- package/src/internal/http/clientError.ts +0 -6
- /package/dist/cjs/{Http/UrlParams.js → UrlParams.js} +0 -0
- /package/dist/dts/{Http/Cookies.d.ts → Cookies.d.ts} +0 -0
- /package/dist/dts/{Http/Headers.d.ts → Headers.d.ts} +0 -0
- /package/dist/dts/{Http/UrlParams.d.ts → UrlParams.d.ts} +0 -0
- /package/dist/dts/internal/{http/etag.d.ts → etag.d.ts} +0 -0
- /package/dist/dts/internal/{http/multipart.d.ts → multipart.d.ts} +0 -0
- /package/dist/esm/{Http/UrlParams.js → UrlParams.js} +0 -0
- /package/src/{Http/TraceContext.ts → HttpTraceContext.ts} +0 -0
- /package/src/{Http/UrlParams.ts → UrlParams.ts} +0 -0
package/src/HttpServer.ts
CHANGED
|
@@ -1,126 +1,195 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
etag,
|
|
56
|
-
/**
|
|
57
|
-
* @since 1.0.0
|
|
58
|
-
*
|
|
59
|
-
* - Docs: [Http/Headers](https://effect-ts.github.io/effect/platform/Http/Headers.ts.html)
|
|
60
|
-
* - Module: `@effect/platform/Http/Headers`
|
|
61
|
-
*/
|
|
62
|
-
headers,
|
|
63
|
-
/**
|
|
64
|
-
* @since 1.0.0
|
|
65
|
-
*
|
|
66
|
-
* - Docs: [Http/Middleware](https://effect-ts.github.io/effect/platform/Http/Middleware.ts.html)
|
|
67
|
-
* - Module: `@effect/platform/Http/Middleware`
|
|
68
|
-
*/
|
|
69
|
-
middleware,
|
|
70
|
-
/**
|
|
71
|
-
* @since 1.0.0
|
|
72
|
-
*
|
|
73
|
-
* - Docs: [Http/Multipart](https://effect-ts.github.io/effect/platform/Http/Multipart.ts.html)
|
|
74
|
-
* - Module: `@effect/platform/Http/Multipart`
|
|
75
|
-
*/
|
|
76
|
-
multipart,
|
|
77
|
-
/**
|
|
78
|
-
* @since 1.0.0
|
|
79
|
-
*
|
|
80
|
-
* - Docs: [Http/Multiplex](https://effect-ts.github.io/effect/platform/Http/Multiplex.ts.html)
|
|
81
|
-
* - Module: `@effect/platform/Http/Multiplex`
|
|
82
|
-
*/
|
|
83
|
-
multiplex,
|
|
84
|
-
/**
|
|
85
|
-
* @since 1.0.0
|
|
86
|
-
*
|
|
87
|
-
* - Docs: [Http/Platform](https://effect-ts.github.io/effect/platform/Http/Platform.ts.html)
|
|
88
|
-
* - Module: `@effect/platform/Http/Platform`
|
|
89
|
-
*/
|
|
90
|
-
platform,
|
|
91
|
-
/**
|
|
92
|
-
* @since 1.0.0
|
|
93
|
-
*
|
|
94
|
-
* - Docs: [Http/ServerRequest](https://effect-ts.github.io/effect/platform/Http/ServerRequest.ts.html)
|
|
95
|
-
* - Module: `@effect/platform/Http/ServerRequest`
|
|
96
|
-
*/
|
|
97
|
-
request,
|
|
98
|
-
/**
|
|
99
|
-
* @since 1.0.0
|
|
100
|
-
*
|
|
101
|
-
* - Docs: [Http/ServerResponse](https://effect-ts.github.io/effect/platform/Http/ServerResponse.ts.html)
|
|
102
|
-
* - Module: `@effect/platform/Http/ServerResponse`
|
|
103
|
-
*/
|
|
104
|
-
response,
|
|
105
|
-
/**
|
|
106
|
-
* @since 1.0.0
|
|
107
|
-
*
|
|
108
|
-
* - Docs: [Http/Router](https://effect-ts.github.io/effect/platform/Http/Router.ts.html)
|
|
109
|
-
* - Module: `@effect/platform/Http/Router`
|
|
110
|
-
*/
|
|
111
|
-
router,
|
|
112
|
-
/**
|
|
113
|
-
* @since 1.0.0
|
|
114
|
-
*
|
|
115
|
-
* - Docs: [Http/Server](https://effect-ts.github.io/effect/platform/Http/Server.ts.html)
|
|
116
|
-
* - Module: `@effect/platform/Http/Server`
|
|
117
|
-
*/
|
|
118
|
-
server,
|
|
119
|
-
/**
|
|
120
|
-
* @since 1.0.0
|
|
121
|
-
*
|
|
122
|
-
* - Docs: [Http/UrlParams](https://effect-ts.github.io/effect/platform/Http/UrlParams.ts.html)
|
|
123
|
-
* - Module: `@effect/platform/Http/UrlParams`
|
|
124
|
-
*/
|
|
125
|
-
urlParams
|
|
4
|
+
import type * as Context from "effect/Context"
|
|
5
|
+
import type * as Effect from "effect/Effect"
|
|
6
|
+
import type * as Layer from "effect/Layer"
|
|
7
|
+
import type * as Scope from "effect/Scope"
|
|
8
|
+
import type * as App from "./HttpApp.js"
|
|
9
|
+
import type * as Middleware from "./HttpMiddleware.js"
|
|
10
|
+
import type * as ServerRequest from "./HttpServerRequest.js"
|
|
11
|
+
import * as internal from "./internal/httpServer.js"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
* @category type ids
|
|
16
|
+
*/
|
|
17
|
+
export const TypeId: unique symbol = internal.TypeId
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @since 1.0.0
|
|
21
|
+
* @category type ids
|
|
22
|
+
*/
|
|
23
|
+
export type TypeId = typeof TypeId
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @since 1.0.0
|
|
27
|
+
* @category models
|
|
28
|
+
*/
|
|
29
|
+
export interface HttpServer {
|
|
30
|
+
readonly [TypeId]: TypeId
|
|
31
|
+
readonly serve: {
|
|
32
|
+
<E, R>(httpApp: App.Default<E, R>): Effect.Effect<
|
|
33
|
+
void,
|
|
34
|
+
never,
|
|
35
|
+
Exclude<R, ServerRequest.HttpServerRequest> | Scope.Scope
|
|
36
|
+
>
|
|
37
|
+
<E, R, App extends App.Default<any, any>>(
|
|
38
|
+
httpApp: App.Default<E, R>,
|
|
39
|
+
middleware: Middleware.HttpMiddleware.Applied<App, E, R>
|
|
40
|
+
): Effect.Effect<
|
|
41
|
+
void,
|
|
42
|
+
never,
|
|
43
|
+
Exclude<R, ServerRequest.HttpServerRequest> | Scope.Scope
|
|
44
|
+
>
|
|
45
|
+
}
|
|
46
|
+
readonly address: Address
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @since 1.0.0
|
|
51
|
+
* @category models
|
|
52
|
+
*/
|
|
53
|
+
export interface ServeOptions {
|
|
54
|
+
readonly respond: boolean
|
|
126
55
|
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @since 1.0.0
|
|
59
|
+
* @category address
|
|
60
|
+
*/
|
|
61
|
+
export type Address = UnixAddress | TcpAddress
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @since 1.0.0
|
|
65
|
+
* @category address
|
|
66
|
+
*/
|
|
67
|
+
export interface TcpAddress {
|
|
68
|
+
readonly _tag: "TcpAddress"
|
|
69
|
+
readonly hostname: string
|
|
70
|
+
readonly port: number
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @since 1.0.0
|
|
75
|
+
* @category address
|
|
76
|
+
*/
|
|
77
|
+
export interface UnixAddress {
|
|
78
|
+
readonly _tag: "UnixAddress"
|
|
79
|
+
readonly path: string
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @since 1.0.0
|
|
84
|
+
* @category constructors
|
|
85
|
+
*/
|
|
86
|
+
export const HttpServer: Context.Tag<HttpServer, HttpServer> = internal.serverTag
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @since 1.0.0
|
|
90
|
+
* @category constructors
|
|
91
|
+
*/
|
|
92
|
+
export const make: (
|
|
93
|
+
options: {
|
|
94
|
+
readonly serve: (
|
|
95
|
+
httpApp: App.Default<unknown>,
|
|
96
|
+
middleware?: Middleware.HttpMiddleware
|
|
97
|
+
) => Effect.Effect<void, never, Scope.Scope>
|
|
98
|
+
readonly address: Address
|
|
99
|
+
}
|
|
100
|
+
) => HttpServer = internal.make
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @since 1.0.0
|
|
104
|
+
* @category accessors
|
|
105
|
+
*/
|
|
106
|
+
export const serve: {
|
|
107
|
+
(): <E, R>(
|
|
108
|
+
httpApp: App.Default<E, R>
|
|
109
|
+
) => Layer.Layer<never, never, HttpServer | Exclude<R, ServerRequest.HttpServerRequest | Scope.Scope>>
|
|
110
|
+
<E, R, App extends App.Default<any, any>>(
|
|
111
|
+
middleware: Middleware.HttpMiddleware.Applied<App, E, R>
|
|
112
|
+
): (
|
|
113
|
+
httpApp: App.Default<E, R>
|
|
114
|
+
) => Layer.Layer<
|
|
115
|
+
never,
|
|
116
|
+
never,
|
|
117
|
+
HttpServer | Exclude<Effect.Effect.Context<App>, ServerRequest.HttpServerRequest | Scope.Scope>
|
|
118
|
+
>
|
|
119
|
+
<E, R>(
|
|
120
|
+
httpApp: App.Default<E, R>
|
|
121
|
+
): Layer.Layer<never, never, HttpServer | Exclude<R, ServerRequest.HttpServerRequest | Scope.Scope>>
|
|
122
|
+
<E, R, App extends App.Default<any, any>>(
|
|
123
|
+
httpApp: App.Default<E, R>,
|
|
124
|
+
middleware: Middleware.HttpMiddleware.Applied<App, E, R>
|
|
125
|
+
): Layer.Layer<
|
|
126
|
+
never,
|
|
127
|
+
never,
|
|
128
|
+
HttpServer | Exclude<Effect.Effect.Context<App>, ServerRequest.HttpServerRequest | Scope.Scope>
|
|
129
|
+
>
|
|
130
|
+
} = internal.serve
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @since 1.0.0
|
|
134
|
+
* @category accessors
|
|
135
|
+
*/
|
|
136
|
+
export const serveEffect: {
|
|
137
|
+
(): <E, R>(
|
|
138
|
+
httpApp: App.Default<E, R>
|
|
139
|
+
) => Effect.Effect<void, never, Scope.Scope | HttpServer | Exclude<R, ServerRequest.HttpServerRequest>>
|
|
140
|
+
<E, R, App extends App.Default<any, any>>(
|
|
141
|
+
middleware: Middleware.HttpMiddleware.Applied<App, E, R>
|
|
142
|
+
): (
|
|
143
|
+
httpApp: App.Default<E, R>
|
|
144
|
+
) => Effect.Effect<
|
|
145
|
+
void,
|
|
146
|
+
never,
|
|
147
|
+
Scope.Scope | HttpServer | Exclude<Effect.Effect.Context<App>, ServerRequest.HttpServerRequest>
|
|
148
|
+
>
|
|
149
|
+
<E, R>(
|
|
150
|
+
httpApp: App.Default<E, R>
|
|
151
|
+
): Effect.Effect<void, never, Scope.Scope | HttpServer | Exclude<R, ServerRequest.HttpServerRequest>>
|
|
152
|
+
<E, R, App extends App.Default<any, any>>(
|
|
153
|
+
httpApp: App.Default<E, R>,
|
|
154
|
+
middleware: Middleware.HttpMiddleware.Applied<App, E, R>
|
|
155
|
+
): Effect.Effect<
|
|
156
|
+
void,
|
|
157
|
+
never,
|
|
158
|
+
Scope.Scope | HttpServer | Exclude<Effect.Effect.Context<App>, ServerRequest.HttpServerRequest>
|
|
159
|
+
>
|
|
160
|
+
} = internal.serveEffect
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @since 1.0.0
|
|
164
|
+
* @category address
|
|
165
|
+
*/
|
|
166
|
+
export const formatAddress: (address: Address) => string = internal.formatAddress
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @since 1.0.0
|
|
170
|
+
* @category address
|
|
171
|
+
*/
|
|
172
|
+
export const addressWith: <A, E, R>(
|
|
173
|
+
effect: (address: Address) => Effect.Effect<A, E, R>
|
|
174
|
+
) => Effect.Effect<A, E, HttpServer | R> = internal.addressWith
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @since 1.0.0
|
|
178
|
+
* @category address
|
|
179
|
+
*/
|
|
180
|
+
export const addressFormattedWith: <A, E, R>(
|
|
181
|
+
effect: (address: string) => Effect.Effect<A, E, R>
|
|
182
|
+
) => Effect.Effect<A, E, HttpServer | R> = internal.addressFormattedWith
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @since 1.0.0
|
|
186
|
+
* @category address
|
|
187
|
+
*/
|
|
188
|
+
export const logAddress: Effect.Effect<void, never, HttpServer> = internal.logAddress
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @since 1.0.0
|
|
192
|
+
* @category address
|
|
193
|
+
*/
|
|
194
|
+
export const withLogAddress: <A, E, R>(layer: Layer.Layer<A, E, R>) => Layer.Layer<A, E, R | Exclude<HttpServer, A>> =
|
|
195
|
+
internal.withLogAddress
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type * as Cause from "effect/Cause"
|
|
5
5
|
import type * as FiberId from "effect/FiberId"
|
|
6
|
-
import { RefailError, TypeIdError } from "
|
|
7
|
-
import * as
|
|
8
|
-
import type * as
|
|
9
|
-
import
|
|
6
|
+
import { RefailError, TypeIdError } from "./Error.js"
|
|
7
|
+
import type * as ServerRequest from "./HttpServerRequest.js"
|
|
8
|
+
import type * as ServerResponse from "./HttpServerResponse.js"
|
|
9
|
+
import * as internal from "./internal/httpServerError.js"
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @since 1.0.0
|
|
@@ -31,7 +31,7 @@ export type HttpServerError = RequestError | ResponseError | RouteNotFound | Ser
|
|
|
31
31
|
* @category error
|
|
32
32
|
*/
|
|
33
33
|
export class RequestError extends RefailError(TypeId, "RequestError")<{
|
|
34
|
-
readonly request: ServerRequest.
|
|
34
|
+
readonly request: ServerRequest.HttpServerRequest
|
|
35
35
|
readonly reason: "Transport" | "Decode"
|
|
36
36
|
}> {
|
|
37
37
|
get methodAndUrl() {
|
|
@@ -54,7 +54,7 @@ export const isServerError: (u: unknown) => u is HttpServerError = internal.isSe
|
|
|
54
54
|
* @category error
|
|
55
55
|
*/
|
|
56
56
|
export class RouteNotFound extends TypeIdError(TypeId, "RouteNotFound")<{
|
|
57
|
-
readonly request: ServerRequest.
|
|
57
|
+
readonly request: ServerRequest.HttpServerRequest
|
|
58
58
|
}> {
|
|
59
59
|
get message() {
|
|
60
60
|
return `${this.request.method} ${this.request.url} not found`
|
|
@@ -66,8 +66,8 @@ export class RouteNotFound extends TypeIdError(TypeId, "RouteNotFound")<{
|
|
|
66
66
|
* @category error
|
|
67
67
|
*/
|
|
68
68
|
export class ResponseError extends RefailError(TypeId, "ResponseError")<{
|
|
69
|
-
readonly request: ServerRequest.
|
|
70
|
-
readonly response: ServerResponse.
|
|
69
|
+
readonly request: ServerRequest.HttpServerRequest
|
|
70
|
+
readonly response: ServerResponse.HttpServerResponse
|
|
71
71
|
readonly reason: "Decode"
|
|
72
72
|
}> {
|
|
73
73
|
get methodAndUrl() {
|
|
@@ -11,15 +11,15 @@ import type * as Effect from "effect/Effect"
|
|
|
11
11
|
import type { ReadonlyRecord } from "effect/Record"
|
|
12
12
|
import type * as Scope from "effect/Scope"
|
|
13
13
|
import type * as Stream from "effect/Stream"
|
|
14
|
-
import type * as FileSystem from "
|
|
15
|
-
import * as internal from "../internal/http/serverRequest.js"
|
|
16
|
-
import type * as Path from "../Path.js"
|
|
17
|
-
import type * as Socket from "../Socket.js"
|
|
14
|
+
import type * as FileSystem from "./FileSystem.js"
|
|
18
15
|
import type * as Headers from "./Headers.js"
|
|
19
|
-
import type * as IncomingMessage from "./
|
|
20
|
-
import type {
|
|
16
|
+
import type * as IncomingMessage from "./HttpIncomingMessage.js"
|
|
17
|
+
import type { HttpMethod } from "./HttpMethod.js"
|
|
18
|
+
import type * as Error from "./HttpServerError.js"
|
|
19
|
+
import * as internal from "./internal/httpServerRequest.js"
|
|
21
20
|
import type * as Multipart from "./Multipart.js"
|
|
22
|
-
import type * as
|
|
21
|
+
import type * as Path from "./Path.js"
|
|
22
|
+
import type * as Socket from "./Socket.js"
|
|
23
23
|
|
|
24
24
|
export {
|
|
25
25
|
/**
|
|
@@ -27,7 +27,7 @@ export {
|
|
|
27
27
|
* @category fiber refs
|
|
28
28
|
*/
|
|
29
29
|
maxBodySize
|
|
30
|
-
} from "./
|
|
30
|
+
} from "./HttpIncomingMessage.js"
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* @since 1.0.0
|
|
@@ -45,12 +45,12 @@ export type TypeId = typeof TypeId
|
|
|
45
45
|
* @since 1.0.0
|
|
46
46
|
* @category models
|
|
47
47
|
*/
|
|
48
|
-
export interface
|
|
48
|
+
export interface HttpServerRequest extends IncomingMessage.HttpIncomingMessage<Error.RequestError> {
|
|
49
49
|
readonly [TypeId]: TypeId
|
|
50
50
|
readonly source: unknown
|
|
51
51
|
readonly url: string
|
|
52
52
|
readonly originalUrl: string
|
|
53
|
-
readonly method:
|
|
53
|
+
readonly method: HttpMethod
|
|
54
54
|
readonly cookies: ReadonlyRecord<string, string>
|
|
55
55
|
|
|
56
56
|
readonly multipart: Effect.Effect<
|
|
@@ -68,14 +68,14 @@ export interface ServerRequest extends IncomingMessage.IncomingMessage<Error.Req
|
|
|
68
68
|
readonly headers?: Headers.Headers
|
|
69
69
|
readonly remoteAddress?: string
|
|
70
70
|
}
|
|
71
|
-
) =>
|
|
71
|
+
) => HttpServerRequest
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
75
|
* @since 1.0.0
|
|
76
76
|
* @category context
|
|
77
77
|
*/
|
|
78
|
-
export const
|
|
78
|
+
export const HttpServerRequest: Context.Tag<HttpServerRequest, HttpServerRequest> = internal.serverRequestTag
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
81
|
* @since 1.0.0
|
|
@@ -106,14 +106,14 @@ export const searchParamsFromURL: (url: URL) => ReadonlyRecord<string, string |
|
|
|
106
106
|
export const persistedMultipart: Effect.Effect<
|
|
107
107
|
unknown,
|
|
108
108
|
Multipart.MultipartError,
|
|
109
|
-
Scope.Scope | FileSystem.FileSystem | Path.Path |
|
|
109
|
+
Scope.Scope | FileSystem.FileSystem | Path.Path | HttpServerRequest
|
|
110
110
|
> = internal.multipartPersisted
|
|
111
111
|
|
|
112
112
|
/**
|
|
113
113
|
* @since 1.0.0
|
|
114
114
|
* @category accessors
|
|
115
115
|
*/
|
|
116
|
-
export const upgrade: Effect.Effect<Socket.Socket, Error.RequestError,
|
|
116
|
+
export const upgrade: Effect.Effect<Socket.Socket, Error.RequestError, HttpServerRequest> = internal.upgrade
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* @since 1.0.0
|
|
@@ -126,7 +126,7 @@ export const upgradeChannel: <IE = never>() => Channel<
|
|
|
126
126
|
IE,
|
|
127
127
|
void,
|
|
128
128
|
unknown,
|
|
129
|
-
|
|
129
|
+
HttpServerRequest
|
|
130
130
|
> = internal.upgradeChannel
|
|
131
131
|
|
|
132
132
|
/**
|
|
@@ -136,7 +136,7 @@ export const upgradeChannel: <IE = never>() => Channel<
|
|
|
136
136
|
export const schemaCookies: <A, I extends Readonly<Record<string, string>>, R>(
|
|
137
137
|
schema: Schema.Schema<A, I, R>,
|
|
138
138
|
options?: ParseOptions | undefined
|
|
139
|
-
) => Effect.Effect<A, ParseResult.ParseError,
|
|
139
|
+
) => Effect.Effect<A, ParseResult.ParseError, HttpServerRequest | R> = internal.schemaCookies
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
142
|
* @since 1.0.0
|
|
@@ -145,7 +145,7 @@ export const schemaCookies: <A, I extends Readonly<Record<string, string>>, R>(
|
|
|
145
145
|
export const schemaHeaders: <A, I extends Readonly<Record<string, string>>, R>(
|
|
146
146
|
schema: Schema.Schema<A, I, R>,
|
|
147
147
|
options?: ParseOptions | undefined
|
|
148
|
-
) => Effect.Effect<A, ParseResult.ParseError,
|
|
148
|
+
) => Effect.Effect<A, ParseResult.ParseError, HttpServerRequest | R> = internal.schemaHeaders
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
151
|
* @since 1.0.0
|
|
@@ -163,7 +163,7 @@ export const schemaSearchParams: <A, I extends Readonly<Record<string, string |
|
|
|
163
163
|
export const schemaBodyJson: <A, I, R>(
|
|
164
164
|
schema: Schema.Schema<A, I, R>,
|
|
165
165
|
options?: ParseOptions | undefined
|
|
166
|
-
) => Effect.Effect<A, Error.RequestError | ParseResult.ParseError,
|
|
166
|
+
) => Effect.Effect<A, Error.RequestError | ParseResult.ParseError, HttpServerRequest | R> = internal.schemaBodyJson
|
|
167
167
|
|
|
168
168
|
/**
|
|
169
169
|
* @since 1.0.0
|
|
@@ -175,7 +175,7 @@ export const schemaBodyForm: <A, I extends Partial<Multipart.Persisted>, R>(
|
|
|
175
175
|
) => Effect.Effect<
|
|
176
176
|
A,
|
|
177
177
|
Multipart.MultipartError | ParseResult.ParseError | Error.RequestError,
|
|
178
|
-
R |
|
|
178
|
+
R | HttpServerRequest | Scope.Scope | FileSystem.FileSystem | Path.Path
|
|
179
179
|
> = internal.schemaBodyForm
|
|
180
180
|
|
|
181
181
|
/**
|
|
@@ -185,7 +185,7 @@ export const schemaBodyForm: <A, I extends Partial<Multipart.Persisted>, R>(
|
|
|
185
185
|
export const schemaBodyUrlParams: <A, I extends Readonly<Record<string, string>>, R>(
|
|
186
186
|
schema: Schema.Schema<A, I, R>,
|
|
187
187
|
options?: ParseOptions | undefined
|
|
188
|
-
) => Effect.Effect<A, ParseResult.ParseError | Error.RequestError, R |
|
|
188
|
+
) => Effect.Effect<A, ParseResult.ParseError | Error.RequestError, R | HttpServerRequest> = internal.schemaBodyUrlParams
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
191
|
* @since 1.0.0
|
|
@@ -197,7 +197,7 @@ export const schemaBodyMultipart: <A, I extends Partial<Multipart.Persisted>, R>
|
|
|
197
197
|
) => Effect.Effect<
|
|
198
198
|
A,
|
|
199
199
|
Multipart.MultipartError | ParseResult.ParseError,
|
|
200
|
-
R |
|
|
200
|
+
R | HttpServerRequest | Scope.Scope | FileSystem.FileSystem | Path.Path
|
|
201
201
|
> = internal.schemaBodyMultipart
|
|
202
202
|
|
|
203
203
|
/**
|
|
@@ -212,11 +212,11 @@ export const schemaBodyFormJson: <A, I, R>(
|
|
|
212
212
|
) => Effect.Effect<
|
|
213
213
|
A,
|
|
214
214
|
ParseResult.ParseError | Error.RequestError,
|
|
215
|
-
R |
|
|
215
|
+
R | HttpServerRequest | FileSystem.FileSystem | Path.Path | Scope.Scope
|
|
216
216
|
> = internal.schemaBodyFormJson
|
|
217
217
|
|
|
218
218
|
/**
|
|
219
219
|
* @since 1.0.0
|
|
220
220
|
* @category conversions
|
|
221
221
|
*/
|
|
222
|
-
export const fromWeb: (request: Request) =>
|
|
222
|
+
export const fromWeb: (request: Request) => HttpServerRequest = internal.fromWeb
|