@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
|
@@ -8,22 +8,22 @@ import type { Inspectable } from "effect/Inspectable"
|
|
|
8
8
|
import type * as Option from "effect/Option"
|
|
9
9
|
import type { Scope } from "effect/Scope"
|
|
10
10
|
import type * as Stream from "effect/Stream"
|
|
11
|
-
import type * as PlatformError from "
|
|
12
|
-
import type * as FileSystem from "
|
|
13
|
-
import * as internal from "../internal/http/clientRequest.js"
|
|
14
|
-
import type * as Body from "./Body.js"
|
|
15
|
-
import type { Client } from "./Client.js"
|
|
16
|
-
import type { HttpClientError } from "./ClientError.js"
|
|
17
|
-
import type { ClientResponse } from "./ClientResponse.js"
|
|
11
|
+
import type * as PlatformError from "./Error.js"
|
|
12
|
+
import type * as FileSystem from "./FileSystem.js"
|
|
18
13
|
import type * as Headers from "./Headers.js"
|
|
19
|
-
import type
|
|
14
|
+
import type * as Body from "./HttpBody.js"
|
|
15
|
+
import type { HttpClient } from "./HttpClient.js"
|
|
16
|
+
import type { HttpClientError } from "./HttpClientError.js"
|
|
17
|
+
import type { HttpClientResponse } from "./HttpClientResponse.js"
|
|
18
|
+
import type { HttpMethod } from "./HttpMethod.js"
|
|
19
|
+
import * as internal from "./internal/httpClientRequest.js"
|
|
20
20
|
import type * as UrlParams from "./UrlParams.js"
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* @since 1.0.0
|
|
24
24
|
* @category type ids
|
|
25
25
|
*/
|
|
26
|
-
export const TypeId: unique symbol = Symbol.for("@effect/platform/
|
|
26
|
+
export const TypeId: unique symbol = Symbol.for("@effect/platform/HttpClientRequest")
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* @since 1.0.0
|
|
@@ -35,16 +35,16 @@ export type TypeId = typeof TypeId
|
|
|
35
35
|
* @since 1.0.0
|
|
36
36
|
* @category models
|
|
37
37
|
*/
|
|
38
|
-
export interface
|
|
39
|
-
extends Effect.Effect<
|
|
38
|
+
export interface HttpClientRequest
|
|
39
|
+
extends Effect.Effect<HttpClientResponse, HttpClientError, HttpClient.Default | Scope>, Inspectable
|
|
40
40
|
{
|
|
41
41
|
readonly [TypeId]: TypeId
|
|
42
|
-
readonly method:
|
|
42
|
+
readonly method: HttpMethod
|
|
43
43
|
readonly url: string
|
|
44
44
|
readonly urlParams: UrlParams.UrlParams
|
|
45
45
|
readonly hash: Option.Option<string>
|
|
46
46
|
readonly headers: Headers.Headers
|
|
47
|
-
readonly body: Body.
|
|
47
|
+
readonly body: Body.HttpBody
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
|
@@ -52,12 +52,12 @@ export interface ClientRequest
|
|
|
52
52
|
* @category models
|
|
53
53
|
*/
|
|
54
54
|
export interface Options {
|
|
55
|
-
readonly method?:
|
|
55
|
+
readonly method?: HttpMethod | undefined
|
|
56
56
|
readonly url?: string | URL | undefined
|
|
57
57
|
readonly urlParams?: UrlParams.Input | undefined
|
|
58
58
|
readonly hash?: string | undefined
|
|
59
59
|
readonly headers?: Headers.Input | undefined
|
|
60
|
-
readonly body?: Body.
|
|
60
|
+
readonly body?: Body.HttpBody | undefined
|
|
61
61
|
readonly accept?: string | undefined
|
|
62
62
|
readonly acceptJson?: boolean | undefined
|
|
63
63
|
}
|
|
@@ -83,62 +83,62 @@ export declare namespace Options {
|
|
|
83
83
|
* @since 1.0.0
|
|
84
84
|
* @category constructors
|
|
85
85
|
*/
|
|
86
|
-
export const make: <M extends
|
|
86
|
+
export const make: <M extends HttpMethod>(
|
|
87
87
|
method: M
|
|
88
88
|
) => (
|
|
89
89
|
url: string | URL,
|
|
90
90
|
options?: (M extends "GET" | "HEAD" ? Options.NoBody : Options.NoUrl) | undefined
|
|
91
|
-
) =>
|
|
91
|
+
) => HttpClientRequest = internal.make
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* @since 1.0.0
|
|
95
95
|
* @category constructors
|
|
96
96
|
*/
|
|
97
|
-
export const get: (url: string | URL, options?: Options.NoBody) =>
|
|
97
|
+
export const get: (url: string | URL, options?: Options.NoBody) => HttpClientRequest = internal.get
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* @since 1.0.0
|
|
101
101
|
* @category constructors
|
|
102
102
|
*/
|
|
103
|
-
export const post: (url: string | URL, options?: Options.NoUrl) =>
|
|
103
|
+
export const post: (url: string | URL, options?: Options.NoUrl) => HttpClientRequest = internal.post
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* @since 1.0.0
|
|
107
107
|
* @category constructors
|
|
108
108
|
*/
|
|
109
|
-
export const patch: (url: string | URL, options?: Options.NoUrl) =>
|
|
109
|
+
export const patch: (url: string | URL, options?: Options.NoUrl) => HttpClientRequest = internal.patch
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
112
|
* @since 1.0.0
|
|
113
113
|
* @category constructors
|
|
114
114
|
*/
|
|
115
|
-
export const put: (url: string | URL, options?: Options.NoUrl) =>
|
|
115
|
+
export const put: (url: string | URL, options?: Options.NoUrl) => HttpClientRequest = internal.put
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
118
|
* @since 1.0.0
|
|
119
119
|
* @category constructors
|
|
120
120
|
*/
|
|
121
|
-
export const del: (url: string | URL, options?: Options.NoUrl) =>
|
|
121
|
+
export const del: (url: string | URL, options?: Options.NoUrl) => HttpClientRequest = internal.del
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
124
|
* @since 1.0.0
|
|
125
125
|
* @category constructors
|
|
126
126
|
*/
|
|
127
|
-
export const head: (url: string | URL, options?: Options.NoBody) =>
|
|
127
|
+
export const head: (url: string | URL, options?: Options.NoBody) => HttpClientRequest = internal.head
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
130
|
* @since 1.0.0
|
|
131
131
|
* @category constructors
|
|
132
132
|
*/
|
|
133
|
-
export const options: (url: string | URL, options?: Options.NoUrl) =>
|
|
133
|
+
export const options: (url: string | URL, options?: Options.NoUrl) => HttpClientRequest = internal.options
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
136
|
* @since 1.0.0
|
|
137
137
|
* @category combinators
|
|
138
138
|
*/
|
|
139
139
|
export const modify: {
|
|
140
|
-
(options: Options): (self:
|
|
141
|
-
(self:
|
|
140
|
+
(options: Options): (self: HttpClientRequest) => HttpClientRequest
|
|
141
|
+
(self: HttpClientRequest, options: Options): HttpClientRequest
|
|
142
142
|
} = internal.modify
|
|
143
143
|
|
|
144
144
|
/**
|
|
@@ -146,8 +146,8 @@ export const modify: {
|
|
|
146
146
|
* @category combinators
|
|
147
147
|
*/
|
|
148
148
|
export const setMethod: {
|
|
149
|
-
(method:
|
|
150
|
-
(self:
|
|
149
|
+
(method: HttpMethod): (self: HttpClientRequest) => HttpClientRequest
|
|
150
|
+
(self: HttpClientRequest, method: HttpMethod): HttpClientRequest
|
|
151
151
|
} = internal.setMethod
|
|
152
152
|
|
|
153
153
|
/**
|
|
@@ -155,8 +155,8 @@ export const setMethod: {
|
|
|
155
155
|
* @category combinators
|
|
156
156
|
*/
|
|
157
157
|
export const setHeader: {
|
|
158
|
-
(key: string, value: string): (self:
|
|
159
|
-
(self:
|
|
158
|
+
(key: string, value: string): (self: HttpClientRequest) => HttpClientRequest
|
|
159
|
+
(self: HttpClientRequest, key: string, value: string): HttpClientRequest
|
|
160
160
|
} = internal.setHeader
|
|
161
161
|
|
|
162
162
|
/**
|
|
@@ -164,8 +164,8 @@ export const setHeader: {
|
|
|
164
164
|
* @category combinators
|
|
165
165
|
*/
|
|
166
166
|
export const setHeaders: {
|
|
167
|
-
(input: Headers.Input): (self:
|
|
168
|
-
(self:
|
|
167
|
+
(input: Headers.Input): (self: HttpClientRequest) => HttpClientRequest
|
|
168
|
+
(self: HttpClientRequest, input: Headers.Input): HttpClientRequest
|
|
169
169
|
} = internal.setHeaders
|
|
170
170
|
|
|
171
171
|
/**
|
|
@@ -173,8 +173,8 @@ export const setHeaders: {
|
|
|
173
173
|
* @category combinators
|
|
174
174
|
*/
|
|
175
175
|
export const basicAuth: {
|
|
176
|
-
(username: string, password: string): (self:
|
|
177
|
-
(self:
|
|
176
|
+
(username: string, password: string): (self: HttpClientRequest) => HttpClientRequest
|
|
177
|
+
(self: HttpClientRequest, username: string, password: string): HttpClientRequest
|
|
178
178
|
} = internal.basicAuth
|
|
179
179
|
|
|
180
180
|
/**
|
|
@@ -182,8 +182,8 @@ export const basicAuth: {
|
|
|
182
182
|
* @category combinators
|
|
183
183
|
*/
|
|
184
184
|
export const bearerToken: {
|
|
185
|
-
(token: string): (self:
|
|
186
|
-
(self:
|
|
185
|
+
(token: string): (self: HttpClientRequest) => HttpClientRequest
|
|
186
|
+
(self: HttpClientRequest, token: string): HttpClientRequest
|
|
187
187
|
} = internal.bearerToken
|
|
188
188
|
|
|
189
189
|
/**
|
|
@@ -191,23 +191,23 @@ export const bearerToken: {
|
|
|
191
191
|
* @category combinators
|
|
192
192
|
*/
|
|
193
193
|
export const accept: {
|
|
194
|
-
(mediaType: string): (self:
|
|
195
|
-
(self:
|
|
194
|
+
(mediaType: string): (self: HttpClientRequest) => HttpClientRequest
|
|
195
|
+
(self: HttpClientRequest, mediaType: string): HttpClientRequest
|
|
196
196
|
} = internal.accept
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
199
|
* @since 1.0.0
|
|
200
200
|
* @category combinators
|
|
201
201
|
*/
|
|
202
|
-
export const acceptJson: (self:
|
|
202
|
+
export const acceptJson: (self: HttpClientRequest) => HttpClientRequest = internal.acceptJson
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
205
|
* @since 1.0.0
|
|
206
206
|
* @category combinators
|
|
207
207
|
*/
|
|
208
208
|
export const setUrl: {
|
|
209
|
-
(url: string | URL): (self:
|
|
210
|
-
(self:
|
|
209
|
+
(url: string | URL): (self: HttpClientRequest) => HttpClientRequest
|
|
210
|
+
(self: HttpClientRequest, url: string | URL): HttpClientRequest
|
|
211
211
|
} = internal.setUrl
|
|
212
212
|
|
|
213
213
|
/**
|
|
@@ -215,8 +215,8 @@ export const setUrl: {
|
|
|
215
215
|
* @category combinators
|
|
216
216
|
*/
|
|
217
217
|
export const prependUrl: {
|
|
218
|
-
(path: string): (self:
|
|
219
|
-
(self:
|
|
218
|
+
(path: string): (self: HttpClientRequest) => HttpClientRequest
|
|
219
|
+
(self: HttpClientRequest, path: string): HttpClientRequest
|
|
220
220
|
} = internal.prependUrl
|
|
221
221
|
|
|
222
222
|
/**
|
|
@@ -224,8 +224,8 @@ export const prependUrl: {
|
|
|
224
224
|
* @category combinators
|
|
225
225
|
*/
|
|
226
226
|
export const appendUrl: {
|
|
227
|
-
(path: string): (self:
|
|
228
|
-
(self:
|
|
227
|
+
(path: string): (self: HttpClientRequest) => HttpClientRequest
|
|
228
|
+
(self: HttpClientRequest, path: string): HttpClientRequest
|
|
229
229
|
} = internal.appendUrl
|
|
230
230
|
|
|
231
231
|
/**
|
|
@@ -233,8 +233,8 @@ export const appendUrl: {
|
|
|
233
233
|
* @category combinators
|
|
234
234
|
*/
|
|
235
235
|
export const updateUrl: {
|
|
236
|
-
(f: (url: string) => string): (self:
|
|
237
|
-
(self:
|
|
236
|
+
(f: (url: string) => string): (self: HttpClientRequest) => HttpClientRequest
|
|
237
|
+
(self: HttpClientRequest, f: (url: string) => string): HttpClientRequest
|
|
238
238
|
} = internal.updateUrl
|
|
239
239
|
|
|
240
240
|
/**
|
|
@@ -242,8 +242,8 @@ export const updateUrl: {
|
|
|
242
242
|
* @category combinators
|
|
243
243
|
*/
|
|
244
244
|
export const setUrlParam: {
|
|
245
|
-
(key: string, value: string): (self:
|
|
246
|
-
(self:
|
|
245
|
+
(key: string, value: string): (self: HttpClientRequest) => HttpClientRequest
|
|
246
|
+
(self: HttpClientRequest, key: string, value: string): HttpClientRequest
|
|
247
247
|
} = internal.setUrlParam
|
|
248
248
|
|
|
249
249
|
/**
|
|
@@ -251,8 +251,8 @@ export const setUrlParam: {
|
|
|
251
251
|
* @category combinators
|
|
252
252
|
*/
|
|
253
253
|
export const setUrlParams: {
|
|
254
|
-
(input: UrlParams.Input): (self:
|
|
255
|
-
(self:
|
|
254
|
+
(input: UrlParams.Input): (self: HttpClientRequest) => HttpClientRequest
|
|
255
|
+
(self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest
|
|
256
256
|
} = internal.setUrlParams
|
|
257
257
|
|
|
258
258
|
/**
|
|
@@ -260,8 +260,8 @@ export const setUrlParams: {
|
|
|
260
260
|
* @category combinators
|
|
261
261
|
*/
|
|
262
262
|
export const appendUrlParam: {
|
|
263
|
-
(key: string, value: string): (self:
|
|
264
|
-
(self:
|
|
263
|
+
(key: string, value: string): (self: HttpClientRequest) => HttpClientRequest
|
|
264
|
+
(self: HttpClientRequest, key: string, value: string): HttpClientRequest
|
|
265
265
|
} = internal.appendUrlParam
|
|
266
266
|
|
|
267
267
|
/**
|
|
@@ -269,8 +269,8 @@ export const appendUrlParam: {
|
|
|
269
269
|
* @category combinators
|
|
270
270
|
*/
|
|
271
271
|
export const appendUrlParams: {
|
|
272
|
-
(input: UrlParams.Input): (self:
|
|
273
|
-
(self:
|
|
272
|
+
(input: UrlParams.Input): (self: HttpClientRequest) => HttpClientRequest
|
|
273
|
+
(self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest
|
|
274
274
|
} = internal.appendUrlParams
|
|
275
275
|
|
|
276
276
|
/**
|
|
@@ -278,23 +278,23 @@ export const appendUrlParams: {
|
|
|
278
278
|
* @category combinators
|
|
279
279
|
*/
|
|
280
280
|
export const setHash: {
|
|
281
|
-
(hash: string): (self:
|
|
282
|
-
(self:
|
|
281
|
+
(hash: string): (self: HttpClientRequest) => HttpClientRequest
|
|
282
|
+
(self: HttpClientRequest, hash: string): HttpClientRequest
|
|
283
283
|
} = internal.setHash
|
|
284
284
|
|
|
285
285
|
/**
|
|
286
286
|
* @since 1.0.0
|
|
287
287
|
* @category combinators
|
|
288
288
|
*/
|
|
289
|
-
export const removeHash: (self:
|
|
289
|
+
export const removeHash: (self: HttpClientRequest) => HttpClientRequest = internal.removeHash
|
|
290
290
|
|
|
291
291
|
/**
|
|
292
292
|
* @since 1.0.0
|
|
293
293
|
* @category combinators
|
|
294
294
|
*/
|
|
295
295
|
export const setBody: {
|
|
296
|
-
(body: Body.
|
|
297
|
-
(self:
|
|
296
|
+
(body: Body.HttpBody): (self: HttpClientRequest) => HttpClientRequest
|
|
297
|
+
(self: HttpClientRequest, body: Body.HttpBody): HttpClientRequest
|
|
298
298
|
} = internal.setBody
|
|
299
299
|
|
|
300
300
|
/**
|
|
@@ -302,8 +302,8 @@ export const setBody: {
|
|
|
302
302
|
* @category combinators
|
|
303
303
|
*/
|
|
304
304
|
export const uint8ArrayBody: {
|
|
305
|
-
(body: Uint8Array, contentType?: string): (self:
|
|
306
|
-
(self:
|
|
305
|
+
(body: Uint8Array, contentType?: string): (self: HttpClientRequest) => HttpClientRequest
|
|
306
|
+
(self: HttpClientRequest, body: Uint8Array, contentType?: string): HttpClientRequest
|
|
307
307
|
} = internal.uint8ArrayBody
|
|
308
308
|
|
|
309
309
|
/**
|
|
@@ -311,8 +311,8 @@ export const uint8ArrayBody: {
|
|
|
311
311
|
* @category combinators
|
|
312
312
|
*/
|
|
313
313
|
export const textBody: {
|
|
314
|
-
(body: string, contentType?: string): (self:
|
|
315
|
-
(self:
|
|
314
|
+
(body: string, contentType?: string): (self: HttpClientRequest) => HttpClientRequest
|
|
315
|
+
(self: HttpClientRequest, body: string, contentType?: string): HttpClientRequest
|
|
316
316
|
} = internal.textBody
|
|
317
317
|
|
|
318
318
|
/**
|
|
@@ -320,8 +320,8 @@ export const textBody: {
|
|
|
320
320
|
* @category combinators
|
|
321
321
|
*/
|
|
322
322
|
export const jsonBody: {
|
|
323
|
-
(body: unknown): (self:
|
|
324
|
-
(self:
|
|
323
|
+
(body: unknown): (self: HttpClientRequest) => Effect.Effect<HttpClientRequest, Body.HttpBodyError>
|
|
324
|
+
(self: HttpClientRequest, body: unknown): Effect.Effect<HttpClientRequest, Body.HttpBodyError>
|
|
325
325
|
} = internal.jsonBody
|
|
326
326
|
|
|
327
327
|
/**
|
|
@@ -329,8 +329,8 @@ export const jsonBody: {
|
|
|
329
329
|
* @category combinators
|
|
330
330
|
*/
|
|
331
331
|
export const unsafeJsonBody: {
|
|
332
|
-
(body: unknown): (self:
|
|
333
|
-
(self:
|
|
332
|
+
(body: unknown): (self: HttpClientRequest) => HttpClientRequest
|
|
333
|
+
(self: HttpClientRequest, body: unknown): HttpClientRequest
|
|
334
334
|
} = internal.unsafeJsonBody
|
|
335
335
|
|
|
336
336
|
/**
|
|
@@ -341,8 +341,8 @@ export const schemaBody: <A, I, R>(
|
|
|
341
341
|
schema: Schema.Schema<A, I, R>,
|
|
342
342
|
options?: ParseOptions | undefined
|
|
343
343
|
) => {
|
|
344
|
-
(body: A): (self:
|
|
345
|
-
(self:
|
|
344
|
+
(body: A): (self: HttpClientRequest) => Effect.Effect<HttpClientRequest, Body.HttpBodyError, R>
|
|
345
|
+
(self: HttpClientRequest, body: A): Effect.Effect<HttpClientRequest, Body.HttpBodyError, R>
|
|
346
346
|
} = internal.schemaBody
|
|
347
347
|
|
|
348
348
|
/**
|
|
@@ -350,8 +350,8 @@ export const schemaBody: <A, I, R>(
|
|
|
350
350
|
* @category combinators
|
|
351
351
|
*/
|
|
352
352
|
export const urlParamsBody: {
|
|
353
|
-
(input: UrlParams.Input): (self:
|
|
354
|
-
(self:
|
|
353
|
+
(input: UrlParams.Input): (self: HttpClientRequest) => HttpClientRequest
|
|
354
|
+
(self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest
|
|
355
355
|
} = internal.urlParamsBody
|
|
356
356
|
|
|
357
357
|
/**
|
|
@@ -359,8 +359,8 @@ export const urlParamsBody: {
|
|
|
359
359
|
* @category combinators
|
|
360
360
|
*/
|
|
361
361
|
export const formDataBody: {
|
|
362
|
-
(body: FormData): (self:
|
|
363
|
-
(self:
|
|
362
|
+
(body: FormData): (self: HttpClientRequest) => HttpClientRequest
|
|
363
|
+
(self: HttpClientRequest, body: FormData): HttpClientRequest
|
|
364
364
|
} = internal.formDataBody
|
|
365
365
|
|
|
366
366
|
/**
|
|
@@ -371,12 +371,12 @@ export const streamBody: {
|
|
|
371
371
|
(
|
|
372
372
|
body: Stream.Stream<Uint8Array, unknown>,
|
|
373
373
|
options?: { readonly contentType?: string | undefined; readonly contentLength?: number | undefined } | undefined
|
|
374
|
-
): (self:
|
|
374
|
+
): (self: HttpClientRequest) => HttpClientRequest
|
|
375
375
|
(
|
|
376
|
-
self:
|
|
376
|
+
self: HttpClientRequest,
|
|
377
377
|
body: Stream.Stream<Uint8Array, unknown>,
|
|
378
378
|
options?: { readonly contentType?: string | undefined; readonly contentLength?: number | undefined } | undefined
|
|
379
|
-
):
|
|
379
|
+
): HttpClientRequest
|
|
380
380
|
} = internal.streamBody
|
|
381
381
|
|
|
382
382
|
/**
|
|
@@ -387,12 +387,12 @@ export const fileBody: {
|
|
|
387
387
|
(
|
|
388
388
|
path: string,
|
|
389
389
|
options?: FileSystem.StreamOptions & { readonly contentType?: string }
|
|
390
|
-
): (self:
|
|
390
|
+
): (self: HttpClientRequest) => Effect.Effect<HttpClientRequest, PlatformError.PlatformError, FileSystem.FileSystem>
|
|
391
391
|
(
|
|
392
|
-
self:
|
|
392
|
+
self: HttpClientRequest,
|
|
393
393
|
path: string,
|
|
394
394
|
options?: FileSystem.StreamOptions & { readonly contentType?: string }
|
|
395
|
-
): Effect.Effect<
|
|
395
|
+
): Effect.Effect<HttpClientRequest, PlatformError.PlatformError, FileSystem.FileSystem>
|
|
396
396
|
} = internal.fileBody
|
|
397
397
|
|
|
398
398
|
/**
|
|
@@ -400,6 +400,6 @@ export const fileBody: {
|
|
|
400
400
|
* @category combinators
|
|
401
401
|
*/
|
|
402
402
|
export const fileWebBody: {
|
|
403
|
-
(file: Body.
|
|
404
|
-
(self:
|
|
403
|
+
(file: Body.HttpBody.FileLike): (self: HttpClientRequest) => HttpClientRequest
|
|
404
|
+
(self: HttpClientRequest, file: Body.HttpBody.FileLike): HttpClientRequest
|
|
405
405
|
} = internal.fileWebBody
|
|
@@ -7,11 +7,11 @@ import type * as Schema from "@effect/schema/Schema"
|
|
|
7
7
|
import type * as Effect from "effect/Effect"
|
|
8
8
|
import type * as Scope from "effect/Scope"
|
|
9
9
|
import type * as Stream from "effect/Stream"
|
|
10
|
-
import * as internal from "../internal/http/clientResponse.js"
|
|
11
|
-
import type * as Error from "./ClientError.js"
|
|
12
|
-
import type * as ClientRequest from "./ClientRequest.js"
|
|
13
10
|
import type * as Cookies from "./Cookies.js"
|
|
14
|
-
import type * as
|
|
11
|
+
import type * as Error from "./HttpClientError.js"
|
|
12
|
+
import type * as ClientRequest from "./HttpClientRequest.js"
|
|
13
|
+
import type * as IncomingMessage from "./HttpIncomingMessage.js"
|
|
14
|
+
import * as internal from "./internal/httpClientResponse.js"
|
|
15
15
|
import type * as UrlParams from "./UrlParams.js"
|
|
16
16
|
|
|
17
17
|
export {
|
|
@@ -45,7 +45,7 @@ export {
|
|
|
45
45
|
* @category schema
|
|
46
46
|
*/
|
|
47
47
|
schemaHeadersScoped
|
|
48
|
-
} from "./
|
|
48
|
+
} from "./HttpIncomingMessage.js"
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* @since 1.0.0
|
|
@@ -63,7 +63,7 @@ export type TypeId = typeof TypeId
|
|
|
63
63
|
* @since 1.0.0
|
|
64
64
|
* @category models
|
|
65
65
|
*/
|
|
66
|
-
export interface
|
|
66
|
+
export interface HttpClientResponse extends IncomingMessage.HttpIncomingMessage<Error.ResponseError> {
|
|
67
67
|
readonly [TypeId]: TypeId
|
|
68
68
|
readonly status: number
|
|
69
69
|
readonly cookies: Cookies.Cookies
|
|
@@ -74,7 +74,8 @@ export interface ClientResponse extends IncomingMessage.IncomingMessage<Error.Re
|
|
|
74
74
|
* @since 1.0.0
|
|
75
75
|
* @category constructors
|
|
76
76
|
*/
|
|
77
|
-
export const fromWeb: (request: ClientRequest.
|
|
77
|
+
export const fromWeb: (request: ClientRequest.HttpClientRequest, source: Response) => HttpClientResponse =
|
|
78
|
+
internal.fromWeb
|
|
78
79
|
|
|
79
80
|
/**
|
|
80
81
|
* @since 1.0.0
|
|
@@ -91,7 +92,8 @@ export const schemaJson: <
|
|
|
91
92
|
>(
|
|
92
93
|
schema: Schema.Schema<A, I, R>,
|
|
93
94
|
options?: ParseOptions | undefined
|
|
94
|
-
) => (self:
|
|
95
|
+
) => (self: HttpClientResponse) => Effect.Effect<A, Error.ResponseError | ParseResult.ParseError, R> =
|
|
96
|
+
internal.schemaJson
|
|
95
97
|
|
|
96
98
|
/**
|
|
97
99
|
* @since 1.0.0
|
|
@@ -107,14 +109,14 @@ export const schemaNoBody: <
|
|
|
107
109
|
>(
|
|
108
110
|
schema: Schema.Schema<A, I, R>,
|
|
109
111
|
options?: ParseOptions | undefined
|
|
110
|
-
) => (self:
|
|
112
|
+
) => (self: HttpClientResponse) => Effect.Effect<A, ParseResult.ParseError, R> = internal.schemaNoBody
|
|
111
113
|
|
|
112
114
|
/**
|
|
113
115
|
* @since 1.0.0
|
|
114
116
|
* @category accessors
|
|
115
117
|
*/
|
|
116
118
|
export const arrayBuffer: <E, R>(
|
|
117
|
-
effect: Effect.Effect<
|
|
119
|
+
effect: Effect.Effect<HttpClientResponse, E, R>
|
|
118
120
|
) => Effect.Effect<ArrayBuffer, Error.ResponseError | E, Exclude<R, Scope.Scope>> = internal.arrayBuffer
|
|
119
121
|
|
|
120
122
|
/**
|
|
@@ -122,7 +124,7 @@ export const arrayBuffer: <E, R>(
|
|
|
122
124
|
* @category accessors
|
|
123
125
|
*/
|
|
124
126
|
export const formData: <E, R>(
|
|
125
|
-
effect: Effect.Effect<
|
|
127
|
+
effect: Effect.Effect<HttpClientResponse, E, R>
|
|
126
128
|
) => Effect.Effect<FormData, Error.ResponseError | E, Exclude<R, Scope.Scope>> = internal.formData
|
|
127
129
|
|
|
128
130
|
/**
|
|
@@ -130,11 +132,12 @@ export const formData: <E, R>(
|
|
|
130
132
|
* @category accessors
|
|
131
133
|
*/
|
|
132
134
|
export const json: <E, R>(
|
|
133
|
-
effect: Effect.Effect<
|
|
135
|
+
effect: Effect.Effect<HttpClientResponse, E, R>
|
|
134
136
|
) => Effect.Effect<unknown, Error.ResponseError | E, Exclude<R, Scope.Scope>> = internal.json
|
|
135
137
|
|
|
136
|
-
const void_: <E, R>(
|
|
137
|
-
|
|
138
|
+
const void_: <E, R>(
|
|
139
|
+
effect: Effect.Effect<HttpClientResponse, E, R>
|
|
140
|
+
) => Effect.Effect<void, E, Exclude<R, Scope.Scope>> = internal.void_
|
|
138
141
|
export {
|
|
139
142
|
/**
|
|
140
143
|
* @since 1.0.0
|
|
@@ -148,7 +151,7 @@ export {
|
|
|
148
151
|
* @category accessors
|
|
149
152
|
*/
|
|
150
153
|
export const stream: <E, R>(
|
|
151
|
-
effect: Effect.Effect<
|
|
154
|
+
effect: Effect.Effect<HttpClientResponse, E, R>
|
|
152
155
|
) => Stream.Stream<Uint8Array, Error.ResponseError | E, Exclude<R, Scope.Scope>> = internal.stream
|
|
153
156
|
|
|
154
157
|
/**
|
|
@@ -156,7 +159,7 @@ export const stream: <E, R>(
|
|
|
156
159
|
* @category accessors
|
|
157
160
|
*/
|
|
158
161
|
export const text: <E, R>(
|
|
159
|
-
effect: Effect.Effect<
|
|
162
|
+
effect: Effect.Effect<HttpClientResponse, E, R>
|
|
160
163
|
) => Effect.Effect<string, Error.ResponseError | E, Exclude<R, Scope.Scope>> = internal.text
|
|
161
164
|
|
|
162
165
|
/**
|
|
@@ -164,7 +167,7 @@ export const text: <E, R>(
|
|
|
164
167
|
* @category accessors
|
|
165
168
|
*/
|
|
166
169
|
export const urlParamsBody: <E, R>(
|
|
167
|
-
effect: Effect.Effect<
|
|
170
|
+
effect: Effect.Effect<HttpClientResponse, E, R>
|
|
168
171
|
) => Effect.Effect<UrlParams.UrlParams, Error.ResponseError | E, Exclude<R, Scope.Scope>> = internal.urlParamsBody
|
|
169
172
|
|
|
170
173
|
/**
|
|
@@ -183,7 +186,7 @@ export const schemaJsonScoped: <
|
|
|
183
186
|
schema: Schema.Schema<A, I, R>,
|
|
184
187
|
options?: ParseOptions | undefined
|
|
185
188
|
) => <E, R2>(
|
|
186
|
-
effect: Effect.Effect<
|
|
189
|
+
effect: Effect.Effect<HttpClientResponse, E, R2>
|
|
187
190
|
) => Effect.Effect<
|
|
188
191
|
A,
|
|
189
192
|
E | Error.ResponseError | ParseResult.ParseError,
|
|
@@ -205,6 +208,6 @@ export const schemaNoBodyScoped: <
|
|
|
205
208
|
schema: Schema.Schema<A, I, R>,
|
|
206
209
|
options?: ParseOptions | undefined
|
|
207
210
|
) => <E, R2>(
|
|
208
|
-
effect: Effect.Effect<
|
|
211
|
+
effect: Effect.Effect<HttpClientResponse, E, R2>
|
|
209
212
|
) => Effect.Effect<A, E | ParseResult.ParseError, Exclude<R, Scope.Scope> | Exclude<R2, Scope.Scope>> =
|
|
210
213
|
internal.schemaNoBodyScoped
|
|
@@ -12,7 +12,7 @@ import type { Inspectable } from "effect/Inspectable"
|
|
|
12
12
|
import * as Option from "effect/Option"
|
|
13
13
|
import type * as Scope from "effect/Scope"
|
|
14
14
|
import type * as Stream from "effect/Stream"
|
|
15
|
-
import * as FileSystem from "
|
|
15
|
+
import * as FileSystem from "./FileSystem.js"
|
|
16
16
|
import type * as Headers from "./Headers.js"
|
|
17
17
|
import type * as UrlParams from "./UrlParams.js"
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ import type * as UrlParams from "./UrlParams.js"
|
|
|
20
20
|
* @since 1.0.0
|
|
21
21
|
* @category type ids
|
|
22
22
|
*/
|
|
23
|
-
export const TypeId: unique symbol = Symbol.for("@effect/platform/
|
|
23
|
+
export const TypeId: unique symbol = Symbol.for("@effect/platform/HttpIncomingMessage")
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* @since 1.0.0
|
|
@@ -32,7 +32,7 @@ export type TypeId = typeof TypeId
|
|
|
32
32
|
* @since 1.0.0
|
|
33
33
|
* @category models
|
|
34
34
|
*/
|
|
35
|
-
export interface
|
|
35
|
+
export interface HttpIncomingMessage<E> extends Inspectable {
|
|
36
36
|
readonly [TypeId]: TypeId
|
|
37
37
|
readonly headers: Headers.Headers
|
|
38
38
|
readonly remoteAddress: Option.Option<string>
|
|
@@ -49,7 +49,7 @@ export interface IncomingMessage<E> extends Inspectable {
|
|
|
49
49
|
*/
|
|
50
50
|
export const schemaBodyJson = <A, I, R>(schema: Schema.Schema<A, I, R>, options?: ParseOptions | undefined) => {
|
|
51
51
|
const parse = Schema.decodeUnknown(schema, options)
|
|
52
|
-
return <E>(self:
|
|
52
|
+
return <E>(self: HttpIncomingMessage<E>): Effect.Effect<A, E | ParseResult.ParseError, R> =>
|
|
53
53
|
Effect.flatMap(self.json, parse)
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -60,7 +60,7 @@ export const schemaBodyJson = <A, I, R>(schema: Schema.Schema<A, I, R>, options?
|
|
|
60
60
|
export const schemaBodyJsonScoped = <A, I, R>(schema: Schema.Schema<A, I, R>, options?: ParseOptions | undefined) => {
|
|
61
61
|
const decode = schemaBodyJson(schema, options)
|
|
62
62
|
return <E, E2, R2>(
|
|
63
|
-
effect: Effect.Effect<
|
|
63
|
+
effect: Effect.Effect<HttpIncomingMessage<E>, E2, R2>
|
|
64
64
|
): Effect.Effect<A, ParseResult.ParseError | E | E2, Exclude<R, Scope.Scope> | Exclude<R2, Scope.Scope>> =>
|
|
65
65
|
Effect.scoped(Effect.flatMap(effect, decode))
|
|
66
66
|
}
|
|
@@ -74,7 +74,7 @@ export const schemaBodyUrlParams = <A, I extends Readonly<Record<string, string>
|
|
|
74
74
|
options?: ParseOptions | undefined
|
|
75
75
|
) => {
|
|
76
76
|
const parse = Schema.decodeUnknown(schema, options)
|
|
77
|
-
return <E>(self:
|
|
77
|
+
return <E>(self: HttpIncomingMessage<E>): Effect.Effect<A, E | ParseResult.ParseError, R> =>
|
|
78
78
|
Effect.flatMap(self.urlParamsBody, (_) => parse(Object.fromEntries(_)))
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -88,7 +88,7 @@ export const schemaBodyUrlParamsScoped = <A, I extends Readonly<Record<string, s
|
|
|
88
88
|
) => {
|
|
89
89
|
const decode = schemaBodyUrlParams(schema, options)
|
|
90
90
|
return <E, E2, R2>(
|
|
91
|
-
effect: Effect.Effect<
|
|
91
|
+
effect: Effect.Effect<HttpIncomingMessage<E>, E2, R2>
|
|
92
92
|
): Effect.Effect<A, ParseResult.ParseError | E | E2, Exclude<R, Scope.Scope> | Exclude<R2, Scope.Scope>> =>
|
|
93
93
|
Effect.scoped(Effect.flatMap(effect, decode))
|
|
94
94
|
}
|
|
@@ -102,7 +102,7 @@ export const schemaHeaders = <A, I extends Readonly<Record<string, string | unde
|
|
|
102
102
|
options?: ParseOptions | undefined
|
|
103
103
|
) => {
|
|
104
104
|
const parse = Schema.decodeUnknown(schema, options)
|
|
105
|
-
return <E>(self:
|
|
105
|
+
return <E>(self: HttpIncomingMessage<E>): Effect.Effect<A, ParseResult.ParseError, R> => parse(self.headers)
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
/**
|
|
@@ -115,7 +115,7 @@ export const schemaHeadersScoped = <A, I extends Readonly<Record<string, string>
|
|
|
115
115
|
) => {
|
|
116
116
|
const decode = schemaHeaders(schema, options)
|
|
117
117
|
return <E, E2, R2>(
|
|
118
|
-
effect: Effect.Effect<
|
|
118
|
+
effect: Effect.Effect<HttpIncomingMessage<E>, E2, R2>
|
|
119
119
|
): Effect.Effect<A, ParseResult.ParseError | E2, Exclude<R, Scope.Scope> | Exclude<R2, Scope.Scope>> =>
|
|
120
120
|
Effect.scoped(Effect.flatMap(effect, decode))
|
|
121
121
|
}
|
|
@@ -125,7 +125,7 @@ export const schemaHeadersScoped = <A, I extends Readonly<Record<string, string>
|
|
|
125
125
|
* @category fiber refs
|
|
126
126
|
*/
|
|
127
127
|
export const maxBodySize: FiberRef.FiberRef<Option.Option<FileSystem.Size>> = Global.globalValue(
|
|
128
|
-
"@effect/platform/
|
|
128
|
+
"@effect/platform/HttpIncomingMessage/maxBodySize",
|
|
129
129
|
() => FiberRef.unsafeMake(Option.none<FileSystem.Size>())
|
|
130
130
|
)
|
|
131
131
|
|
|
@@ -141,7 +141,7 @@ export const withMaxBodySize = dual<
|
|
|
141
141
|
/**
|
|
142
142
|
* @since 1.0.0
|
|
143
143
|
*/
|
|
144
|
-
export const inspect = <E>(self:
|
|
144
|
+
export const inspect = <E>(self: HttpIncomingMessage<E>, that: object): object => {
|
|
145
145
|
const contentType = self.headers["content-type"] ?? ""
|
|
146
146
|
let body: unknown
|
|
147
147
|
if (contentType.includes("application/json")) {
|