@zudojs/http 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/dist/httpAdapter/fetch/httpFetch.body.d.ts +20 -0
- package/dist/httpAdapter/fetch/httpFetch.body.d.ts.map +1 -0
- package/dist/httpAdapter/fetch/httpFetch.body.js +57 -0
- package/dist/httpAdapter/fetch/httpFetch.body.js.map +1 -0
- package/dist/httpAdapter/fetch/httpFetch.helper.d.ts.map +1 -0
- package/dist/httpAdapter/fetch/httpFetch.requestContext.d.ts.map +1 -0
- package/dist/httpAdapter/fetch/httpFetch.responseWriter.d.ts.map +1 -0
- package/dist/httpAdapter/fetch/httpFetch.type.d.ts.map +1 -0
- package/dist/httpAdapter/fetch/index.d.ts.map +1 -0
- package/dist/httpAdapter/http.adapter.d.ts +116 -0
- package/dist/httpAdapter/http.adapter.d.ts.map +1 -0
- package/dist/httpAdapter/http.adapter.js +284 -0
- package/dist/httpAdapter/http.adapter.js.map +1 -0
- package/dist/httpAdapter/http.adapters.d.ts.map +1 -0
- package/dist/httpAdapter/http.adapters.js +137 -0
- package/dist/httpAdapter/http.adapters.js.map +1 -0
- package/dist/httpAdapter/httpFetch.adapter.d.ts.map +1 -0
- package/dist/httpAdapter/index.d.ts +10 -0
- package/dist/httpAdapter/index.d.ts.map +1 -0
- package/dist/httpAdapter/index.js +10 -0
- package/dist/httpAdapter/index.js.map +1 -0
- package/dist/httpAdapter/node/httpNode.adapter.d.ts +42 -0
- package/dist/httpAdapter/node/httpNode.adapter.d.ts.map +1 -0
- package/dist/httpAdapter/node/httpNode.adapter.js +221 -0
- package/dist/httpAdapter/node/httpNode.adapter.js.map +1 -0
- package/dist/httpAdapter/node/httpNode.request.d.ts.map +1 -0
- package/dist/httpAdapter/node/httpNode.response.d.ts.map +1 -0
- package/dist/httpAdapter/node/httpNode.server.d.ts +39 -0
- package/dist/httpAdapter/node/httpNode.server.d.ts.map +1 -0
- package/dist/httpAdapter/node/httpNode.server.js +228 -0
- package/dist/httpAdapter/node/httpNode.server.js.map +1 -0
- package/dist/httpAdapter/node/httpNode.type.d.ts.map +1 -0
- package/dist/httpAdapter/node/index.d.ts +11 -0
- package/dist/httpAdapter/node/index.d.ts.map +1 -0
- package/dist/httpAdapter/node/index.js +11 -0
- package/dist/httpAdapter/node/index.js.map +1 -0
- package/dist/httpAgent/http.agent.d.ts.map +1 -0
- package/dist/httpAgent/index.d.ts +7 -0
- package/dist/httpAgent/index.d.ts.map +1 -0
- package/dist/httpAgent/index.js +7 -0
- package/dist/httpAgent/index.js.map +1 -0
- package/dist/httpBody/http.body.d.ts +36 -0
- package/dist/httpBody/http.body.d.ts.map +1 -0
- package/dist/httpBody/http.body.js +245 -0
- package/dist/httpBody/http.body.js.map +1 -0
- package/dist/httpBody/httpBody.formData.d.ts +48 -0
- package/dist/httpBody/httpBody.formData.d.ts.map +1 -0
- package/dist/httpBody/httpBody.formData.js +366 -0
- package/dist/httpBody/httpBody.formData.js.map +1 -0
- package/dist/httpBody/httpBody.parser.d.ts +44 -0
- package/dist/httpBody/httpBody.parser.d.ts.map +1 -0
- package/dist/httpBody/httpBody.parser.js +233 -0
- package/dist/httpBody/httpBody.parser.js.map +1 -0
- package/dist/httpBody/index.d.ts +9 -0
- package/dist/httpBody/index.d.ts.map +1 -0
- package/dist/httpBody/index.js +9 -0
- package/dist/httpBody/index.js.map +1 -0
- package/dist/httpCacheControl/core/httpCacheControl.parse.d.ts.map +1 -0
- package/dist/httpCacheControl/core/httpCacheControl.type.d.ts.map +1 -0
- package/dist/httpCacheControl/core/httpCacheControl.validation.d.ts.map +1 -0
- package/dist/httpCacheControl/core/index.d.ts.map +1 -0
- package/dist/httpCacheControl/httpCacheControl.core.d.ts.map +1 -0
- package/dist/httpCacheControl/httpCacheControl.factory.d.ts.map +1 -0
- package/dist/httpCacheControl/httpCacheControl.freshness.d.ts.map +1 -0
- package/dist/httpCacheControl/httpCacheControl.requestHelper.d.ts.map +1 -0
- package/dist/httpCacheControl/httpCacheControl.responseHelper.d.ts.map +1 -0
- package/dist/httpCacheControl/index.d.ts +7 -0
- package/dist/httpCacheControl/index.d.ts.map +1 -0
- package/dist/httpCacheControl/index.js +7 -0
- package/dist/httpCacheControl/index.js.map +1 -0
- package/dist/httpClient/httpClient.abort.d.ts.map +1 -0
- package/dist/httpClient/httpClient.body.d.ts.map +1 -0
- package/dist/httpClient/httpClient.client.d.ts.map +1 -0
- package/dist/httpClient/httpClient.context.d.ts.map +1 -0
- package/dist/httpClient/httpClient.error.d.ts +9 -0
- package/dist/httpClient/httpClient.error.d.ts.map +1 -0
- package/dist/httpClient/httpClient.error.js +9 -0
- package/dist/httpClient/httpClient.error.js.map +1 -0
- package/dist/httpClient/httpClient.errorNormalizer.d.ts.map +1 -0
- package/dist/httpClient/httpClient.executor.d.ts.map +1 -0
- package/dist/httpClient/httpClient.factory.d.ts.map +1 -0
- package/dist/httpClient/httpClient.headers.d.ts.map +1 -0
- package/dist/httpClient/httpClient.helpers.d.ts.map +1 -0
- package/dist/httpClient/httpClient.interceptors.d.ts.map +1 -0
- package/dist/httpClient/httpClient.methods.d.ts.map +1 -0
- package/dist/httpClient/httpClient.response.d.ts.map +1 -0
- package/dist/httpClient/httpClient.retry.d.ts +38 -0
- package/dist/httpClient/httpClient.retry.d.ts.map +1 -0
- package/dist/httpClient/httpClient.retry.js +61 -0
- package/dist/httpClient/httpClient.retry.js.map +1 -0
- package/dist/httpClient/httpClient.type.d.ts.map +1 -0
- package/dist/httpClient/httpClient.typeGuards.d.ts.map +1 -0
- package/dist/httpClient/httpClient.url.d.ts.map +1 -0
- package/dist/httpClient/index.d.ts +17 -0
- package/dist/httpClient/index.d.ts.map +1 -0
- package/dist/httpClient/index.js +17 -0
- package/dist/httpClient/index.js.map +1 -0
- package/dist/httpCompression/http.compression.d.ts.map +1 -0
- package/dist/httpCompression/index.d.ts +7 -0
- package/dist/httpCompression/index.d.ts.map +1 -0
- package/dist/httpCompression/index.js +7 -0
- package/dist/httpCompression/index.js.map +1 -0
- package/dist/httpConditional/httpConditional.core.d.ts.map +1 -0
- package/dist/httpConditional/index.d.ts +7 -0
- package/dist/httpConditional/index.d.ts.map +1 -0
- package/dist/httpConditional/index.js +7 -0
- package/dist/httpConditional/index.js.map +1 -0
- package/dist/httpConstants/http.constants.d.ts +171 -0
- package/dist/httpConstants/http.constants.d.ts.map +1 -0
- package/dist/httpConstants/http.constants.js +294 -0
- package/dist/httpConstants/http.constants.js.map +1 -0
- package/dist/httpConstants/index.d.ts +7 -0
- package/dist/httpConstants/index.d.ts.map +1 -0
- package/dist/httpConstants/index.js +7 -0
- package/dist/httpConstants/index.js.map +1 -0
- package/dist/httpContentDisposition/httpContentDisposition.core.d.ts.map +1 -0
- package/dist/httpContentDisposition/index.d.ts +7 -0
- package/dist/httpContentDisposition/index.d.ts.map +1 -0
- package/dist/httpContentDisposition/index.js +7 -0
- package/dist/httpContentDisposition/index.js.map +1 -0
- package/dist/httpContentType/httpContentType.boundary.d.ts.map +1 -0
- package/dist/httpContentType/httpContentType.category.d.ts.map +1 -0
- package/dist/httpContentType/httpContentType.categoryBinary.d.ts.map +1 -0
- package/dist/httpContentType/httpContentType.charset.d.ts.map +1 -0
- package/dist/httpContentType/httpContentType.constructors.d.ts.map +1 -0
- package/dist/httpContentType/httpContentType.formatter.d.ts.map +1 -0
- package/dist/httpContentType/httpContentType.matcher.d.ts.map +1 -0
- package/dist/httpContentType/httpContentType.mediaTypes.d.ts.map +1 -0
- package/dist/httpContentType/httpContentType.normalizer.d.ts.map +1 -0
- package/dist/httpContentType/httpContentType.parameter.d.ts.map +1 -0
- package/dist/httpContentType/httpContentType.parser.d.ts.map +1 -0
- package/dist/httpContentType/httpContentType.parserHelpers.d.ts.map +1 -0
- package/dist/httpContentType/httpContentType.type.d.ts.map +1 -0
- package/dist/httpContentType/index.d.ts +19 -0
- package/dist/httpContentType/index.d.ts.map +1 -0
- package/dist/httpContentType/index.js +19 -0
- package/dist/httpContentType/index.js.map +1 -0
- package/dist/httpContext/http.context.d.ts +45 -0
- package/dist/httpContext/http.context.d.ts.map +1 -0
- package/dist/httpContext/http.context.js +157 -0
- package/dist/httpContext/http.context.js.map +1 -0
- package/dist/httpContext/index.d.ts +7 -0
- package/dist/httpContext/index.d.ts.map +1 -0
- package/dist/httpContext/index.js +7 -0
- package/dist/httpContext/index.js.map +1 -0
- package/dist/httpCookies/http.cookies.d.ts.map +1 -0
- package/dist/httpCookies/index.d.ts +7 -0
- package/dist/httpCookies/index.d.ts.map +1 -0
- package/dist/httpCookies/index.js +7 -0
- package/dist/httpCookies/index.js.map +1 -0
- package/dist/httpCors/http.cors.d.ts.map +1 -0
- package/dist/httpCors/index.d.ts +7 -0
- package/dist/httpCors/index.d.ts.map +1 -0
- package/dist/httpCors/index.js +7 -0
- package/dist/httpCors/index.js.map +1 -0
- package/dist/httpCsp/checks/httpCsp.checks.d.ts.map +1 -0
- package/dist/httpCsp/checks/index.d.ts.map +1 -0
- package/dist/httpCsp/formatting/httpCsp.formatting.d.ts.map +1 -0
- package/dist/httpCsp/formatting/index.d.ts.map +1 -0
- package/dist/httpCsp/index.d.ts +19 -0
- package/dist/httpCsp/index.d.ts.map +1 -0
- package/dist/httpCsp/index.js +17 -0
- package/dist/httpCsp/index.js.map +1 -0
- package/dist/httpCsp/internal/httpCsp.internal.d.ts.map +1 -0
- package/dist/httpCsp/internal/index.d.ts.map +1 -0
- package/dist/httpCsp/nonce/httpCsp.nonce.d.ts.map +1 -0
- package/dist/httpCsp/nonce/index.d.ts.map +1 -0
- package/dist/httpCsp/parsing/httpCsp.parsing.d.ts.map +1 -0
- package/dist/httpCsp/parsing/index.d.ts.map +1 -0
- package/dist/httpCsp/policies/httpCsp.policies.d.ts.map +1 -0
- package/dist/httpCsp/policies/index.d.ts.map +1 -0
- package/dist/httpCsp/reportOnly/httpCsp.reportOnly.d.ts.map +1 -0
- package/dist/httpCsp/reportOnly/index.d.ts.map +1 -0
- package/dist/httpCsp/sources/httpCsp.sources.d.ts.map +1 -0
- package/dist/httpCsp/sources/index.d.ts.map +1 -0
- package/dist/httpCsp/types/httpCsp.constant.d.ts.map +1 -0
- package/dist/httpCsp/types/httpCsp.type.d.ts.map +1 -0
- package/dist/httpCsp/types/index.d.ts.map +1 -0
- package/dist/httpCsp/validation/httpCsp.validate.d.ts.map +1 -0
- package/dist/httpCsp/validation/httpCsp.validation.d.ts.map +1 -0
- package/dist/httpCsp/validation/index.d.ts.map +1 -0
- package/dist/httpErrors/factories/httpError.clientError.d.ts.map +1 -0
- package/dist/httpErrors/factories/httpError.serverError.d.ts.map +1 -0
- package/dist/httpErrors/httpError.base.d.ts +42 -0
- package/dist/httpErrors/httpError.base.d.ts.map +1 -0
- package/dist/httpErrors/httpError.base.js +73 -0
- package/dist/httpErrors/httpError.base.js.map +1 -0
- package/dist/httpErrors/httpError.helper.d.ts.map +1 -0
- package/dist/httpErrors/httpError.invalidJson.d.ts.map +1 -0
- package/dist/httpErrors/httpError.type.d.ts +69 -0
- package/dist/httpErrors/httpError.type.d.ts.map +1 -0
- package/dist/httpErrors/httpError.type.js +7 -0
- package/dist/httpErrors/httpError.type.js.map +1 -0
- package/dist/httpErrors/httpError.typeGuard.d.ts.map +1 -0
- package/dist/httpErrors/index.d.ts +13 -0
- package/dist/httpErrors/index.d.ts.map +1 -0
- package/dist/httpErrors/index.js +13 -0
- package/dist/httpErrors/index.js.map +1 -0
- package/dist/httpFormData/index.d.ts +7 -0
- package/dist/httpFormData/index.d.ts.map +1 -0
- package/dist/httpFormData/index.js +7 -0
- package/dist/httpFormData/index.js.map +1 -0
- package/dist/httpHeaders/authorization/httpHeaders.authorization.d.ts.map +1 -0
- package/dist/httpHeaders/authorization/index.d.ts +8 -0
- package/dist/httpHeaders/authorization/index.d.ts.map +1 -0
- package/dist/httpHeaders/authorization/index.js +8 -0
- package/dist/httpHeaders/authorization/index.js.map +1 -0
- package/dist/httpHeaders/basic/httpHeaders.basic.d.ts.map +1 -0
- package/dist/httpHeaders/basic/httpHeaders.basicMatch.d.ts.map +1 -0
- package/dist/httpHeaders/basic/index.d.ts +8 -0
- package/dist/httpHeaders/basic/index.d.ts.map +1 -0
- package/dist/httpHeaders/basic/index.js +8 -0
- package/dist/httpHeaders/basic/index.js.map +1 -0
- package/dist/httpHeaders/cacheControl/httpHeaders.cacheControl.d.ts.map +1 -0
- package/dist/httpHeaders/cacheControl/httpHeaders.cacheControlBuilder.d.ts.map +1 -0
- package/dist/httpHeaders/cacheControl/httpHeaders.cacheControlParse.d.ts.map +1 -0
- package/dist/httpHeaders/cacheControl/httpHeaders.cacheControlTokens.d.ts.map +1 -0
- package/dist/httpHeaders/cacheControl/index.d.ts +10 -0
- package/dist/httpHeaders/cacheControl/index.d.ts.map +1 -0
- package/dist/httpHeaders/cacheControl/index.js +10 -0
- package/dist/httpHeaders/cacheControl/index.js.map +1 -0
- package/dist/httpHeaders/conversion/httpHeaders.conversion.d.ts.map +1 -0
- package/dist/httpHeaders/conversion/httpHeaders.conversionObject.d.ts.map +1 -0
- package/dist/httpHeaders/conversion/index.d.ts +8 -0
- package/dist/httpHeaders/conversion/index.d.ts.map +1 -0
- package/dist/httpHeaders/conversion/index.js +8 -0
- package/dist/httpHeaders/conversion/index.js.map +1 -0
- package/dist/httpHeaders/date/httpHeaders.date.d.ts.map +1 -0
- package/dist/httpHeaders/date/index.d.ts +8 -0
- package/dist/httpHeaders/date/index.d.ts.map +1 -0
- package/dist/httpHeaders/date/index.js +8 -0
- package/dist/httpHeaders/date/index.js.map +1 -0
- package/dist/httpHeaders/etag/httpHeaders.etag.d.ts.map +1 -0
- package/dist/httpHeaders/etag/httpHeaders.etagMatch.d.ts.map +1 -0
- package/dist/httpHeaders/etag/index.d.ts +8 -0
- package/dist/httpHeaders/etag/index.d.ts.map +1 -0
- package/dist/httpHeaders/etag/index.js +8 -0
- package/dist/httpHeaders/etag/index.js.map +1 -0
- package/dist/httpHeaders/forwarded/httpHeaders.forwarded.d.ts.map +1 -0
- package/dist/httpHeaders/forwarded/index.d.ts +8 -0
- package/dist/httpHeaders/forwarded/index.d.ts.map +1 -0
- package/dist/httpHeaders/forwarded/index.js +8 -0
- package/dist/httpHeaders/forwarded/index.js.map +1 -0
- package/dist/httpHeaders/http.headers.d.ts.map +1 -0
- package/dist/httpHeaders/index.d.ts +14 -0
- package/dist/httpHeaders/index.d.ts.map +1 -0
- package/dist/httpHeaders/index.js +14 -0
- package/dist/httpHeaders/index.js.map +1 -0
- package/dist/httpHeaders/internal/httpHeaders.internal.cacheControl.d.ts.map +1 -0
- package/dist/httpHeaders/internal/httpHeaders.internal.mediaType.d.ts.map +1 -0
- package/dist/httpHeaders/internal/httpHeaders.internal.specificity.d.ts.map +1 -0
- package/dist/httpHeaders/internal/httpHeaders.internal.typeGuards.d.ts.map +1 -0
- package/dist/httpHeaders/internal/httpHeaders.internal.weightedValues.d.ts.map +1 -0
- package/dist/httpHeaders/internal/index.d.ts +12 -0
- package/dist/httpHeaders/internal/index.d.ts.map +1 -0
- package/dist/httpHeaders/internal/index.js +12 -0
- package/dist/httpHeaders/internal/index.js.map +1 -0
- package/dist/httpHeaders/list/httpHeaders.list.d.ts.map +1 -0
- package/dist/httpHeaders/list/httpHeaders.listMutation.d.ts.map +1 -0
- package/dist/httpHeaders/list/index.d.ts +8 -0
- package/dist/httpHeaders/list/index.d.ts.map +1 -0
- package/dist/httpHeaders/list/index.js +8 -0
- package/dist/httpHeaders/list/index.js.map +1 -0
- package/dist/httpHeaders/negotiation/httpHeaders.contentNegotiation.d.ts.map +1 -0
- package/dist/httpHeaders/negotiation/httpHeaders.contentNegotiationSelect.d.ts.map +1 -0
- package/dist/httpHeaders/negotiation/httpHeaders.encodingNegotiation.d.ts.map +1 -0
- package/dist/httpHeaders/negotiation/httpHeaders.encodingNegotiationSelect.d.ts.map +1 -0
- package/dist/httpHeaders/negotiation/httpHeaders.languageNegotiation.d.ts.map +1 -0
- package/dist/httpHeaders/negotiation/index.d.ts +11 -0
- package/dist/httpHeaders/negotiation/index.d.ts.map +1 -0
- package/dist/httpHeaders/negotiation/index.js +11 -0
- package/dist/httpHeaders/negotiation/index.js.map +1 -0
- package/dist/httpHeaders/range/httpHeaders.contentRange.d.ts.map +1 -0
- package/dist/httpHeaders/range/httpHeaders.contentRangeParse.d.ts.map +1 -0
- package/dist/httpHeaders/range/httpHeaders.range.d.ts.map +1 -0
- package/dist/httpHeaders/range/httpHeaders.rangeResolution.d.ts.map +1 -0
- package/dist/httpHeaders/range/httpHeaders.rangeSingle.d.ts.map +1 -0
- package/dist/httpHeaders/range/index.d.ts +11 -0
- package/dist/httpHeaders/range/index.d.ts.map +1 -0
- package/dist/httpHeaders/range/index.js +11 -0
- package/dist/httpHeaders/range/index.js.map +1 -0
- package/dist/httpHeaders/security/httpHeaders.security.d.ts.map +1 -0
- package/dist/httpHeaders/security/index.d.ts +8 -0
- package/dist/httpHeaders/security/index.d.ts.map +1 -0
- package/dist/httpHeaders/security/index.js +8 -0
- package/dist/httpHeaders/security/index.js.map +1 -0
- package/dist/httpHeaders/types/httpHeaders.type.d.ts.map +1 -0
- package/dist/httpHeaders/types/index.d.ts +7 -0
- package/dist/httpHeaders/types/index.d.ts.map +1 -0
- package/dist/httpHeaders/types/index.js +7 -0
- package/dist/httpHeaders/types/index.js.map +1 -0
- package/dist/httpHsts/http.hsts.d.ts.map +1 -0
- package/dist/httpHsts/index.d.ts +7 -0
- package/dist/httpHsts/index.d.ts.map +1 -0
- package/dist/httpHsts/index.js +7 -0
- package/dist/httpHsts/index.js.map +1 -0
- package/dist/httpInterceptors/builtin/httpInterceptor.request.d.ts.map +1 -0
- package/dist/httpInterceptors/builtin/httpInterceptor.request.js +79 -0
- package/dist/httpInterceptors/builtin/httpInterceptor.request.js.map +1 -0
- package/dist/httpInterceptors/builtin/httpInterceptor.response.d.ts.map +1 -0
- package/dist/httpInterceptors/builtin/index.d.ts.map +1 -0
- package/dist/httpInterceptors/http.interceptors.d.ts.map +1 -0
- package/dist/httpInterceptors/httpInterceptor.helper.d.ts.map +1 -0
- package/dist/httpInterceptors/httpInterceptor.middleware.d.ts.map +1 -0
- package/dist/httpInterceptors/httpInterceptor.type.d.ts.map +1 -0
- package/dist/httpInterceptors/index.d.ts +7 -0
- package/dist/httpInterceptors/index.d.ts.map +1 -0
- package/dist/httpInterceptors/index.js +7 -0
- package/dist/httpInterceptors/index.js.map +1 -0
- package/dist/httpInterceptors/manager/httpInterceptor.lookup.d.ts.map +1 -0
- package/dist/httpInterceptors/manager/httpInterceptor.manager.d.ts.map +1 -0
- package/dist/httpInterceptors/manager/httpInterceptor.registration.d.ts.map +1 -0
- package/dist/httpInterceptors/manager/httpInterceptor.snapshot.d.ts.map +1 -0
- package/dist/httpInterceptors/manager/index.d.ts.map +1 -0
- package/dist/httpKeepAlive/httpKeepAlive.core.d.ts.map +1 -0
- package/dist/httpKeepAlive/index.d.ts +7 -0
- package/dist/httpKeepAlive/index.d.ts.map +1 -0
- package/dist/httpKeepAlive/index.js +7 -0
- package/dist/httpKeepAlive/index.js.map +1 -0
- package/dist/httpMethods/http.methods.d.ts.map +1 -0
- package/dist/httpMethods/index.d.ts +7 -0
- package/dist/httpMethods/index.d.ts.map +1 -0
- package/dist/httpMethods/index.js +7 -0
- package/dist/httpMethods/index.js.map +1 -0
- package/dist/httpMiddleware/builtin/compose/httpMiddleware.compose.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/compose/index.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/conditional/httpMiddleware.conditional.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/conditional/index.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/cors/httpMiddleware.cors.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/cors/index.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.accessor.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.accessor.js +52 -0
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.accessor.js.map +1 -0
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.contextHelper.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.normalizer.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/helpers/index.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/image/httpMiddleware.image.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/image/index.d.ts +7 -0
- package/dist/httpMiddleware/builtin/image/index.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/image/index.js +7 -0
- package/dist/httpMiddleware/builtin/image/index.js.map +1 -0
- package/dist/httpMiddleware/builtin/index.d.ts +18 -0
- package/dist/httpMiddleware/builtin/index.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/index.js +22 -0
- package/dist/httpMiddleware/builtin/index.js.map +1 -0
- package/dist/httpMiddleware/builtin/logging/httpMiddleware.logging.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/logging/index.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/security/httpMiddleware.security.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/security/index.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/static/httpMiddleware.static.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/static/index.d.ts +7 -0
- package/dist/httpMiddleware/builtin/static/index.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/static/index.js +7 -0
- package/dist/httpMiddleware/builtin/static/index.js.map +1 -0
- package/dist/httpMiddleware/builtin/timing/httpMiddleware.timing.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/timing/index.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/video/httpMiddleware.video.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/video/index.d.ts +7 -0
- package/dist/httpMiddleware/builtin/video/index.d.ts.map +1 -0
- package/dist/httpMiddleware/builtin/video/index.js +7 -0
- package/dist/httpMiddleware/builtin/video/index.js.map +1 -0
- package/dist/httpMiddleware/httpMiddleware.error.d.ts +38 -0
- package/dist/httpMiddleware/httpMiddleware.error.d.ts.map +1 -0
- package/dist/httpMiddleware/httpMiddleware.error.js +60 -0
- package/dist/httpMiddleware/httpMiddleware.error.js.map +1 -0
- package/dist/httpMiddleware/httpMiddleware.state.d.ts.map +1 -0
- package/dist/httpMiddleware/httpMiddleware.type.d.ts.map +1 -0
- package/dist/httpMiddleware/index.d.ts +11 -0
- package/dist/httpMiddleware/index.d.ts.map +1 -0
- package/dist/httpMiddleware/index.js +11 -0
- package/dist/httpMiddleware/index.js.map +1 -0
- package/dist/httpMiddleware/pipeline/httpMiddleware.pipeline.d.ts.map +1 -0
- package/dist/httpMiddleware/pipeline/httpPipeline.execution.d.ts.map +1 -0
- package/dist/httpMiddleware/pipeline/httpPipeline.helper.d.ts.map +1 -0
- package/dist/httpMiddleware/pipeline/httpPipeline.registration.d.ts.map +1 -0
- package/dist/httpMiddleware/pipeline/index.d.ts +10 -0
- package/dist/httpMiddleware/pipeline/index.d.ts.map +1 -0
- package/dist/httpMiddleware/pipeline/index.js +10 -0
- package/dist/httpMiddleware/pipeline/index.js.map +1 -0
- package/dist/httpMime/http.mime.d.ts.map +1 -0
- package/dist/httpMime/index.d.ts +7 -0
- package/dist/httpMime/index.d.ts.map +1 -0
- package/dist/httpMime/index.js +7 -0
- package/dist/httpMime/index.js.map +1 -0
- package/dist/httpMultipart/http.multipart.d.ts +42 -0
- package/dist/httpMultipart/http.multipart.d.ts.map +1 -0
- package/dist/httpMultipart/http.multipart.js +334 -0
- package/dist/httpMultipart/http.multipart.js.map +1 -0
- package/dist/httpMultipart/index.d.ts +7 -0
- package/dist/httpMultipart/index.d.ts.map +1 -0
- package/dist/httpMultipart/index.js +7 -0
- package/dist/httpMultipart/index.js.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.accept.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.charset.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.construction.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.core.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.encoding.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.formatting.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.helpers.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.internal.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.language.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.mediaType.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.negotiate.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.parsing.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.quality.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.sorting.d.ts.map +1 -0
- package/dist/httpNegotiation/httpNegotiation.types.d.ts.map +1 -0
- package/dist/httpNegotiation/index.d.ts +7 -0
- package/dist/httpNegotiation/index.d.ts.map +1 -0
- package/dist/httpNegotiation/index.js +7 -0
- package/dist/httpNegotiation/index.js.map +1 -0
- package/dist/httpProtocol/http.protocol.d.ts.map +1 -0
- package/dist/httpProtocol/index.d.ts +7 -0
- package/dist/httpProtocol/index.d.ts.map +1 -0
- package/dist/httpProtocol/index.js +7 -0
- package/dist/httpProtocol/index.js.map +1 -0
- package/dist/httpProxy/http.proxy.d.ts.map +1 -0
- package/dist/httpProxy/index.d.ts +8 -0
- package/dist/httpProxy/index.d.ts.map +1 -0
- package/dist/httpProxy/index.js +8 -0
- package/dist/httpProxy/index.js.map +1 -0
- package/dist/httpQuery/http.query.d.ts.map +1 -0
- package/dist/httpQuery/httpQuery.string.d.ts.map +1 -0
- package/dist/httpQuery/index.d.ts +8 -0
- package/dist/httpQuery/index.d.ts.map +1 -0
- package/dist/httpQuery/index.js +8 -0
- package/dist/httpQuery/index.js.map +1 -0
- package/dist/httpRange/http.range.d.ts.map +1 -0
- package/dist/httpRange/index.d.ts +7 -0
- package/dist/httpRange/index.d.ts.map +1 -0
- package/dist/httpRange/index.js +7 -0
- package/dist/httpRange/index.js.map +1 -0
- package/dist/httpRedirect/http.redirect.d.ts.map +1 -0
- package/dist/httpRedirect/index.d.ts +7 -0
- package/dist/httpRedirect/index.d.ts.map +1 -0
- package/dist/httpRedirect/index.js +7 -0
- package/dist/httpRedirect/index.js.map +1 -0
- package/dist/httpRequest/http.request.d.ts.map +1 -0
- package/dist/httpRequest/httpRequest.context.constant.d.ts.map +1 -0
- package/dist/httpRequest/httpRequest.context.constant.js +8 -0
- package/dist/httpRequest/httpRequest.context.constant.js.map +1 -0
- package/dist/httpRequest/httpRequest.context.d.ts.map +1 -0
- package/dist/httpRequest/httpRequest.context.id.d.ts.map +1 -0
- package/dist/httpRequest/httpRequest.context.js +402 -0
- package/dist/httpRequest/httpRequest.context.js.map +1 -0
- package/dist/httpRequest/httpRequest.context.type.d.ts.map +1 -0
- package/dist/httpRequest/index.d.ts +8 -0
- package/dist/httpRequest/index.d.ts.map +1 -0
- package/dist/httpRequest/index.js +8 -0
- package/dist/httpRequest/index.js.map +1 -0
- package/dist/httpResponse/core/httpResponse.statusText.d.ts.map +1 -0
- package/dist/httpResponse/core/httpResponse.type.d.ts.map +1 -0
- package/dist/httpResponse/core/index.d.ts.map +1 -0
- package/dist/httpResponse/http.response.d.ts.map +1 -0
- package/dist/httpResponse/httpResponse.context.d.ts.map +1 -0
- package/dist/httpResponse/httpResponse.helper.d.ts.map +1 -0
- package/dist/httpResponse/httpResponse.writer.d.ts +52 -0
- package/dist/httpResponse/httpResponse.writer.d.ts.map +1 -0
- package/dist/httpResponse/httpResponse.writer.js +278 -0
- package/dist/httpResponse/httpResponse.writer.js.map +1 -0
- package/dist/httpResponse/index.d.ts +9 -0
- package/dist/httpResponse/index.d.ts.map +1 -0
- package/dist/httpResponse/index.js +9 -0
- package/dist/httpResponse/index.js.map +1 -0
- package/dist/httpSecurity/httpSecurity.config.d.ts +43 -0
- package/dist/httpSecurity/httpSecurity.config.d.ts.map +1 -0
- package/dist/httpSecurity/httpSecurity.config.js +26 -0
- package/dist/httpSecurity/httpSecurity.config.js.map +1 -0
- package/dist/httpSecurity/httpSecurity.guard.d.ts +29 -0
- package/dist/httpSecurity/httpSecurity.guard.d.ts.map +1 -0
- package/dist/httpSecurity/httpSecurity.guard.js +40 -0
- package/dist/httpSecurity/httpSecurity.guard.js.map +1 -0
- package/dist/httpSecurity/httpSecurity.validator.d.ts +42 -0
- package/dist/httpSecurity/httpSecurity.validator.d.ts.map +1 -0
- package/dist/httpSecurity/httpSecurity.validator.js +151 -0
- package/dist/httpSecurity/httpSecurity.validator.js.map +1 -0
- package/dist/httpSecurity/index.d.ts +14 -0
- package/dist/httpSecurity/index.d.ts.map +1 -0
- package/dist/httpSecurity/index.js +11 -0
- package/dist/httpSecurity/index.js.map +1 -0
- package/dist/httpSecurityHeaders/core/httpSecurityHeader.type.d.ts.map +1 -0
- package/dist/httpSecurityHeaders/core/httpSecurityHeader.validation.d.ts.map +1 -0
- package/dist/httpSecurityHeaders/core/index.d.ts.map +1 -0
- package/dist/httpSecurityHeaders/httpSecurity.headers.d.ts.map +1 -0
- package/dist/httpSecurityHeaders/httpSecurityHeader.factory.d.ts.map +1 -0
- package/dist/httpSecurityHeaders/httpSecurityHeader.individual.d.ts.map +1 -0
- package/dist/httpSecurityHeaders/httpSecurityHeader.permissionsPolicy.d.ts.map +1 -0
- package/dist/httpSecurityHeaders/httpSecurityHeader.recommended.d.ts.map +1 -0
- package/dist/httpSecurityHeaders/index.d.ts +7 -0
- package/dist/httpSecurityHeaders/index.d.ts.map +1 -0
- package/dist/httpSecurityHeaders/index.js +7 -0
- package/dist/httpSecurityHeaders/index.js.map +1 -0
- package/dist/httpServer/core/httpServer.core.d.ts +55 -0
- package/dist/httpServer/core/httpServer.core.d.ts.map +1 -0
- package/dist/httpServer/core/httpServer.core.js +240 -0
- package/dist/httpServer/core/httpServer.core.js.map +1 -0
- package/dist/httpServer/core/index.d.ts +7 -0
- package/dist/httpServer/core/index.d.ts.map +1 -0
- package/dist/httpServer/core/index.js +7 -0
- package/dist/httpServer/core/index.js.map +1 -0
- package/dist/httpServer/factory/httpServer.factory.d.ts +24 -0
- package/dist/httpServer/factory/httpServer.factory.d.ts.map +1 -0
- package/dist/httpServer/factory/httpServer.factory.js +67 -0
- package/dist/httpServer/factory/httpServer.factory.js.map +1 -0
- package/dist/httpServer/factory/index.d.ts +7 -0
- package/dist/httpServer/factory/index.d.ts.map +1 -0
- package/dist/httpServer/factory/index.js +7 -0
- package/dist/httpServer/factory/index.js.map +1 -0
- package/dist/httpServer/index.d.ts +10 -0
- package/dist/httpServer/index.d.ts.map +1 -0
- package/dist/httpServer/index.js +10 -0
- package/dist/httpServer/index.js.map +1 -0
- package/dist/httpServer/manager/httpServer.manager.d.ts +19 -0
- package/dist/httpServer/manager/httpServer.manager.d.ts.map +1 -0
- package/dist/httpServer/manager/httpServer.manager.js +57 -0
- package/dist/httpServer/manager/httpServer.manager.js.map +1 -0
- package/dist/httpServer/manager/index.d.ts +7 -0
- package/dist/httpServer/manager/index.d.ts.map +1 -0
- package/dist/httpServer/manager/index.js +7 -0
- package/dist/httpServer/manager/index.js.map +1 -0
- package/dist/httpServer/types/httpServer.type.d.ts +43 -0
- package/dist/httpServer/types/httpServer.type.d.ts.map +1 -0
- package/dist/httpServer/types/httpServer.type.js +8 -0
- package/dist/httpServer/types/httpServer.type.js.map +1 -0
- package/dist/httpStatus/httpStatus.categoryPredicate.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.clientErrorConstant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.clientErrorTextConstant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.collection.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.commonPredicate.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.constant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.errorPredicate.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.info.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.informationalSuccessConstant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.informationalSuccessTextConstant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.lookup.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.name.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.predicate.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.redirectErrorConstant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.redirectErrorTextConstant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.redirectPredicate.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.redirectionConstant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.redirectionTextConstant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.semantics.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.serverErrorConstant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.serverErrorTextConstant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.statusConstant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.statusTextConstant.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.type.d.ts.map +1 -0
- package/dist/httpStatus/httpStatus.validator.d.ts.map +1 -0
- package/dist/httpStatus/httpStatusCodes.constant.d.ts.map +1 -0
- package/dist/httpStatus/index.d.ts +20 -0
- package/dist/httpStatus/index.d.ts.map +1 -0
- package/dist/httpStatus/index.js +20 -0
- package/dist/httpStatus/index.js.map +1 -0
- package/dist/httpStream/httpStream.backpressure.d.ts +6 -0
- package/dist/httpStream/httpStream.backpressure.d.ts.map +1 -0
- package/dist/httpStream/httpStream.backpressure.js +38 -0
- package/dist/httpStream/httpStream.backpressure.js.map +1 -0
- package/dist/httpStream/httpStream.constants.d.ts +5 -0
- package/dist/httpStream/httpStream.constants.d.ts.map +1 -0
- package/dist/httpStream/httpStream.constants.js +5 -0
- package/dist/httpStream/httpStream.constants.js.map +1 -0
- package/dist/httpStream/httpStream.consume.d.ts +6 -0
- package/dist/httpStream/httpStream.consume.d.ts.map +1 -0
- package/dist/httpStream/httpStream.consume.js +70 -0
- package/dist/httpStream/httpStream.consume.js.map +1 -0
- package/dist/httpStream/httpStream.destroy.d.ts +5 -0
- package/dist/httpStream/httpStream.destroy.d.ts.map +1 -0
- package/dist/httpStream/httpStream.destroy.js +11 -0
- package/dist/httpStream/httpStream.destroy.js.map +1 -0
- package/dist/httpStream/httpStream.error.d.ts +8 -0
- package/dist/httpStream/httpStream.error.d.ts.map +1 -0
- package/dist/httpStream/httpStream.error.js +17 -0
- package/dist/httpStream/httpStream.error.js.map +1 -0
- package/dist/httpStream/httpStream.eventHelper.d.ts +13 -0
- package/dist/httpStream/httpStream.eventHelper.d.ts.map +1 -0
- package/dist/httpStream/httpStream.eventHelper.js +50 -0
- package/dist/httpStream/httpStream.eventHelper.js.map +1 -0
- package/dist/httpStream/httpStream.helper.d.ts +8 -0
- package/dist/httpStream/httpStream.helper.d.ts.map +1 -0
- package/dist/httpStream/httpStream.helper.js +35 -0
- package/dist/httpStream/httpStream.helper.js.map +1 -0
- package/dist/httpStream/httpStream.pipe.d.ts +7 -0
- package/dist/httpStream/httpStream.pipe.d.ts.map +1 -0
- package/dist/httpStream/httpStream.pipe.js +107 -0
- package/dist/httpStream/httpStream.pipe.js.map +1 -0
- package/dist/httpStream/httpStream.progress.d.ts +6 -0
- package/dist/httpStream/httpStream.progress.d.ts.map +1 -0
- package/dist/httpStream/httpStream.progress.js +100 -0
- package/dist/httpStream/httpStream.progress.js.map +1 -0
- package/dist/httpStream/httpStream.read.d.ts +7 -0
- package/dist/httpStream/httpStream.read.d.ts.map +1 -0
- package/dist/httpStream/httpStream.read.js +20 -0
- package/dist/httpStream/httpStream.read.js.map +1 -0
- package/dist/httpStream/httpStream.request.d.ts +8 -0
- package/dist/httpStream/httpStream.request.d.ts.map +1 -0
- package/dist/httpStream/httpStream.request.js +11 -0
- package/dist/httpStream/httpStream.request.js.map +1 -0
- package/dist/httpStream/httpStream.state.d.ts +8 -0
- package/dist/httpStream/httpStream.state.d.ts.map +1 -0
- package/dist/httpStream/httpStream.state.js +17 -0
- package/dist/httpStream/httpStream.state.js.map +1 -0
- package/dist/httpStream/httpStream.transform.d.ts +8 -0
- package/dist/httpStream/httpStream.transform.d.ts.map +1 -0
- package/dist/httpStream/httpStream.transform.js +17 -0
- package/dist/httpStream/httpStream.transform.js.map +1 -0
- package/dist/httpStream/httpStream.types.d.ts +19 -0
- package/dist/httpStream/httpStream.types.d.ts.map +1 -0
- package/dist/httpStream/httpStream.types.js +5 -0
- package/dist/httpStream/httpStream.types.js.map +1 -0
- package/dist/httpStream/index.d.ts +20 -0
- package/dist/httpStream/index.d.ts.map +1 -0
- package/dist/httpStream/index.js +20 -0
- package/dist/httpStream/index.js.map +1 -0
- package/dist/httpTrustProxy/httpTrustProxy.compilation.d.ts.map +1 -0
- package/dist/httpTrustProxy/httpTrustProxy.core.d.ts.map +1 -0
- package/dist/httpTrustProxy/httpTrustProxy.helper.d.ts.map +1 -0
- package/dist/httpTrustProxy/httpTrustProxy.parsing.d.ts.map +1 -0
- package/dist/httpTrustProxy/httpTrustProxy.type.d.ts.map +1 -0
- package/dist/httpTrustProxy/index.d.ts +7 -0
- package/dist/httpTrustProxy/index.d.ts.map +1 -0
- package/dist/httpTrustProxy/index.js +7 -0
- package/dist/httpTrustProxy/index.js.map +1 -0
- package/dist/httpTypes/http.types.d.ts +212 -0
- package/dist/httpTypes/http.types.d.ts.map +1 -0
- package/dist/httpTypes/http.types.js +15 -0
- package/dist/httpTypes/http.types.js.map +1 -0
- package/dist/httpTypes/index.d.ts +7 -0
- package/dist/httpTypes/index.d.ts.map +1 -0
- package/dist/httpTypes/index.js +7 -0
- package/dist/httpTypes/index.js.map +1 -0
- package/dist/httpUrl/http.url.d.ts.map +1 -0
- package/dist/httpUrl/index.d.ts +7 -0
- package/dist/httpUrl/index.d.ts.map +1 -0
- package/dist/httpUrl/index.js +7 -0
- package/dist/httpUrl/index.js.map +1 -0
- package/dist/httpValidation/httpValidationAssertion.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationAuthority.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationAuthorization.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationCacheControl.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationContentLength.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationContentType.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationCookie.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationDate.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationETag.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationHeader.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationHostname.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationMessage.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationMethod.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationPort.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationRange.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationRequestTarget.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationStatusCode.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationToken.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationTypes.type.d.ts.map +1 -0
- package/dist/httpValidation/httpValidationUrl.d.ts.map +1 -0
- package/dist/httpValidation/index.d.ts +29 -0
- package/dist/httpValidation/index.d.ts.map +1 -0
- package/dist/httpValidation/index.js +29 -0
- package/dist/httpValidation/index.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js HTTP server lifecycle, body reading, and utilities.
|
|
3
|
+
*
|
|
4
|
+
* @module httpAdapter/node/server
|
|
5
|
+
*/
|
|
6
|
+
import { IncomingMessage, Server, ServerResponse } from "node:http";
|
|
7
|
+
import { validateTimeout, validateMaxBodySize } from "./httpNode.type.js";
|
|
8
|
+
import { DEFAULT_MAX_BODY_SIZE } from "./httpNode.type.js";
|
|
9
|
+
/* -------------------------------------------------------------------------- */
|
|
10
|
+
/* Type Guards */
|
|
11
|
+
/* -------------------------------------------------------------------------- */
|
|
12
|
+
export function isIncomingMessage(value) {
|
|
13
|
+
return value instanceof IncomingMessage;
|
|
14
|
+
}
|
|
15
|
+
export function isServerResponse(value) {
|
|
16
|
+
return value instanceof ServerResponse;
|
|
17
|
+
}
|
|
18
|
+
export function isNodeRequestResponsePair(value) {
|
|
19
|
+
if (value === null || typeof value !== "object") {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
const pair = value;
|
|
23
|
+
return isIncomingMessage(pair.request) && isServerResponse(pair.response);
|
|
24
|
+
}
|
|
25
|
+
/* -------------------------------------------------------------------------- */
|
|
26
|
+
/* Server Configuration */
|
|
27
|
+
/* -------------------------------------------------------------------------- */
|
|
28
|
+
export function configureServer(server, options) {
|
|
29
|
+
if (options.requestTimeout !== undefined) {
|
|
30
|
+
server.requestTimeout = validateTimeout(options.requestTimeout, "requestTimeout");
|
|
31
|
+
}
|
|
32
|
+
if (options.headersTimeout !== undefined) {
|
|
33
|
+
server.headersTimeout = validateTimeout(options.headersTimeout, "headersTimeout");
|
|
34
|
+
}
|
|
35
|
+
if (options.keepAliveTimeout !== undefined) {
|
|
36
|
+
server.keepAliveTimeout = validateTimeout(options.keepAliveTimeout, "keepAliveTimeout");
|
|
37
|
+
}
|
|
38
|
+
if (options.connectionTimeout !== undefined) {
|
|
39
|
+
server.timeout = validateTimeout(options.connectionTimeout, "connectionTimeout");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/* -------------------------------------------------------------------------- */
|
|
43
|
+
/* Listen / Close */
|
|
44
|
+
/* -------------------------------------------------------------------------- */
|
|
45
|
+
export function listen(server, port, host) {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
const onError = (error) => {
|
|
48
|
+
cleanup();
|
|
49
|
+
reject(error);
|
|
50
|
+
};
|
|
51
|
+
const onListening = () => {
|
|
52
|
+
cleanup();
|
|
53
|
+
resolve();
|
|
54
|
+
};
|
|
55
|
+
const cleanup = () => {
|
|
56
|
+
server.off("error", onError);
|
|
57
|
+
server.off("listening", onListening);
|
|
58
|
+
};
|
|
59
|
+
server.once("error", onError);
|
|
60
|
+
server.once("listening", onListening);
|
|
61
|
+
server.listen(port, host);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
export function closeServer(server) {
|
|
65
|
+
if (!server.listening) {
|
|
66
|
+
return Promise.resolve();
|
|
67
|
+
}
|
|
68
|
+
return new Promise((resolve, reject) => {
|
|
69
|
+
server.close((error) => {
|
|
70
|
+
if (error) {
|
|
71
|
+
reject(error);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
resolve();
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/* -------------------------------------------------------------------------- */
|
|
79
|
+
/* Header Helpers */
|
|
80
|
+
/* -------------------------------------------------------------------------- */
|
|
81
|
+
export function getHeader(request, name) {
|
|
82
|
+
const value = request.headers[name.toLowerCase()];
|
|
83
|
+
if (Array.isArray(value)) {
|
|
84
|
+
return value.join(", ");
|
|
85
|
+
}
|
|
86
|
+
return value;
|
|
87
|
+
}
|
|
88
|
+
/* -------------------------------------------------------------------------- */
|
|
89
|
+
/* URL Helpers */
|
|
90
|
+
/* -------------------------------------------------------------------------- */
|
|
91
|
+
export function removePort(host) {
|
|
92
|
+
if (host.startsWith("[")) {
|
|
93
|
+
const closing = host.indexOf("]", 1);
|
|
94
|
+
if (closing !== -1) {
|
|
95
|
+
return host.slice(1, closing);
|
|
96
|
+
}
|
|
97
|
+
return host;
|
|
98
|
+
}
|
|
99
|
+
const separator = host.lastIndexOf(":");
|
|
100
|
+
if (separator > -1 && host.indexOf(":") === separator) {
|
|
101
|
+
return host.slice(0, separator);
|
|
102
|
+
}
|
|
103
|
+
return host;
|
|
104
|
+
}
|
|
105
|
+
export function extractPort(host) {
|
|
106
|
+
if (host.startsWith("[")) {
|
|
107
|
+
const closing = host.indexOf("]", 1);
|
|
108
|
+
if (closing === -1) {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
const suffix = host.slice(closing + 1);
|
|
112
|
+
if (!suffix.startsWith(":")) {
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
return parsePort(suffix.slice(1));
|
|
116
|
+
}
|
|
117
|
+
const separator = host.lastIndexOf(":");
|
|
118
|
+
if (separator === -1 || host.indexOf(":") !== separator) {
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
return parsePort(host.slice(separator + 1));
|
|
122
|
+
}
|
|
123
|
+
export function parsePort(value) {
|
|
124
|
+
if (!/^\d+$/.test(value)) {
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
const port = Number(value);
|
|
128
|
+
return Number.isInteger(port) && port >= 1 && port <= 65535
|
|
129
|
+
? port
|
|
130
|
+
: undefined;
|
|
131
|
+
}
|
|
132
|
+
export function getSearchPart(url) {
|
|
133
|
+
const index = url.indexOf("?");
|
|
134
|
+
if (index === -1) {
|
|
135
|
+
return "";
|
|
136
|
+
}
|
|
137
|
+
return url.slice(index + 1);
|
|
138
|
+
}
|
|
139
|
+
/* -------------------------------------------------------------------------- */
|
|
140
|
+
/* Body Errors */
|
|
141
|
+
/* -------------------------------------------------------------------------- */
|
|
142
|
+
import { RequestBodyTooLargeError as NodeRequestBodyTooLargeError } from "@zudojs/errors";
|
|
143
|
+
export { NodeRequestBodyTooLargeError };
|
|
144
|
+
/* -------------------------------------------------------------------------- */
|
|
145
|
+
/* Body Reader */
|
|
146
|
+
/* -------------------------------------------------------------------------- */
|
|
147
|
+
export function readNodeRequestBody(request, maxBodySize = DEFAULT_MAX_BODY_SIZE) {
|
|
148
|
+
const limit = validateMaxBodySize(maxBodySize);
|
|
149
|
+
const declaredLength = getHeader(request, "content-length");
|
|
150
|
+
if (declaredLength) {
|
|
151
|
+
const length = Number(declaredLength);
|
|
152
|
+
if (Number.isFinite(length) && length > limit) {
|
|
153
|
+
request.destroy();
|
|
154
|
+
return Promise.reject(new NodeRequestBodyTooLargeError(limit, length));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return new Promise((resolve, reject) => {
|
|
158
|
+
const chunks = [];
|
|
159
|
+
let total = 0;
|
|
160
|
+
let settled = false;
|
|
161
|
+
const cleanup = () => {
|
|
162
|
+
request.off("data", onData);
|
|
163
|
+
request.off("end", onEnd);
|
|
164
|
+
request.off("error", onError);
|
|
165
|
+
request.off("aborted", onAborted);
|
|
166
|
+
};
|
|
167
|
+
const fail = (error) => {
|
|
168
|
+
if (settled) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
settled = true;
|
|
172
|
+
cleanup();
|
|
173
|
+
reject(error);
|
|
174
|
+
};
|
|
175
|
+
const onData = (chunk) => {
|
|
176
|
+
const data = new Uint8Array(chunk);
|
|
177
|
+
total += data.byteLength;
|
|
178
|
+
if (total > limit) {
|
|
179
|
+
request.destroy();
|
|
180
|
+
fail(new NodeRequestBodyTooLargeError(limit, total));
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
chunks.push(data);
|
|
184
|
+
};
|
|
185
|
+
const onEnd = () => {
|
|
186
|
+
if (settled) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
settled = true;
|
|
190
|
+
cleanup();
|
|
191
|
+
const result = new Uint8Array(total);
|
|
192
|
+
let offset = 0;
|
|
193
|
+
for (const chunk of chunks) {
|
|
194
|
+
result.set(chunk, offset);
|
|
195
|
+
offset += chunk.byteLength;
|
|
196
|
+
}
|
|
197
|
+
resolve(result);
|
|
198
|
+
};
|
|
199
|
+
const onError = (error) => {
|
|
200
|
+
fail(error);
|
|
201
|
+
};
|
|
202
|
+
const onAborted = () => {
|
|
203
|
+
fail(new Error("The HTTP request was aborted while reading the request body."));
|
|
204
|
+
};
|
|
205
|
+
request.on("data", onData);
|
|
206
|
+
request.once("end", onEnd);
|
|
207
|
+
request.once("error", onError);
|
|
208
|
+
request.once("aborted", onAborted);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
/* -------------------------------------------------------------------------- */
|
|
212
|
+
/* Response Result Detection */
|
|
213
|
+
/* -------------------------------------------------------------------------- */
|
|
214
|
+
export function isResponseContextLike(value) {
|
|
215
|
+
if (value === null || typeof value !== "object") {
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
const candidate = value;
|
|
219
|
+
return ("status" in candidate ||
|
|
220
|
+
"statusText" in candidate ||
|
|
221
|
+
"headers" in candidate ||
|
|
222
|
+
"body" in candidate ||
|
|
223
|
+
"contentType" in candidate ||
|
|
224
|
+
"contentLength" in candidate ||
|
|
225
|
+
"cookies" in candidate ||
|
|
226
|
+
"metadata" in candidate);
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=httpNode.server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpNode.server.js","sourceRoot":"","sources":["../../../src/httpAdapter/node/httpNode.server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,KAAK,YAAY,eAAe,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,KAAK,YAAY,cAAc,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,KAAc;IAKtD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,IAAI,GAAG,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B;IACjC;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;CAClC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAE1C,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAE5D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAMD,eAAO,MAAM,YAAY,cAAc,CAAC;AAExC,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,eAAO,MAAM,qBAAqB,QAAmB,CAAC;AAMtD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQxD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMnE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zudojs/http/httpAdapter/node
|
|
3
|
+
*
|
|
4
|
+
* Node.js HTTP adapter.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./httpNode.type.js";
|
|
7
|
+
export * from "./httpNode.response.js";
|
|
8
|
+
export * from "./httpNode.request.js";
|
|
9
|
+
export * from "./httpNode.adapter.js";
|
|
10
|
+
export * from "./httpNode.server.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/httpAdapter/node/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zudojs/http/httpAdapter/node
|
|
3
|
+
*
|
|
4
|
+
* Node.js HTTP adapter.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./httpNode.type.js";
|
|
7
|
+
export * from "./httpNode.response.js";
|
|
8
|
+
export * from "./httpNode.request.js";
|
|
9
|
+
export * from "./httpNode.adapter.js";
|
|
10
|
+
export * from "./httpNode.server.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/httpAdapter/node/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.agent.d.ts","sourceRoot":"","sources":["../../src/httpAgent/http.agent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,SAAS,EAEnB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,KAAK,IAAI,UAAU,EAEpB,MAAM,YAAY,CAAC;AAMpB,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;I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gB,mBAAmB,IAAI,SAAS,CAM/C;AAED,wBAAgB,oBAAoB,IAAI,UAAU,CAMjD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAM1D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAM5D;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAOzC;AAMD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,iBAAiB,CAQnB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,KAAK,IAAI,SAAS,CAExE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,KAAK,IAAI,UAAU,CAE1E;AAMD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CA+BxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/httpAgent/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/httpAgent/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { IncomingMessage } from "node:http";
|
|
2
|
+
export type HTTPBody = string | Buffer | Uint8Array | Record<string, unknown> | unknown[] | null;
|
|
3
|
+
export interface HTTPBodyParseOptions {
|
|
4
|
+
readonly limit?: number;
|
|
5
|
+
readonly encoding?: BufferEncoding;
|
|
6
|
+
readonly strict?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface HTTPBodyReaderOptions extends HTTPBodyParseOptions {
|
|
9
|
+
readonly request: IncomingMessage;
|
|
10
|
+
}
|
|
11
|
+
export declare const DEFAULT_BODY_LIMIT = 1048576;
|
|
12
|
+
export declare const DEFAULT_BODY_ENCODING: BufferEncoding;
|
|
13
|
+
export declare const BODY_CONTENT_TYPES: {
|
|
14
|
+
readonly JSON: "application/json";
|
|
15
|
+
readonly FORM_URLENCODED: "application/x-www-form-urlencoded";
|
|
16
|
+
readonly TEXT: "text/plain";
|
|
17
|
+
readonly HTML: "text/html";
|
|
18
|
+
readonly MULTIPART: "multipart/form-data";
|
|
19
|
+
readonly OCTET_STREAM: "application/octet-stream";
|
|
20
|
+
};
|
|
21
|
+
export declare function readBody(options: HTTPBodyReaderOptions): Promise<Buffer>;
|
|
22
|
+
export declare function readText(options: HTTPBodyReaderOptions): Promise<string>;
|
|
23
|
+
export declare function readJSON<T = unknown>(options?: HTTPBodyReaderOptions): Promise<T>;
|
|
24
|
+
export declare function readForm(options: HTTPBodyReaderOptions): Promise<Record<string, string | string[]>>;
|
|
25
|
+
export declare function parseBody<T = unknown>(options: HTTPBodyReaderOptions): Promise<T | Buffer | string>;
|
|
26
|
+
export declare function getContentType(request: IncomingMessage): string | undefined;
|
|
27
|
+
export declare function isJSONContentType(contentType: string | undefined): boolean;
|
|
28
|
+
export declare function isFormContentType(contentType: string | undefined): boolean;
|
|
29
|
+
export declare function isTextContentType(contentType: string | undefined): boolean;
|
|
30
|
+
export declare function isMultipartContentType(contentType: string | undefined): boolean;
|
|
31
|
+
export declare function getContentLength(request: IncomingMessage): number | undefined;
|
|
32
|
+
export declare function bodyToBuffer(body: string | Buffer | Uint8Array, encoding?: BufferEncoding): Buffer;
|
|
33
|
+
export declare function bodyToJSON(body: unknown): string;
|
|
34
|
+
import { HttpBodyError as HTTPBodyError, HttpBodyLimitError as HTTPBodyLimitError, HttpBodyAbortedError as HTTPBodyAbortedError, HttpBodyParseError as HTTPBodyParseError } from "@zudojs/errors";
|
|
35
|
+
export { HTTPBodyError, HTTPBodyLimitError, HTTPBodyAbortedError, HTTPBodyParseError, };
|
|
36
|
+
//# sourceMappingURL=http.body.d.ts.map
|
|
@@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M,GAAG,MAAM,EAAE,CAAC,CAAC,CA0B5C;AAMD,wBAAsB,SAAS,CAAC,CAAC,GAAG,OAAO,EACzC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,CAgB9B;AAMD,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAY3E;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAQ1E;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAS1E;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAU1E;AAED,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,OAAO,CAST;AAMD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAY7E;AAoBD,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,EAClC,QAAQ,GAAE,cAAsC,GAC/C,MAAM,CAUR;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAShD;AAkBD,OAAO,EACL,aAAa,IAAI,aAAa,EAC9B,kBAAkB,IAAI,kBAAkB,EACxC,oBAAoB,IAAI,oBAAoB,EAC5C,kBAAkB,IAAI,kBAAkB,EACzC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,GACnB,CAAC"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/* -------------------------------------------------------------------------- */
|
|
2
|
+
/* Defaults */
|
|
3
|
+
/* -------------------------------------------------------------------------- */
|
|
4
|
+
export const DEFAULT_BODY_LIMIT = 1_048_576;
|
|
5
|
+
export const DEFAULT_BODY_ENCODING = "utf8";
|
|
6
|
+
/* -------------------------------------------------------------------------- */
|
|
7
|
+
/* Content Types */
|
|
8
|
+
/* -------------------------------------------------------------------------- */
|
|
9
|
+
export const BODY_CONTENT_TYPES = {
|
|
10
|
+
JSON: "application/json",
|
|
11
|
+
FORM_URLENCODED: "application/x-www-form-urlencoded",
|
|
12
|
+
TEXT: "text/plain",
|
|
13
|
+
HTML: "text/html",
|
|
14
|
+
MULTIPART: "multipart/form-data",
|
|
15
|
+
OCTET_STREAM: "application/octet-stream",
|
|
16
|
+
};
|
|
17
|
+
/* -------------------------------------------------------------------------- */
|
|
18
|
+
/* Body Reader */
|
|
19
|
+
/* -------------------------------------------------------------------------- */
|
|
20
|
+
export async function readBody(options) {
|
|
21
|
+
const { request, limit = DEFAULT_BODY_LIMIT } = options;
|
|
22
|
+
validateBodyLimit(limit);
|
|
23
|
+
const contentLength = getContentLength(request);
|
|
24
|
+
if (contentLength !== undefined && contentLength > limit) {
|
|
25
|
+
request.resume();
|
|
26
|
+
throw new HTTPBodyLimitError(limit, contentLength);
|
|
27
|
+
}
|
|
28
|
+
const chunks = [];
|
|
29
|
+
let total = 0;
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
let settled = false;
|
|
32
|
+
const cleanup = () => {
|
|
33
|
+
request.removeListener("data", onData);
|
|
34
|
+
request.removeListener("end", onEnd);
|
|
35
|
+
request.removeListener("error", onError);
|
|
36
|
+
request.removeListener("aborted", onAborted);
|
|
37
|
+
request.removeListener("close", onClose);
|
|
38
|
+
};
|
|
39
|
+
const fail = (error) => {
|
|
40
|
+
if (settled) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
settled = true;
|
|
44
|
+
cleanup();
|
|
45
|
+
request.resume();
|
|
46
|
+
reject(error);
|
|
47
|
+
};
|
|
48
|
+
const onData = (chunk) => {
|
|
49
|
+
const buffer = Buffer.isBuffer(chunk)
|
|
50
|
+
? chunk
|
|
51
|
+
: Buffer.from(chunk, options.encoding ?? DEFAULT_BODY_ENCODING);
|
|
52
|
+
total += buffer.byteLength;
|
|
53
|
+
if (total > limit) {
|
|
54
|
+
fail(new HTTPBodyLimitError(limit, total));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
chunks.push(buffer);
|
|
58
|
+
};
|
|
59
|
+
const onEnd = () => {
|
|
60
|
+
if (settled) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
settled = true;
|
|
64
|
+
cleanup();
|
|
65
|
+
resolve(Buffer.concat(chunks, total));
|
|
66
|
+
};
|
|
67
|
+
const onError = (error) => {
|
|
68
|
+
fail(error);
|
|
69
|
+
};
|
|
70
|
+
const onAborted = () => {
|
|
71
|
+
fail(new HTTPBodyAbortedError());
|
|
72
|
+
};
|
|
73
|
+
const onClose = () => {
|
|
74
|
+
if (!settled && request.readableEnded !== true) {
|
|
75
|
+
fail(new HTTPBodyAbortedError());
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
request.on("data", onData);
|
|
79
|
+
request.once("end", onEnd);
|
|
80
|
+
request.once("error", onError);
|
|
81
|
+
request.once("aborted", onAborted);
|
|
82
|
+
request.once("close", onClose);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/* -------------------------------------------------------------------------- */
|
|
86
|
+
/* Text Parsing */
|
|
87
|
+
/* -------------------------------------------------------------------------- */
|
|
88
|
+
export async function readText(options) {
|
|
89
|
+
const body = await readBody(options);
|
|
90
|
+
return body.toString(options.encoding ?? DEFAULT_BODY_ENCODING);
|
|
91
|
+
}
|
|
92
|
+
/* -------------------------------------------------------------------------- */
|
|
93
|
+
/* JSON Parsing */
|
|
94
|
+
/* -------------------------------------------------------------------------- */
|
|
95
|
+
export async function readJSON(options = {
|
|
96
|
+
request: undefined,
|
|
97
|
+
}) {
|
|
98
|
+
const text = await readText(options);
|
|
99
|
+
if (text.trim() === "") {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
return JSON.parse(text);
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
throw new HTTPBodyParseError("Invalid JSON request body.", error);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/* -------------------------------------------------------------------------- */
|
|
110
|
+
/* Form URL Encoded */
|
|
111
|
+
/* -------------------------------------------------------------------------- */
|
|
112
|
+
export async function readForm(options) {
|
|
113
|
+
const text = await readText(options);
|
|
114
|
+
const params = new URLSearchParams(text);
|
|
115
|
+
const result = {};
|
|
116
|
+
for (const [key, value] of params.entries()) {
|
|
117
|
+
const existing = result[key];
|
|
118
|
+
if (existing === undefined) {
|
|
119
|
+
result[key] = value;
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
if (Array.isArray(existing)) {
|
|
123
|
+
existing.push(value);
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
result[key] = [existing, value];
|
|
127
|
+
}
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
/* -------------------------------------------------------------------------- */
|
|
131
|
+
/* Automatic Parsing */
|
|
132
|
+
/* -------------------------------------------------------------------------- */
|
|
133
|
+
export async function parseBody(options) {
|
|
134
|
+
const contentType = getContentType(options.request);
|
|
135
|
+
if (isJSONContentType(contentType)) {
|
|
136
|
+
return readJSON(options);
|
|
137
|
+
}
|
|
138
|
+
if (isFormContentType(contentType)) {
|
|
139
|
+
return readForm(options);
|
|
140
|
+
}
|
|
141
|
+
if (isTextContentType(contentType)) {
|
|
142
|
+
return readText(options);
|
|
143
|
+
}
|
|
144
|
+
return readBody(options);
|
|
145
|
+
}
|
|
146
|
+
/* -------------------------------------------------------------------------- */
|
|
147
|
+
/* Content Type Helpers */
|
|
148
|
+
/* -------------------------------------------------------------------------- */
|
|
149
|
+
export function getContentType(request) {
|
|
150
|
+
const value = request.headers["content-type"];
|
|
151
|
+
if (Array.isArray(value)) {
|
|
152
|
+
return value[0];
|
|
153
|
+
}
|
|
154
|
+
if (typeof value !== "string") {
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
return value.split(";", 1)[0]?.trim().toLowerCase();
|
|
158
|
+
}
|
|
159
|
+
export function isJSONContentType(contentType) {
|
|
160
|
+
if (!contentType) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
const normalized = contentType.split(";", 1)[0].trim().toLowerCase();
|
|
164
|
+
return normalized === BODY_CONTENT_TYPES.JSON || normalized.endsWith("+json");
|
|
165
|
+
}
|
|
166
|
+
export function isFormContentType(contentType) {
|
|
167
|
+
if (!contentType) {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
return (contentType.split(";", 1)[0].trim().toLowerCase() ===
|
|
171
|
+
BODY_CONTENT_TYPES.FORM_URLENCODED);
|
|
172
|
+
}
|
|
173
|
+
export function isTextContentType(contentType) {
|
|
174
|
+
if (!contentType) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
const normalized = contentType.split(";", 1)[0].trim().toLowerCase();
|
|
178
|
+
return (normalized.startsWith("text/") || normalized === BODY_CONTENT_TYPES.HTML);
|
|
179
|
+
}
|
|
180
|
+
export function isMultipartContentType(contentType) {
|
|
181
|
+
if (!contentType) {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
return contentType
|
|
185
|
+
.trim()
|
|
186
|
+
.toLowerCase()
|
|
187
|
+
.startsWith(BODY_CONTENT_TYPES.MULTIPART);
|
|
188
|
+
}
|
|
189
|
+
/* -------------------------------------------------------------------------- */
|
|
190
|
+
/* Content Length */
|
|
191
|
+
/* -------------------------------------------------------------------------- */
|
|
192
|
+
export function getContentLength(request) {
|
|
193
|
+
const value = request.headers["content-length"];
|
|
194
|
+
if (Array.isArray(value)) {
|
|
195
|
+
return parseContentLength(value[0]);
|
|
196
|
+
}
|
|
197
|
+
if (typeof value !== "string") {
|
|
198
|
+
return undefined;
|
|
199
|
+
}
|
|
200
|
+
return parseContentLength(value);
|
|
201
|
+
}
|
|
202
|
+
function parseContentLength(value) {
|
|
203
|
+
if (!value) {
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
const parsed = Number(value);
|
|
207
|
+
if (!Number.isSafeInteger(parsed) || parsed < 0) {
|
|
208
|
+
throw new HTTPBodyParseError("Invalid Content-Length header.");
|
|
209
|
+
}
|
|
210
|
+
return parsed;
|
|
211
|
+
}
|
|
212
|
+
/* -------------------------------------------------------------------------- */
|
|
213
|
+
/* Body Utilities */
|
|
214
|
+
/* -------------------------------------------------------------------------- */
|
|
215
|
+
export function bodyToBuffer(body, encoding = DEFAULT_BODY_ENCODING) {
|
|
216
|
+
if (Buffer.isBuffer(body)) {
|
|
217
|
+
return body;
|
|
218
|
+
}
|
|
219
|
+
if (typeof body === "string") {
|
|
220
|
+
return Buffer.from(body, encoding);
|
|
221
|
+
}
|
|
222
|
+
return Buffer.from(body);
|
|
223
|
+
}
|
|
224
|
+
export function bodyToJSON(body) {
|
|
225
|
+
try {
|
|
226
|
+
return JSON.stringify(body);
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
throw new HTTPBodyParseError("Unable to serialize response body as JSON.", error);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/* -------------------------------------------------------------------------- */
|
|
233
|
+
/* Validation */
|
|
234
|
+
/* -------------------------------------------------------------------------- */
|
|
235
|
+
function validateBodyLimit(limit) {
|
|
236
|
+
if (!Number.isSafeInteger(limit) || limit < 0) {
|
|
237
|
+
throw new RangeError("HTTP body limit must be a non-negative safe integer.");
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
/* -------------------------------------------------------------------------- */
|
|
241
|
+
/* Errors */
|
|
242
|
+
/* -------------------------------------------------------------------------- */
|
|
243
|
+
import { HttpBodyError as HTTPBodyError, HttpBodyLimitError as HTTPBodyLimitError, HttpBodyAbortedError as HTTPBodyAbortedError, HttpBodyParseError as HTTPBodyParseError, } from "@zudojs/errors";
|
|
244
|
+
export { HTTPBodyError, HTTPBodyLimitError, HTTPBodyAbortedError, HTTPBodyParseError, };
|
|
245
|
+
//# sourceMappingURL=http.body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.body.js","sourceRoot":"","sources":["../../src/httpBody/http.body.ts"],"names":[],"mappings":"AAmBA,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAE5C,MAAM,CAAC,MAAM,qBAAqB,GAAmB,MAAM,CAAC;AAE5D,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,kBAAkB;IAExB,eAAe,EAAE,mCAAmC;IAEpD,IAAI,EAAE,YAAY;IAElB,IAAI,EAAE,WAAW;IAEjB,SAAS,EAAE,qBAAqB;IAEhC,YAAY,EAAE,0BAA0B;CAChC,CAAC;AAEX,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,OAA8B;IAE9B,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,kBAAkB,EAAE,GAAG,OAAO,CAAC;IAExD,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAEzB,MAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEhD,IAAI,aAAa,KAAK,SAAS,IAAI,aAAa,GAAG,KAAK,EAAE,CAAC;QACzD,OAAO,CAAC,MAAM,EAAE,CAAC;QAEjB,MAAM,IAAI,kBAAkB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC7C,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,MAAM,OAAO,GAAG,GAAG,EAA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