@zudojs/http 1.4.3 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/httpAdapter/errorResponse/httpAdapterError.headers.d.ts +46 -0
- package/dist/httpAdapter/errorResponse/httpAdapterError.headers.js +68 -0
- package/dist/httpAdapter/errorResponse/httpAdapterError.issues.d.ts +11 -0
- package/dist/httpAdapter/errorResponse/httpAdapterError.issues.js +37 -0
- package/dist/httpAdapter/errorResponse/httpAdapterError.locate.d.ts +29 -0
- package/dist/httpAdapter/errorResponse/httpAdapterError.locate.js +74 -0
- package/dist/httpAdapter/{httpAdapter.errorResponse.d.ts → errorResponse/httpAdapterError.response.d.ts} +10 -5
- package/dist/httpAdapter/errorResponse/httpAdapterError.response.js +83 -0
- package/dist/httpAdapter/errorResponse/index.d.ts +10 -0
- package/dist/httpAdapter/errorResponse/index.js +10 -0
- package/dist/httpAdapter/fetch/httpFetch.body.d.ts +0 -1
- package/dist/httpAdapter/fetch/httpFetch.body.js +0 -1
- package/dist/httpAdapter/fetch/httpFetch.helper.d.ts +0 -1
- package/dist/httpAdapter/fetch/httpFetch.helper.js +0 -1
- package/dist/httpAdapter/fetch/httpFetch.requestContext.d.ts +0 -1
- package/dist/httpAdapter/fetch/httpFetch.requestContext.js +0 -1
- package/dist/httpAdapter/fetch/httpFetch.responseWriter.d.ts +0 -1
- package/dist/httpAdapter/fetch/httpFetch.responseWriter.js +0 -1
- package/dist/httpAdapter/fetch/httpFetch.type.d.ts +2 -2
- package/dist/httpAdapter/fetch/httpFetch.type.js +2 -2
- package/dist/httpAdapter/fetch/index.d.ts +0 -1
- package/dist/httpAdapter/fetch/index.js +0 -1
- package/dist/httpAdapter/http.adapter.d.ts +12 -1
- package/dist/httpAdapter/http.adapter.js +5 -3
- package/dist/httpAdapter/http.adapters.d.ts +0 -1
- package/dist/httpAdapter/http.adapters.js +0 -1
- package/dist/httpAdapter/httpAdapter.logger.d.ts +0 -1
- package/dist/httpAdapter/httpAdapter.logger.js +0 -1
- package/dist/httpAdapter/httpFetch.adapter.d.ts +0 -1
- package/dist/httpAdapter/httpFetch.adapter.js +0 -1
- package/dist/httpAdapter/index.d.ts +1 -1
- package/dist/httpAdapter/index.js +0 -1
- package/dist/httpAdapter/node/httpNode.adapter.d.ts +6 -2
- package/dist/httpAdapter/node/httpNode.adapter.js +33 -10
- package/dist/httpAdapter/node/httpNode.request.d.ts +0 -1
- package/dist/httpAdapter/node/httpNode.request.js +0 -1
- package/dist/httpAdapter/node/httpNode.response.d.ts +0 -1
- package/dist/httpAdapter/node/httpNode.response.js +0 -1
- package/dist/httpAdapter/node/httpNode.server.d.ts +0 -1
- package/dist/httpAdapter/node/httpNode.server.js +0 -1
- package/dist/httpAdapter/node/httpNode.type.d.ts +2 -2
- package/dist/httpAdapter/node/httpNode.type.js +2 -2
- package/dist/httpAdapter/node/index.d.ts +0 -1
- package/dist/httpAdapter/node/index.js +0 -1
- package/dist/httpAgent/http.agent.d.ts +0 -1
- package/dist/httpAgent/http.agent.js +0 -1
- package/dist/httpAgent/index.d.ts +0 -1
- package/dist/httpAgent/index.js +0 -1
- package/dist/httpBody/http.body.d.ts +0 -1
- package/dist/httpBody/http.body.js +0 -1
- package/dist/httpBody/httpBody.formData.d.ts +5 -2
- package/dist/httpBody/httpBody.formData.js +5 -2
- package/dist/httpBody/httpBody.parser.d.ts +0 -1
- package/dist/httpBody/httpBody.parser.js +0 -1
- package/dist/httpBody/index.d.ts +0 -1
- package/dist/httpBody/index.js +0 -1
- package/dist/httpCacheControl/core/httpCacheControl.parse.d.ts +0 -1
- package/dist/httpCacheControl/core/httpCacheControl.parse.js +0 -1
- package/dist/httpCacheControl/core/httpCacheControl.type.d.ts +0 -1
- package/dist/httpCacheControl/core/httpCacheControl.type.js +0 -1
- package/dist/httpCacheControl/core/httpCacheControl.validation.d.ts +0 -1
- package/dist/httpCacheControl/core/httpCacheControl.validation.js +0 -1
- package/dist/httpCacheControl/core/index.d.ts +0 -1
- package/dist/httpCacheControl/core/index.js +0 -1
- package/dist/httpCacheControl/httpCacheControl.core.d.ts +0 -1
- package/dist/httpCacheControl/httpCacheControl.core.js +0 -1
- package/dist/httpCacheControl/httpCacheControl.factory.d.ts +0 -1
- package/dist/httpCacheControl/httpCacheControl.factory.js +0 -1
- package/dist/httpCacheControl/httpCacheControl.freshness.d.ts +0 -1
- package/dist/httpCacheControl/httpCacheControl.freshness.js +0 -1
- package/dist/httpCacheControl/httpCacheControl.requestHelper.d.ts +0 -1
- package/dist/httpCacheControl/httpCacheControl.requestHelper.js +0 -1
- package/dist/httpCacheControl/httpCacheControl.responseHelper.d.ts +0 -1
- package/dist/httpCacheControl/httpCacheControl.responseHelper.js +0 -1
- package/dist/httpCacheControl/index.d.ts +0 -1
- package/dist/httpCacheControl/index.js +0 -1
- package/dist/httpClient/httpClient.abort.d.ts +0 -1
- package/dist/httpClient/httpClient.abort.js +0 -1
- package/dist/httpClient/httpClient.body.d.ts +0 -1
- package/dist/httpClient/httpClient.body.js +0 -1
- package/dist/httpClient/httpClient.client.d.ts +0 -1
- package/dist/httpClient/httpClient.client.js +0 -1
- package/dist/httpClient/httpClient.context.d.ts +0 -1
- package/dist/httpClient/httpClient.context.js +0 -1
- package/dist/httpClient/httpClient.error.d.ts +0 -1
- package/dist/httpClient/httpClient.error.js +0 -1
- package/dist/httpClient/httpClient.errorNormalizer.d.ts +0 -1
- package/dist/httpClient/httpClient.errorNormalizer.js +0 -1
- package/dist/httpClient/httpClient.executor.d.ts +0 -1
- package/dist/httpClient/httpClient.executor.js +0 -1
- package/dist/httpClient/httpClient.factory.d.ts +0 -1
- package/dist/httpClient/httpClient.factory.js +0 -1
- package/dist/httpClient/httpClient.headers.d.ts +0 -1
- package/dist/httpClient/httpClient.headers.js +0 -1
- package/dist/httpClient/httpClient.helpers.d.ts +0 -1
- package/dist/httpClient/httpClient.helpers.js +0 -1
- package/dist/httpClient/httpClient.interceptors.d.ts +0 -1
- package/dist/httpClient/httpClient.interceptors.js +0 -1
- package/dist/httpClient/httpClient.methods.d.ts +0 -1
- package/dist/httpClient/httpClient.methods.js +0 -1
- package/dist/httpClient/httpClient.response.d.ts +0 -1
- package/dist/httpClient/httpClient.response.js +0 -1
- package/dist/httpClient/httpClient.retry.d.ts +0 -1
- package/dist/httpClient/httpClient.retry.js +0 -1
- package/dist/httpClient/httpClient.type.d.ts +0 -1
- package/dist/httpClient/httpClient.type.js +0 -1
- package/dist/httpClient/httpClient.typeGuards.d.ts +0 -1
- package/dist/httpClient/httpClient.typeGuards.js +0 -1
- package/dist/httpClient/httpClient.url.d.ts +0 -1
- package/dist/httpClient/httpClient.url.js +0 -1
- package/dist/httpClient/index.d.ts +2 -1
- package/dist/httpClient/index.js +2 -1
- package/dist/httpCompression/http.compression.d.ts +0 -1
- package/dist/httpCompression/http.compression.js +0 -1
- package/dist/httpCompression/index.d.ts +0 -1
- package/dist/httpCompression/index.js +0 -1
- package/dist/httpConditional/httpConditional.core.d.ts +0 -1
- package/dist/httpConditional/httpConditional.core.js +0 -1
- package/dist/httpConditional/index.d.ts +0 -1
- package/dist/httpConditional/index.js +0 -1
- package/dist/httpConstants/http.constants.d.ts +0 -1
- package/dist/httpConstants/http.constants.js +0 -1
- package/dist/httpConstants/index.d.ts +0 -1
- package/dist/httpConstants/index.js +0 -1
- package/dist/httpContentDisposition/httpContentDisposition.core.d.ts +0 -1
- package/dist/httpContentDisposition/httpContentDisposition.core.js +0 -1
- package/dist/httpContentDisposition/index.d.ts +0 -1
- package/dist/httpContentDisposition/index.js +0 -1
- package/dist/httpContentType/httpContentType.boundary.d.ts +0 -1
- package/dist/httpContentType/httpContentType.boundary.js +0 -1
- package/dist/httpContentType/httpContentType.category.d.ts +0 -1
- package/dist/httpContentType/httpContentType.category.js +0 -1
- package/dist/httpContentType/httpContentType.categoryBinary.d.ts +0 -1
- package/dist/httpContentType/httpContentType.categoryBinary.js +0 -1
- package/dist/httpContentType/httpContentType.charset.d.ts +0 -1
- package/dist/httpContentType/httpContentType.charset.js +0 -1
- package/dist/httpContentType/httpContentType.constructors.d.ts +0 -1
- package/dist/httpContentType/httpContentType.constructors.js +0 -1
- package/dist/httpContentType/httpContentType.formatter.d.ts +0 -1
- package/dist/httpContentType/httpContentType.formatter.js +0 -1
- package/dist/httpContentType/httpContentType.matcher.d.ts +0 -1
- package/dist/httpContentType/httpContentType.matcher.js +0 -1
- package/dist/httpContentType/httpContentType.mediaTypes.d.ts +0 -1
- package/dist/httpContentType/httpContentType.mediaTypes.js +0 -1
- package/dist/httpContentType/httpContentType.normalizer.d.ts +0 -1
- package/dist/httpContentType/httpContentType.normalizer.js +0 -1
- package/dist/httpContentType/httpContentType.parameter.d.ts +0 -1
- package/dist/httpContentType/httpContentType.parameter.js +0 -1
- package/dist/httpContentType/httpContentType.parser.d.ts +0 -1
- package/dist/httpContentType/httpContentType.parser.js +0 -1
- package/dist/httpContentType/httpContentType.parserHelpers.d.ts +0 -1
- package/dist/httpContentType/httpContentType.parserHelpers.js +0 -1
- package/dist/httpContentType/httpContentType.type.d.ts +0 -1
- package/dist/httpContentType/httpContentType.type.js +0 -1
- package/dist/httpContentType/index.d.ts +0 -1
- package/dist/httpContentType/index.js +0 -1
- package/dist/httpContext/http.context.d.ts +0 -1
- package/dist/httpContext/http.context.js +0 -1
- package/dist/httpContext/index.d.ts +0 -1
- package/dist/httpContext/index.js +0 -1
- package/dist/httpCookies/http.cookies.d.ts +0 -1
- package/dist/httpCookies/http.cookies.js +0 -1
- package/dist/httpCookies/httpCookies.defaults.d.ts +0 -1
- package/dist/httpCookies/httpCookies.defaults.js +0 -1
- package/dist/httpCookies/index.d.ts +0 -1
- package/dist/httpCookies/index.js +0 -1
- package/dist/httpCors/http.cors.d.ts +0 -1
- package/dist/httpCors/http.cors.js +0 -1
- package/dist/httpCors/index.d.ts +0 -1
- package/dist/httpCors/index.js +0 -1
- package/dist/httpCsp/checks/httpCsp.checks.d.ts +0 -1
- package/dist/httpCsp/checks/httpCsp.checks.js +0 -1
- package/dist/httpCsp/checks/index.d.ts +0 -1
- package/dist/httpCsp/checks/index.js +0 -1
- package/dist/httpCsp/formatting/httpCsp.formatting.d.ts +0 -1
- package/dist/httpCsp/formatting/httpCsp.formatting.js +0 -1
- package/dist/httpCsp/formatting/index.d.ts +0 -1
- package/dist/httpCsp/formatting/index.js +0 -1
- package/dist/httpCsp/index.d.ts +0 -1
- package/dist/httpCsp/index.js +0 -1
- package/dist/httpCsp/internal/httpCsp.internal.d.ts +0 -1
- package/dist/httpCsp/internal/httpCsp.internal.js +0 -1
- package/dist/httpCsp/internal/index.d.ts +0 -1
- package/dist/httpCsp/internal/index.js +0 -1
- package/dist/httpCsp/nonce/httpCsp.nonce.d.ts +0 -1
- package/dist/httpCsp/nonce/httpCsp.nonce.js +0 -1
- package/dist/httpCsp/nonce/index.d.ts +0 -1
- package/dist/httpCsp/nonce/index.js +0 -1
- package/dist/httpCsp/parsing/httpCsp.parsing.d.ts +0 -1
- package/dist/httpCsp/parsing/httpCsp.parsing.js +0 -1
- package/dist/httpCsp/parsing/index.d.ts +0 -1
- package/dist/httpCsp/parsing/index.js +0 -1
- package/dist/httpCsp/policies/httpCsp.policies.d.ts +0 -1
- package/dist/httpCsp/policies/httpCsp.policies.js +0 -1
- package/dist/httpCsp/policies/index.d.ts +0 -1
- package/dist/httpCsp/policies/index.js +0 -1
- package/dist/httpCsp/reportOnly/httpCsp.reportOnly.d.ts +0 -1
- package/dist/httpCsp/reportOnly/httpCsp.reportOnly.js +0 -1
- package/dist/httpCsp/reportOnly/index.d.ts +0 -1
- package/dist/httpCsp/reportOnly/index.js +0 -1
- package/dist/httpCsp/sources/httpCsp.sources.d.ts +0 -1
- package/dist/httpCsp/sources/httpCsp.sources.js +0 -1
- package/dist/httpCsp/sources/index.d.ts +0 -1
- package/dist/httpCsp/sources/index.js +0 -1
- package/dist/httpCsp/types/httpCsp.constant.d.ts +0 -1
- package/dist/httpCsp/types/httpCsp.constant.js +0 -1
- package/dist/httpCsp/types/httpCsp.type.d.ts +0 -1
- package/dist/httpCsp/types/httpCsp.type.js +0 -1
- package/dist/httpCsp/types/index.d.ts +0 -1
- package/dist/httpCsp/types/index.js +0 -1
- package/dist/httpCsp/validation/httpCsp.validate.d.ts +0 -1
- package/dist/httpCsp/validation/httpCsp.validate.js +0 -1
- package/dist/httpCsp/validation/httpCsp.validation.d.ts +0 -1
- package/dist/httpCsp/validation/httpCsp.validation.js +0 -1
- package/dist/httpCsp/validation/index.d.ts +0 -1
- package/dist/httpCsp/validation/index.js +0 -1
- package/dist/httpErrors/factories/httpError.clientError.d.ts +0 -1
- package/dist/httpErrors/factories/httpError.clientError.js +0 -1
- package/dist/httpErrors/factories/httpError.serverError.d.ts +10 -6
- package/dist/httpErrors/factories/httpError.serverError.js +22 -6
- package/dist/httpErrors/httpError.base.d.ts +0 -1
- package/dist/httpErrors/httpError.base.js +0 -1
- package/dist/httpErrors/httpError.helper.d.ts +0 -1
- package/dist/httpErrors/httpError.helper.js +0 -1
- package/dist/httpErrors/httpError.invalidJson.d.ts +0 -1
- package/dist/httpErrors/httpError.invalidJson.js +0 -1
- package/dist/httpErrors/httpError.type.d.ts +0 -1
- package/dist/httpErrors/httpError.type.js +0 -1
- package/dist/httpErrors/httpError.typeGuard.d.ts +0 -1
- package/dist/httpErrors/httpError.typeGuard.js +0 -1
- package/dist/httpErrors/httpError.util.d.ts +0 -1
- package/dist/httpErrors/httpError.util.js +0 -1
- package/dist/httpErrors/index.d.ts +0 -1
- package/dist/httpErrors/index.js +0 -1
- package/dist/httpFetchMount/httpFetchMount.core.d.ts +0 -1
- package/dist/httpFetchMount/httpFetchMount.core.js +0 -1
- package/dist/httpFetchMount/httpFetchMount.request.d.ts +0 -1
- package/dist/httpFetchMount/httpFetchMount.request.js +0 -1
- package/dist/httpFetchMount/httpFetchMount.type.d.ts +0 -1
- package/dist/httpFetchMount/httpFetchMount.type.js +0 -1
- package/dist/httpFetchMount/index.d.ts +0 -1
- package/dist/httpFetchMount/index.js +0 -1
- package/dist/httpFormData/index.d.ts +0 -1
- package/dist/httpFormData/index.js +0 -1
- package/dist/httpHeaders/authorization/httpHeaders.authorization.d.ts +0 -1
- package/dist/httpHeaders/authorization/httpHeaders.authorization.js +0 -1
- package/dist/httpHeaders/authorization/index.d.ts +0 -1
- package/dist/httpHeaders/authorization/index.js +0 -1
- package/dist/httpHeaders/basic/httpHeaders.basic.d.ts +0 -1
- package/dist/httpHeaders/basic/httpHeaders.basic.js +0 -1
- package/dist/httpHeaders/basic/httpHeaders.basicMatch.d.ts +0 -1
- package/dist/httpHeaders/basic/httpHeaders.basicMatch.js +0 -1
- package/dist/httpHeaders/basic/index.d.ts +0 -1
- package/dist/httpHeaders/basic/index.js +0 -1
- package/dist/httpHeaders/conversion/httpHeaders.conversion.d.ts +0 -1
- package/dist/httpHeaders/conversion/httpHeaders.conversion.js +0 -1
- package/dist/httpHeaders/conversion/httpHeaders.conversionObject.d.ts +0 -1
- package/dist/httpHeaders/conversion/httpHeaders.conversionObject.js +0 -1
- package/dist/httpHeaders/conversion/index.d.ts +0 -1
- package/dist/httpHeaders/conversion/index.js +0 -1
- package/dist/httpHeaders/etag/httpHeaders.etag.d.ts +0 -1
- package/dist/httpHeaders/etag/httpHeaders.etag.js +0 -1
- package/dist/httpHeaders/etag/httpHeaders.etagMatch.d.ts +0 -1
- package/dist/httpHeaders/etag/httpHeaders.etagMatch.js +0 -1
- package/dist/httpHeaders/etag/index.d.ts +0 -1
- package/dist/httpHeaders/etag/index.js +0 -1
- package/dist/httpHeaders/forwarded/httpHeaders.forwarded.d.ts +0 -1
- package/dist/httpHeaders/forwarded/httpHeaders.forwarded.js +0 -1
- package/dist/httpHeaders/forwarded/index.d.ts +0 -1
- package/dist/httpHeaders/forwarded/index.js +0 -1
- package/dist/httpHeaders/http.headers.d.ts +0 -1
- package/dist/httpHeaders/http.headers.js +0 -1
- package/dist/httpHeaders/index.d.ts +0 -1
- package/dist/httpHeaders/index.js +0 -1
- package/dist/httpHeaders/internal/httpHeaders.internal.typeGuards.d.ts +0 -1
- package/dist/httpHeaders/internal/httpHeaders.internal.typeGuards.js +0 -1
- package/dist/httpHeaders/internal/index.d.ts +0 -1
- package/dist/httpHeaders/internal/index.js +0 -1
- package/dist/httpHeaders/list/httpHeaders.list.d.ts +0 -1
- package/dist/httpHeaders/list/httpHeaders.list.js +0 -1
- package/dist/httpHeaders/list/httpHeaders.listMutation.d.ts +0 -1
- package/dist/httpHeaders/list/httpHeaders.listMutation.js +0 -1
- package/dist/httpHeaders/list/index.d.ts +0 -1
- package/dist/httpHeaders/list/index.js +0 -1
- package/dist/httpHeaders/security/httpHeaders.security.d.ts +0 -1
- package/dist/httpHeaders/security/httpHeaders.security.js +0 -1
- package/dist/httpHeaders/security/index.d.ts +0 -1
- package/dist/httpHeaders/security/index.js +0 -1
- package/dist/httpHeaders/types/httpHeaders.type.d.ts +0 -1
- package/dist/httpHeaders/types/httpHeaders.type.js +0 -1
- package/dist/httpHeaders/types/index.d.ts +0 -1
- package/dist/httpHeaders/types/index.js +0 -1
- package/dist/httpHsts/http.hsts.d.ts +0 -1
- package/dist/httpHsts/http.hsts.js +0 -1
- package/dist/httpHsts/index.d.ts +0 -1
- package/dist/httpHsts/index.js +0 -1
- package/dist/httpInterceptors/builtin/httpInterceptor.request.d.ts +0 -1
- package/dist/httpInterceptors/builtin/httpInterceptor.request.js +0 -1
- package/dist/httpInterceptors/builtin/httpInterceptor.response.d.ts +0 -1
- package/dist/httpInterceptors/builtin/httpInterceptor.response.js +0 -1
- package/dist/httpInterceptors/builtin/index.d.ts +0 -1
- package/dist/httpInterceptors/builtin/index.js +0 -1
- package/dist/httpInterceptors/http.interceptors.d.ts +0 -1
- package/dist/httpInterceptors/http.interceptors.js +0 -1
- package/dist/httpInterceptors/httpInterceptor.helper.d.ts +0 -1
- package/dist/httpInterceptors/httpInterceptor.helper.js +0 -1
- package/dist/httpInterceptors/httpInterceptor.type.d.ts +0 -1
- package/dist/httpInterceptors/httpInterceptor.type.js +0 -1
- package/dist/httpInterceptors/index.d.ts +0 -1
- package/dist/httpInterceptors/index.js +0 -1
- package/dist/httpInterceptors/manager/httpInterceptor.lookup.d.ts +0 -1
- package/dist/httpInterceptors/manager/httpInterceptor.lookup.js +0 -1
- package/dist/httpInterceptors/manager/httpInterceptor.manager.d.ts +0 -1
- package/dist/httpInterceptors/manager/httpInterceptor.manager.js +0 -1
- package/dist/httpInterceptors/manager/httpInterceptor.registration.d.ts +0 -1
- package/dist/httpInterceptors/manager/httpInterceptor.registration.js +0 -1
- package/dist/httpInterceptors/manager/httpInterceptor.snapshot.d.ts +0 -1
- package/dist/httpInterceptors/manager/httpInterceptor.snapshot.js +0 -1
- package/dist/httpInterceptors/manager/index.d.ts +0 -1
- package/dist/httpInterceptors/manager/index.js +0 -1
- package/dist/httpKeepAlive/httpKeepAlive.core.d.ts +0 -1
- package/dist/httpKeepAlive/httpKeepAlive.core.js +0 -1
- package/dist/httpKeepAlive/index.d.ts +0 -1
- package/dist/httpKeepAlive/index.js +0 -1
- package/dist/httpMethods/http.methods.d.ts +0 -1
- package/dist/httpMethods/http.methods.js +0 -1
- package/dist/httpMethods/index.d.ts +0 -1
- package/dist/httpMethods/index.js +0 -1
- package/dist/httpMiddleware/builtin/compose/httpMiddleware.compose.d.ts +0 -1
- package/dist/httpMiddleware/builtin/compose/httpMiddleware.compose.js +0 -1
- package/dist/httpMiddleware/builtin/compose/index.d.ts +0 -1
- package/dist/httpMiddleware/builtin/compose/index.js +0 -1
- package/dist/httpMiddleware/builtin/conditional/httpMiddleware.conditional.d.ts +0 -1
- package/dist/httpMiddleware/builtin/conditional/httpMiddleware.conditional.js +0 -1
- package/dist/httpMiddleware/builtin/conditional/index.d.ts +0 -1
- package/dist/httpMiddleware/builtin/conditional/index.js +0 -1
- package/dist/httpMiddleware/builtin/cors/httpMiddleware.cors.d.ts +0 -1
- package/dist/httpMiddleware/builtin/cors/httpMiddleware.cors.js +0 -1
- package/dist/httpMiddleware/builtin/cors/index.d.ts +0 -1
- package/dist/httpMiddleware/builtin/cors/index.js +0 -1
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.accessor.d.ts +0 -1
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.accessor.js +0 -1
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.contextHelper.d.ts +0 -1
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.contextHelper.js +0 -1
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.media.d.ts +0 -1
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.media.js +0 -1
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.response.d.ts +0 -1
- package/dist/httpMiddleware/builtin/helpers/httpMiddleware.response.js +0 -1
- package/dist/httpMiddleware/builtin/helpers/index.d.ts +0 -1
- package/dist/httpMiddleware/builtin/helpers/index.js +0 -1
- package/dist/httpMiddleware/builtin/image/httpMiddleware.image.d.ts +0 -1
- package/dist/httpMiddleware/builtin/image/httpMiddleware.image.js +0 -1
- package/dist/httpMiddleware/builtin/image/index.d.ts +0 -1
- package/dist/httpMiddleware/builtin/image/index.js +0 -1
- package/dist/httpMiddleware/builtin/index.d.ts +0 -1
- package/dist/httpMiddleware/builtin/index.js +0 -1
- package/dist/httpMiddleware/builtin/logging/httpMiddleware.logging.d.ts +0 -1
- package/dist/httpMiddleware/builtin/logging/httpMiddleware.logging.js +0 -1
- package/dist/httpMiddleware/builtin/logging/index.d.ts +0 -1
- package/dist/httpMiddleware/builtin/logging/index.js +0 -1
- package/dist/httpMiddleware/builtin/rateLimit/httpMiddleware.rateLimit.d.ts +3 -3
- package/dist/httpMiddleware/builtin/rateLimit/httpMiddleware.rateLimit.js +33 -4
- package/dist/httpMiddleware/builtin/rateLimit/index.d.ts +0 -1
- package/dist/httpMiddleware/builtin/rateLimit/index.js +0 -1
- package/dist/httpMiddleware/builtin/security/httpMiddleware.security.d.ts +0 -1
- package/dist/httpMiddleware/builtin/security/httpMiddleware.security.js +0 -1
- package/dist/httpMiddleware/builtin/security/index.d.ts +0 -1
- package/dist/httpMiddleware/builtin/security/index.js +0 -1
- package/dist/httpMiddleware/builtin/static/httpMiddleware.static.d.ts +0 -1
- package/dist/httpMiddleware/builtin/static/httpMiddleware.static.js +0 -1
- package/dist/httpMiddleware/builtin/static/index.d.ts +0 -1
- package/dist/httpMiddleware/builtin/static/index.js +0 -1
- package/dist/httpMiddleware/builtin/timing/httpMiddleware.timing.d.ts +0 -1
- package/dist/httpMiddleware/builtin/timing/httpMiddleware.timing.js +0 -1
- package/dist/httpMiddleware/builtin/timing/index.d.ts +0 -1
- package/dist/httpMiddleware/builtin/timing/index.js +0 -1
- package/dist/httpMiddleware/builtin/video/httpMiddleware.video.d.ts +0 -1
- package/dist/httpMiddleware/builtin/video/httpMiddleware.video.js +0 -1
- package/dist/httpMiddleware/builtin/video/httpMiddleware.video.options.d.ts +0 -1
- package/dist/httpMiddleware/builtin/video/httpMiddleware.video.options.js +0 -1
- package/dist/httpMiddleware/builtin/video/index.d.ts +0 -1
- package/dist/httpMiddleware/builtin/video/index.js +0 -1
- package/dist/httpMiddleware/httpMiddleware.error.d.ts +0 -1
- package/dist/httpMiddleware/httpMiddleware.error.js +0 -1
- package/dist/httpMiddleware/httpMiddleware.state.d.ts +0 -1
- package/dist/httpMiddleware/httpMiddleware.state.js +0 -1
- package/dist/httpMiddleware/httpMiddleware.type.d.ts +0 -1
- package/dist/httpMiddleware/httpMiddleware.type.js +0 -1
- package/dist/httpMiddleware/index.d.ts +0 -1
- package/dist/httpMiddleware/index.js +0 -1
- package/dist/httpMiddleware/pipeline/httpMiddleware.pipeline.d.ts +0 -1
- package/dist/httpMiddleware/pipeline/httpMiddleware.pipeline.js +0 -1
- package/dist/httpMiddleware/pipeline/httpPipeline.execution.d.ts +0 -1
- package/dist/httpMiddleware/pipeline/httpPipeline.execution.js +0 -1
- package/dist/httpMiddleware/pipeline/httpPipeline.guardResponse.d.ts +0 -1
- package/dist/httpMiddleware/pipeline/httpPipeline.guardResponse.js +0 -1
- package/dist/httpMiddleware/pipeline/httpPipeline.helper.d.ts +0 -1
- package/dist/httpMiddleware/pipeline/httpPipeline.helper.js +0 -1
- package/dist/httpMiddleware/pipeline/httpPipeline.registration.d.ts +0 -1
- package/dist/httpMiddleware/pipeline/httpPipeline.registration.js +0 -1
- package/dist/httpMiddleware/pipeline/index.d.ts +0 -1
- package/dist/httpMiddleware/pipeline/index.js +0 -1
- package/dist/httpMime/http.mime.d.ts +0 -1
- package/dist/httpMime/http.mime.js +0 -1
- package/dist/httpMime/httpMime.sniff.d.ts +31 -0
- package/dist/httpMime/httpMime.sniff.js +90 -0
- package/dist/httpMime/index.d.ts +1 -1
- package/dist/httpMime/index.js +1 -1
- package/dist/httpMultipart/http.multipart.d.ts +0 -1
- package/dist/httpMultipart/http.multipart.js +0 -1
- package/dist/httpMultipart/index.d.ts +0 -1
- package/dist/httpMultipart/index.js +0 -1
- package/dist/httpNegotiation/httpNegotiation.core.d.ts +0 -1
- package/dist/httpNegotiation/httpNegotiation.core.js +0 -1
- package/dist/httpNegotiation/index.d.ts +0 -1
- package/dist/httpNegotiation/index.js +0 -1
- package/dist/httpOpenApi/httpOpenApi.document.d.ts +0 -1
- package/dist/httpOpenApi/httpOpenApi.document.js +0 -1
- package/dist/httpOpenApi/httpOpenApi.mount.d.ts +2 -2
- package/dist/httpOpenApi/httpOpenApi.mount.js +7 -3
- package/dist/httpOpenApi/httpOpenApi.type.d.ts +5 -2
- package/dist/httpOpenApi/httpOpenApi.type.js +0 -1
- package/dist/httpOpenApi/index.d.ts +0 -1
- package/dist/httpOpenApi/index.js +0 -1
- package/dist/httpOpenApi/routeTable/index.d.ts +0 -1
- package/dist/httpOpenApi/routeTable/index.js +0 -1
- package/dist/httpOpenApi/routeTable/routeTable.collect.d.ts +0 -1
- package/dist/httpOpenApi/routeTable/routeTable.collect.js +0 -1
- package/dist/httpOpenApi/routeTable/routeTable.merge.d.ts +0 -1
- package/dist/httpOpenApi/routeTable/routeTable.merge.js +0 -1
- package/dist/httpOpenApi/routeTable/routeTable.template.d.ts +0 -1
- package/dist/httpOpenApi/routeTable/routeTable.template.js +0 -1
- package/dist/httpProtocol/http.protocol.d.ts +0 -1
- package/dist/httpProtocol/http.protocol.js +0 -1
- package/dist/httpProtocol/index.d.ts +0 -1
- package/dist/httpProtocol/index.js +0 -1
- package/dist/httpProxy/http.proxy.d.ts +0 -1
- package/dist/httpProxy/http.proxy.js +0 -1
- package/dist/httpProxy/httpProxy.pathGuard.d.ts +0 -1
- package/dist/httpProxy/httpProxy.pathGuard.js +0 -1
- package/dist/httpProxy/index.d.ts +0 -1
- package/dist/httpProxy/index.js +0 -1
- package/dist/httpQuery/index.d.ts +0 -1
- package/dist/httpQuery/index.js +0 -1
- package/dist/httpQuery/queryParse/index.d.ts +0 -1
- package/dist/httpQuery/queryParse/index.js +0 -1
- package/dist/httpQuery/queryParse/queryParse.flat.d.ts +0 -1
- package/dist/httpQuery/queryParse/queryParse.flat.js +0 -1
- package/dist/httpQuery/queryParse/queryParse.nested.d.ts +0 -1
- package/dist/httpQuery/queryParse/queryParse.nested.js +0 -1
- package/dist/httpQuery/queryParse/queryParse.tokenizer.d.ts +0 -1
- package/dist/httpQuery/queryParse/queryParse.tokenizer.js +0 -1
- package/dist/httpQuery/queryRequest/index.d.ts +0 -1
- package/dist/httpQuery/queryRequest/index.js +0 -1
- package/dist/httpQuery/queryRequest/query.request.d.ts +0 -1
- package/dist/httpQuery/queryRequest/query.request.js +0 -1
- package/dist/httpQuery/querySerialize/index.d.ts +0 -1
- package/dist/httpQuery/querySerialize/index.js +0 -1
- package/dist/httpQuery/querySerialize/query.util.d.ts +0 -1
- package/dist/httpQuery/querySerialize/query.util.js +0 -1
- package/dist/httpQuery/querySerialize/querySerialize.core.d.ts +0 -1
- package/dist/httpQuery/querySerialize/querySerialize.core.js +0 -1
- package/dist/httpQuery/queryTypes/index.d.ts +0 -1
- package/dist/httpQuery/queryTypes/index.js +0 -1
- package/dist/httpQuery/queryTypes/query.container.d.ts +0 -1
- package/dist/httpQuery/queryTypes/query.container.js +0 -1
- package/dist/httpQuery/queryTypes/query.limit.d.ts +0 -1
- package/dist/httpQuery/queryTypes/query.limit.js +0 -1
- package/dist/httpQuery/queryTypes/query.type.d.ts +0 -1
- package/dist/httpQuery/queryTypes/query.type.js +0 -1
- package/dist/httpRange/http.range.d.ts +0 -1
- package/dist/httpRange/http.range.js +0 -1
- package/dist/httpRange/index.d.ts +0 -1
- package/dist/httpRange/index.js +0 -1
- package/dist/httpRedirect/http.redirect.d.ts +0 -1
- package/dist/httpRedirect/http.redirect.js +0 -1
- package/dist/httpRedirect/index.d.ts +0 -1
- package/dist/httpRedirect/index.js +0 -1
- package/dist/httpRequest/http.request.d.ts +0 -1
- package/dist/httpRequest/http.request.js +12 -2
- package/dist/httpRequest/httpRequest.context.constant.d.ts +0 -1
- package/dist/httpRequest/httpRequest.context.constant.js +0 -1
- package/dist/httpRequest/httpRequest.context.d.ts +0 -1
- package/dist/httpRequest/httpRequest.context.id.d.ts +0 -1
- package/dist/httpRequest/httpRequest.context.id.js +0 -1
- package/dist/httpRequest/httpRequest.context.js +15 -2
- package/dist/httpRequest/httpRequest.context.type.d.ts +0 -1
- package/dist/httpRequest/httpRequest.context.type.js +0 -1
- package/dist/httpRequest/index.d.ts +0 -1
- package/dist/httpRequest/index.js +0 -1
- package/dist/httpRequest/requestId/httpRequest.requestId.d.ts +0 -1
- package/dist/httpRequest/requestId/httpRequest.requestId.js +0 -1
- package/dist/httpRequest/requestId/index.d.ts +0 -1
- package/dist/httpRequest/requestId/index.js +0 -1
- package/dist/httpRequest/target/httpRequest.target.d.ts +0 -1
- package/dist/httpRequest/target/httpRequest.target.js +0 -1
- package/dist/httpRequest/target/index.d.ts +0 -1
- package/dist/httpRequest/target/index.js +0 -1
- package/dist/httpResponse/core/httpResponse.statusText.d.ts +0 -1
- package/dist/httpResponse/core/httpResponse.statusText.js +0 -1
- package/dist/httpResponse/core/httpResponse.type.d.ts +0 -1
- package/dist/httpResponse/core/httpResponse.type.js +0 -1
- package/dist/httpResponse/core/index.d.ts +0 -1
- package/dist/httpResponse/core/index.js +0 -1
- package/dist/httpResponse/http.response.d.ts +0 -1
- package/dist/httpResponse/http.response.js +0 -1
- package/dist/httpResponse/httpResponse.context.d.ts +0 -1
- package/dist/httpResponse/httpResponse.context.js +0 -1
- package/dist/httpResponse/httpResponse.fromWeb.d.ts +0 -1
- package/dist/httpResponse/httpResponse.fromWeb.js +0 -1
- package/dist/httpResponse/httpResponse.helper.d.ts +0 -1
- package/dist/httpResponse/httpResponse.helper.js +0 -1
- package/dist/httpResponse/httpResponse.writer.d.ts +0 -1
- package/dist/httpResponse/httpResponse.writer.js +0 -1
- package/dist/httpResponse/index.d.ts +0 -1
- package/dist/httpResponse/index.js +0 -1
- package/dist/httpRouter/core/error/httpRouter.error.d.ts +0 -1
- package/dist/httpRouter/core/error/httpRouter.error.js +0 -1
- package/dist/httpRouter/core/error/index.d.ts +0 -1
- package/dist/httpRouter/core/error/index.js +0 -1
- package/dist/httpRouter/core/factory/httpRoute.factory.base.d.ts +0 -1
- package/dist/httpRouter/core/factory/httpRoute.factory.base.js +24 -22
- package/dist/httpRouter/core/factory/httpRoute.factory.d.ts +7 -1
- package/dist/httpRouter/core/factory/httpRoute.factory.js +36 -13
- package/dist/httpRouter/core/factory/index.d.ts +0 -1
- package/dist/httpRouter/core/factory/index.js +0 -1
- package/dist/httpRouter/core/group/httpRouterGroup.core.d.ts +0 -1
- package/dist/httpRouter/core/group/httpRouterGroup.core.js +0 -1
- package/dist/httpRouter/core/group/index.d.ts +0 -1
- package/dist/httpRouter/core/group/index.js +0 -1
- package/dist/httpRouter/core/index.d.ts +0 -1
- package/dist/httpRouter/core/index.js +0 -1
- package/dist/httpRouter/core/register/httpRouter.register.d.ts +15 -1
- package/dist/httpRouter/core/register/httpRouter.register.js +124 -26
- package/dist/httpRouter/core/register/httpRouter.shadow.d.ts +18 -0
- package/dist/httpRouter/core/register/httpRouter.shadow.js +91 -0
- package/dist/httpRouter/core/register/index.d.ts +1 -1
- package/dist/httpRouter/core/register/index.js +1 -1
- package/dist/httpRouter/core/registry/core/httpRegistry.helper.d.ts +0 -1
- package/dist/httpRouter/core/registry/core/httpRegistry.helper.js +0 -1
- package/dist/httpRouter/core/registry/core/httpRegistry.type.d.ts +0 -1
- package/dist/httpRouter/core/registry/core/httpRegistry.type.js +0 -1
- package/dist/httpRouter/core/registry/core/index.d.ts +0 -1
- package/dist/httpRouter/core/registry/core/index.js +0 -1
- package/dist/httpRouter/core/registry/httpRegistry.core.d.ts +0 -1
- package/dist/httpRouter/core/registry/httpRegistry.core.js +0 -1
- package/dist/httpRouter/core/registry/httpRegistry.factory.d.ts +0 -1
- package/dist/httpRouter/core/registry/httpRegistry.factory.js +0 -1
- package/dist/httpRouter/core/registry/httpRegistry.group.d.ts +0 -1
- package/dist/httpRouter/core/registry/httpRegistry.group.js +0 -1
- package/dist/httpRouter/core/registry/index.d.ts +0 -1
- package/dist/httpRouter/core/registry/index.js +0 -1
- package/dist/httpRouter/core/types/httpRouter.type.d.ts +27 -1
- package/dist/httpRouter/core/types/httpRouter.type.js +0 -1
- package/dist/httpRouter/core/types/index.d.ts +0 -1
- package/dist/httpRouter/core/types/index.js +0 -1
- package/dist/httpRouter/core/util/httpRoute.util.d.ts +0 -1
- package/dist/httpRouter/core/util/httpRoute.util.js +0 -1
- package/dist/httpRouter/core/util/index.d.ts +0 -1
- package/dist/httpRouter/core/util/index.js +0 -1
- package/dist/httpRouter/dispatch/httpRoute.dispatcher.d.ts +0 -1
- package/dist/httpRouter/dispatch/httpRoute.dispatcher.js +0 -1
- package/dist/httpRouter/dispatch/httpRoute.stack.d.ts +0 -1
- package/dist/httpRouter/dispatch/httpRoute.stack.js +0 -1
- package/dist/httpRouter/dispatch/index.d.ts +0 -1
- package/dist/httpRouter/dispatch/index.js +0 -1
- package/dist/httpRouter/httpRouter.context.d.ts +0 -1
- package/dist/httpRouter/httpRouter.context.js +0 -1
- package/dist/httpRouter/httpRouter.state.d.ts +0 -1
- package/dist/httpRouter/httpRouter.state.js +0 -1
- package/dist/httpRouter/index.d.ts +0 -1
- package/dist/httpRouter/index.js +0 -1
- package/dist/httpRouter/matching/httpRoute.matcher.core.d.ts +0 -1
- package/dist/httpRouter/matching/httpRoute.matcher.core.js +0 -1
- package/dist/httpRouter/matching/httpRoute.matcher.d.ts +0 -1
- package/dist/httpRouter/matching/httpRoute.matcher.js +0 -1
- package/dist/httpRouter/matching/index.d.ts +0 -1
- package/dist/httpRouter/matching/index.js +0 -1
- package/dist/httpRouter/pattern/core/httpPattern.compilation.d.ts +0 -1
- package/dist/httpRouter/pattern/core/httpPattern.compilation.js +0 -1
- package/dist/httpRouter/pattern/core/httpPattern.matching.d.ts +0 -1
- package/dist/httpRouter/pattern/core/httpPattern.matching.js +0 -1
- package/dist/httpRouter/pattern/core/httpPattern.regexBuilding.d.ts +0 -1
- package/dist/httpRouter/pattern/core/httpPattern.regexBuilding.js +0 -1
- package/dist/httpRouter/pattern/core/httpPattern.segmentParsing.d.ts +0 -1
- package/dist/httpRouter/pattern/core/httpPattern.segmentParsing.js +0 -1
- package/dist/httpRouter/pattern/core/httpPattern.type.d.ts +0 -1
- package/dist/httpRouter/pattern/core/httpPattern.type.js +0 -1
- package/dist/httpRouter/pattern/core/index.d.ts +0 -1
- package/dist/httpRouter/pattern/core/index.js +0 -1
- package/dist/httpRouter/pattern/httpPattern.factory.d.ts +0 -1
- package/dist/httpRouter/pattern/httpPattern.factory.js +0 -1
- package/dist/httpRouter/pattern/httpRoute.pattern.parse.d.ts +18 -1
- package/dist/httpRouter/pattern/httpRoute.pattern.parse.js +51 -13
- package/dist/httpRouter/pattern/index.d.ts +0 -1
- package/dist/httpRouter/pattern/index.js +0 -1
- package/dist/httpRouter/result/httpRoute.result.builder.d.ts +0 -1
- package/dist/httpRouter/result/httpRoute.result.builder.js +0 -1
- package/dist/httpRouter/result/httpRoute.result.class.d.ts +0 -1
- package/dist/httpRouter/result/httpRoute.result.class.js +0 -1
- package/dist/httpRouter/result/httpRoute.result.d.ts +0 -1
- package/dist/httpRouter/result/httpRoute.result.error.4xx.d.ts +0 -1
- package/dist/httpRouter/result/httpRoute.result.error.4xx.js +0 -1
- package/dist/httpRouter/result/httpRoute.result.error.5xx.d.ts +0 -1
- package/dist/httpRouter/result/httpRoute.result.error.5xx.js +0 -1
- package/dist/httpRouter/result/httpRoute.result.factory.d.ts +0 -1
- package/dist/httpRouter/result/httpRoute.result.factory.js +0 -1
- package/dist/httpRouter/result/httpRoute.result.guard.d.ts +0 -1
- package/dist/httpRouter/result/httpRoute.result.guard.js +0 -1
- package/dist/httpRouter/result/httpRoute.result.js +0 -1
- package/dist/httpRouter/result/httpRoute.result.normalize.d.ts +0 -1
- package/dist/httpRouter/result/httpRoute.result.normalize.js +0 -1
- package/dist/httpRouter/result/httpRoute.result.output.d.ts +0 -1
- package/dist/httpRouter/result/httpRoute.result.output.js +0 -1
- package/dist/httpRouter/result/httpRoute.result.serialize.d.ts +0 -1
- package/dist/httpRouter/result/httpRoute.result.serialize.js +0 -1
- package/dist/httpRouter/result/httpRoute.result.type.d.ts +0 -1
- package/dist/httpRouter/result/httpRoute.result.type.js +0 -1
- package/dist/httpRouter/result/httpRoute.result.util.d.ts +0 -1
- package/dist/httpRouter/result/httpRoute.result.util.js +0 -1
- package/dist/httpRouter/result/index.d.ts +0 -1
- package/dist/httpRouter/result/index.js +0 -1
- package/dist/httpRouter/tree/core/httpTree.enumerate.d.ts +21 -0
- package/dist/httpRouter/tree/core/httpTree.enumerate.js +43 -0
- package/dist/httpRouter/tree/core/httpTree.helper.d.ts +2 -3
- package/dist/httpRouter/tree/core/httpTree.helper.js +11 -10
- package/dist/httpRouter/tree/core/httpTree.nodeCreation.d.ts +15 -1
- package/dist/httpRouter/tree/core/httpTree.nodeCreation.js +58 -34
- package/dist/httpRouter/tree/core/httpTree.traversal.d.ts +15 -14
- package/dist/httpRouter/tree/core/httpTree.traversal.js +46 -48
- package/dist/httpRouter/tree/core/httpTree.type.d.ts +7 -6
- package/dist/httpRouter/tree/core/httpTree.type.js +0 -1
- package/dist/httpRouter/tree/core/index.d.ts +1 -1
- package/dist/httpRouter/tree/core/index.js +1 -1
- package/dist/httpRouter/tree/httpTree.core.d.ts +7 -3
- package/dist/httpRouter/tree/httpTree.core.js +17 -19
- package/dist/httpRouter/tree/httpTree.factory.d.ts +0 -1
- package/dist/httpRouter/tree/httpTree.factory.js +0 -1
- package/dist/httpRouter/tree/index.d.ts +0 -1
- package/dist/httpRouter/tree/index.js +0 -1
- package/dist/httpSecurity/httpSecurity.config.d.ts +10 -2
- package/dist/httpSecurity/httpSecurity.config.js +10 -2
- package/dist/httpSecurity/httpSecurity.guard.d.ts +0 -1
- package/dist/httpSecurity/httpSecurity.guard.js +14 -2
- package/dist/httpSecurity/httpSecurity.nodeGuard.d.ts +0 -1
- package/dist/httpSecurity/httpSecurity.nodeGuard.js +0 -1
- package/dist/httpSecurity/httpSecurity.validator.d.ts +0 -1
- package/dist/httpSecurity/httpSecurity.validator.js +0 -1
- package/dist/httpSecurity/index.d.ts +1 -2
- package/dist/httpSecurity/index.js +1 -2
- package/dist/httpSecurityHeaders/core/httpSecurityHeader.type.d.ts +0 -1
- package/dist/httpSecurityHeaders/core/httpSecurityHeader.type.js +0 -1
- package/dist/httpSecurityHeaders/core/httpSecurityHeader.validation.d.ts +0 -1
- package/dist/httpSecurityHeaders/core/httpSecurityHeader.validation.js +0 -1
- package/dist/httpSecurityHeaders/core/index.d.ts +0 -1
- package/dist/httpSecurityHeaders/core/index.js +0 -1
- package/dist/httpSecurityHeaders/httpSecurity.headers.d.ts +0 -1
- package/dist/httpSecurityHeaders/httpSecurity.headers.js +0 -1
- package/dist/httpSecurityHeaders/httpSecurityHeader.factory.d.ts +0 -1
- package/dist/httpSecurityHeaders/httpSecurityHeader.factory.js +0 -1
- package/dist/httpSecurityHeaders/httpSecurityHeader.individual.d.ts +0 -1
- package/dist/httpSecurityHeaders/httpSecurityHeader.individual.js +0 -1
- package/dist/httpSecurityHeaders/httpSecurityHeader.permissionsPolicy.d.ts +0 -1
- package/dist/httpSecurityHeaders/httpSecurityHeader.permissionsPolicy.js +0 -1
- package/dist/httpSecurityHeaders/httpSecurityHeader.recommended.d.ts +8 -2
- package/dist/httpSecurityHeaders/httpSecurityHeader.recommended.js +11 -4
- package/dist/httpSecurityHeaders/index.d.ts +0 -1
- package/dist/httpSecurityHeaders/index.js +0 -1
- package/dist/httpServer/core/httpServer.core.d.ts +0 -1
- package/dist/httpServer/core/httpServer.core.js +0 -1
- package/dist/httpServer/core/index.d.ts +0 -1
- package/dist/httpServer/core/index.js +0 -1
- package/dist/httpServer/factory/httpServer.factory.d.ts +0 -1
- package/dist/httpServer/factory/httpServer.factory.js +0 -1
- package/dist/httpServer/factory/index.d.ts +0 -1
- package/dist/httpServer/factory/index.js +0 -1
- package/dist/httpServer/index.d.ts +0 -1
- package/dist/httpServer/index.js +0 -1
- package/dist/httpServer/manager/httpServer.manager.d.ts +0 -1
- package/dist/httpServer/manager/httpServer.manager.js +0 -1
- package/dist/httpServer/manager/index.d.ts +0 -1
- package/dist/httpServer/manager/index.js +0 -1
- package/dist/httpServer/types/httpServer.type.d.ts +0 -1
- package/dist/httpServer/types/httpServer.type.js +0 -1
- package/dist/httpStatus/httpStatus.categoryPredicate.d.ts +0 -1
- package/dist/httpStatus/httpStatus.categoryPredicate.js +0 -1
- package/dist/httpStatus/httpStatus.clientErrorConstant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.clientErrorConstant.js +0 -1
- package/dist/httpStatus/httpStatus.clientErrorTextConstant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.clientErrorTextConstant.js +0 -1
- package/dist/httpStatus/httpStatus.collection.d.ts +0 -1
- package/dist/httpStatus/httpStatus.collection.js +0 -1
- package/dist/httpStatus/httpStatus.commonPredicate.d.ts +0 -1
- package/dist/httpStatus/httpStatus.commonPredicate.js +0 -1
- package/dist/httpStatus/httpStatus.constant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.constant.js +0 -1
- package/dist/httpStatus/httpStatus.errorPredicate.d.ts +0 -1
- package/dist/httpStatus/httpStatus.errorPredicate.js +0 -1
- package/dist/httpStatus/httpStatus.info.d.ts +0 -1
- package/dist/httpStatus/httpStatus.info.js +0 -1
- package/dist/httpStatus/httpStatus.informationalSuccessConstant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.informationalSuccessConstant.js +0 -1
- package/dist/httpStatus/httpStatus.informationalSuccessTextConstant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.informationalSuccessTextConstant.js +0 -1
- package/dist/httpStatus/httpStatus.lookup.d.ts +0 -1
- package/dist/httpStatus/httpStatus.lookup.js +0 -1
- package/dist/httpStatus/httpStatus.name.d.ts +0 -1
- package/dist/httpStatus/httpStatus.name.js +0 -1
- package/dist/httpStatus/httpStatus.predicate.d.ts +0 -1
- package/dist/httpStatus/httpStatus.predicate.js +0 -1
- package/dist/httpStatus/httpStatus.redirectErrorConstant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.redirectErrorConstant.js +0 -1
- package/dist/httpStatus/httpStatus.redirectErrorTextConstant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.redirectErrorTextConstant.js +0 -1
- package/dist/httpStatus/httpStatus.redirectPredicate.d.ts +0 -1
- package/dist/httpStatus/httpStatus.redirectPredicate.js +0 -1
- package/dist/httpStatus/httpStatus.redirectionConstant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.redirectionConstant.js +0 -1
- package/dist/httpStatus/httpStatus.redirectionTextConstant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.redirectionTextConstant.js +0 -1
- package/dist/httpStatus/httpStatus.semantics.d.ts +0 -1
- package/dist/httpStatus/httpStatus.semantics.js +0 -1
- package/dist/httpStatus/httpStatus.serverErrorConstant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.serverErrorConstant.js +0 -1
- package/dist/httpStatus/httpStatus.serverErrorTextConstant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.serverErrorTextConstant.js +0 -1
- package/dist/httpStatus/httpStatus.statusConstant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.statusConstant.js +0 -1
- package/dist/httpStatus/httpStatus.statusTextConstant.d.ts +0 -1
- package/dist/httpStatus/httpStatus.statusTextConstant.js +0 -1
- package/dist/httpStatus/httpStatus.type.d.ts +0 -1
- package/dist/httpStatus/httpStatus.type.js +0 -1
- package/dist/httpStatus/httpStatus.validator.d.ts +0 -1
- package/dist/httpStatus/httpStatus.validator.js +0 -1
- package/dist/httpStatus/httpStatusCodes.constant.d.ts +0 -1
- package/dist/httpStatus/httpStatusCodes.constant.js +0 -1
- package/dist/httpStatus/index.d.ts +0 -1
- package/dist/httpStatus/index.js +0 -1
- package/dist/httpStream/httpStream.backpressure.d.ts +0 -1
- package/dist/httpStream/httpStream.backpressure.js +0 -1
- package/dist/httpStream/httpStream.constants.d.ts +0 -1
- package/dist/httpStream/httpStream.constants.js +0 -1
- package/dist/httpStream/httpStream.consume.d.ts +0 -1
- package/dist/httpStream/httpStream.consume.js +0 -1
- package/dist/httpStream/httpStream.destroy.d.ts +0 -1
- package/dist/httpStream/httpStream.destroy.js +0 -1
- package/dist/httpStream/httpStream.error.d.ts +0 -1
- package/dist/httpStream/httpStream.error.js +0 -1
- package/dist/httpStream/httpStream.eventHelper.d.ts +0 -1
- package/dist/httpStream/httpStream.eventHelper.js +0 -1
- package/dist/httpStream/httpStream.helper.d.ts +0 -1
- package/dist/httpStream/httpStream.helper.js +0 -1
- package/dist/httpStream/httpStream.pipe.d.ts +0 -1
- package/dist/httpStream/httpStream.pipe.js +0 -1
- package/dist/httpStream/httpStream.progress.d.ts +0 -1
- package/dist/httpStream/httpStream.progress.js +0 -1
- package/dist/httpStream/httpStream.read.d.ts +0 -1
- package/dist/httpStream/httpStream.read.js +0 -1
- package/dist/httpStream/httpStream.request.d.ts +0 -1
- package/dist/httpStream/httpStream.request.js +0 -1
- package/dist/httpStream/httpStream.state.d.ts +0 -1
- package/dist/httpStream/httpStream.state.js +0 -1
- package/dist/httpStream/httpStream.transform.d.ts +0 -1
- package/dist/httpStream/httpStream.transform.js +0 -1
- package/dist/httpStream/httpStream.types.d.ts +0 -1
- package/dist/httpStream/httpStream.types.js +0 -1
- package/dist/httpStream/index.d.ts +0 -1
- package/dist/httpStream/index.js +0 -1
- package/dist/httpTrustProxy/httpTrustProxy.compilation.d.ts +0 -1
- package/dist/httpTrustProxy/httpTrustProxy.compilation.js +0 -1
- package/dist/httpTrustProxy/httpTrustProxy.core.d.ts +0 -1
- package/dist/httpTrustProxy/httpTrustProxy.core.js +0 -1
- package/dist/httpTrustProxy/httpTrustProxy.helper.d.ts +0 -1
- package/dist/httpTrustProxy/httpTrustProxy.helper.js +0 -1
- package/dist/httpTrustProxy/httpTrustProxy.ip.d.ts +0 -1
- package/dist/httpTrustProxy/httpTrustProxy.ip.js +0 -1
- package/dist/httpTrustProxy/httpTrustProxy.parsing.d.ts +0 -1
- package/dist/httpTrustProxy/httpTrustProxy.parsing.js +0 -1
- package/dist/httpTrustProxy/httpTrustProxy.type.d.ts +0 -1
- package/dist/httpTrustProxy/httpTrustProxy.type.js +0 -1
- package/dist/httpTrustProxy/index.d.ts +0 -1
- package/dist/httpTrustProxy/index.js +0 -1
- package/dist/httpTypes/http.types.d.ts +0 -1
- package/dist/httpTypes/http.types.js +0 -1
- package/dist/httpTypes/index.d.ts +0 -1
- package/dist/httpTypes/index.js +0 -1
- package/dist/httpUrl/http.url.d.ts +0 -1
- package/dist/httpUrl/http.url.js +0 -1
- package/dist/httpUrl/index.d.ts +0 -1
- package/dist/httpUrl/index.js +0 -1
- package/dist/httpValidation/httpValidationAssertion.d.ts +0 -1
- package/dist/httpValidation/httpValidationAssertion.js +0 -1
- package/dist/httpValidation/httpValidationAuthority.d.ts +0 -1
- package/dist/httpValidation/httpValidationAuthority.js +0 -1
- package/dist/httpValidation/httpValidationAuthorization.d.ts +0 -1
- package/dist/httpValidation/httpValidationAuthorization.js +0 -1
- package/dist/httpValidation/httpValidationCacheControl.d.ts +0 -1
- package/dist/httpValidation/httpValidationCacheControl.js +0 -1
- package/dist/httpValidation/httpValidationContentLength.d.ts +0 -1
- package/dist/httpValidation/httpValidationContentLength.js +0 -1
- package/dist/httpValidation/httpValidationContentType.d.ts +0 -1
- package/dist/httpValidation/httpValidationContentType.js +0 -1
- package/dist/httpValidation/httpValidationCookie.d.ts +0 -1
- package/dist/httpValidation/httpValidationCookie.js +0 -1
- package/dist/httpValidation/httpValidationDate.d.ts +0 -1
- package/dist/httpValidation/httpValidationDate.js +0 -1
- package/dist/httpValidation/httpValidationETag.d.ts +0 -1
- package/dist/httpValidation/httpValidationETag.js +0 -1
- package/dist/httpValidation/httpValidationHeader.d.ts +0 -1
- package/dist/httpValidation/httpValidationHeader.js +0 -1
- package/dist/httpValidation/httpValidationHostname.d.ts +0 -1
- package/dist/httpValidation/httpValidationHostname.js +0 -1
- package/dist/httpValidation/httpValidationMessage.d.ts +0 -1
- package/dist/httpValidation/httpValidationMessage.js +0 -1
- package/dist/httpValidation/httpValidationMethod.d.ts +0 -1
- package/dist/httpValidation/httpValidationMethod.js +0 -1
- package/dist/httpValidation/httpValidationPort.d.ts +0 -1
- package/dist/httpValidation/httpValidationPort.js +0 -1
- package/dist/httpValidation/httpValidationRange.d.ts +0 -1
- package/dist/httpValidation/httpValidationRange.js +0 -1
- package/dist/httpValidation/httpValidationRequestTarget.d.ts +0 -1
- package/dist/httpValidation/httpValidationRequestTarget.js +0 -1
- package/dist/httpValidation/httpValidationStatusCode.d.ts +0 -1
- package/dist/httpValidation/httpValidationStatusCode.js +0 -1
- package/dist/httpValidation/httpValidationToken.d.ts +0 -1
- package/dist/httpValidation/httpValidationToken.js +0 -1
- package/dist/httpValidation/httpValidationTypes.type.d.ts +0 -1
- package/dist/httpValidation/httpValidationTypes.type.js +0 -1
- package/dist/httpValidation/httpValidationUrl.d.ts +0 -1
- package/dist/httpValidation/httpValidationUrl.js +0 -1
- package/dist/httpValidation/index.d.ts +0 -1
- package/dist/httpValidation/index.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +8 -8
- package/dist/httpAdapter/httpAdapter.errorResponse.js +0 -137
- package/dist/httpQuery/http.query.d.ts +0 -110
- package/dist/httpQuery/http.query.js +0 -484
|
@@ -139,33 +139,36 @@ export function createOptionsResponse(allowedMethods) {
|
|
|
139
139
|
* Default handler used when no route matches a request.
|
|
140
140
|
*/
|
|
141
141
|
export function defaultNotFoundHandler(context) {
|
|
142
|
-
return
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
method: context.method,
|
|
148
|
-
path: context.path,
|
|
149
|
-
},
|
|
142
|
+
return jsonErrorResponse(404, {
|
|
143
|
+
error: "Not Found",
|
|
144
|
+
code: "NOT_FOUND",
|
|
145
|
+
method: context.method,
|
|
146
|
+
path: context.path,
|
|
150
147
|
});
|
|
151
148
|
}
|
|
152
149
|
/**
|
|
153
150
|
* Default handler used when a path matches but the method does not.
|
|
154
151
|
*/
|
|
155
152
|
export function defaultMethodNotAllowedHandler(context, allowedMethods) {
|
|
156
|
-
return
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
153
|
+
return jsonErrorResponse(405, {
|
|
154
|
+
error: "Method Not Allowed",
|
|
155
|
+
code: "METHOD_NOT_ALLOWED",
|
|
156
|
+
method: context.method,
|
|
157
|
+
path: context.path,
|
|
158
|
+
allowed: [...allowedMethods],
|
|
159
|
+
}).setHeader("allow", formatAllowHeader(allowedMethods));
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Builds a default error response the same way `.json()` does, so its body
|
|
163
|
+
* is the serialized string every other JSON response carries. The default
|
|
164
|
+
* 404/405 used to keep a plain object as the body while a handler's
|
|
165
|
+
* `.json()` produced a string, so `result.response.body` had two types.
|
|
166
|
+
* Every framework-built error body carries `error` and `code`.
|
|
167
|
+
*/
|
|
168
|
+
function jsonErrorResponse(status, body) {
|
|
169
|
+
return new HttpResponseContext({ status })
|
|
170
|
+
.json(body)
|
|
171
|
+
.setHeader("content-type", "application/json; charset=utf-8");
|
|
169
172
|
}
|
|
170
173
|
/* -------------------------------------------------------------------------- */
|
|
171
174
|
/* Route Execution */
|
|
@@ -239,4 +242,3 @@ export async function executeRoute(route, context) {
|
|
|
239
242
|
};
|
|
240
243
|
return run(0);
|
|
241
244
|
}
|
|
242
|
-
//# sourceMappingURL=httpRoute.factory.base.js.map
|
|
@@ -15,6 +15,13 @@ export declare function createRouter(options?: RouterOptions): HttpRouter;
|
|
|
15
15
|
export declare function createRoute(definition: RouteDefinition): RouteDefinition;
|
|
16
16
|
/**
|
|
17
17
|
* Builds a route path from a pattern and parameters.
|
|
18
|
+
*
|
|
19
|
+
* Handles every parameter spelling the router accepts — `:id`, `:id?`,
|
|
20
|
+
* `:id(\\d+)`, `{name}`, `{name?:\\w+}` and a trailing `*rest` — and
|
|
21
|
+
* percent-encodes each value (a wildcard value segment by segment). An
|
|
22
|
+
* omitted optional parameter no longer leaves a trailing slash
|
|
23
|
+
* (`/reports/2026/`), and a missing required parameter throws
|
|
24
|
+
* {@link HttpRouterError} rather than a plain `Error`.
|
|
18
25
|
*/
|
|
19
26
|
export declare function buildRoutePath(pattern: string, params?: Readonly<Record<string, string | number>>): string;
|
|
20
27
|
/**
|
|
@@ -33,4 +40,3 @@ export declare function isRouteConflictError(value: unknown): value is RouteConf
|
|
|
33
40
|
* Type guard for InvalidRoutePatternError instances.
|
|
34
41
|
*/
|
|
35
42
|
export declare function isInvalidRoutePatternError(value: unknown): value is InvalidRoutePatternError;
|
|
36
|
-
//# sourceMappingURL=httpRoute.factory.d.ts.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { HttpRouter } from "../register/httpRouter.register.js";
|
|
5
5
|
import { HttpRouterGroup } from "../group/httpRouterGroup.core.js";
|
|
6
|
-
import { RouteConflictError, InvalidRoutePatternError, } from "../error/httpRouter.error.js";
|
|
6
|
+
import { HttpRouterError, RouteConflictError, InvalidRoutePatternError, } from "../error/httpRouter.error.js";
|
|
7
7
|
import { normalizeRoutePattern } from "../util/httpRoute.util.js";
|
|
8
8
|
/**
|
|
9
9
|
* Creates a new HTTP router instance.
|
|
@@ -24,21 +24,45 @@ export function createRoute(definition) {
|
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Builds a route path from a pattern and parameters.
|
|
27
|
+
*
|
|
28
|
+
* Handles every parameter spelling the router accepts — `:id`, `:id?`,
|
|
29
|
+
* `:id(\\d+)`, `{name}`, `{name?:\\w+}` and a trailing `*rest` — and
|
|
30
|
+
* percent-encodes each value (a wildcard value segment by segment). An
|
|
31
|
+
* omitted optional parameter no longer leaves a trailing slash
|
|
32
|
+
* (`/reports/2026/`), and a missing required parameter throws
|
|
33
|
+
* {@link HttpRouterError} rather than a plain `Error`.
|
|
27
34
|
*/
|
|
28
35
|
export function buildRoutePath(pattern, params = {}) {
|
|
29
36
|
const normalized = normalizeRoutePattern(pattern);
|
|
30
|
-
|
|
31
|
-
.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
const segments = normalized
|
|
38
|
+
.split("/")
|
|
39
|
+
.filter((segment) => segment !== "")
|
|
40
|
+
.map((segment) => buildSegment(segment, params))
|
|
41
|
+
.filter((segment) => segment !== undefined);
|
|
42
|
+
return `/${segments.join("/")}`;
|
|
43
|
+
}
|
|
44
|
+
const COLON_PARAMETER = /^:([a-zA-Z_][a-zA-Z0-9_-]*)(?:\(.*\))?(\?)?$/;
|
|
45
|
+
const BRACE_PARAMETER = /^\{([a-zA-Z_][a-zA-Z0-9_-]*)(\?)?(?::.+)?\}$/;
|
|
46
|
+
function buildSegment(segment, params) {
|
|
47
|
+
if (segment.startsWith("*")) {
|
|
48
|
+
const value = params[segment.slice(1) || "*"];
|
|
49
|
+
return value === undefined
|
|
50
|
+
? undefined
|
|
51
|
+
: String(value).split("/").map(encodeURIComponent).join("/");
|
|
52
|
+
}
|
|
53
|
+
const match = COLON_PARAMETER.exec(segment) ?? BRACE_PARAMETER.exec(segment);
|
|
54
|
+
if (!match) {
|
|
55
|
+
return segment;
|
|
56
|
+
}
|
|
57
|
+
const [, name, optional] = match;
|
|
58
|
+
const value = name === undefined ? undefined : params[name];
|
|
59
|
+
if (value === undefined || value === null) {
|
|
60
|
+
if (optional) {
|
|
61
|
+
return undefined;
|
|
38
62
|
}
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
63
|
+
throw new HttpRouterError(`Missing route parameter "${name}".`);
|
|
64
|
+
}
|
|
65
|
+
return encodeURIComponent(String(value));
|
|
42
66
|
}
|
|
43
67
|
/**
|
|
44
68
|
* Type guard for HttpRouter instances.
|
|
@@ -64,4 +88,3 @@ export function isRouteConflictError(value) {
|
|
|
64
88
|
export function isInvalidRoutePatternError(value) {
|
|
65
89
|
return value instanceof InvalidRoutePatternError;
|
|
66
90
|
}
|
|
67
|
-
//# sourceMappingURL=httpRoute.factory.js.map
|
|
@@ -6,6 +6,13 @@ import type { HttpRequestContext as RequestContext } from "../../../httpRequest/
|
|
|
6
6
|
import { HttpRouterGroup } from "../group/httpRouterGroup.core.js";
|
|
7
7
|
export declare class HttpRouter {
|
|
8
8
|
private readonly routes;
|
|
9
|
+
/**
|
|
10
|
+
* The routes in matching order. Rebuilt lazily after a registration or
|
|
11
|
+
* removal; `match()` used to copy and sort every route on every request.
|
|
12
|
+
*/
|
|
13
|
+
private sortedCache;
|
|
14
|
+
private readonly shadowedRoutes;
|
|
15
|
+
private readonly errorHandler;
|
|
9
16
|
private readonly routerOptions;
|
|
10
17
|
private readonly notFoundHandler;
|
|
11
18
|
private readonly methodNotAllowedHandler;
|
|
@@ -35,11 +42,18 @@ export declare class HttpRouter {
|
|
|
35
42
|
compiled(): readonly CompiledRoute[];
|
|
36
43
|
find(id: string): MatchedRoute | undefined;
|
|
37
44
|
match(method: string, path: string): RouterMatch;
|
|
45
|
+
private withAutomaticMethods;
|
|
38
46
|
dispatch(request: RequestContext, options?: {
|
|
39
47
|
readonly signal?: AbortSignal;
|
|
40
48
|
readonly state?: Map<string, unknown>;
|
|
41
49
|
}): Promise<RouterResult>;
|
|
42
50
|
private register;
|
|
51
|
+
/**
|
|
52
|
+
* Refuses a registration that leaves a route unreachable: the new route
|
|
53
|
+
* when an earlier-ranked route already matches everything it would, or an
|
|
54
|
+
* existing route the new one would rank ahead of and fully cover.
|
|
55
|
+
*/
|
|
56
|
+
private assertReachable;
|
|
57
|
+
private compareRoutes;
|
|
43
58
|
private sortedRoutes;
|
|
44
59
|
}
|
|
45
|
-
//# sourceMappingURL=httpRouter.register.d.ts.map
|
|
@@ -3,13 +3,21 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { HttpRouterError, RouteConflictError, } from "../error/httpRouter.error.js";
|
|
5
5
|
import { HttpRouterGroup } from "../group/httpRouterGroup.core.js";
|
|
6
|
-
import { collectAllowedMethods, createFallbackRoute, createOptionsResponse, defaultMethodNotAllowedHandler, defaultNotFoundHandler, executeRoute, extractRouteSequence,
|
|
6
|
+
import { collectAllowedMethods, createFallbackRoute, createOptionsResponse, defaultMethodNotAllowedHandler, defaultNotFoundHandler, executeRoute, extractRouteSequence, normalizeMethod, normalizeMethods, normalizeResponse, } from "../factory/httpRoute.factory.base.js";
|
|
7
7
|
import { getRequestMethod, getRequestSignal, applyRouteParams, getRequestUrl, normalizeMatchPath, normalizePath, normalizeRoutePattern, parseQuery, parseUrl, } from "../util/httpRoute.util.js";
|
|
8
8
|
import { matchCompiledRoute } from "../../matching/httpRoute.matcher.core.js";
|
|
9
9
|
import { compareSegmentSpecificity, compileRoute, } from "../../pattern/httpRoute.pattern.parse.js";
|
|
10
10
|
import { createRouterMiddlewareContext } from "../../httpRouter.context.js";
|
|
11
|
+
import { shadowsRoute } from "./httpRouter.shadow.js";
|
|
11
12
|
export class HttpRouter {
|
|
12
13
|
routes = [];
|
|
14
|
+
/**
|
|
15
|
+
* The routes in matching order. Rebuilt lazily after a registration or
|
|
16
|
+
* removal; `match()` used to copy and sort every route on every request.
|
|
17
|
+
*/
|
|
18
|
+
sortedCache;
|
|
19
|
+
shadowedRoutes;
|
|
20
|
+
errorHandler;
|
|
13
21
|
routerOptions;
|
|
14
22
|
notFoundHandler;
|
|
15
23
|
methodNotAllowedHandler;
|
|
@@ -24,6 +32,8 @@ export class HttpRouter {
|
|
|
24
32
|
this.notFoundHandler = options.notFoundHandler ?? defaultNotFoundHandler;
|
|
25
33
|
this.methodNotAllowedHandler =
|
|
26
34
|
options.methodNotAllowedHandler ?? defaultMethodNotAllowedHandler;
|
|
35
|
+
this.shadowedRoutes = options.shadowedRoutes ?? "throw";
|
|
36
|
+
this.errorHandler = options.onError;
|
|
27
37
|
}
|
|
28
38
|
/* ------------------------------------------------------------------------ */
|
|
29
39
|
/* Route Registration */
|
|
@@ -96,10 +106,12 @@ export class HttpRouter {
|
|
|
96
106
|
return false;
|
|
97
107
|
}
|
|
98
108
|
this.routes.splice(index, 1);
|
|
109
|
+
this.sortedCache = undefined;
|
|
99
110
|
return true;
|
|
100
111
|
}
|
|
101
112
|
clear() {
|
|
102
113
|
this.routes.length = 0;
|
|
114
|
+
this.sortedCache = undefined;
|
|
103
115
|
}
|
|
104
116
|
count() {
|
|
105
117
|
return this.routes.length;
|
|
@@ -125,8 +137,7 @@ export class HttpRouter {
|
|
|
125
137
|
const normalizedPath = normalizePath(path);
|
|
126
138
|
const matchPath = normalizeMatchPath(path);
|
|
127
139
|
const candidates = this.sortedRoutes();
|
|
128
|
-
const allowedForPath = () => collectAllowedMethods(candidates, matchPath, this.routerOptions.caseSensitive);
|
|
129
|
-
const allowed = new Set();
|
|
140
|
+
const allowedForPath = () => this.withAutomaticMethods(collectAllowedMethods(candidates, matchPath, this.routerOptions.caseSensitive));
|
|
130
141
|
let pathMatched = false;
|
|
131
142
|
for (const route of candidates) {
|
|
132
143
|
const params = matchCompiledRoute(route, matchPath, this.routerOptions.caseSensitive);
|
|
@@ -140,14 +151,11 @@ export class HttpRouter {
|
|
|
140
151
|
matched: true,
|
|
141
152
|
route: route.definition,
|
|
142
153
|
params,
|
|
143
|
-
allowedMethods: Object.freeze(
|
|
154
|
+
allowedMethods: Object.freeze(allowedForPath()),
|
|
144
155
|
path: normalizedPath,
|
|
145
156
|
method: normalizedMethod,
|
|
146
157
|
};
|
|
147
158
|
}
|
|
148
|
-
if (isHttpMethod(routeMethod)) {
|
|
149
|
-
allowed.add(routeMethod);
|
|
150
|
-
}
|
|
151
159
|
}
|
|
152
160
|
if (normalizedMethod === "HEAD" && this.routerOptions.automaticHead) {
|
|
153
161
|
for (const route of candidates) {
|
|
@@ -160,7 +168,7 @@ export class HttpRouter {
|
|
|
160
168
|
matched: true,
|
|
161
169
|
route: route.definition,
|
|
162
170
|
params,
|
|
163
|
-
allowedMethods: Object.freeze(
|
|
171
|
+
allowedMethods: Object.freeze(allowedForPath()),
|
|
164
172
|
path: normalizedPath,
|
|
165
173
|
method: normalizedMethod,
|
|
166
174
|
};
|
|
@@ -174,20 +182,39 @@ export class HttpRouter {
|
|
|
174
182
|
matched: true,
|
|
175
183
|
route: undefined,
|
|
176
184
|
params: {},
|
|
177
|
-
allowedMethods: Object.freeze(
|
|
185
|
+
allowedMethods: Object.freeze(allowedForPath()),
|
|
178
186
|
path: normalizedPath,
|
|
179
187
|
method: normalizedMethod,
|
|
180
188
|
};
|
|
181
189
|
}
|
|
190
|
+
/*
|
|
191
|
+
* The methods a `405` advertises must be the ones the router actually
|
|
192
|
+
* answers: the automatic `HEAD` (for a `GET` route) and `OPTIONS` were
|
|
193
|
+
* left out, so `Allow: GET, PATCH` contradicted the `OPTIONS` response
|
|
194
|
+
* for the same path.
|
|
195
|
+
*/
|
|
182
196
|
return {
|
|
183
197
|
matched: false,
|
|
184
198
|
route: undefined,
|
|
185
199
|
params: {},
|
|
186
|
-
allowedMethods: Object.freeze([
|
|
200
|
+
allowedMethods: Object.freeze(pathMatched ? allowedForPath() : []),
|
|
187
201
|
path: normalizedPath,
|
|
188
202
|
method: normalizedMethod,
|
|
189
203
|
};
|
|
190
204
|
}
|
|
205
|
+
withAutomaticMethods(methods) {
|
|
206
|
+
const result = new Set(methods);
|
|
207
|
+
if (result.size === 0) {
|
|
208
|
+
return [];
|
|
209
|
+
}
|
|
210
|
+
if (this.routerOptions.automaticHead && result.has("GET")) {
|
|
211
|
+
result.add("HEAD");
|
|
212
|
+
}
|
|
213
|
+
if (this.routerOptions.automaticOptions) {
|
|
214
|
+
result.add("OPTIONS");
|
|
215
|
+
}
|
|
216
|
+
return [...result];
|
|
217
|
+
}
|
|
191
218
|
/* ------------------------------------------------------------------------ */
|
|
192
219
|
/* Dispatch */
|
|
193
220
|
/* ------------------------------------------------------------------------ */
|
|
@@ -213,11 +240,34 @@ export class HttpRouter {
|
|
|
213
240
|
};
|
|
214
241
|
if (match.matched && match.route) {
|
|
215
242
|
applyRouteParams(request, match.params);
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
243
|
+
try {
|
|
244
|
+
const response = await executeRoute(match.route, routerContext);
|
|
245
|
+
return {
|
|
246
|
+
response: await normalizeResponse(response),
|
|
247
|
+
route: match.route,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
if (!this.errorHandler) {
|
|
252
|
+
throw error;
|
|
253
|
+
}
|
|
254
|
+
const handled = await this.errorHandler(error, {
|
|
255
|
+
request,
|
|
256
|
+
path,
|
|
257
|
+
method,
|
|
258
|
+
signal,
|
|
259
|
+
state,
|
|
260
|
+
route: match.route,
|
|
261
|
+
});
|
|
262
|
+
if (handled === undefined) {
|
|
263
|
+
throw error;
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
response: await normalizeResponse(handled),
|
|
267
|
+
route: match.route,
|
|
268
|
+
error,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
221
271
|
}
|
|
222
272
|
if (method.toUpperCase() === "OPTIONS" &&
|
|
223
273
|
match.allowedMethods.length > 0 &&
|
|
@@ -282,26 +332,74 @@ export class HttpRouter {
|
|
|
282
332
|
handler,
|
|
283
333
|
middleware: Object.freeze([...(options.middleware ?? [])]),
|
|
284
334
|
};
|
|
285
|
-
|
|
335
|
+
const route = {
|
|
286
336
|
definition,
|
|
287
337
|
segments: compiled.segments,
|
|
288
338
|
score: compiled.score,
|
|
289
339
|
strictTrailingSlash: compiled.strictTrailingSlash,
|
|
290
340
|
expectsTrailingSlash: compiled.expectsTrailingSlash,
|
|
291
|
-
}
|
|
341
|
+
};
|
|
342
|
+
if (this.shadowedRoutes === "throw") {
|
|
343
|
+
this.assertReachable(route);
|
|
344
|
+
}
|
|
345
|
+
this.routes.push(route);
|
|
346
|
+
this.sortedCache = undefined;
|
|
292
347
|
return () => {
|
|
293
348
|
this.remove(normalizedMethod, normalizedPath);
|
|
294
349
|
};
|
|
295
350
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
351
|
+
/**
|
|
352
|
+
* Refuses a registration that leaves a route unreachable: the new route
|
|
353
|
+
* when an earlier-ranked route already matches everything it would, or an
|
|
354
|
+
* existing route the new one would rank ahead of and fully cover.
|
|
355
|
+
*/
|
|
356
|
+
assertReachable(candidate) {
|
|
357
|
+
for (const existing of this.routes) {
|
|
358
|
+
const existingFirst = this.compareRoutes(existing, candidate) < 0;
|
|
359
|
+
const [first, second] = existingFirst
|
|
360
|
+
? [existing, candidate]
|
|
361
|
+
: [candidate, existing];
|
|
362
|
+
if (!shadowsRoute(first, second, this.routerOptions.caseSensitive)) {
|
|
363
|
+
continue;
|
|
301
364
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
});
|
|
365
|
+
throw shadowedRouteError(second, first);
|
|
366
|
+
}
|
|
305
367
|
}
|
|
368
|
+
compareRoutes(left, right) {
|
|
369
|
+
const specificity = compareSegmentSpecificity(left.segments, right.segments);
|
|
370
|
+
if (specificity !== 0) {
|
|
371
|
+
return specificity;
|
|
372
|
+
}
|
|
373
|
+
/*
|
|
374
|
+
* At equal specificity a method-specific route is tried before an
|
|
375
|
+
* `all()` route, so `all("/x/:id")` no longer swallows a later
|
|
376
|
+
* `get("/x/:id")`.
|
|
377
|
+
*/
|
|
378
|
+
const leftAny = left.definition.method === "*" ? 1 : 0;
|
|
379
|
+
const rightAny = right.definition.method === "*" ? 1 : 0;
|
|
380
|
+
if (leftAny !== rightAny) {
|
|
381
|
+
return leftAny - rightAny;
|
|
382
|
+
}
|
|
383
|
+
return (extractRouteSequence(left.definition.id) -
|
|
384
|
+
extractRouteSequence(right.definition.id));
|
|
385
|
+
}
|
|
386
|
+
sortedRoutes() {
|
|
387
|
+
if (this.sortedCache === undefined) {
|
|
388
|
+
this.sortedCache = [...this.routes].sort((left, right) => this.compareRoutes(left, right));
|
|
389
|
+
}
|
|
390
|
+
return this.sortedCache;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Builds the conflict error for a shadowed route, naming the route that
|
|
395
|
+
* shadows it in both the message and `reason`.
|
|
396
|
+
*/
|
|
397
|
+
function shadowedRouteError(shadowed, by) {
|
|
398
|
+
return new RouteConflictError(shadowed.definition.path, shadowed.definition.method, {
|
|
399
|
+
reason: `shadowed by ${by.definition.method} ${by.definition.path}`,
|
|
400
|
+
message: `Route ${shadowed.definition.method} ${shadowed.definition.path} can ` +
|
|
401
|
+
`never match: ${by.definition.method} ${by.definition.path} is tried ` +
|
|
402
|
+
"first and matches every request it would. Pass " +
|
|
403
|
+
'{ shadowedRoutes: "ignore" } to register it anyway.',
|
|
404
|
+
});
|
|
306
405
|
}
|
|
307
|
-
//# sourceMappingURL=httpRouter.register.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route shadow detection: a route at least as general as one tried before
|
|
3
|
+
* it, for the same method, can never be reached. Only an exact duplicate
|
|
4
|
+
* used to be refused, so `/x/:id` followed by `/x/:slug` registered without
|
|
5
|
+
* complaint and the second handler never ran.
|
|
6
|
+
*/
|
|
7
|
+
import type { CompiledRoute } from "../types/httpRouter.type.js";
|
|
8
|
+
/**
|
|
9
|
+
* Whether `first`, which the router tries before `second`, matches every
|
|
10
|
+
* request `second` matches, leaving `second` unreachable. Deliberately
|
|
11
|
+
* conservative: only a shadow provable from the two patterns alone is
|
|
12
|
+
* reported, so `/x/:id(\\d+)` before `/x/:slug` never is.
|
|
13
|
+
*
|
|
14
|
+
* @param first - The route tried first.
|
|
15
|
+
* @param second - The route tried afterwards.
|
|
16
|
+
* @param caseSensitive - The router's literal comparison mode.
|
|
17
|
+
*/
|
|
18
|
+
export declare function shadowsRoute(first: CompiledRoute, second: CompiledRoute, caseSensitive: boolean): boolean;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route shadow detection: a route at least as general as one tried before
|
|
3
|
+
* it, for the same method, can never be reached. Only an exact duplicate
|
|
4
|
+
* used to be refused, so `/x/:id` followed by `/x/:slug` registered without
|
|
5
|
+
* complaint and the second handler never ran.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Whether `first`, which the router tries before `second`, matches every
|
|
9
|
+
* request `second` matches, leaving `second` unreachable. Deliberately
|
|
10
|
+
* conservative: only a shadow provable from the two patterns alone is
|
|
11
|
+
* reported, so `/x/:id(\\d+)` before `/x/:slug` never is.
|
|
12
|
+
*
|
|
13
|
+
* @param first - The route tried first.
|
|
14
|
+
* @param second - The route tried afterwards.
|
|
15
|
+
* @param caseSensitive - The router's literal comparison mode.
|
|
16
|
+
*/
|
|
17
|
+
export function shadowsRoute(first, second, caseSensitive) {
|
|
18
|
+
if (!methodCovers(first.definition.method, second.definition.method)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (first.strictTrailingSlash !== second.strictTrailingSlash) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (first.strictTrailingSlash &&
|
|
25
|
+
(first.expectsTrailingSlash ?? false) !==
|
|
26
|
+
(second.expectsTrailingSlash ?? false)) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
return segmentsCover(first.segments, second.segments, caseSensitive);
|
|
30
|
+
}
|
|
31
|
+
function methodCovers(first, second) {
|
|
32
|
+
return first === "*" || first === second;
|
|
33
|
+
}
|
|
34
|
+
function segmentsCover(first, second, caseSensitive) {
|
|
35
|
+
const length = Math.max(first.length, second.length);
|
|
36
|
+
for (let index = 0; index < length; index += 1) {
|
|
37
|
+
const left = first[index];
|
|
38
|
+
const right = second[index];
|
|
39
|
+
if (left === undefined) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
if (left.type === "wildcard") {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
if (right === undefined) {
|
|
46
|
+
return tailMatchesNothing(first, index);
|
|
47
|
+
}
|
|
48
|
+
if (!segmentCovers(left, right, caseSensitive)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
function tailMatchesNothing(segments, start) {
|
|
55
|
+
for (let index = start; index < segments.length; index += 1) {
|
|
56
|
+
const segment = segments[index];
|
|
57
|
+
if (segment === undefined || segment.type === "wildcard") {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (segment.type === "literal" || !segment.optional) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
function segmentCovers(left, right, caseSensitive) {
|
|
67
|
+
if (right.type === "wildcard") {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if (left.type === "literal") {
|
|
71
|
+
return (right.type === "literal" &&
|
|
72
|
+
(caseSensitive
|
|
73
|
+
? left.value === right.value
|
|
74
|
+
: left.value.toLowerCase() === right.value.toLowerCase()));
|
|
75
|
+
}
|
|
76
|
+
if (right.type === "literal") {
|
|
77
|
+
return left.pattern === undefined || left.pattern.test(right.value);
|
|
78
|
+
}
|
|
79
|
+
if (right.optional && !left.optional) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
return constraintCovers(left, right);
|
|
83
|
+
}
|
|
84
|
+
function constraintCovers(left, right) {
|
|
85
|
+
if (left.pattern === undefined) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
return (right.pattern !== undefined &&
|
|
89
|
+
right.pattern.source === left.pattern.source &&
|
|
90
|
+
right.pattern.flags === left.pattern.flags);
|
|
91
|
+
}
|