@zudojs/http 1.4.4 → 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
|
@@ -1,484 +0,0 @@
|
|
|
1
|
-
import { HttpError } from "@zudojs/errors";
|
|
2
|
-
/* -------------------------------------------------------------------------- */
|
|
3
|
-
/* Limits */
|
|
4
|
-
/* -------------------------------------------------------------------------- */
|
|
5
|
-
export const DEFAULT_QUERY_MAX_KEYS = 1000;
|
|
6
|
-
export const DEFAULT_QUERY_MAX_KEY_LENGTH = 4096;
|
|
7
|
-
export const DEFAULT_QUERY_MAX_VALUE_LENGTH = 16384;
|
|
8
|
-
export const DEFAULT_QUERY_MAX_TOTAL_LENGTH = 1024 * 1024;
|
|
9
|
-
export const DEFAULT_QUERY_MAX_DEPTH = 10;
|
|
10
|
-
/**
|
|
11
|
-
* Thrown when a query string exceeds one of the parser's limits.
|
|
12
|
-
*
|
|
13
|
-
* Carries `statusCode: 414` so an error handler can answer with
|
|
14
|
-
* `414 URI Too Long` rather than treating the rejection as an internal fault.
|
|
15
|
-
*/
|
|
16
|
-
export class HTTPQueryLimitError extends HttpError {
|
|
17
|
-
constructor(message) {
|
|
18
|
-
super(message, {
|
|
19
|
-
statusCode: 414,
|
|
20
|
-
code: "HTTP_QUERY_LIMIT",
|
|
21
|
-
expose: true,
|
|
22
|
-
isOperational: true,
|
|
23
|
-
});
|
|
24
|
-
this.name = "HTTPQueryLimitError";
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/* -------------------------------------------------------------------------- */
|
|
28
|
-
/* Prototype Safety */
|
|
29
|
-
/* -------------------------------------------------------------------------- */
|
|
30
|
-
/**
|
|
31
|
-
* Key names that would mutate a prototype chain if assigned to an object.
|
|
32
|
-
*
|
|
33
|
-
* `__proto__` is the direct pollution vector. `constructor` and `prototype`
|
|
34
|
-
* are blocked as defence in depth so no future container type re-opens the
|
|
35
|
-
* hole.
|
|
36
|
-
*/
|
|
37
|
-
const FORBIDDEN_QUERY_KEYS = new Set([
|
|
38
|
-
"__proto__",
|
|
39
|
-
"constructor",
|
|
40
|
-
"prototype",
|
|
41
|
-
]);
|
|
42
|
-
export function isForbiddenQueryKey(key) {
|
|
43
|
-
return FORBIDDEN_QUERY_KEYS.has(key);
|
|
44
|
-
}
|
|
45
|
-
function createQueryContainer() {
|
|
46
|
-
return Object.create(null);
|
|
47
|
-
}
|
|
48
|
-
function ownValue(target, key) {
|
|
49
|
-
return Object.prototype.hasOwnProperty.call(target, key)
|
|
50
|
-
? target[key]
|
|
51
|
-
: undefined;
|
|
52
|
-
}
|
|
53
|
-
function resolveLimits(options) {
|
|
54
|
-
return {
|
|
55
|
-
maxKeys: options.maxKeys ?? DEFAULT_QUERY_MAX_KEYS,
|
|
56
|
-
maxKeyLength: options.maxKeyLength ?? DEFAULT_QUERY_MAX_KEY_LENGTH,
|
|
57
|
-
maxValueLength: options.maxValueLength ?? DEFAULT_QUERY_MAX_VALUE_LENGTH,
|
|
58
|
-
maxTotalLength: options.maxTotalLength ?? DEFAULT_QUERY_MAX_TOTAL_LENGTH,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Percent-decodes a query component.
|
|
63
|
-
*
|
|
64
|
-
* A malformed sequence such as `%ZZ` makes `decodeURIComponent` throw a
|
|
65
|
-
* `URIError`. Any client can send one, so the raw component is returned
|
|
66
|
-
* instead of propagating an unhandled error onto the request path. The raw
|
|
67
|
-
* bytes are never interpolated into an error message.
|
|
68
|
-
*/
|
|
69
|
-
export function decodeQueryComponent(value, decode = true, plusAsSpace = true) {
|
|
70
|
-
const input = plusAsSpace ? value.replace(/\+/g, " ") : value;
|
|
71
|
-
if (!decode) {
|
|
72
|
-
return input;
|
|
73
|
-
}
|
|
74
|
-
try {
|
|
75
|
-
return decodeURIComponent(input);
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
return input;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Splits a raw query string into decoded `[name, value]` pairs, enforcing
|
|
83
|
-
* every configured limit as it goes.
|
|
84
|
-
*
|
|
85
|
-
* This is the single tokenizer for the module: both {@link parseQuery} and
|
|
86
|
-
* {@link parseQueryString} are built on it, so the limits and the decoding
|
|
87
|
-
* rules cannot drift apart.
|
|
88
|
-
*/
|
|
89
|
-
function tokenizeQuery(query, limits, decode, plusAsSpace, commaSeparated) {
|
|
90
|
-
if (query.length > limits.maxTotalLength) {
|
|
91
|
-
throw new HTTPQueryLimitError("Query string exceeds the maximum allowed length.");
|
|
92
|
-
}
|
|
93
|
-
const entries = [];
|
|
94
|
-
let count = 0;
|
|
95
|
-
for (const part of query.split("&")) {
|
|
96
|
-
if (part === "") {
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
count += 1;
|
|
100
|
-
if (count > limits.maxKeys) {
|
|
101
|
-
throw new HTTPQueryLimitError("Query string contains too many parameters.");
|
|
102
|
-
}
|
|
103
|
-
const separator = part.indexOf("=");
|
|
104
|
-
const rawKey = separator === -1 ? part : part.slice(0, separator);
|
|
105
|
-
const rawValue = separator === -1 ? "" : part.slice(separator + 1);
|
|
106
|
-
const key = decodeQueryComponent(rawKey, decode, plusAsSpace);
|
|
107
|
-
if (key.length > limits.maxKeyLength) {
|
|
108
|
-
throw new HTTPQueryLimitError("Query parameter name exceeds the maximum allowed length.");
|
|
109
|
-
}
|
|
110
|
-
const value = decodeQueryComponent(rawValue, decode, plusAsSpace);
|
|
111
|
-
if (value.length > limits.maxValueLength) {
|
|
112
|
-
throw new HTTPQueryLimitError("Query parameter value exceeds the maximum allowed length.");
|
|
113
|
-
}
|
|
114
|
-
if (commaSeparated && value.includes(",")) {
|
|
115
|
-
for (const item of value.split(",")) {
|
|
116
|
-
entries.push([key, item]);
|
|
117
|
-
}
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
entries.push([key, value]);
|
|
121
|
-
}
|
|
122
|
-
return entries;
|
|
123
|
-
}
|
|
124
|
-
export function stripQueryPrefix(input) {
|
|
125
|
-
let value = input;
|
|
126
|
-
if (value.startsWith("?")) {
|
|
127
|
-
value = value.slice(1);
|
|
128
|
-
}
|
|
129
|
-
const hashIndex = value.indexOf("#");
|
|
130
|
-
if (hashIndex !== -1) {
|
|
131
|
-
value = value.slice(0, hashIndex);
|
|
132
|
-
}
|
|
133
|
-
return value;
|
|
134
|
-
}
|
|
135
|
-
/* -------------------------------------------------------------------------- */
|
|
136
|
-
/* Query Parser */
|
|
137
|
-
/* -------------------------------------------------------------------------- */
|
|
138
|
-
/**
|
|
139
|
-
* Parses a query string into a nested object.
|
|
140
|
-
*
|
|
141
|
-
* The returned objects have a `null` prototype: a parameter named
|
|
142
|
-
* `__proto__` can never reach `Object.prototype`, and a lookup of an
|
|
143
|
-
* unrelated key can never return an inherited member.
|
|
144
|
-
*/
|
|
145
|
-
export function parseQuery(query, options = {}) {
|
|
146
|
-
if (query === undefined) {
|
|
147
|
-
return createQueryContainer();
|
|
148
|
-
}
|
|
149
|
-
const limits = resolveLimits(options);
|
|
150
|
-
const maxDepth = options.maxDepth ?? DEFAULT_QUERY_MAX_DEPTH;
|
|
151
|
-
const entries = query instanceof URLSearchParams
|
|
152
|
-
? limitSearchParams(query, limits)
|
|
153
|
-
: tokenizeQuery(stripQueryPrefix(query), limits, options.decode !== false, options.plusAsSpace !== false, options.commaSeparated === true);
|
|
154
|
-
const result = createQueryContainer();
|
|
155
|
-
for (const [key, value] of entries) {
|
|
156
|
-
appendQueryValue(result, parseQueryKey(key), value, maxDepth);
|
|
157
|
-
}
|
|
158
|
-
return result;
|
|
159
|
-
}
|
|
160
|
-
function limitSearchParams(params, limits) {
|
|
161
|
-
const entries = [];
|
|
162
|
-
let count = 0;
|
|
163
|
-
for (const [key, value] of params.entries()) {
|
|
164
|
-
count += 1;
|
|
165
|
-
if (count > limits.maxKeys) {
|
|
166
|
-
throw new HTTPQueryLimitError("Query string contains too many parameters.");
|
|
167
|
-
}
|
|
168
|
-
if (key.length > limits.maxKeyLength) {
|
|
169
|
-
throw new HTTPQueryLimitError("Query parameter name exceeds the maximum allowed length.");
|
|
170
|
-
}
|
|
171
|
-
if (value.length > limits.maxValueLength) {
|
|
172
|
-
throw new HTTPQueryLimitError("Query parameter value exceeds the maximum allowed length.");
|
|
173
|
-
}
|
|
174
|
-
entries.push([key, value]);
|
|
175
|
-
}
|
|
176
|
-
return entries;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Parses a query string into a flat record of decoded values.
|
|
180
|
-
*
|
|
181
|
-
* Unlike {@link parseQuery} this applies no bracket-path nesting and no value
|
|
182
|
-
* coercion: every value is the decoded string, and a repeated name yields an
|
|
183
|
-
* array. Both functions share one tokenizer and one set of limits.
|
|
184
|
-
*/
|
|
185
|
-
export function parseQueryString(input, options = {}) {
|
|
186
|
-
const result = createQueryContainer();
|
|
187
|
-
if (input === undefined || input === null || input === "") {
|
|
188
|
-
return result;
|
|
189
|
-
}
|
|
190
|
-
const value = stripQueryPrefix(input);
|
|
191
|
-
if (value.length === 0) {
|
|
192
|
-
return result;
|
|
193
|
-
}
|
|
194
|
-
const allowEmptyKeys = options.allowEmptyKeys ?? true;
|
|
195
|
-
const entries = tokenizeQuery(value, resolveLimits(options), true, options.decodePlusAsSpace !== false, false);
|
|
196
|
-
for (const [key, item] of entries) {
|
|
197
|
-
if (!allowEmptyKeys && key.length === 0) {
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
|
-
if (isForbiddenQueryKey(key)) {
|
|
201
|
-
continue;
|
|
202
|
-
}
|
|
203
|
-
const existing = ownValue(result, key);
|
|
204
|
-
if (existing === undefined) {
|
|
205
|
-
result[key] = item;
|
|
206
|
-
continue;
|
|
207
|
-
}
|
|
208
|
-
if (Array.isArray(existing)) {
|
|
209
|
-
existing.push(item);
|
|
210
|
-
continue;
|
|
211
|
-
}
|
|
212
|
-
result[key] = [existing, item];
|
|
213
|
-
}
|
|
214
|
-
return result;
|
|
215
|
-
}
|
|
216
|
-
/* -------------------------------------------------------------------------- */
|
|
217
|
-
/* Request Query Helpers */
|
|
218
|
-
/* -------------------------------------------------------------------------- */
|
|
219
|
-
export function getQuery(request, options = {}) {
|
|
220
|
-
const url = request.url;
|
|
221
|
-
if (!url) {
|
|
222
|
-
return createQueryContainer();
|
|
223
|
-
}
|
|
224
|
-
const queryIndex = url.indexOf("?");
|
|
225
|
-
if (queryIndex === -1) {
|
|
226
|
-
return createQueryContainer();
|
|
227
|
-
}
|
|
228
|
-
const hashIndex = url.indexOf("#", queryIndex + 1);
|
|
229
|
-
const query = url.slice(queryIndex + 1, hashIndex === -1 ? undefined : hashIndex);
|
|
230
|
-
return parseQuery(query, options);
|
|
231
|
-
}
|
|
232
|
-
export function getQueryValue(request, key) {
|
|
233
|
-
return ownValue(getQuery(request), key);
|
|
234
|
-
}
|
|
235
|
-
export function getQueryString(request, key) {
|
|
236
|
-
const value = getQueryValue(request, key);
|
|
237
|
-
if (value === undefined || Array.isArray(value)) {
|
|
238
|
-
return undefined;
|
|
239
|
-
}
|
|
240
|
-
if (value === null) {
|
|
241
|
-
return null;
|
|
242
|
-
}
|
|
243
|
-
return String(value);
|
|
244
|
-
}
|
|
245
|
-
export function getQueryStrings(request, key) {
|
|
246
|
-
const value = getQueryValue(request, key);
|
|
247
|
-
if (value === undefined) {
|
|
248
|
-
return [];
|
|
249
|
-
}
|
|
250
|
-
if (Array.isArray(value)) {
|
|
251
|
-
return value.map(String);
|
|
252
|
-
}
|
|
253
|
-
return [String(value)];
|
|
254
|
-
}
|
|
255
|
-
/* -------------------------------------------------------------------------- */
|
|
256
|
-
/* Search Params */
|
|
257
|
-
/* -------------------------------------------------------------------------- */
|
|
258
|
-
export function getSearchParams(request) {
|
|
259
|
-
const url = request.url ?? "";
|
|
260
|
-
const queryIndex = url.indexOf("?");
|
|
261
|
-
if (queryIndex === -1) {
|
|
262
|
-
return new URLSearchParams();
|
|
263
|
-
}
|
|
264
|
-
const hashIndex = url.indexOf("#", queryIndex + 1);
|
|
265
|
-
const query = url.slice(queryIndex + 1, hashIndex === -1 ? undefined : hashIndex);
|
|
266
|
-
return new URLSearchParams(query);
|
|
267
|
-
}
|
|
268
|
-
/* -------------------------------------------------------------------------- */
|
|
269
|
-
/* Query String Serialization */
|
|
270
|
-
/* -------------------------------------------------------------------------- */
|
|
271
|
-
export function stringifyQuery(query) {
|
|
272
|
-
const params = new URLSearchParams();
|
|
273
|
-
appendObjectToSearchParams(params, query);
|
|
274
|
-
return params.toString();
|
|
275
|
-
}
|
|
276
|
-
export function buildQueryString(query) {
|
|
277
|
-
const value = stringifyQuery(query);
|
|
278
|
-
return value ? `?${value}` : "";
|
|
279
|
-
}
|
|
280
|
-
/* -------------------------------------------------------------------------- */
|
|
281
|
-
/* Query Value Access */
|
|
282
|
-
/* -------------------------------------------------------------------------- */
|
|
283
|
-
export function hasQuery(request, key) {
|
|
284
|
-
return getSearchParams(request).has(key);
|
|
285
|
-
}
|
|
286
|
-
export function querySize(request) {
|
|
287
|
-
let size = 0;
|
|
288
|
-
for (const _ of getSearchParams(request)) {
|
|
289
|
-
size += 1;
|
|
290
|
-
}
|
|
291
|
-
return size;
|
|
292
|
-
}
|
|
293
|
-
/* -------------------------------------------------------------------------- */
|
|
294
|
-
/* Query Key Parsing */
|
|
295
|
-
/* -------------------------------------------------------------------------- */
|
|
296
|
-
/**
|
|
297
|
-
* Splits a bracket/dot path such as `a[b][c]` into its segments.
|
|
298
|
-
*
|
|
299
|
-
* A path containing `__proto__`, `constructor` or `prototype` yields an empty
|
|
300
|
-
* array, which callers treat as "drop this parameter entirely".
|
|
301
|
-
*/
|
|
302
|
-
export function parseQueryKey(key) {
|
|
303
|
-
if (!key) {
|
|
304
|
-
return [""];
|
|
305
|
-
}
|
|
306
|
-
const normalized = key.replace(/\]/g, "");
|
|
307
|
-
const segments = normalized
|
|
308
|
-
.split(/[.[\]]+/)
|
|
309
|
-
.filter((part) => part.length > 0);
|
|
310
|
-
if (segments.some(isForbiddenQueryKey)) {
|
|
311
|
-
return [];
|
|
312
|
-
}
|
|
313
|
-
return segments;
|
|
314
|
-
}
|
|
315
|
-
/* -------------------------------------------------------------------------- */
|
|
316
|
-
/* Nested Query Values */
|
|
317
|
-
/* -------------------------------------------------------------------------- */
|
|
318
|
-
/**
|
|
319
|
-
* Writes one value into the nested result object.
|
|
320
|
-
*
|
|
321
|
-
* Iterative rather than recursive so a deeply nested key cannot overflow the
|
|
322
|
-
* stack, depth-capped so it cannot allocate without bound, and every level is
|
|
323
|
-
* a null-prototype container read through `hasOwnProperty`.
|
|
324
|
-
*/
|
|
325
|
-
function appendQueryValue(target, path, value, maxDepth) {
|
|
326
|
-
if (path.length === 0) {
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
if (path.length > maxDepth) {
|
|
330
|
-
throw new HTTPQueryLimitError("Query parameter nesting exceeds the maximum allowed depth.");
|
|
331
|
-
}
|
|
332
|
-
let current = target;
|
|
333
|
-
for (let index = 0; index < path.length - 1; index += 1) {
|
|
334
|
-
const segment = path[index];
|
|
335
|
-
if (segment === undefined) {
|
|
336
|
-
continue;
|
|
337
|
-
}
|
|
338
|
-
const existing = ownValue(current, segment);
|
|
339
|
-
if (isQueryObject(existing)) {
|
|
340
|
-
current = existing;
|
|
341
|
-
continue;
|
|
342
|
-
}
|
|
343
|
-
const next = createQueryContainer();
|
|
344
|
-
current[segment] = next;
|
|
345
|
-
current = next;
|
|
346
|
-
}
|
|
347
|
-
const leaf = path[path.length - 1];
|
|
348
|
-
if (leaf === undefined) {
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
const existing = ownValue(current, leaf);
|
|
352
|
-
if (existing === undefined) {
|
|
353
|
-
current[leaf] = normalizeQueryValue(value);
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
if (Array.isArray(existing)) {
|
|
357
|
-
existing.push(normalizeQueryValue(value));
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
current[leaf] = [existing, normalizeQueryValue(value)];
|
|
361
|
-
}
|
|
362
|
-
/* -------------------------------------------------------------------------- */
|
|
363
|
-
/* Query Value Normalization */
|
|
364
|
-
/* -------------------------------------------------------------------------- */
|
|
365
|
-
/**
|
|
366
|
-
* Coerces the well-known literals and numbers that round-trip exactly.
|
|
367
|
-
*
|
|
368
|
-
* A numeric literal is only converted when `String(Number(value)) === value`,
|
|
369
|
-
* so a 20-digit identifier stays the string it arrived as instead of being
|
|
370
|
-
* silently rewritten to a different number.
|
|
371
|
-
*/
|
|
372
|
-
export function normalizeQueryValue(value) {
|
|
373
|
-
if (value === "null") {
|
|
374
|
-
return null;
|
|
375
|
-
}
|
|
376
|
-
if (value === "true") {
|
|
377
|
-
return true;
|
|
378
|
-
}
|
|
379
|
-
if (value === "false") {
|
|
380
|
-
return false;
|
|
381
|
-
}
|
|
382
|
-
if (/^-?(?:0|[1-9]\d*)(?:\.\d+)?$/.test(value)) {
|
|
383
|
-
const number = Number(value);
|
|
384
|
-
if (Number.isFinite(number) && String(number) === value) {
|
|
385
|
-
return number;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
return value;
|
|
389
|
-
}
|
|
390
|
-
function isQueryObject(value) {
|
|
391
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
392
|
-
}
|
|
393
|
-
/* -------------------------------------------------------------------------- */
|
|
394
|
-
/* Serialization */
|
|
395
|
-
/* -------------------------------------------------------------------------- */
|
|
396
|
-
function appendObjectToSearchParams(params, object, prefix) {
|
|
397
|
-
for (const [key, value] of Object.entries(object)) {
|
|
398
|
-
const path = prefix ? `${prefix}[${key}]` : key;
|
|
399
|
-
if (value === undefined) {
|
|
400
|
-
continue;
|
|
401
|
-
}
|
|
402
|
-
if (value === null) {
|
|
403
|
-
params.append(path, "null");
|
|
404
|
-
continue;
|
|
405
|
-
}
|
|
406
|
-
if (Array.isArray(value)) {
|
|
407
|
-
for (const item of value) {
|
|
408
|
-
if (item === undefined) {
|
|
409
|
-
continue;
|
|
410
|
-
}
|
|
411
|
-
if (isPlainObject(item)) {
|
|
412
|
-
appendObjectToSearchParams(params, item, path);
|
|
413
|
-
}
|
|
414
|
-
else {
|
|
415
|
-
params.append(path, serializeQueryPrimitive(item));
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
continue;
|
|
419
|
-
}
|
|
420
|
-
if (isPlainObject(value)) {
|
|
421
|
-
appendObjectToSearchParams(params, value, path);
|
|
422
|
-
continue;
|
|
423
|
-
}
|
|
424
|
-
params.append(path, serializeQueryPrimitive(value));
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
/* -------------------------------------------------------------------------- */
|
|
428
|
-
/* Primitive Serialization */
|
|
429
|
-
/* -------------------------------------------------------------------------- */
|
|
430
|
-
function serializeQueryPrimitive(value) {
|
|
431
|
-
if (value === null) {
|
|
432
|
-
return "null";
|
|
433
|
-
}
|
|
434
|
-
if (value === undefined) {
|
|
435
|
-
return "";
|
|
436
|
-
}
|
|
437
|
-
if (typeof value === "boolean") {
|
|
438
|
-
return value ? "true" : "false";
|
|
439
|
-
}
|
|
440
|
-
if (typeof value === "string") {
|
|
441
|
-
return value;
|
|
442
|
-
}
|
|
443
|
-
if (typeof value === "number" || typeof value === "bigint") {
|
|
444
|
-
return String(value);
|
|
445
|
-
}
|
|
446
|
-
if (value instanceof Date) {
|
|
447
|
-
return value.toISOString();
|
|
448
|
-
}
|
|
449
|
-
return String(value);
|
|
450
|
-
}
|
|
451
|
-
function isPlainObject(value) {
|
|
452
|
-
if (value === null || typeof value !== "object") {
|
|
453
|
-
return false;
|
|
454
|
-
}
|
|
455
|
-
const prototype = Object.getPrototypeOf(value);
|
|
456
|
-
return prototype === Object.prototype || prototype === null;
|
|
457
|
-
}
|
|
458
|
-
/* -------------------------------------------------------------------------- */
|
|
459
|
-
/* Query Utilities */
|
|
460
|
-
/* -------------------------------------------------------------------------- */
|
|
461
|
-
export function cloneQuery(query) {
|
|
462
|
-
return JSON.parse(JSON.stringify(query));
|
|
463
|
-
}
|
|
464
|
-
export function mergeQuery(...queries) {
|
|
465
|
-
const result = createQueryContainer();
|
|
466
|
-
for (const query of queries) {
|
|
467
|
-
mergeQueryObject(result, query);
|
|
468
|
-
}
|
|
469
|
-
return result;
|
|
470
|
-
}
|
|
471
|
-
function mergeQueryObject(target, source) {
|
|
472
|
-
for (const [key, value] of Object.entries(source)) {
|
|
473
|
-
if (isForbiddenQueryKey(key)) {
|
|
474
|
-
continue;
|
|
475
|
-
}
|
|
476
|
-
const existing = ownValue(target, key);
|
|
477
|
-
if (isQueryObject(existing) && isQueryObject(value)) {
|
|
478
|
-
mergeQueryObject(existing, value);
|
|
479
|
-
continue;
|
|
480
|
-
}
|
|
481
|
-
target[key] = value;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
//# sourceMappingURL=http.query.js.map
|