@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,137 @@
|
|
|
1
|
+
import { createHTTPContext } from "../httpContext/http.context.js";
|
|
2
|
+
import { createHTTPRequest } from "../httpRequest/http.request.js";
|
|
3
|
+
import { createHTTPResponse } from "../httpResponse/http.response.js";
|
|
4
|
+
/* -------------------------------------------------------------------------- */
|
|
5
|
+
/* Node Adapter */
|
|
6
|
+
/* -------------------------------------------------------------------------- */
|
|
7
|
+
export class NodeHTTPAdapter {
|
|
8
|
+
name = "node";
|
|
9
|
+
createRequest(request) {
|
|
10
|
+
return createHTTPRequest(request);
|
|
11
|
+
}
|
|
12
|
+
createResponse(response) {
|
|
13
|
+
return createHTTPResponse(response);
|
|
14
|
+
}
|
|
15
|
+
createContext(request, response, options = {}) {
|
|
16
|
+
return createHTTPContext({
|
|
17
|
+
request,
|
|
18
|
+
response,
|
|
19
|
+
state: options.state ?? {},
|
|
20
|
+
signal: options.signal,
|
|
21
|
+
logger: createFallbackLogger(),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/* -------------------------------------------------------------------------- */
|
|
26
|
+
/* Adapter Factory */
|
|
27
|
+
/* -------------------------------------------------------------------------- */
|
|
28
|
+
export function createHTTPAdapter() {
|
|
29
|
+
return new NodeHTTPAdapter();
|
|
30
|
+
}
|
|
31
|
+
export class NodeRequestAdapter {
|
|
32
|
+
toHTTPRequest(request) {
|
|
33
|
+
return createHTTPRequest(request);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class NodeResponseAdapter {
|
|
37
|
+
toHTTPResponse(response) {
|
|
38
|
+
return createHTTPResponse(response);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export class NodeContextAdapter {
|
|
42
|
+
create(request, response, options = {}) {
|
|
43
|
+
return createHTTPContext({
|
|
44
|
+
request,
|
|
45
|
+
response,
|
|
46
|
+
state: options.state ?? {},
|
|
47
|
+
signal: options.signal,
|
|
48
|
+
logger: createFallbackLogger(),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export class DefaultHTTPHandlerAdapter {
|
|
53
|
+
async handle(handler, context) {
|
|
54
|
+
return handler(context);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export class DefaultHTTPMiddlewareAdapter {
|
|
58
|
+
async execute(middleware, context, handler) {
|
|
59
|
+
let index = -1;
|
|
60
|
+
const dispatch = async (currentIndex) => {
|
|
61
|
+
if (currentIndex <= index) {
|
|
62
|
+
throw new Error("next() called multiple times.");
|
|
63
|
+
}
|
|
64
|
+
index = currentIndex;
|
|
65
|
+
const current = middleware[currentIndex];
|
|
66
|
+
if (!current) {
|
|
67
|
+
await handler(context);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
await current(context, () => dispatch(currentIndex + 1));
|
|
71
|
+
};
|
|
72
|
+
await dispatch(0);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/* -------------------------------------------------------------------------- */
|
|
76
|
+
/* Request Conversion Helpers */
|
|
77
|
+
/* -------------------------------------------------------------------------- */
|
|
78
|
+
export function adaptNodeRequest(request) {
|
|
79
|
+
return createHTTPRequest(request);
|
|
80
|
+
}
|
|
81
|
+
export function adaptNodeResponse(response) {
|
|
82
|
+
return createHTTPResponse(response);
|
|
83
|
+
}
|
|
84
|
+
export function adaptNodeContext(request, response, options = {}) {
|
|
85
|
+
return createHTTPContext({
|
|
86
|
+
request: adaptNodeRequest(request),
|
|
87
|
+
response: adaptNodeResponse(response),
|
|
88
|
+
state: options.state ?? {},
|
|
89
|
+
signal: options.signal,
|
|
90
|
+
logger: createFallbackLogger(),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/* -------------------------------------------------------------------------- */
|
|
94
|
+
/* Adapter Detection */
|
|
95
|
+
/* -------------------------------------------------------------------------- */
|
|
96
|
+
export function isHTTPAdapter(value) {
|
|
97
|
+
if (value === null || typeof value !== "object") {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
const candidate = value;
|
|
101
|
+
return (typeof candidate.name === "string" &&
|
|
102
|
+
typeof candidate.createRequest === "function" &&
|
|
103
|
+
typeof candidate.createResponse === "function" &&
|
|
104
|
+
typeof candidate.createContext === "function");
|
|
105
|
+
}
|
|
106
|
+
/* -------------------------------------------------------------------------- */
|
|
107
|
+
/* Fallback Logger */
|
|
108
|
+
/* -------------------------------------------------------------------------- */
|
|
109
|
+
function createFallbackLogger() {
|
|
110
|
+
return {
|
|
111
|
+
info(message, metadata) {
|
|
112
|
+
if (metadata !== undefined) {
|
|
113
|
+
console.info(message, metadata);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
console.info(message);
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
warn(message, metadata) {
|
|
120
|
+
if (metadata !== undefined) {
|
|
121
|
+
console.warn(message, metadata);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
console.warn(message);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
error(message, metadata) {
|
|
128
|
+
if (metadata !== undefined) {
|
|
129
|
+
console.error(message, metadata);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
console.error(message);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=http.adapters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.adapters.js","sourceRoot":"","sources":["../../src/httpAdapter/http.adapters.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAuBtE,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,MAAM,OAAO,eAAe;IAGV,IAAI,GAAG,MAAM,CAAC;IAEvB,aAAa,CAAC,OAAwB;QAC3C,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAEM,cAAc,CAAC,QAAwB;QAC5C,OAAO,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAEM,aAAa,CAClB,OAAoB,EACpB,QAAsB,EACtB,OAAO,GAGH,EAAE;QAEN,OAAO,iBAAiB,CAAQ;YAC9B,OAAO;YACP,QAAQ;YACR,KAAK,EAAE,OAAO,CAAC,KAAK,IAAK,EAAY;YACrC,MAAM,EAAE,OA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B,kBAAkB,GACnB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,6BAA6B,GAC9B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,SAAS,EACT,UAAU,EACV,mBAAmB,GACpB,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zudojs/http/httpAdapter
|
|
3
|
+
*
|
|
4
|
+
* HTTP adapter abstraction and implementations.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./http.adapter.js";
|
|
7
|
+
export * from "./http.adapters.js";
|
|
8
|
+
export * from "./httpFetch.adapter.js";
|
|
9
|
+
export * from "./node/index.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/httpAdapter/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zudojs/http/httpAdapter
|
|
3
|
+
*
|
|
4
|
+
* HTTP adapter abstraction and implementations.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./http.adapter.js";
|
|
7
|
+
export * from "./http.adapters.js";
|
|
8
|
+
export * from "./httpFetch.adapter.js";
|
|
9
|
+
export * from "./node/index.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/httpAdapter/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js HTTP adapter.
|
|
3
|
+
*
|
|
4
|
+
* Bridges Node's `http` / `https` server APIs with Zudojs's runtime
|
|
5
|
+
* independent HTTP adapter contract.
|
|
6
|
+
*
|
|
7
|
+
* @module httpAdapter/node/adapter
|
|
8
|
+
*/
|
|
9
|
+
import { Server } from "node:http";
|
|
10
|
+
import { HttpRequestContext } from "../../httpRequest/httpRequest.context.js";
|
|
11
|
+
import { HttpResponseContext } from "../../httpResponse/httpResponse.context.js";
|
|
12
|
+
import { BaseHttpAdapter } from "../http.adapter.js";
|
|
13
|
+
import type { HttpResponseWriter } from "../../httpResponse/httpResponse.writer.js";
|
|
14
|
+
import type { NodeAdapterOptions, NodeServerAddress } from "./httpNode.type.js";
|
|
15
|
+
export declare class NodeHttpAdapter extends BaseHttpAdapter {
|
|
16
|
+
private readonly host;
|
|
17
|
+
private readonly port;
|
|
18
|
+
private readonly maxBodySize;
|
|
19
|
+
private readonly requestTimeout;
|
|
20
|
+
private readonly headersTimeout;
|
|
21
|
+
private readonly keepAliveTimeout;
|
|
22
|
+
private readonly connectionTimeout;
|
|
23
|
+
private readonly trustProxy;
|
|
24
|
+
private readonly events;
|
|
25
|
+
private server;
|
|
26
|
+
private ownsServer;
|
|
27
|
+
constructor(options?: NodeAdapterOptions);
|
|
28
|
+
get httpServer(): Server | undefined;
|
|
29
|
+
get address(): NodeServerAddress | undefined;
|
|
30
|
+
createRequest(input: unknown): HttpRequestContext;
|
|
31
|
+
createResponse(input?: unknown): HttpResponseContext;
|
|
32
|
+
createWriter(response: unknown): HttpResponseWriter;
|
|
33
|
+
handle(input: unknown): Promise<void>;
|
|
34
|
+
private executeNodeHandler;
|
|
35
|
+
private normalizeResult;
|
|
36
|
+
private handleNodeError;
|
|
37
|
+
private writeNodeResponse;
|
|
38
|
+
start(): Promise<void>;
|
|
39
|
+
stop(): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
export declare function createNodeHttpAdapter(options?: NodeAdapterOptions): NodeHttpAdapter;
|
|
42
|
+
//# sourceMappingURL=httpNode.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpNode.adapter.d.ts","sourceRoot":"","sources":["../../../src/httpAdapter/node/httpNode.adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAgC,MAAM,WAAW,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAE9E,OAAO,EACL,mBAAmB,EAEpB,MAAM,4CAA4C,CAAC;AAIpD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EAElB,MAAM,oBAAoB,CAAC;AAoC5B,qBAAa,eAAgB,SAAQ,eAAe;IAClD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAE9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAE9B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;IAEpD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;IAEpD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IAEtD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAqB;IAEvD,OAAO,CAAC,QAAQ,CAAC,UAAU,CACiC;IAE5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAE3C,OAAO,CAAC,MAAM,CAAqB;IAEnC,OAAO,CAAC,UAAU,CAAS;IAE3B,YAAY,OAAO,GAAE,kBAAuB,EAwC3C;IAMD,IAAI,UAAU,IAAI,MAAM,GAAG,SAAS,CAEnC;IAED,IAAI,OAAO,IAAI,iBAAiB,GAAG,SAAS,CAmB3C;IAMQ,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAWzD;IAEQ,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,mBAAmB,CAQ5D;IAEQ,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,CAQ3D;IAMc,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBnD;YAEa,kBAAkB;IAUhC,OAAO,CAAC,eAAe;YAgBT,eAAe;YAkCf,iBAAiB;IAahB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAmCpC;IAEc,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAcnC;CACF;AAMD,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,kBAAuB,GAC/B,eAAe,CAEjB"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js HTTP adapter.
|
|
3
|
+
*
|
|
4
|
+
* Bridges Node's `http` / `https` server APIs with Zudojs's runtime
|
|
5
|
+
* independent HTTP adapter contract.
|
|
6
|
+
*
|
|
7
|
+
* @module httpAdapter/node/adapter
|
|
8
|
+
*/
|
|
9
|
+
import { Server, ServerResponse, createServer } from "node:http";
|
|
10
|
+
import { HttpRequestContext } from "../../httpRequest/httpRequest.context.js";
|
|
11
|
+
import { HttpResponseContext, createResponseContext, } from "../../httpResponse/httpResponse.context.js";
|
|
12
|
+
import { BaseHttpAdapter } from "../http.adapter.js";
|
|
13
|
+
import { DEFAULT_HOST, DEFAULT_PORT, DEFAULT_MAX_BODY_SIZE, validatePort, validateMaxBodySize, } from "./httpNode.type.js";
|
|
14
|
+
import { NodeResponseWriter } from "./httpNode.response.js";
|
|
15
|
+
import { getNodeRequestHeaders, getNodeRequestProtocol, getNodeRequestHostname, getNodeRequestPort, getNodeRemoteAddress, parseNodeQuery, createNodeRequestContext, } from "./httpNode.request.js";
|
|
16
|
+
import { isIncomingMessage, isServerResponse, isNodeRequestResponsePair, configureServer, listen, closeServer, isResponseContextLike, } from "./httpNode.server.js";
|
|
17
|
+
/* -------------------------------------------------------------------------- */
|
|
18
|
+
/* Node HTTP Adapter */
|
|
19
|
+
/* -------------------------------------------------------------------------- */
|
|
20
|
+
export class NodeHttpAdapter extends BaseHttpAdapter {
|
|
21
|
+
host;
|
|
22
|
+
port;
|
|
23
|
+
maxBodySize;
|
|
24
|
+
requestTimeout;
|
|
25
|
+
headersTimeout;
|
|
26
|
+
keepAliveTimeout;
|
|
27
|
+
connectionTimeout;
|
|
28
|
+
trustProxy;
|
|
29
|
+
events;
|
|
30
|
+
server;
|
|
31
|
+
ownsServer = false;
|
|
32
|
+
constructor(options = {}) {
|
|
33
|
+
super({
|
|
34
|
+
...options,
|
|
35
|
+
name: options.name ?? "node",
|
|
36
|
+
capabilities: {
|
|
37
|
+
streaming: true,
|
|
38
|
+
websockets: false,
|
|
39
|
+
http2: false,
|
|
40
|
+
http3: false,
|
|
41
|
+
trailers: true,
|
|
42
|
+
abortSignal: true,
|
|
43
|
+
keepAlive: true,
|
|
44
|
+
compression: false,
|
|
45
|
+
...options.capabilities,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
this.host = options.host ?? DEFAULT_HOST;
|
|
49
|
+
this.port = validatePort(options.port ?? DEFAULT_PORT);
|
|
50
|
+
this.maxBodySize = validateMaxBodySize(options.maxBodySize ?? DEFAULT_MAX_BODY_SIZE);
|
|
51
|
+
this.requestTimeout = options.requestTimeout;
|
|
52
|
+
this.headersTimeout = options.headersTimeout;
|
|
53
|
+
this.keepAliveTimeout = options.keepAliveTimeout;
|
|
54
|
+
this.connectionTimeout = options.connectionTimeout;
|
|
55
|
+
this.trustProxy = options.trustProxy;
|
|
56
|
+
this.events = {};
|
|
57
|
+
this.server = options.server;
|
|
58
|
+
this.ownsServer = !options.server;
|
|
59
|
+
}
|
|
60
|
+
/* ------------------------------------------------------------------------ */
|
|
61
|
+
/* Server */
|
|
62
|
+
/* ------------------------------------------------------------------------ */
|
|
63
|
+
get httpServer() {
|
|
64
|
+
return this.server;
|
|
65
|
+
}
|
|
66
|
+
get address() {
|
|
67
|
+
if (!this.server) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
const address = this.server.address();
|
|
71
|
+
if (!address || typeof address === "string") {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
host: address.address,
|
|
76
|
+
port: address.port,
|
|
77
|
+
family: typeof address.family === "string"
|
|
78
|
+
? address.family
|
|
79
|
+
: String(address.family),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/* ------------------------------------------------------------------------ */
|
|
83
|
+
/* Request / Response */
|
|
84
|
+
/* ------------------------------------------------------------------------ */
|
|
85
|
+
createRequest(input) {
|
|
86
|
+
if (!isIncomingMessage(input)) {
|
|
87
|
+
throw new TypeError("NodeHttpAdapter.createRequest expected an IncomingMessage.");
|
|
88
|
+
}
|
|
89
|
+
return createNodeRequestContext(input, {
|
|
90
|
+
maxBodySize: this.maxBodySize,
|
|
91
|
+
trustProxy: this.trustProxy,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
createResponse(input) {
|
|
95
|
+
if (input !== undefined && !isServerResponse(input)) {
|
|
96
|
+
throw new TypeError("NodeHttpAdapter.createResponse expected a ServerResponse.");
|
|
97
|
+
}
|
|
98
|
+
return createResponseContext();
|
|
99
|
+
}
|
|
100
|
+
createWriter(response) {
|
|
101
|
+
if (!isServerResponse(response)) {
|
|
102
|
+
throw new TypeError("NodeHttpAdapter.createWriter expected a ServerResponse.");
|
|
103
|
+
}
|
|
104
|
+
return new NodeResponseWriter(response);
|
|
105
|
+
}
|
|
106
|
+
/* ------------------------------------------------------------------------ */
|
|
107
|
+
/* Handle */
|
|
108
|
+
/* ------------------------------------------------------------------------ */
|
|
109
|
+
async handle(input) {
|
|
110
|
+
if (!isNodeRequestResponsePair(input)) {
|
|
111
|
+
throw new TypeError("NodeHttpAdapter.handle expects a Node HTTP request/response pair.");
|
|
112
|
+
}
|
|
113
|
+
const request = input.request;
|
|
114
|
+
const response = input.response;
|
|
115
|
+
const context = this.createRequest(request);
|
|
116
|
+
try {
|
|
117
|
+
const result = await this.executeNodeHandler(context);
|
|
118
|
+
const responseContext = this.normalizeResult(result);
|
|
119
|
+
await this.writeNodeResponse(response, responseContext);
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
await this.handleNodeError(error, context, response);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
async executeNodeHandler(request) {
|
|
126
|
+
if (!this.handler) {
|
|
127
|
+
throw new Error("No HTTP handler has been configured.");
|
|
128
|
+
}
|
|
129
|
+
return this.handler(request);
|
|
130
|
+
}
|
|
131
|
+
normalizeResult(result) {
|
|
132
|
+
if (result instanceof HttpResponseContext) {
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
if (result === undefined || result === null) {
|
|
136
|
+
return createResponseContext();
|
|
137
|
+
}
|
|
138
|
+
if (isResponseContextLike(result)) {
|
|
139
|
+
return createResponseContext(result);
|
|
140
|
+
}
|
|
141
|
+
return createResponseContext().json(result);
|
|
142
|
+
}
|
|
143
|
+
async handleNodeError(error, request, response) {
|
|
144
|
+
if (response.headersSent) {
|
|
145
|
+
response.destroy(error instanceof Error ? error : undefined);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const context = createResponseContext();
|
|
149
|
+
if (this.errorHandler) {
|
|
150
|
+
try {
|
|
151
|
+
const result = await this.errorHandler(error, request);
|
|
152
|
+
const normalized = this.normalizeResult(result);
|
|
153
|
+
await this.writeNodeResponse(response, normalized);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
// Fall through to the safe internal server error response.
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
context.internalServerError().json({
|
|
161
|
+
error: "Internal Server Error",
|
|
162
|
+
});
|
|
163
|
+
await this.writeNodeResponse(response, context);
|
|
164
|
+
}
|
|
165
|
+
async writeNodeResponse(response, context) {
|
|
166
|
+
const writer = this.createWriter(response);
|
|
167
|
+
await this.writeNodeResponse(response, context);
|
|
168
|
+
if (!response.writableEnded) {
|
|
169
|
+
writer.end();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
async start() {
|
|
173
|
+
if (this.server?.listening) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (!this.server) {
|
|
177
|
+
this.server = createServer((request, response) => {
|
|
178
|
+
void this.handle({
|
|
179
|
+
request,
|
|
180
|
+
response,
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
this.ownsServer = true;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
this.server.removeAllListeners("request");
|
|
187
|
+
this.server.on("request", (request, response) => {
|
|
188
|
+
void this.handle({
|
|
189
|
+
request,
|
|
190
|
+
response,
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
configureServer(this.server, {
|
|
195
|
+
requestTimeout: this.requestTimeout,
|
|
196
|
+
headersTimeout: this.headersTimeout,
|
|
197
|
+
keepAliveTimeout: this.keepAliveTimeout,
|
|
198
|
+
connectionTimeout: this.connectionTimeout,
|
|
199
|
+
});
|
|
200
|
+
await listen(this.server, this.port, this.host);
|
|
201
|
+
await super.start();
|
|
202
|
+
}
|
|
203
|
+
async stop() {
|
|
204
|
+
if (!this.server || !this.server.listening) {
|
|
205
|
+
await super.stop();
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
await closeServer(this.server);
|
|
209
|
+
if (this.ownsServer) {
|
|
210
|
+
this.server = undefined;
|
|
211
|
+
}
|
|
212
|
+
await super.stop();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/* -------------------------------------------------------------------------- */
|
|
216
|
+
/* Factory */
|
|
217
|
+
/* -------------------------------------------------------------------------- */
|
|
218
|
+
export function createNodeHttpAdapter(options = {}) {
|
|
219
|
+
return new NodeHttpAdapter(options);
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=httpNode.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpNode.adapter.js","sourceRoot":"","sources":["../../../src/httpAdapter/node/httpNode.adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAE9E,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,4CAA4C,CAAC;AAIpD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAYrD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,YAAY,EACZ,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,MAAM,EACN,WAAW,EACX,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,MAAM,OAAO,eAAgB,SAAQ,eAAe;IACjC,IAAI,CAAS;IAEb,IAAI,CAAS;IAEb,WAAW,CAAS;IAEpB,cAAc,CAAqB;IAEnC,cAAc,CAAqB;IAEnC,gBAAgB,CAAqB;IAErC,iBAAiB,CAAqB;IAEtC,UAAU,CACiC;IAE3C,MAAM,CAAoB;IAEnC,MAAM,CAAqB;IAE3B,UAAU,GAAG,KAAK,CAAC;IAE3B,YAAY,OAAO,GAAuB,E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O;QACT,CAAC;QAED,MAAM,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAE/B,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QAC1B,CAAC;QAED,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACF;AAED,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,MAAM,UAAU,qBAAqB,CACnC,OAAO,GAAuB,EAAE;IAEhC,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpNode.request.d.ts","sourceRoot":"","sources":["../../../src/httpAdapter/node/httpNode.request.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,EACL,kBAAkB,EAEnB,MAAM,0CAA0C,CAAC;AASlD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAU7D,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,eAAe,GACvB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAYlC;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAkBR;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAsBR;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAsCR;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,kBAAuB,GAC/B,MAAM,GAAG,SAAS,CAepB;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,eAAe,GACv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0,0 +1,39 @@
|
|
|
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
|
+
export declare function isIncomingMessage(value: unknown): value is IncomingMessage;
|
|
8
|
+
export declare function isServerResponse(value: unknown): value is ServerResponse;
|
|
9
|
+
export declare function isNodeRequestResponsePair(value: unknown): value is {
|
|
10
|
+
readonly request: IncomingMessage;
|
|
11
|
+
readonly response: ServerResponse;
|
|
12
|
+
};
|
|
13
|
+
export declare function configureServer(server: Server, options: {
|
|
14
|
+
readonly requestTimeout?: number;
|
|
15
|
+
readonly headersTimeout?: number;
|
|
16
|
+
readonly keepAliveTimeout?: number;
|
|
17
|
+
readonly connectionTimeout?: number;
|
|
18
|
+
}): void;
|
|
19
|
+
export declare function listen(server: Server, port: number, host: string): Promise<void>;
|
|
20
|
+
export declare function closeServer(server: Server): Promise<void>;
|
|
21
|
+
export declare function getHeader(request: IncomingMessage, name: string): string | undefined;
|
|
22
|
+
export declare function removePort(host: string): string;
|
|
23
|
+
export declare function extractPort(host: string): number | undefined;
|
|
24
|
+
export declare function parsePort(value: string): number | undefined;
|
|
25
|
+
export declare function getSearchPart(url: string): string;
|
|
26
|
+
import { RequestBodyTooLargeError as NodeRequestBodyTooLargeError } from "@zudojs/errors";
|
|
27
|
+
export { NodeRequestBodyTooLargeError };
|
|
28
|
+
export declare function readNodeRequestBody(request: IncomingMessage, maxBodySize?: number): Promise<Uint8Array>;
|
|
29
|
+
export declare function isResponseContextLike(value: unknown): value is {
|
|
30
|
+
readonly status?: number;
|
|
31
|
+
readonly statusText?: string;
|
|
32
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
33
|
+
readonly body?: unknown;
|
|
34
|
+
readonly contentType?: string;
|
|
35
|
+
readonly contentLength?: number;
|
|
36
|
+
readonly cookies?: readonly never[];
|
|
37
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=httpNode.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpNode.server.d.ts","sourceRoot":"","sources":["../../../src/httpAdapter/node/httpNode.server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAUpE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAClE,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAElC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;CACnC,CAWA;AAMD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IACP,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC,GACA,IAAI,CA4BN;AAMD,wBAAgB,MAAM,CACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBzD;AAMD,wBAAgB,SAAS,CACvB,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAQpB;AAMD,wBAAgB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