@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
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @zudojs/http
|
|
2
|
+
|
|
3
|
+
HTTP primitives, request handling, routing, middleware, and server infrastructure for Zudojs applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @zudojs/http
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { createHTTPServer } from "@zudojs/http";
|
|
15
|
+
|
|
16
|
+
const server = createHTTPServer({
|
|
17
|
+
handler: {
|
|
18
|
+
async fetch(request) {
|
|
19
|
+
return new Response("Hello from Zudojs");
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
await server.start();
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
- Runtime-independent HTTP server abstraction
|
|
30
|
+
- Request/response wrappers with full Web API compatibility
|
|
31
|
+
- Middleware pipeline with error handling
|
|
32
|
+
- Router with parameter extraction
|
|
33
|
+
- CORS, security headers, and content negotiation
|
|
34
|
+
- HTTP client with interceptors
|
|
35
|
+
|
|
36
|
+
## Use Cases
|
|
37
|
+
|
|
38
|
+
- Building REST APIs
|
|
39
|
+
- Implementing middleware pipelines
|
|
40
|
+
- Handling HTTP requests in serverless environments
|
|
41
|
+
- Proxy and gateway implementations
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch body reading utilities.
|
|
3
|
+
*
|
|
4
|
+
* @module httpAdapter/fetch/body
|
|
5
|
+
*/
|
|
6
|
+
import { RequestBodyTooLargeError as FetchRequestBodyTooLargeError } from "@zudojs/errors";
|
|
7
|
+
export { FetchRequestBodyTooLargeError };
|
|
8
|
+
/**
|
|
9
|
+
* Reads the body from a Request or Response as a string.
|
|
10
|
+
*/
|
|
11
|
+
export declare function readFetchBodyAsString(request: Request | Response, maxBodySize?: number): Promise<string>;
|
|
12
|
+
/**
|
|
13
|
+
* Reads the body from a Request or Response and parses it as JSON.
|
|
14
|
+
*/
|
|
15
|
+
export declare function readFetchBodyAsJson<T = unknown>(request: Request | Response, maxBodySize?: number): Promise<T>;
|
|
16
|
+
/**
|
|
17
|
+
* Reads the body from a Request or Response.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readFetchBody(request: Request | Response, maxBodySize?: number): Promise<string | Buffer>;
|
|
20
|
+
//# sourceMappingURL=httpFetch.body.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpFetch.body.d.ts","sourceRoot":"","sources":["../../../src/httpAdapter/fetch/httpFetch.body.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,wBAAwB,IAAI,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAE3F,OAAO,EAAE,6BAA6B,EAAE,CAAC;AAEzC;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,OAAO,GAAG,QAAQ,EAC3B,WAAW,GAAE,MAA8B,GAC1C,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,CAAC,GAAG,OAAO,EACnD,OAAO,EAAE,OAAO,GAAG,QAAQ,EAC3B,WAAW,GAAE,MAA8B,GAC1C,OAAO,CAAC,CAAC,CAAC,CAGZ;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,GAAG,QAAQ,EAC3B,WAAW,GAAE,MAA8B,GAC1C,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAkC1B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch body reading utilities.
|
|
3
|
+
*
|
|
4
|
+
* @module httpAdapter/fetch/body
|
|
5
|
+
*/
|
|
6
|
+
import { DEFAULT_MAX_BODY_SIZE } from "./httpFetch.type.js";
|
|
7
|
+
import { RequestBodyTooLargeError as FetchRequestBodyTooLargeError } from "@zudojs/errors";
|
|
8
|
+
export { FetchRequestBodyTooLargeError };
|
|
9
|
+
/**
|
|
10
|
+
* Reads the body from a Request or Response as a string.
|
|
11
|
+
*/
|
|
12
|
+
export async function readFetchBodyAsString(request, maxBodySize = DEFAULT_MAX_BODY_SIZE) {
|
|
13
|
+
const body = await readFetchBody(request, maxBodySize);
|
|
14
|
+
return body.toString("utf-8");
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Reads the body from a Request or Response and parses it as JSON.
|
|
18
|
+
*/
|
|
19
|
+
export async function readFetchBodyAsJson(request, maxBodySize = DEFAULT_MAX_BODY_SIZE) {
|
|
20
|
+
const text = await readFetchBodyAsString(request, maxBodySize);
|
|
21
|
+
return JSON.parse(text);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Reads the body from a Request or Response.
|
|
25
|
+
*/
|
|
26
|
+
export async function readFetchBody(request, maxBodySize = DEFAULT_MAX_BODY_SIZE) {
|
|
27
|
+
const contentLength = request.headers.get("content-length");
|
|
28
|
+
if (contentLength) {
|
|
29
|
+
const size = parseInt(contentLength, 10);
|
|
30
|
+
if (size > maxBodySize) {
|
|
31
|
+
throw new FetchRequestBodyTooLargeError(maxBodySize, size);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const reader = request.body?.getReader();
|
|
35
|
+
if (!reader) {
|
|
36
|
+
return Buffer.alloc(0);
|
|
37
|
+
}
|
|
38
|
+
const chunks = [];
|
|
39
|
+
let totalSize = 0;
|
|
40
|
+
try {
|
|
41
|
+
while (true) {
|
|
42
|
+
const { done, value } = await reader.read();
|
|
43
|
+
if (done)
|
|
44
|
+
break;
|
|
45
|
+
totalSize += value.length;
|
|
46
|
+
if (totalSize > maxBodySize) {
|
|
47
|
+
throw new FetchRequestBodyTooLargeError(maxBodySize, totalSize);
|
|
48
|
+
}
|
|
49
|
+
chunks.push(value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
reader.releaseLock();
|
|
54
|
+
}
|
|
55
|
+
return Buffer.concat(chunks);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=httpFetch.body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpFetch.body.js","sourceRoot":"","sources":["../../../src/httpAdapter/fetch/httpFetch.body.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,qBAAqB,EAAE,M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IAElB,IAAI,CAAC;QACH,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YAC5C,IAAI,IAAI;gBAAE,MAAM;YAEhB,SAAS,IAAI,KAAK,CAAC,MAAM,CAAC;YAC1B,IAAI,SAAS,GAAG,WAAW,EAAE,CAAC;gBAC5B,MAAM,IAAI,6BAA6B,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;YAClE,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpFetch.helper.d.ts","sourceRoot":"","sources":["../../../src/httpAdapter/fetch/httpFetch.helper.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAQ1D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAQ5D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,iBAAiB,CAO5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpFetch.requestContext.d.ts","sourceRoot":"","sources":["../../../src/httpAdapter/fetch/httpFetch.requestContext.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;GAEG;AACH,wBAA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,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,QAAQ,CAAC,GAAG,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,qBAAqB,QAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/httpAdapter/fetch/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP runtime adapter contract.
|
|
3
|
+
*
|
|
4
|
+
* The adapter layer keeps Zudojs's HTTP core independent from a concrete
|
|
5
|
+
* runtime such as Node.js, Bun, Deno, or a custom server implementation.
|
|
6
|
+
*
|
|
7
|
+
* An adapter is responsible for translating runtime-native requests and
|
|
8
|
+
* responses into Zudojs's request/response contexts and for invoking the
|
|
9
|
+
* application handler.
|
|
10
|
+
*/
|
|
11
|
+
import { HttpRequestContext } from "../httpRequest/httpRequest.context.js";
|
|
12
|
+
import type { RequestContextInit } from "../httpRequest/httpRequest.context.js";
|
|
13
|
+
import { HttpResponseContext } from "../httpResponse/httpResponse.context.js";
|
|
14
|
+
import type { ResponseContextInit } from "../httpResponse/httpResponse.context.js";
|
|
15
|
+
import type { HttpResponseWriter } from "../httpResponse/httpResponse.writer.js";
|
|
16
|
+
export type HttpAdapterName = string;
|
|
17
|
+
export type HttpHandlerResult = HttpResponseContext | ResponseContextInit | unknown | void;
|
|
18
|
+
export type HttpHandler = (request: HttpRequestContext) => HttpHandlerResult | Promise<HttpHandlerResult>;
|
|
19
|
+
export type HttpErrorHandler = (error: unknown, request: HttpRequestContext) => HttpHandlerResult | Promise<HttpHandlerResult>;
|
|
20
|
+
export interface HttpAdapterCapabilities {
|
|
21
|
+
readonly streaming?: boolean;
|
|
22
|
+
readonly websockets?: boolean;
|
|
23
|
+
readonly http2?: boolean;
|
|
24
|
+
readonly http3?: boolean;
|
|
25
|
+
readonly trailers?: boolean;
|
|
26
|
+
readonly abortSignal?: boolean;
|
|
27
|
+
readonly keepAlive?: boolean;
|
|
28
|
+
readonly compression?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface HttpAdapterOptions {
|
|
31
|
+
readonly name?: HttpAdapterName;
|
|
32
|
+
readonly handler?: HttpHandler;
|
|
33
|
+
readonly errorHandler?: HttpErrorHandler;
|
|
34
|
+
readonly capabilities?: HttpAdapterCapabilities;
|
|
35
|
+
readonly trustProxy?: boolean | number | string | readonly string[];
|
|
36
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
37
|
+
}
|
|
38
|
+
export interface HttpAdapterContext {
|
|
39
|
+
readonly adapter: HttpAdapter;
|
|
40
|
+
readonly request: HttpRequestContext;
|
|
41
|
+
readonly response: HttpResponseContext;
|
|
42
|
+
}
|
|
43
|
+
export interface HttpAdapter {
|
|
44
|
+
readonly name: HttpAdapterName;
|
|
45
|
+
readonly capabilities: Readonly<HttpAdapterCapabilities>;
|
|
46
|
+
readonly metadata: Readonly<Record<string, unknown>>;
|
|
47
|
+
createRequest(input: unknown): HttpRequestContext;
|
|
48
|
+
createResponse(input?: unknown): HttpResponseContext;
|
|
49
|
+
createWriter(response: unknown): HttpResponseWriter;
|
|
50
|
+
handle(input: unknown): void | Promise<void> | Promise<unknown> | Promise<Response>;
|
|
51
|
+
normalizeRequest?(input: unknown): RequestContextInit | Promise<RequestContextInit>;
|
|
52
|
+
normalizeResponse?(input: unknown): ResponseContextInit | Promise<ResponseContextInit>;
|
|
53
|
+
writeResponse?(response: unknown, context: HttpResponseContext): void | Promise<void>;
|
|
54
|
+
start?(): void | Promise<void>;
|
|
55
|
+
stop?(): void | Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
import { HttpAdapterError } from "@zudojs/errors";
|
|
58
|
+
export { HttpAdapterError };
|
|
59
|
+
export declare abstract class BaseHttpAdapter implements HttpAdapter {
|
|
60
|
+
readonly name: HttpAdapterName;
|
|
61
|
+
readonly capabilities: Readonly<HttpAdapterCapabilities>;
|
|
62
|
+
readonly metadata: Readonly<Record<string, unknown>>;
|
|
63
|
+
protected handler: HttpHandler | undefined;
|
|
64
|
+
protected errorHandler: HttpErrorHandler | undefined;
|
|
65
|
+
private started;
|
|
66
|
+
normalizeRequest?(input: unknown): RequestContextInit | Promise<RequestContextInit>;
|
|
67
|
+
normalizeResponse?(input: unknown): ResponseContextInit | Promise<ResponseContextInit>;
|
|
68
|
+
writeResponse?(response: unknown, context: HttpResponseContext): void | Promise<void>;
|
|
69
|
+
constructor(options?: HttpAdapterOptions);
|
|
70
|
+
abstract createRequest(input: unknown): HttpRequestContext;
|
|
71
|
+
abstract createResponse(input?: unknown): HttpResponseContext;
|
|
72
|
+
abstract createWriter(response: unknown): HttpResponseWriter;
|
|
73
|
+
handle(input: unknown): Promise<void>;
|
|
74
|
+
protected createRequestContext(input: unknown): Promise<HttpRequestContext>;
|
|
75
|
+
protected executeHandler(request: HttpRequestContext): Promise<HttpHandlerResult>;
|
|
76
|
+
protected handleError(error: unknown, request: HttpRequestContext, input: unknown, response: HttpResponseContext): Promise<void>;
|
|
77
|
+
protected write(input: unknown, context: HttpResponseContext): Promise<void>;
|
|
78
|
+
start(): Promise<void>;
|
|
79
|
+
stop(): Promise<void>;
|
|
80
|
+
get isStarted(): boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface GenericAdapterOptions extends HttpAdapterOptions {
|
|
83
|
+
readonly requestFactory: (input: unknown) => HttpRequestContext | RequestContextInit;
|
|
84
|
+
readonly responseFactory?: (input?: unknown) => HttpResponseContext | ResponseContextInit;
|
|
85
|
+
readonly writerFactory: (response: unknown) => HttpResponseWriter;
|
|
86
|
+
readonly responseWriter?: (response: unknown, context: HttpResponseContext) => void | Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
export declare class GenericHttpAdapter extends BaseHttpAdapter {
|
|
89
|
+
private readonly requestFactory;
|
|
90
|
+
private readonly responseFactory;
|
|
91
|
+
private readonly writerFactory;
|
|
92
|
+
private readonly responseWriter;
|
|
93
|
+
constructor(options: GenericAdapterOptions);
|
|
94
|
+
createRequest(input: unknown): HttpRequestContext;
|
|
95
|
+
createResponse(input?: unknown): HttpResponseContext;
|
|
96
|
+
createWriter(response: unknown): HttpResponseWriter;
|
|
97
|
+
writeResponse(response: unknown, context: HttpResponseContext): Promise<void>;
|
|
98
|
+
}
|
|
99
|
+
export declare class HttpAdapterRegistry {
|
|
100
|
+
private readonly adapters;
|
|
101
|
+
register(adapter: HttpAdapter): this;
|
|
102
|
+
replace(adapter: HttpAdapter): this;
|
|
103
|
+
unregister(name: string): boolean;
|
|
104
|
+
has(name: string): boolean;
|
|
105
|
+
get(name: string): HttpAdapter | undefined;
|
|
106
|
+
require(name: string): HttpAdapter;
|
|
107
|
+
list(): readonly HttpAdapter[];
|
|
108
|
+
clear(): void;
|
|
109
|
+
}
|
|
110
|
+
export declare function startAdapter(adapter: HttpAdapter): Promise<void>;
|
|
111
|
+
export declare function stopAdapter(adapter: HttpAdapter): Promise<void>;
|
|
112
|
+
export declare function isHttpAdapter(value: unknown): value is HttpAdapter;
|
|
113
|
+
export declare function normalizeHandlerResult(result: HttpHandlerResult): HttpResponseContext;
|
|
114
|
+
export declare function isResponseContextInit(value: unknown): value is ResponseContextInit;
|
|
115
|
+
export declare function mergeResponseContext(target: HttpResponseContext, source: HttpResponseContext): HttpResponseContext;
|
|
116
|
+
//# sourceMappingURL=http.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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gB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAclE;AAMD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,iBAAiB,GACxB,mBAAmB,CAcrB;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,mBAAmB,CAiB9B;AAMD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CAuBrB"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP runtime adapter contract.
|
|
3
|
+
*
|
|
4
|
+
* The adapter layer keeps Zudojs's HTTP core independent from a concrete
|
|
5
|
+
* runtime such as Node.js, Bun, Deno, or a custom server implementation.
|
|
6
|
+
*
|
|
7
|
+
* An adapter is responsible for translating runtime-native requests and
|
|
8
|
+
* responses into Zudojs's request/response contexts and for invoking the
|
|
9
|
+
* application handler.
|
|
10
|
+
*/
|
|
11
|
+
import { HttpRequestContext, createRequestContext, } from "../httpRequest/httpRequest.context.js";
|
|
12
|
+
import { HttpResponseContext, createResponseContext, } from "../httpResponse/httpResponse.context.js";
|
|
13
|
+
import { writeResponse } from "../httpResponse/httpResponse.writer.js";
|
|
14
|
+
/* -------------------------------------------------------------------------- */
|
|
15
|
+
/* Adapter Error */
|
|
16
|
+
/* -------------------------------------------------------------------------- */
|
|
17
|
+
import { HttpAdapterError } from "@zudojs/errors";
|
|
18
|
+
export { HttpAdapterError };
|
|
19
|
+
/* -------------------------------------------------------------------------- */
|
|
20
|
+
/* Abstract Adapter */
|
|
21
|
+
/* -------------------------------------------------------------------------- */
|
|
22
|
+
export class BaseHttpAdapter {
|
|
23
|
+
name;
|
|
24
|
+
capabilities;
|
|
25
|
+
metadata;
|
|
26
|
+
handler;
|
|
27
|
+
errorHandler;
|
|
28
|
+
started = false;
|
|
29
|
+
constructor(options = {}) {
|
|
30
|
+
this.name = options.name ?? this.constructor.name;
|
|
31
|
+
this.capabilities = Object.freeze({
|
|
32
|
+
...(options.capabilities ?? {}),
|
|
33
|
+
});
|
|
34
|
+
this.metadata = Object.freeze({
|
|
35
|
+
...(options.metadata ?? {}),
|
|
36
|
+
});
|
|
37
|
+
this.handler = options.handler;
|
|
38
|
+
this.errorHandler = options.errorHandler;
|
|
39
|
+
}
|
|
40
|
+
async handle(input) {
|
|
41
|
+
const request = await this.createRequestContext(input);
|
|
42
|
+
const response = this.createResponse();
|
|
43
|
+
try {
|
|
44
|
+
const result = await this.executeHandler(request);
|
|
45
|
+
const context = normalizeHandlerResult(result);
|
|
46
|
+
mergeResponseContext(response, context);
|
|
47
|
+
await this.write(input, response);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
await this.handleError(error, request, input, response);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async createRequestContext(input) {
|
|
54
|
+
if (this.normalizeRequest) {
|
|
55
|
+
const normalized = await this.normalizeRequest(input);
|
|
56
|
+
return createRequestContext(normalized);
|
|
57
|
+
}
|
|
58
|
+
return this.createRequest(input);
|
|
59
|
+
}
|
|
60
|
+
async executeHandler(request) {
|
|
61
|
+
if (!this.handler) {
|
|
62
|
+
throw new HttpAdapterError("No HTTP handler has been configured for this adapter.", {
|
|
63
|
+
code: "HTTP_HANDLER_NOT_CONFIGURED",
|
|
64
|
+
adapter: this.name,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return this.handler(request);
|
|
68
|
+
}
|
|
69
|
+
async handleError(error, request, input, response) {
|
|
70
|
+
if (this.errorHandler) {
|
|
71
|
+
const result = await this.errorHandler(error, request);
|
|
72
|
+
const context = normalizeHandlerResult(result);
|
|
73
|
+
mergeResponseContext(response, context);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
response.internalServerError();
|
|
77
|
+
response.json({
|
|
78
|
+
error: "Internal Server Error",
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
await this.write(input, response);
|
|
82
|
+
}
|
|
83
|
+
async write(input, context) {
|
|
84
|
+
if (this.writeResponse) {
|
|
85
|
+
await this.writeResponse(input, context);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
throw new HttpAdapterError("The HTTP adapter does not implement response writing.", {
|
|
89
|
+
code: "HTTP_RESPONSE_WRITER_NOT_IMPLEMENTED",
|
|
90
|
+
adapter: this.name,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async start() {
|
|
94
|
+
if (this.started) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
this.started = true;
|
|
98
|
+
}
|
|
99
|
+
async stop() {
|
|
100
|
+
if (!this.started) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
this.started = false;
|
|
104
|
+
}
|
|
105
|
+
get isStarted() {
|
|
106
|
+
return this.started;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export class GenericHttpAdapter extends BaseHttpAdapter {
|
|
110
|
+
requestFactory;
|
|
111
|
+
responseFactory;
|
|
112
|
+
writerFactory;
|
|
113
|
+
responseWriter;
|
|
114
|
+
constructor(options) {
|
|
115
|
+
super(options);
|
|
116
|
+
this.requestFactory = options.requestFactory;
|
|
117
|
+
this.responseFactory = options.responseFactory;
|
|
118
|
+
this.writerFactory = options.writerFactory;
|
|
119
|
+
this.responseWriter = options.responseWriter;
|
|
120
|
+
}
|
|
121
|
+
createRequest(input) {
|
|
122
|
+
const result = this.requestFactory(input);
|
|
123
|
+
if (result instanceof HttpRequestContext) {
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
return createRequestContext(result);
|
|
127
|
+
}
|
|
128
|
+
createResponse(input) {
|
|
129
|
+
if (this.responseFactory) {
|
|
130
|
+
const result = this.responseFactory(input);
|
|
131
|
+
if (result instanceof HttpResponseContext) {
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
return createResponseContext(result);
|
|
135
|
+
}
|
|
136
|
+
return createResponseContext();
|
|
137
|
+
}
|
|
138
|
+
createWriter(response) {
|
|
139
|
+
return this.writerFactory(response);
|
|
140
|
+
}
|
|
141
|
+
async writeResponse(response, context) {
|
|
142
|
+
if (this.responseWriter) {
|
|
143
|
+
await this.responseWriter(response, context);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const writer = this.createWriter(response);
|
|
147
|
+
await writeResponse(context, writer);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/* -------------------------------------------------------------------------- */
|
|
151
|
+
/* Adapter Registry */
|
|
152
|
+
/* -------------------------------------------------------------------------- */
|
|
153
|
+
export class HttpAdapterRegistry {
|
|
154
|
+
adapters = new Map();
|
|
155
|
+
register(adapter) {
|
|
156
|
+
const name = normalizeAdapterName(adapter.name);
|
|
157
|
+
if (!name) {
|
|
158
|
+
throw new TypeError("HTTP adapter name cannot be empty.");
|
|
159
|
+
}
|
|
160
|
+
if (this.adapters.has(name)) {
|
|
161
|
+
throw new HttpAdapterError(`An HTTP adapter named "${adapter.name}" is already registered.`, {
|
|
162
|
+
code: "HTTP_ADAPTER_ALREADY_REGISTERED",
|
|
163
|
+
adapter: adapter.name,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
this.adapters.set(name, adapter);
|
|
167
|
+
return this;
|
|
168
|
+
}
|
|
169
|
+
replace(adapter) {
|
|
170
|
+
const name = normalizeAdapterName(adapter.name);
|
|
171
|
+
if (!name) {
|
|
172
|
+
throw new TypeError("HTTP adapter name cannot be empty.");
|
|
173
|
+
}
|
|
174
|
+
this.adapters.set(name, adapter);
|
|
175
|
+
return this;
|
|
176
|
+
}
|
|
177
|
+
unregister(name) {
|
|
178
|
+
return this.adapters.delete(normalizeAdapterName(name));
|
|
179
|
+
}
|
|
180
|
+
has(name) {
|
|
181
|
+
return this.adapters.has(normalizeAdapterName(name));
|
|
182
|
+
}
|
|
183
|
+
get(name) {
|
|
184
|
+
return this.adapters.get(normalizeAdapterName(name));
|
|
185
|
+
}
|
|
186
|
+
require(name) {
|
|
187
|
+
const adapter = this.get(name);
|
|
188
|
+
if (!adapter) {
|
|
189
|
+
throw new HttpAdapterError(`HTTP adapter "${name}" is not registered.`, {
|
|
190
|
+
code: "HTTP_ADAPTER_NOT_FOUND",
|
|
191
|
+
adapter: name,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
return adapter;
|
|
195
|
+
}
|
|
196
|
+
list() {
|
|
197
|
+
return Object.freeze([...this.adapters.values()]);
|
|
198
|
+
}
|
|
199
|
+
clear() {
|
|
200
|
+
this.adapters.clear();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/* -------------------------------------------------------------------------- */
|
|
204
|
+
/* Adapter Lifecycle */
|
|
205
|
+
/* -------------------------------------------------------------------------- */
|
|
206
|
+
export async function startAdapter(adapter) {
|
|
207
|
+
if (adapter.start) {
|
|
208
|
+
await adapter.start();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
export async function stopAdapter(adapter) {
|
|
212
|
+
if (adapter.stop) {
|
|
213
|
+
await adapter.stop();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/* -------------------------------------------------------------------------- */
|
|
217
|
+
/* Adapter Assertions */
|
|
218
|
+
/* -------------------------------------------------------------------------- */
|
|
219
|
+
export function isHttpAdapter(value) {
|
|
220
|
+
if (value === null || typeof value !== "object") {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
const candidate = value;
|
|
224
|
+
return (typeof candidate.name === "string" &&
|
|
225
|
+
typeof candidate.createRequest === "function" &&
|
|
226
|
+
typeof candidate.createResponse === "function" &&
|
|
227
|
+
typeof candidate.createWriter === "function" &&
|
|
228
|
+
typeof candidate.handle === "function");
|
|
229
|
+
}
|
|
230
|
+
/* -------------------------------------------------------------------------- */
|
|
231
|
+
/* Result Normalization */
|
|
232
|
+
/* -------------------------------------------------------------------------- */
|
|
233
|
+
export function normalizeHandlerResult(result) {
|
|
234
|
+
if (result instanceof HttpResponseContext) {
|
|
235
|
+
return result;
|
|
236
|
+
}
|
|
237
|
+
if (result === undefined || result === null) {
|
|
238
|
+
return createResponseContext();
|
|
239
|
+
}
|
|
240
|
+
if (isResponseContextInit(result)) {
|
|
241
|
+
return createResponseContext(result);
|
|
242
|
+
}
|
|
243
|
+
return createResponseContext().json(result);
|
|
244
|
+
}
|
|
245
|
+
export function isResponseContextInit(value) {
|
|
246
|
+
if (value === null || typeof value !== "object") {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
const candidate = value;
|
|
250
|
+
return ("status" in candidate ||
|
|
251
|
+
"statusText" in candidate ||
|
|
252
|
+
"headers" in candidate ||
|
|
253
|
+
"body" in candidate ||
|
|
254
|
+
"contentType" in candidate ||
|
|
255
|
+
"contentLength" in candidate ||
|
|
256
|
+
"cookies" in candidate ||
|
|
257
|
+
"metadata" in candidate);
|
|
258
|
+
}
|
|
259
|
+
/* -------------------------------------------------------------------------- */
|
|
260
|
+
/* Response Merging */
|
|
261
|
+
/* -------------------------------------------------------------------------- */
|
|
262
|
+
export function mergeResponseContext(target, source) {
|
|
263
|
+
target.setStatus(source.status, source.statusText);
|
|
264
|
+
for (const [name, value] of Object.entries(source.headers)) {
|
|
265
|
+
target.setHeader(name, typeof value === "string" ? value : value.join(", "));
|
|
266
|
+
}
|
|
267
|
+
for (const cookie of source.cookies) {
|
|
268
|
+
target.setCookie(cookie);
|
|
269
|
+
}
|
|
270
|
+
for (const [key, value] of Object.entries(source.metadata)) {
|
|
271
|
+
target.setMetadata(key, value);
|
|
272
|
+
}
|
|
273
|
+
if (source.body !== undefined) {
|
|
274
|
+
target.setBody(source.body);
|
|
275
|
+
}
|
|
276
|
+
return target;
|
|
277
|
+
}
|
|
278
|
+
/* -------------------------------------------------------------------------- */
|
|
279
|
+
/* Internal Helpers */
|
|
280
|
+
/* -------------------------------------------------------------------------- */
|
|
281
|
+
function normalizeAdapterName(name) {
|
|
282
|
+
return name.trim().toLowerCase();
|
|
283
|
+
}
|
|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