@inversifyjs/http-core 1.0.0 → 3.0.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/CHANGELOG.md +95 -0
- package/README.md +1 -1
- package/lib/cjs/error/models/InversifyHttpAdapterError.d.ts +7 -1
- package/lib/cjs/error/models/InversifyHttpAdapterError.d.ts.map +1 -1
- package/lib/cjs/error/models/InversifyHttpAdapterError.js +3 -1
- package/lib/cjs/error/models/InversifyHttpAdapterError.js.map +1 -1
- package/lib/cjs/error/models/InversifyHttpAdapterErrorKind.d.ts +3 -2
- package/lib/cjs/error/models/InversifyHttpAdapterErrorKind.d.ts.map +1 -1
- package/lib/cjs/error/models/InversifyHttpAdapterErrorKind.js +3 -2
- package/lib/cjs/error/models/InversifyHttpAdapterErrorKind.js.map +1 -1
- package/lib/cjs/http/actions/setErrorFilterToErrorFilterMap.d.ts +4 -0
- package/lib/cjs/http/actions/setErrorFilterToErrorFilterMap.d.ts.map +1 -0
- package/lib/cjs/http/actions/setErrorFilterToErrorFilterMap.js +14 -0
- package/lib/cjs/http/actions/setErrorFilterToErrorFilterMap.js.map +1 -0
- package/lib/cjs/http/actions/setErrorFilterToErrorFilterMap.spec.d.ts +2 -0
- package/lib/cjs/http/actions/setErrorFilterToErrorFilterMap.spec.d.ts.map +1 -0
- package/lib/cjs/http/adapter/InversifyHttpAdapter.d.ts +30 -15
- package/lib/cjs/http/adapter/InversifyHttpAdapter.d.ts.map +1 -1
- package/lib/cjs/http/adapter/InversifyHttpAdapter.js +273 -84
- package/lib/cjs/http/adapter/InversifyHttpAdapter.js.map +1 -1
- package/lib/cjs/http/calculations/buildInterceptedHandler.d.ts +7 -0
- package/lib/cjs/http/calculations/buildInterceptedHandler.d.ts.map +1 -0
- package/lib/cjs/http/calculations/buildInterceptedHandler.js +57 -0
- package/lib/cjs/http/calculations/buildInterceptedHandler.js.map +1 -0
- package/lib/cjs/http/calculations/buildInterceptedHandler.spec.d.ts +2 -0
- package/lib/cjs/http/calculations/buildInterceptedHandler.spec.d.ts.map +1 -0
- package/lib/cjs/http/calculations/buildNormalizedPath.d.ts +2 -0
- package/lib/cjs/http/calculations/buildNormalizedPath.d.ts.map +1 -0
- package/lib/cjs/http/calculations/buildNormalizedPath.js +10 -0
- package/lib/cjs/http/calculations/buildNormalizedPath.js.map +1 -0
- package/lib/cjs/http/calculations/buildNormalizedPath.spec.d.ts +2 -0
- package/lib/cjs/http/calculations/buildNormalizedPath.spec.d.ts.map +1 -0
- package/lib/cjs/http/calculations/buildRouteParameterDecorator.d.ts +7 -0
- package/lib/cjs/http/calculations/buildRouteParameterDecorator.d.ts.map +1 -0
- package/lib/cjs/http/calculations/buildRouteParameterDecorator.js +29 -0
- package/lib/cjs/http/calculations/buildRouteParameterDecorator.js.map +1 -0
- package/lib/cjs/http/calculations/buildRouteParameterDecorator.spec.d.ts +2 -0
- package/lib/cjs/http/calculations/buildRouteParameterDecorator.spec.d.ts.map +1 -0
- package/lib/cjs/http/calculations/buildSetHeaderMetadata.d.ts +2 -0
- package/lib/cjs/http/calculations/buildSetHeaderMetadata.d.ts.map +1 -0
- package/lib/cjs/http/calculations/buildSetHeaderMetadata.js +17 -0
- package/lib/cjs/http/calculations/buildSetHeaderMetadata.js.map +1 -0
- package/lib/cjs/http/calculations/buildSetHeaderMetadata.spec.d.ts +2 -0
- package/lib/cjs/http/calculations/buildSetHeaderMetadata.spec.d.ts.map +1 -0
- package/lib/cjs/http/calculations/createCustomParameterDecorator.d.ts +5 -0
- package/lib/cjs/http/calculations/createCustomParameterDecorator.d.ts.map +1 -0
- package/lib/cjs/http/calculations/createCustomParameterDecorator.js +9 -0
- package/lib/cjs/http/calculations/createCustomParameterDecorator.js.map +1 -0
- package/lib/cjs/http/calculations/createCustomParameterDecorator.spec.d.ts +2 -0
- package/lib/cjs/http/calculations/createCustomParameterDecorator.spec.d.ts.map +1 -0
- package/lib/cjs/http/{decorators/RequestMethod.d.ts → calculations/requestMethod.d.ts} +1 -1
- package/lib/cjs/http/calculations/requestMethod.d.ts.map +1 -0
- package/lib/cjs/http/calculations/requestMethod.js +17 -0
- package/lib/cjs/http/calculations/requestMethod.js.map +1 -0
- package/lib/cjs/http/calculations/requestMethod.spec.d.ts +2 -0
- package/lib/cjs/http/calculations/requestMethod.spec.d.ts.map +1 -0
- package/lib/cjs/http/calculations/requestParam.d.ts +3 -0
- package/lib/cjs/http/calculations/requestParam.d.ts.map +1 -0
- package/lib/cjs/http/calculations/requestParam.js +24 -0
- package/lib/cjs/http/calculations/requestParam.js.map +1 -0
- package/lib/cjs/http/calculations/requestParam.spec.d.ts +2 -0
- package/lib/cjs/http/calculations/requestParam.spec.d.ts.map +1 -0
- package/lib/cjs/http/decorators/All.d.ts +1 -1
- package/lib/cjs/http/decorators/All.d.ts.map +1 -1
- package/lib/cjs/http/decorators/All.js +5 -4
- package/lib/cjs/http/decorators/All.js.map +1 -1
- package/lib/cjs/http/decorators/Body.d.ts +4 -1
- package/lib/cjs/http/decorators/Body.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Body.js +5 -4
- package/lib/cjs/http/decorators/Body.js.map +1 -1
- package/lib/cjs/http/decorators/Controller.d.ts +1 -1
- package/lib/cjs/http/decorators/Controller.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Controller.js +16 -13
- package/lib/cjs/http/decorators/Controller.js.map +1 -1
- package/lib/cjs/http/decorators/Cookies.d.ts +4 -1
- package/lib/cjs/http/decorators/Cookies.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Cookies.js +5 -4
- package/lib/cjs/http/decorators/Cookies.js.map +1 -1
- package/lib/cjs/http/decorators/Delete.d.ts +1 -1
- package/lib/cjs/http/decorators/Delete.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Delete.js +5 -4
- package/lib/cjs/http/decorators/Delete.js.map +1 -1
- package/lib/cjs/http/decorators/Get.d.ts +1 -1
- package/lib/cjs/http/decorators/Get.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Get.js +5 -4
- package/lib/cjs/http/decorators/Get.js.map +1 -1
- package/lib/cjs/http/decorators/Head.d.ts +1 -1
- package/lib/cjs/http/decorators/Head.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Head.js +5 -4
- package/lib/cjs/http/decorators/Head.js.map +1 -1
- package/lib/cjs/http/decorators/Headers.d.ts +4 -1
- package/lib/cjs/http/decorators/Headers.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Headers.js +5 -4
- package/lib/cjs/http/decorators/Headers.js.map +1 -1
- package/lib/cjs/http/decorators/Next.d.ts +1 -1
- package/lib/cjs/http/decorators/Next.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Next.js +5 -4
- package/lib/cjs/http/decorators/Next.js.map +1 -1
- package/lib/cjs/http/decorators/Options.d.ts +1 -1
- package/lib/cjs/http/decorators/Options.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Options.js +5 -4
- package/lib/cjs/http/decorators/Options.js.map +1 -1
- package/lib/cjs/http/decorators/Params.d.ts +4 -1
- package/lib/cjs/http/decorators/Params.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Params.js +5 -4
- package/lib/cjs/http/decorators/Params.js.map +1 -1
- package/lib/cjs/http/decorators/Patch.d.ts +1 -1
- package/lib/cjs/http/decorators/Patch.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Patch.js +5 -4
- package/lib/cjs/http/decorators/Patch.js.map +1 -1
- package/lib/cjs/http/decorators/Post.d.ts +1 -1
- package/lib/cjs/http/decorators/Post.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Post.js +5 -4
- package/lib/cjs/http/decorators/Post.js.map +1 -1
- package/lib/cjs/http/decorators/Put.d.ts +1 -1
- package/lib/cjs/http/decorators/Put.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Put.js +5 -4
- package/lib/cjs/http/decorators/Put.js.map +1 -1
- package/lib/cjs/http/decorators/Query.d.ts +4 -1
- package/lib/cjs/http/decorators/Query.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Query.js +5 -4
- package/lib/cjs/http/decorators/Query.js.map +1 -1
- package/lib/cjs/http/decorators/Request.d.ts +3 -1
- package/lib/cjs/http/decorators/Request.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Request.js +5 -4
- package/lib/cjs/http/decorators/Request.js.map +1 -1
- package/lib/cjs/http/decorators/Response.d.ts +3 -1
- package/lib/cjs/http/decorators/Response.d.ts.map +1 -1
- package/lib/cjs/http/decorators/Response.js +5 -4
- package/lib/cjs/http/decorators/Response.js.map +1 -1
- package/lib/cjs/http/decorators/SetHeader.d.ts +2 -0
- package/lib/cjs/http/decorators/SetHeader.d.ts.map +1 -0
- package/lib/cjs/http/decorators/SetHeader.js +13 -0
- package/lib/cjs/http/decorators/SetHeader.js.map +1 -0
- package/lib/cjs/http/decorators/SetHeader.spec.d.ts +2 -0
- package/lib/cjs/http/decorators/SetHeader.spec.d.ts.map +1 -0
- package/lib/cjs/http/decorators/StatusCode.d.ts +2 -2
- package/lib/cjs/http/decorators/StatusCode.d.ts.map +1 -1
- package/lib/cjs/http/decorators/StatusCode.js +5 -4
- package/lib/cjs/http/decorators/StatusCode.js.map +1 -1
- package/lib/cjs/http/models/ControllerOptions.d.ts +3 -1
- package/lib/cjs/http/models/ControllerOptions.d.ts.map +1 -1
- package/lib/cjs/http/models/ControllerResponse.d.ts +3 -2
- package/lib/cjs/http/models/ControllerResponse.d.ts.map +1 -1
- package/lib/cjs/http/models/CustomParameterDecoratorHandler.d.ts +2 -0
- package/lib/cjs/http/models/CustomParameterDecoratorHandler.d.ts.map +1 -0
- package/lib/cjs/http/models/CustomParameterDecoratorHandler.js +3 -0
- package/lib/cjs/http/models/CustomParameterDecoratorHandler.js.map +1 -0
- package/lib/cjs/http/models/HttpAdapterOptions.d.ts +5 -0
- package/lib/cjs/http/models/HttpAdapterOptions.d.ts.map +1 -0
- package/lib/cjs/http/models/HttpAdapterOptions.js +3 -0
- package/lib/cjs/http/models/HttpAdapterOptions.js.map +1 -0
- package/lib/cjs/http/models/HttpStatusCode.d.ts.map +1 -0
- package/lib/cjs/http/models/HttpStatusCode.js.map +1 -0
- package/lib/cjs/http/models/MiddlewareHandler.d.ts +2 -0
- package/lib/cjs/http/models/MiddlewareHandler.d.ts.map +1 -0
- package/lib/cjs/http/models/MiddlewareHandler.js +3 -0
- package/lib/cjs/http/models/MiddlewareHandler.js.map +1 -0
- package/lib/cjs/http/models/RequestHandler.d.ts +1 -1
- package/lib/cjs/http/models/RequestHandler.d.ts.map +1 -1
- package/lib/cjs/http/models/RequestMethodParameterType.d.ts +9 -8
- package/lib/cjs/http/models/RequestMethodParameterType.d.ts.map +1 -1
- package/lib/cjs/http/models/RequestMethodParameterType.js +9 -8
- package/lib/cjs/http/models/RequestMethodParameterType.js.map +1 -1
- package/lib/cjs/http/models/RequestMethodType.d.ts +8 -8
- package/lib/cjs/http/models/RequestMethodType.d.ts.map +1 -1
- package/lib/cjs/http/models/RequestMethodType.js +8 -8
- package/lib/cjs/http/models/RequestMethodType.js.map +1 -1
- package/lib/cjs/http/models/RequiredOptions.d.ts +4 -0
- package/lib/cjs/http/models/RequiredOptions.d.ts.map +1 -0
- package/lib/cjs/http/models/RequiredOptions.js +3 -0
- package/lib/cjs/http/models/RequiredOptions.js.map +1 -0
- package/lib/cjs/http/models/RouteParamOptions.d.ts +4 -0
- package/lib/cjs/http/models/RouteParamOptions.d.ts.map +1 -0
- package/lib/cjs/http/models/RouteParamOptions.js +3 -0
- package/lib/cjs/http/models/RouteParamOptions.js.map +1 -0
- package/lib/cjs/http/models/RouteParams.d.ts +12 -0
- package/lib/cjs/http/models/RouteParams.d.ts.map +1 -0
- package/lib/cjs/http/models/{Middleware.js → RouteParams.js} +1 -1
- package/lib/cjs/http/models/RouteParams.js.map +1 -0
- package/lib/cjs/http/models/RouterParams.d.ts +3 -6
- package/lib/cjs/http/models/RouterParams.d.ts.map +1 -1
- package/lib/cjs/httpResponse/calculations/isHttpResponse.d.ts +3 -0
- package/lib/cjs/httpResponse/calculations/isHttpResponse.d.ts.map +1 -0
- package/lib/cjs/httpResponse/calculations/isHttpResponse.js +10 -0
- package/lib/cjs/httpResponse/calculations/isHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/calculations/isHttpResponse.spec.d.ts +2 -0
- package/lib/cjs/httpResponse/calculations/isHttpResponse.spec.d.ts.map +1 -0
- package/lib/cjs/httpResponse/models/AcceptedHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/AcceptedHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/success → httpResponse/models}/AcceptedHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/AcceptedHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/AlreadyReportedHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/AlreadyReportedHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/success → httpResponse/models}/AlreadyReportedHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/AlreadyReportedHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/BadGatewayHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/BadGatewayHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/BadGatewayHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/BadGatewayHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/BadRequestHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/BadRequestHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/BadRequestHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/BadRequestHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/ConflictHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/ConflictHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/ConflictHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/ConflictHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/ContentDifferentHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/ContentDifferentHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/success → httpResponse/models}/ContentDifferentHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/ContentDifferentHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/CreatedHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/CreatedHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/success → httpResponse/models}/CreatedHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/CreatedHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/ErrorHttpResponse.d.ts +14 -0
- package/lib/cjs/httpResponse/models/ErrorHttpResponse.d.ts.map +1 -0
- package/lib/cjs/httpResponse/models/ErrorHttpResponse.js +25 -0
- package/lib/cjs/httpResponse/models/ErrorHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/ErrorHttpResponse.spec.d.ts +2 -0
- package/lib/cjs/httpResponse/models/ErrorHttpResponse.spec.d.ts.map +1 -0
- package/lib/cjs/httpResponse/models/ForbiddenHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/ForbiddenHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/ForbiddenHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/ForbiddenHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/GatewayTimeoutHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/GatewayTimeoutHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/GatewayTimeoutHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/GatewayTimeoutHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/GoneHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/GoneHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/GoneHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/GoneHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/HttpResponse.d.ts +9 -0
- package/lib/cjs/httpResponse/models/HttpResponse.d.ts.map +1 -0
- package/lib/cjs/httpResponse/models/HttpResponse.js +5 -0
- package/lib/cjs/httpResponse/models/HttpResponse.js.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/HttpVersionNotSupportedHttpResponse.d.ts +1 -1
- package/lib/cjs/httpResponse/models/HttpVersionNotSupportedHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/HttpVersionNotSupportedHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/HttpVersionNotSupportedHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/InsufficientStorageHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/InsufficientStorageHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/InsufficientStorageHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/InsufficientStorageHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/InternalServerErrorHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/InternalServerErrorHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/InternalServerErrorHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/InternalServerErrorHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/LoopDetectedHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/LoopDetectedHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/LoopDetectedHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/LoopDetectedHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/MethodNotAllowedHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/MethodNotAllowedHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/MethodNotAllowedHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/MethodNotAllowedHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/MultiStatusHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/MultiStatusHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/success → httpResponse/models}/MultiStatusHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/MultiStatusHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/NoContentHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/NoContentHttpResponse.d.ts.map +1 -0
- package/lib/cjs/httpResponse/models/NoContentHttpResponse.js +12 -0
- package/lib/cjs/httpResponse/models/NoContentHttpResponse.js.map +1 -0
- package/lib/cjs/{http/responses/success → httpResponse/models}/NonAuthoritativeInformationHttpResponse.d.ts +2 -2
- package/lib/cjs/httpResponse/models/NonAuthoritativeInformationHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/success → httpResponse/models}/NonAuthoritativeInformationHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/NonAuthoritativeInformationHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/NotAcceptableHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/NotAcceptableHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/NotAcceptableHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/NotAcceptableHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/NotFoundHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/NotFoundHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/NotFoundHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/NotFoundHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/NotImplementedHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/NotImplementedHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/NotImplementedHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/NotImplementedHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/OkHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/OkHttpResponse.d.ts.map +1 -0
- package/lib/cjs/httpResponse/models/OkHttpResponse.js +12 -0
- package/lib/cjs/httpResponse/models/OkHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/PartialContentHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/PartialContentHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/success → httpResponse/models}/PartialContentHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/PartialContentHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/PaymentRequiredHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/PaymentRequiredHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/PaymentRequiredHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/PaymentRequiredHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/ResetContentHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/ResetContentHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/success → httpResponse/models}/ResetContentHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/ResetContentHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/ServiceUnavailableHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/ServiceUnavailableHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/ServiceUnavailableHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/ServiceUnavailableHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/SuccessHttpResponse.d.ts +14 -0
- package/lib/cjs/httpResponse/models/SuccessHttpResponse.d.ts.map +1 -0
- package/lib/cjs/httpResponse/models/SuccessHttpResponse.js +24 -0
- package/lib/cjs/httpResponse/models/SuccessHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/SuccessHttpResponse.spec.d.ts +2 -0
- package/lib/cjs/httpResponse/models/SuccessHttpResponse.spec.d.ts.map +1 -0
- package/lib/cjs/httpResponse/models/UnauthorizedHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/UnauthorizedHttpResponse.d.ts.map +1 -0
- package/lib/cjs/{http/responses/error → httpResponse/models}/UnauthorizedHttpResponse.js +3 -3
- package/lib/cjs/httpResponse/models/UnauthorizedHttpResponse.js.map +1 -0
- package/lib/cjs/httpResponse/models/UnprocessableEntityHttpResponse.d.ts +5 -0
- package/lib/cjs/httpResponse/models/UnprocessableEntityHttpResponse.d.ts.map +1 -0
- package/lib/cjs/httpResponse/models/UnprocessableEntityHttpResponse.js +12 -0
- package/lib/cjs/httpResponse/models/UnprocessableEntityHttpResponse.js.map +1 -0
- package/lib/cjs/index.d.ts +67 -51
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +86 -62
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/reflectMetadata/data/controllerMethodHeaderMetadataReflectKey.d.ts +2 -0
- package/lib/cjs/reflectMetadata/data/controllerMethodHeaderMetadataReflectKey.d.ts.map +1 -0
- package/lib/cjs/reflectMetadata/data/controllerMethodHeaderMetadataReflectKey.js +5 -0
- package/lib/cjs/reflectMetadata/data/controllerMethodHeaderMetadataReflectKey.js.map +1 -0
- package/lib/cjs/reflectMetadata/data/controllerMethodUseNativeHandlerMetadataReflectKey.d.ts +2 -0
- package/lib/cjs/reflectMetadata/data/controllerMethodUseNativeHandlerMetadataReflectKey.d.ts.map +1 -0
- package/lib/cjs/reflectMetadata/data/controllerMethodUseNativeHandlerMetadataReflectKey.js +5 -0
- package/lib/cjs/reflectMetadata/data/controllerMethodUseNativeHandlerMetadataReflectKey.js.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildErrorTypeToErrorFilterMap.d.ts +4 -0
- package/lib/cjs/routerExplorer/calculations/buildErrorTypeToErrorFilterMap.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildErrorTypeToErrorFilterMap.js +16 -0
- package/lib/cjs/routerExplorer/calculations/buildErrorTypeToErrorFilterMap.js.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildErrorTypeToErrorFilterMap.spec.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/buildErrorTypeToErrorFilterMap.spec.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMetadata.d.ts +4 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMetadata.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMetadata.js +15 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMetadata.js.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMetadata.spec.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMetadata.spec.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMetadataList.d.ts +4 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMetadataList.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMetadataList.js +21 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMetadataList.js.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMetadataList.spec.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMetadataList.spec.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMethodMetadata.d.ts +5 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMethodMetadata.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMethodMetadata.js +49 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMethodMetadata.js.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMethodMetadata.spec.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMethodMetadata.spec.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMethodMetadataList.d.ts +5 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMethodMetadataList.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMethodMetadataList.js +8 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMethodMetadataList.js.map +1 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMethodMetadataList.spec.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/buildRouterExplorerControllerMethodMetadataList.spec.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMetadataList.d.ts +3 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMetadataList.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMetadataList.js +9 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMetadataList.js.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMetadataList.spec.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMetadataList.spec.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodHeaderMetadataList.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodHeaderMetadataList.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodHeaderMetadataList.js +14 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodHeaderMetadataList.js.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodHeaderMetadataList.spec.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodHeaderMetadataList.spec.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodMetadataList.d.ts +3 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodMetadataList.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodMetadataList.js +9 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodMetadataList.js.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodMetadataList.spec.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodMetadataList.spec.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodParameterMetadataList.d.ts +3 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodParameterMetadataList.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodParameterMetadataList.js +9 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodParameterMetadataList.js.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodParameterMetadataList.spec.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodParameterMetadataList.spec.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodStatusCodeMetadata.d.ts +3 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodStatusCodeMetadata.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodStatusCodeMetadata.js +9 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodStatusCodeMetadata.js.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodStatusCodeMetadata.spec.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodStatusCodeMetadata.spec.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodUseNativeHandlerMetadata.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodUseNativeHandlerMetadata.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodUseNativeHandlerMetadata.js +9 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodUseNativeHandlerMetadata.js.map +1 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodUseNativeHandlerMetadata.spec.d.ts +2 -0
- package/lib/cjs/routerExplorer/calculations/getControllerMethodUseNativeHandlerMetadata.spec.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/model/ControllerMetadata.d.ts +7 -0
- package/lib/cjs/routerExplorer/model/ControllerMetadata.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/model/ControllerMetadata.js.map +1 -0
- package/lib/cjs/{http/models → routerExplorer/model}/ControllerMethodMetadata.d.ts +1 -1
- package/lib/cjs/routerExplorer/model/ControllerMethodMetadata.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/model/ControllerMethodMetadata.js.map +1 -0
- package/lib/cjs/routerExplorer/model/ControllerMethodParameterMetadata.d.ts +11 -0
- package/lib/cjs/routerExplorer/model/ControllerMethodParameterMetadata.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/model/ControllerMethodParameterMetadata.js.map +1 -0
- package/lib/cjs/routerExplorer/model/RouterExplorerControllerMetadata.d.ts +9 -0
- package/lib/cjs/routerExplorer/model/RouterExplorerControllerMetadata.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/model/RouterExplorerControllerMetadata.js +4 -0
- package/lib/cjs/routerExplorer/model/RouterExplorerControllerMetadata.js.map +1 -0
- package/lib/cjs/routerExplorer/model/RouterExplorerControllerMethodMetadata.d.ts +20 -0
- package/lib/cjs/routerExplorer/model/RouterExplorerControllerMethodMetadata.d.ts.map +1 -0
- package/lib/cjs/routerExplorer/model/RouterExplorerControllerMethodMetadata.js +3 -0
- package/lib/cjs/routerExplorer/model/RouterExplorerControllerMethodMetadata.js.map +1 -0
- package/lib/esm/index.d.ts +191 -103
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/package.json +24 -23
- package/lib/cjs/http/decorators/ApplyMiddleware.d.ts +0 -2
- package/lib/cjs/http/decorators/ApplyMiddleware.d.ts.map +0 -1
- package/lib/cjs/http/decorators/ApplyMiddleware.js +0 -30
- package/lib/cjs/http/decorators/ApplyMiddleware.js.map +0 -1
- package/lib/cjs/http/decorators/ApplyMiddleware.spec.d.ts +0 -2
- package/lib/cjs/http/decorators/ApplyMiddleware.spec.d.ts.map +0 -1
- package/lib/cjs/http/decorators/RequestMethod.d.ts.map +0 -1
- package/lib/cjs/http/decorators/RequestMethod.js +0 -23
- package/lib/cjs/http/decorators/RequestMethod.js.map +0 -1
- package/lib/cjs/http/decorators/RequestMethod.spec.d.ts +0 -2
- package/lib/cjs/http/decorators/RequestMethod.spec.d.ts.map +0 -1
- package/lib/cjs/http/decorators/RequestParam.d.ts +0 -3
- package/lib/cjs/http/decorators/RequestParam.d.ts.map +0 -1
- package/lib/cjs/http/decorators/RequestParam.js +0 -41
- package/lib/cjs/http/decorators/RequestParam.js.map +0 -1
- package/lib/cjs/http/decorators/RequestParam.spec.d.ts +0 -2
- package/lib/cjs/http/decorators/RequestParam.spec.d.ts.map +0 -1
- package/lib/cjs/http/models/ControllerMetadata.d.ts +0 -6
- package/lib/cjs/http/models/ControllerMetadata.d.ts.map +0 -1
- package/lib/cjs/http/models/ControllerMetadata.js.map +0 -1
- package/lib/cjs/http/models/ControllerMethodMetadata.d.ts.map +0 -1
- package/lib/cjs/http/models/ControllerMethodMetadata.js.map +0 -1
- package/lib/cjs/http/models/ControllerMethodParameterMetadata.d.ts +0 -7
- package/lib/cjs/http/models/ControllerMethodParameterMetadata.d.ts.map +0 -1
- package/lib/cjs/http/models/ControllerMethodParameterMetadata.js.map +0 -1
- package/lib/cjs/http/models/Middleware.d.ts +0 -4
- package/lib/cjs/http/models/Middleware.d.ts.map +0 -1
- package/lib/cjs/http/models/Middleware.js.map +0 -1
- package/lib/cjs/http/responses/HttpResponse.d.ts +0 -11
- package/lib/cjs/http/responses/HttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/HttpResponse.js +0 -21
- package/lib/cjs/http/responses/HttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/HttpStatusCode.d.ts.map +0 -1
- package/lib/cjs/http/responses/HttpStatusCode.js.map +0 -1
- package/lib/cjs/http/responses/error/BadGatewayHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/BadGatewayHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/BadGatewayHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/BadRequestHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/BadRequestHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/BadRequestHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/ConflictHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/ConflictHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/ConflictHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/ErrorHttpResponse.d.ts +0 -6
- package/lib/cjs/http/responses/error/ErrorHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/ErrorHttpResponse.js +0 -11
- package/lib/cjs/http/responses/error/ErrorHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/ForbiddenHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/ForbiddenHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/ForbiddenHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/GatewayTimeoutHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/GatewayTimeoutHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/GatewayTimeoutHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/GoneHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/GoneHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/GoneHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/HttpVersionNotSupportedHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/HttpVersionNotSupportedHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/InsufficientStorageHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/InsufficientStorageHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/InsufficientStorageHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/InternalServerErrorHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/InternalServerErrorHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/InternalServerErrorHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/LoopDetectedHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/LoopDetectedHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/LoopDetectedHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/MethodNotAllowedHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/MethodNotAllowedHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/MethodNotAllowedHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/NotAcceptableHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/NotAcceptableHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/NotAcceptableHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/NotFoundHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/NotFoundHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/NotFoundHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/NotImplementedHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/NotImplementedHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/NotImplementedHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/PaymentRequiredHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/PaymentRequiredHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/PaymentRequiredHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/ServiceUnavailableHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/ServiceUnavailableHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/ServiceUnavailableHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/error/UnauthorizedHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/error/UnauthorizedHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/error/UnauthorizedHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/success/AcceptedHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/success/AcceptedHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/success/AcceptedHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/success/AlreadyReportedHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/success/AlreadyReportedHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/success/AlreadyReportedHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/success/ContentDifferentHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/success/ContentDifferentHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/success/ContentDifferentHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/success/CreatedHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/success/CreatedHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/success/CreatedHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/success/MultiStatusHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/success/MultiStatusHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/success/MultiStatusHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/success/NoContentHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/success/NoContentHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/success/NoContentHttpResponse.js +0 -12
- package/lib/cjs/http/responses/success/NoContentHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/success/NonAuthoritativeInformationHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/success/NonAuthoritativeInformationHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/success/OkHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/success/OkHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/success/OkHttpResponse.js +0 -12
- package/lib/cjs/http/responses/success/OkHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/success/PartialContentHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/success/PartialContentHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/success/PartialContentHttpResponse.js.map +0 -1
- package/lib/cjs/http/responses/success/ResetContentHttpResponse.d.ts +0 -5
- package/lib/cjs/http/responses/success/ResetContentHttpResponse.d.ts.map +0 -1
- package/lib/cjs/http/responses/success/ResetContentHttpResponse.js.map +0 -1
- package/lib/cjs/reflectMetadata/data/controllerMethodMiddlewareMetadataReflectKey.d.ts +0 -2
- package/lib/cjs/reflectMetadata/data/controllerMethodMiddlewareMetadataReflectKey.d.ts.map +0 -1
- package/lib/cjs/reflectMetadata/data/controllerMethodMiddlewareMetadataReflectKey.js +0 -5
- package/lib/cjs/reflectMetadata/data/controllerMethodMiddlewareMetadataReflectKey.js.map +0 -1
- package/lib/cjs/reflectMetadata/data/controllerMiddlewareMetadataReflectKey.d.ts +0 -2
- package/lib/cjs/reflectMetadata/data/controllerMiddlewareMetadataReflectKey.d.ts.map +0 -1
- package/lib/cjs/reflectMetadata/data/controllerMiddlewareMetadataReflectKey.js +0 -5
- package/lib/cjs/reflectMetadata/data/controllerMiddlewareMetadataReflectKey.js.map +0 -1
- /package/lib/cjs/http/{responses → models}/HttpStatusCode.d.ts +0 -0
- /package/lib/cjs/http/{responses → models}/HttpStatusCode.js +0 -0
- /package/lib/cjs/{http/models → routerExplorer/model}/ControllerMetadata.js +0 -0
- /package/lib/cjs/{http/models → routerExplorer/model}/ControllerMethodMetadata.js +0 -0
- /package/lib/cjs/{http/models → routerExplorer/model}/ControllerMethodParameterMetadata.js +0 -0
|
@@ -1,107 +1,249 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InversifyHttpAdapter = void 0;
|
|
4
|
-
const
|
|
4
|
+
const node_stream_1 = require("node:stream");
|
|
5
|
+
const framework_core_1 = require("@inversifyjs/framework-core");
|
|
6
|
+
const logger_1 = require("@inversifyjs/logger");
|
|
7
|
+
const prototype_utils_1 = require("@inversifyjs/prototype-utils");
|
|
5
8
|
const InversifyHttpAdapterError_1 = require("../../error/models/InversifyHttpAdapterError");
|
|
6
9
|
const InversifyHttpAdapterErrorKind_1 = require("../../error/models/InversifyHttpAdapterErrorKind");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
10
|
+
const isHttpResponse_1 = require("../../httpResponse/calculations/isHttpResponse");
|
|
11
|
+
const ErrorHttpResponse_1 = require("../../httpResponse/models/ErrorHttpResponse");
|
|
12
|
+
const ForbiddenHttpResponse_1 = require("../../httpResponse/models/ForbiddenHttpResponse");
|
|
13
|
+
const InternalServerErrorHttpResponse_1 = require("../../httpResponse/models/InternalServerErrorHttpResponse");
|
|
14
|
+
const buildRouterExplorerControllerMetadataList_1 = require("../../routerExplorer/calculations/buildRouterExplorerControllerMetadataList");
|
|
15
|
+
const setErrorFilterToErrorFilterMap_1 = require("../actions/setErrorFilterToErrorFilterMap");
|
|
16
|
+
const buildInterceptedHandler_1 = require("../calculations/buildInterceptedHandler");
|
|
13
17
|
const RequestMethodParameterType_1 = require("../models/RequestMethodParameterType");
|
|
14
|
-
const
|
|
15
|
-
const HttpResponse_1 = require("../responses/HttpResponse");
|
|
18
|
+
const DEFAULT_ERROR_MESSAGE = 'An unexpected error occurred';
|
|
16
19
|
class InversifyHttpAdapter {
|
|
20
|
+
httpAdapterOptions;
|
|
21
|
+
globalHandlers;
|
|
22
|
+
#awaitableRequestMethodParamTypes;
|
|
17
23
|
#container;
|
|
18
|
-
|
|
24
|
+
#errorTypeToGlobalErrorFilterMap;
|
|
25
|
+
#globalGuardList;
|
|
26
|
+
#globalPipeList;
|
|
27
|
+
#logger;
|
|
28
|
+
#postHandlerMiddlewareList;
|
|
29
|
+
#preHandlerMiddlewareList;
|
|
30
|
+
#isBuilt;
|
|
31
|
+
constructor(container, defaultHttpAdapterOptions, httpAdapterOptions, awaitableRequestMethodParamTypes) {
|
|
32
|
+
this.#awaitableRequestMethodParamTypes = new Set(awaitableRequestMethodParamTypes);
|
|
19
33
|
this.#container = container;
|
|
34
|
+
this.httpAdapterOptions = this.#parseHttpAdapterOptions(defaultHttpAdapterOptions, httpAdapterOptions);
|
|
35
|
+
this.#globalGuardList = [];
|
|
36
|
+
this.#globalPipeList = [];
|
|
37
|
+
this.#errorTypeToGlobalErrorFilterMap = new Map();
|
|
38
|
+
this.#logger = this.#buildLogger(this.httpAdapterOptions);
|
|
39
|
+
this.#isBuilt = false;
|
|
40
|
+
this.globalHandlers = {
|
|
41
|
+
interceptorList: [],
|
|
42
|
+
};
|
|
43
|
+
this.#postHandlerMiddlewareList = [];
|
|
44
|
+
this.#preHandlerMiddlewareList = [];
|
|
45
|
+
}
|
|
46
|
+
applyGlobalMiddleware(...middlewareList) {
|
|
47
|
+
if (this.#isBuilt) {
|
|
48
|
+
throw new InversifyHttpAdapterError_1.InversifyHttpAdapterError(InversifyHttpAdapterErrorKind_1.InversifyHttpAdapterErrorKind.invalidOperationAfterBuild, 'Cannot apply global middleware after the server has been built');
|
|
49
|
+
}
|
|
50
|
+
const middlewareOptions = (0, framework_core_1.buildMiddlewareOptionsFromApplyMiddlewareOptions)(middlewareList);
|
|
51
|
+
this.#postHandlerMiddlewareList.push(...middlewareOptions.postHandlerMiddlewareList);
|
|
52
|
+
this.#preHandlerMiddlewareList.push(...middlewareOptions.preHandlerMiddlewareList);
|
|
53
|
+
}
|
|
54
|
+
useGlobalFilters(...errorFilterList) {
|
|
55
|
+
for (const errorFilter of errorFilterList) {
|
|
56
|
+
this.#setGlobalErrorFilter(errorFilter);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
applyGlobalGuards(...guardList) {
|
|
60
|
+
if (this.#isBuilt) {
|
|
61
|
+
throw new InversifyHttpAdapterError_1.InversifyHttpAdapterError(InversifyHttpAdapterErrorKind_1.InversifyHttpAdapterErrorKind.invalidOperationAfterBuild, 'Cannot apply global guard after the server has been built');
|
|
62
|
+
}
|
|
63
|
+
this.#globalGuardList.push(...guardList);
|
|
64
|
+
}
|
|
65
|
+
useGlobalInterceptors(...interceptorList) {
|
|
66
|
+
if (this.#isBuilt) {
|
|
67
|
+
throw new InversifyHttpAdapterError_1.InversifyHttpAdapterError(InversifyHttpAdapterErrorKind_1.InversifyHttpAdapterErrorKind.invalidOperationAfterBuild, 'Cannot apply global interceptor after the server has been built');
|
|
68
|
+
}
|
|
69
|
+
for (const interceptor of interceptorList) {
|
|
70
|
+
this.#setGlobalInterceptor(interceptor);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
useGlobalPipe(...pipeList) {
|
|
74
|
+
this.#globalPipeList.push(...pipeList);
|
|
75
|
+
}
|
|
76
|
+
async _buildServer() {
|
|
77
|
+
await this.#registerControllers();
|
|
78
|
+
this.#isBuilt = true;
|
|
20
79
|
}
|
|
21
|
-
|
|
22
|
-
this.#
|
|
80
|
+
async #appendHandlerParam(params, index, param, type) {
|
|
81
|
+
params[index] = this.#awaitableRequestMethodParamTypes.has(type)
|
|
82
|
+
? await param
|
|
83
|
+
: param;
|
|
23
84
|
}
|
|
24
|
-
#
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
throw new InversifyHttpAdapterError_1.InversifyHttpAdapterError(InversifyHttpAdapterErrorKind_1.InversifyHttpAdapterErrorKind.noControllerFound);
|
|
85
|
+
#buildLogger(httpAdapterOptions) {
|
|
86
|
+
if (typeof httpAdapterOptions.logger === 'boolean') {
|
|
87
|
+
return new logger_1.ConsoleLogger();
|
|
28
88
|
}
|
|
29
|
-
|
|
89
|
+
return httpAdapterOptions.logger;
|
|
30
90
|
}
|
|
31
|
-
#
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
91
|
+
#parseHttpAdapterOptions(defaultHttpAdapterOptions, httpAdapterOptions) {
|
|
92
|
+
return {
|
|
93
|
+
...defaultHttpAdapterOptions,
|
|
94
|
+
...httpAdapterOptions,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
async #registerControllers() {
|
|
98
|
+
const routerExplorerControllerMetadataList = (0, buildRouterExplorerControllerMetadataList_1.buildRouterExplorerControllerMetadataList)(this.#container);
|
|
99
|
+
for (const routerExplorerControllerMetadata of routerExplorerControllerMetadataList) {
|
|
100
|
+
await this._buildRouter({
|
|
101
|
+
path: routerExplorerControllerMetadata.path,
|
|
102
|
+
routeParamsList: this.#builRouteParamdHandlerList(routerExplorerControllerMetadata),
|
|
103
|
+
});
|
|
104
|
+
if (this.httpAdapterOptions.logger !== false) {
|
|
105
|
+
this.#printController(routerExplorerControllerMetadata.target.name, routerExplorerControllerMetadata.path, routerExplorerControllerMetadata.controllerMethodMetadataList);
|
|
38
106
|
}
|
|
39
107
|
}
|
|
40
108
|
}
|
|
41
|
-
#
|
|
42
|
-
return controllerMethodMetadataList.map((
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
109
|
+
#builRouteParamdHandlerList(routerExplorerControllerMetadata) {
|
|
110
|
+
return routerExplorerControllerMetadata.controllerMethodMetadataList.map((routerExplorerControllerMethodMetadata) => ({
|
|
111
|
+
guardList: [
|
|
112
|
+
...this.#getGuardHandlerFromMetadata(this.#globalGuardList, routerExplorerControllerMethodMetadata),
|
|
113
|
+
...this.#getGuardHandlerFromMetadata(routerExplorerControllerMethodMetadata.guardList, routerExplorerControllerMethodMetadata),
|
|
114
|
+
],
|
|
115
|
+
handler: this.#buildHandler(routerExplorerControllerMetadata.serviceIdentifier, routerExplorerControllerMetadata.target, routerExplorerControllerMethodMetadata),
|
|
116
|
+
path: routerExplorerControllerMethodMetadata.path,
|
|
117
|
+
postHandlerMiddlewareList: [
|
|
118
|
+
...this.#getMiddlewareHandlerFromMetadata(routerExplorerControllerMethodMetadata, this.#postHandlerMiddlewareList),
|
|
119
|
+
...this.#getMiddlewareHandlerFromMetadata(routerExplorerControllerMethodMetadata, routerExplorerControllerMethodMetadata.postHandlerMiddlewareList),
|
|
120
|
+
],
|
|
121
|
+
preHandlerMiddlewareList: [
|
|
122
|
+
...this.#getMiddlewareHandlerFromMetadata(routerExplorerControllerMethodMetadata, this.#preHandlerMiddlewareList),
|
|
123
|
+
...this.#getMiddlewareHandlerFromMetadata(routerExplorerControllerMethodMetadata, routerExplorerControllerMethodMetadata.preHandlerMiddlewareList),
|
|
124
|
+
],
|
|
125
|
+
requestMethodType: routerExplorerControllerMethodMetadata.requestMethodType,
|
|
126
|
+
}));
|
|
59
127
|
}
|
|
60
|
-
#buildHandler(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
128
|
+
#buildHandler(serviceIdentifier, targetClass, routerExplorerControllerMethodMetadata) {
|
|
129
|
+
const buildHandlerParams = this.#buildHandlerParams(targetClass, routerExplorerControllerMethodMetadata.methodKey, routerExplorerControllerMethodMetadata.parameterMetadataList);
|
|
130
|
+
let reply;
|
|
131
|
+
if (routerExplorerControllerMethodMetadata.useNativeHandler) {
|
|
132
|
+
reply = (_req, _res, value) => value;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
reply = (req, res, value) => this.#reply(req, res, value, routerExplorerControllerMethodMetadata.statusCode);
|
|
136
|
+
}
|
|
137
|
+
const handleError = this.#buildHandleError(routerExplorerControllerMethodMetadata);
|
|
138
|
+
return (0, buildInterceptedHandler_1.buildInterceptedHandler)(serviceIdentifier, routerExplorerControllerMethodMetadata, this.#container, buildHandlerParams, handleError, reply, this.#setHeaders.bind(this));
|
|
139
|
+
}
|
|
140
|
+
#buildHandlerParams(targetClass, controllerMethodKey, controllerMethodParameterMetadataList) {
|
|
141
|
+
const paramBuilders = controllerMethodParameterMetadataList.map((controllerMethodParameterMetadata) => {
|
|
142
|
+
if (controllerMethodParameterMetadata === undefined) {
|
|
143
|
+
return undefined;
|
|
66
144
|
}
|
|
67
|
-
|
|
68
|
-
|
|
145
|
+
switch (controllerMethodParameterMetadata.parameterType) {
|
|
146
|
+
case RequestMethodParameterType_1.RequestMethodParameterType.Body:
|
|
147
|
+
return (request) => this._getBody(request, controllerMethodParameterMetadata.parameterName);
|
|
148
|
+
case RequestMethodParameterType_1.RequestMethodParameterType.Cookies:
|
|
149
|
+
return (request, response) => this._getCookies(request, response, controllerMethodParameterMetadata.parameterName);
|
|
150
|
+
case RequestMethodParameterType_1.RequestMethodParameterType.Custom:
|
|
151
|
+
return (request, response) => controllerMethodParameterMetadata.customParameterDecoratorHandler?.(request, response);
|
|
152
|
+
case RequestMethodParameterType_1.RequestMethodParameterType.Headers:
|
|
153
|
+
return (request) => this._getHeaders(request, controllerMethodParameterMetadata.parameterName);
|
|
154
|
+
case RequestMethodParameterType_1.RequestMethodParameterType.Next:
|
|
155
|
+
return (_request, _response, next) => next;
|
|
156
|
+
case RequestMethodParameterType_1.RequestMethodParameterType.Params:
|
|
157
|
+
return (request) => this._getParams(request, controllerMethodParameterMetadata.parameterName);
|
|
158
|
+
case RequestMethodParameterType_1.RequestMethodParameterType.Query:
|
|
159
|
+
return (request) => this._getQuery(request, controllerMethodParameterMetadata.parameterName);
|
|
160
|
+
case RequestMethodParameterType_1.RequestMethodParameterType.Request:
|
|
161
|
+
return (request) => request;
|
|
162
|
+
case RequestMethodParameterType_1.RequestMethodParameterType.Response:
|
|
163
|
+
return (_request, response) => response;
|
|
69
164
|
}
|
|
165
|
+
});
|
|
166
|
+
return async (request, response, next) => {
|
|
167
|
+
const params = new Array(controllerMethodParameterMetadataList.length);
|
|
168
|
+
await Promise.all(paramBuilders.map(async (paramBuilder, index) => {
|
|
169
|
+
const controllerMethodParameterMetadata = controllerMethodParameterMetadataList[index];
|
|
170
|
+
await this.#appendHandlerParam(params, index, paramBuilder(request, response, next), controllerMethodParameterMetadata.parameterType);
|
|
171
|
+
await this.#applyPipeList(params, [
|
|
172
|
+
...this.#globalPipeList,
|
|
173
|
+
...controllerMethodParameterMetadata.pipeList,
|
|
174
|
+
], {
|
|
175
|
+
methodName: controllerMethodKey,
|
|
176
|
+
parameterIndex: index,
|
|
177
|
+
targetClass,
|
|
178
|
+
});
|
|
179
|
+
}));
|
|
180
|
+
return params;
|
|
70
181
|
};
|
|
71
182
|
}
|
|
72
|
-
#
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return this._getQuery(request, controllerMethodParameterMetadata.parameterName);
|
|
88
|
-
}
|
|
89
|
-
case RequestMethodParameterType_1.RequestMethodParameterType.HEADERS: {
|
|
90
|
-
return this._getHeaders(request, controllerMethodParameterMetadata.parameterName);
|
|
183
|
+
async #applyPipeList(params, pipeList, pipeMetadata) {
|
|
184
|
+
for (const pipeOrServiceIdentifier of pipeList) {
|
|
185
|
+
const pipe = (0, framework_core_1.isPipe)(pipeOrServiceIdentifier)
|
|
186
|
+
? pipeOrServiceIdentifier
|
|
187
|
+
: await this.#container.getAsync(pipeOrServiceIdentifier);
|
|
188
|
+
params[pipeMetadata.parameterIndex] = await pipe.execute(params[pipeMetadata.parameterIndex], pipeMetadata);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async #getErrorFilterForError(error, errorToFilterMap) {
|
|
192
|
+
if (error instanceof Error) {
|
|
193
|
+
let currentErrorType = error.constructor;
|
|
194
|
+
while (currentErrorType !== Error) {
|
|
195
|
+
const errorFilterType = errorToFilterMap.get(currentErrorType);
|
|
196
|
+
if (errorFilterType !== undefined) {
|
|
197
|
+
return this.#container.getAsync(errorFilterType);
|
|
91
198
|
}
|
|
92
|
-
|
|
93
|
-
|
|
199
|
+
currentErrorType = (0, prototype_utils_1.getBaseType)(currentErrorType);
|
|
200
|
+
}
|
|
201
|
+
const errorFilterType = errorToFilterMap.get(currentErrorType);
|
|
202
|
+
if (errorFilterType !== undefined) {
|
|
203
|
+
return this.#container.getAsync(errorFilterType);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const errorFilterType = errorToFilterMap.get(null);
|
|
207
|
+
if (errorFilterType !== undefined) {
|
|
208
|
+
return this.#container.getAsync(errorFilterType);
|
|
209
|
+
}
|
|
210
|
+
return undefined;
|
|
211
|
+
}
|
|
212
|
+
#buildHandleError(routerExplorerControllerMethodMetadata) {
|
|
213
|
+
const handleError = async (request, response, error) => {
|
|
214
|
+
const errorFilter = (await this.#getErrorFilterForError(error, routerExplorerControllerMethodMetadata.errorTypeToErrorFilterMap)) ??
|
|
215
|
+
(await this.#getErrorFilterForError(error, this.#errorTypeToGlobalErrorFilterMap));
|
|
216
|
+
if (errorFilter === undefined) {
|
|
217
|
+
let httpResponse = undefined;
|
|
218
|
+
if (ErrorHttpResponse_1.ErrorHttpResponse.is(error)) {
|
|
219
|
+
httpResponse = error;
|
|
94
220
|
}
|
|
95
|
-
|
|
96
|
-
|
|
221
|
+
else {
|
|
222
|
+
this.#printError(error);
|
|
223
|
+
httpResponse = new InternalServerErrorHttpResponse_1.InternalServerErrorHttpResponse(undefined, undefined, {
|
|
224
|
+
cause: error,
|
|
225
|
+
});
|
|
97
226
|
}
|
|
227
|
+
return this.#reply(request, response, httpResponse);
|
|
98
228
|
}
|
|
99
|
-
|
|
229
|
+
try {
|
|
230
|
+
return await errorFilter.catch(error, request, response);
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
return handleError(request, response, error);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
return handleError;
|
|
237
|
+
}
|
|
238
|
+
#setHeaders(request, response, headerList) {
|
|
239
|
+
for (const [key, value] of headerList) {
|
|
240
|
+
this._setHeader(request, response, key, value);
|
|
241
|
+
}
|
|
100
242
|
}
|
|
101
243
|
#reply(request, response, value, statusCode) {
|
|
102
244
|
let body = undefined;
|
|
103
245
|
let httpStatusCode = statusCode;
|
|
104
|
-
if (
|
|
246
|
+
if ((0, isHttpResponse_1.isHttpResponse)(value)) {
|
|
105
247
|
body = value.body;
|
|
106
248
|
httpStatusCode = value.statusCode;
|
|
107
249
|
}
|
|
@@ -115,21 +257,68 @@ class InversifyHttpAdapter {
|
|
|
115
257
|
return this._replyText(request, response, body);
|
|
116
258
|
}
|
|
117
259
|
else if (body === undefined || typeof body === 'object') {
|
|
118
|
-
|
|
260
|
+
if (body instanceof node_stream_1.Readable) {
|
|
261
|
+
return this._replyStream(request, response, body);
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
return this._replyJson(request, response, body);
|
|
265
|
+
}
|
|
119
266
|
}
|
|
120
267
|
else {
|
|
121
268
|
return this._replyText(request, response, JSON.stringify(body));
|
|
122
269
|
}
|
|
123
270
|
}
|
|
124
|
-
#getMiddlewareHandlerFromMetadata(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
271
|
+
#getMiddlewareHandlerFromMetadata(routerExplorerControllerMethodMetadata, middlewareServiceIdentifierList) {
|
|
272
|
+
const handleError = this.#buildHandleError(routerExplorerControllerMethodMetadata);
|
|
273
|
+
return middlewareServiceIdentifierList.map((middlewareServiceIdentifier) => {
|
|
274
|
+
return async (request, response, next) => {
|
|
275
|
+
try {
|
|
276
|
+
const middleware = await this.#container.getAsync(middlewareServiceIdentifier);
|
|
277
|
+
return await middleware.execute(request, response, next);
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
return handleError(request, response, error);
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
#getGuardHandlerFromMetadata(guardServiceIdentifierList, routerExplorerControllerMethodMetadata) {
|
|
286
|
+
const handleError = this.#buildHandleError(routerExplorerControllerMethodMetadata);
|
|
287
|
+
return guardServiceIdentifierList.map((guardServiceIdentifier) => {
|
|
288
|
+
return async (request, response, next) => {
|
|
289
|
+
try {
|
|
290
|
+
const guard = await this.#container.getAsync(guardServiceIdentifier);
|
|
291
|
+
const isAllowed = await guard.activate(request);
|
|
292
|
+
if (isAllowed) {
|
|
293
|
+
await next();
|
|
294
|
+
return undefined;
|
|
295
|
+
}
|
|
296
|
+
return this.#reply(request, response, new ForbiddenHttpResponse_1.ForbiddenHttpResponse());
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
return handleError(request, response, error);
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
#printController(controllerName, path, routerExplorerControllerMethodMetadataList) {
|
|
305
|
+
this.#logger.info(`${controllerName} {${path}}:`);
|
|
306
|
+
for (const controllerMethodMetadata of routerExplorerControllerMethodMetadataList) {
|
|
307
|
+
this.#logger.info(` - .${controllerMethodMetadata.methodKey}() mapped {${controllerMethodMetadata.path}, ${controllerMethodMetadata.requestMethodType}}`);
|
|
131
308
|
}
|
|
132
|
-
|
|
309
|
+
}
|
|
310
|
+
#printError(error) {
|
|
311
|
+
const errorMessage = DEFAULT_ERROR_MESSAGE;
|
|
312
|
+
if (error instanceof Error) {
|
|
313
|
+
this.#logger.error(error.stack ?? error.message);
|
|
314
|
+
}
|
|
315
|
+
this.#logger.error(errorMessage);
|
|
316
|
+
}
|
|
317
|
+
#setGlobalErrorFilter(errorFilter) {
|
|
318
|
+
(0, setErrorFilterToErrorFilterMap_1.setErrorFilterToErrorFilterMap)(this.#errorTypeToGlobalErrorFilterMap, errorFilter);
|
|
319
|
+
}
|
|
320
|
+
#setGlobalInterceptor(interceptor) {
|
|
321
|
+
this.globalHandlers.interceptorList.push(this.#container.get(interceptor));
|
|
133
322
|
}
|
|
134
323
|
}
|
|
135
324
|
exports.InversifyHttpAdapter = InversifyHttpAdapter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InversifyHttpAdapter.js","sourceRoot":"","sources":["../../../../src/http/adapter/InversifyHttpAdapter.ts"],"names":[],"mappings":";;;AAAA,gFAAyE;AAGzE,4FAAyF;AACzF,oGAAiG;AACjG,0GAAuG;AACvG,sHAAmH;AACnH,0IAAuI;AACvI,wIAAqI;AACrI,0IAAuI;AACvI,8HAA2H;AAS3H,qFAAkF;AAElF,wGAAqG;AACrG,4DAAyD;AAGzD,MAAsB,oBAAoB;IAK/B,UAAU,CAAY;IAE/B,YAAY,SAAoB;QAC9B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAES,YAAY;QACpB,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED,oBAAoB;QAClB,MAAM,sBAAsB,GAC1B,IAAA,2CAAkB,EAAC,OAAO,EAAE,2DAA4B,CAAC,CAAC;QAE5D,IAAI,sBAAsB,KAAK,SAAS,EAAE,CAAC;YACzC,MAAM,IAAI,qDAAyB,CACjC,6DAA6B,CAAC,iBAAiB,CAChD,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;IAC9C,CAAC;IAED,cAAc,CAAC,sBAA4C;QACzD,KAAK,MAAM,kBAAkB,IAAI,sBAAsB,EAAE,CAAC;YACxD,MAAM,4BAA4B,GAElB,IAAA,2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4xBC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Container, ServiceIdentifier } from 'inversify';
|
|
2
|
+
import { RouterExplorerControllerMethodMetadata } from '../../routerExplorer/model/RouterExplorerControllerMethodMetadata';
|
|
3
|
+
import { Controller } from '../models/Controller';
|
|
4
|
+
import { ControllerResponse } from '../models/ControllerResponse';
|
|
5
|
+
import { RequestHandler } from '../models/RequestHandler';
|
|
6
|
+
export declare function buildInterceptedHandler<TRequest, TResponse, TNextFunction extends (err?: any) => Promise<void> | void, TResult>(serviceIdentifier: ServiceIdentifier<Controller>, routerExplorerControllerMethodMetadata: RouterExplorerControllerMethodMetadata<TRequest, TResponse, unknown>, container: Container, buildHandlerParams: (request: TRequest, response: TResponse, next: TNextFunction) => Promise<unknown[]>, handleError: (request: TRequest, response: TResponse, error: unknown) => Promise<TResult>, reply: (req: TRequest, res: TResponse, value: ControllerResponse) => TResult, setHeaders: (request: TRequest, response: TResponse, headerList: [string, string][]) => void): RequestHandler<TRequest, TResponse, TNextFunction, TResult>;
|
|
7
|
+
//# sourceMappingURL=buildInterceptedHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildInterceptedHandler.d.ts","sourceRoot":"","sources":["../../../../src/http/calculations/buildInterceptedHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,sCAAsC,EAAE,MAAM,mEAAmE,CAAC;AAC3H,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,wBAAgB,uBAAuB,CACrC,QAAQ,EACR,SAAS,EAET,aAAa,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,EACzD,OAAO,EAEP,iBAAiB,EAAE,iBAAiB,CAAC,UAAU,CAAC,EAChD,sCAAsC,EAAE,sCAAsC,CAC5E,QAAQ,EACR,SAAS,EACT,OAAO,CACR,EACD,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,CAClB,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,SAAS,EACnB,IAAI,EAAE,aAAa,KAChB,OAAO,CAAC,OAAO,EAAE,CAAC,EACvB,WAAW,EAAE,CACX,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,OAAO,KACX,OAAO,CAAC,OAAO,CAAC,EACrB,KAAK,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,KAAK,OAAO,EAC5E,UAAU,EAAE,CACV,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,SAAS,EACnB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAC3B,IAAI,GACR,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,CAAC,CA+G7D"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildInterceptedHandler = buildInterceptedHandler;
|
|
4
|
+
function buildInterceptedHandler(serviceIdentifier, routerExplorerControllerMethodMetadata, container, buildHandlerParams, handleError, reply, setHeaders) {
|
|
5
|
+
if (routerExplorerControllerMethodMetadata.interceptorList.length === 0) {
|
|
6
|
+
return async (request, response, next) => {
|
|
7
|
+
try {
|
|
8
|
+
const controller = await container.getAsync(serviceIdentifier);
|
|
9
|
+
const handlerParams = await buildHandlerParams(request, response, next);
|
|
10
|
+
setHeaders(request, response, routerExplorerControllerMethodMetadata.headerMetadataList);
|
|
11
|
+
const value = await controller[routerExplorerControllerMethodMetadata.methodKey]?.(...handlerParams);
|
|
12
|
+
return reply(request, response, value);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
return handleError(request, response, error);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return async (request, response, next) => {
|
|
20
|
+
const transforms = [];
|
|
21
|
+
const transformObject = {
|
|
22
|
+
push: (transform) => {
|
|
23
|
+
transforms.push(transform);
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
let handlerResult;
|
|
27
|
+
const nextFunction = (index) => {
|
|
28
|
+
if (index < routerExplorerControllerMethodMetadata.interceptorList.length) {
|
|
29
|
+
return async () => {
|
|
30
|
+
const interceptor = await container.getAsync(routerExplorerControllerMethodMetadata.interceptorList[index]);
|
|
31
|
+
await interceptor.intercept(request, response, nextFunction(index + 1));
|
|
32
|
+
return transformObject;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return async () => {
|
|
37
|
+
const controller = await container.getAsync(serviceIdentifier);
|
|
38
|
+
const handlerParams = await buildHandlerParams(request, response, next);
|
|
39
|
+
setHeaders(request, response, routerExplorerControllerMethodMetadata.headerMetadataList);
|
|
40
|
+
handlerResult = await controller[routerExplorerControllerMethodMetadata.methodKey]?.(...handlerParams);
|
|
41
|
+
return transformObject;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
try {
|
|
46
|
+
await nextFunction(0)();
|
|
47
|
+
for (const transform of transforms) {
|
|
48
|
+
handlerResult = (await transform(handlerResult));
|
|
49
|
+
}
|
|
50
|
+
return reply(request, response, handlerResult);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
return handleError(request, response, error);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=buildInterceptedHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildInterceptedHandler.js","sourceRoot":"","sources":["../../../../src/http/calculations/buildInter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+1 @@
|
|
|
1
|
+
{"version":3,"file":"buildInterceptedHandler.spec.d.ts","sourceRoot":"","sources":["../../../../src/http/calculations/buildInterceptedHandler.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildNormalizedPath.d.ts","sourceRoot":"","sources":["../../../../src/http/calculations/buildNormalizedPath.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildNormalizedPath = buildNormalizedPath;
|
|
4
|
+
function buildNormalizedPath(path) {
|
|
5
|
+
const segments = path
|
|
6
|
+
.split('/')
|
|
7
|
+
.filter((segment) => segment.length > 0);
|
|
8
|
+
return '/' + segments.join('/');
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=buildNormalizedPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildNormalizedPath.js","sourceRoot":"","sources":["../../../../src/http/calculations/buildNormalizedPath.ts"],"names":[],"mappings":";;AAAA,kDAMC;AAND,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,MAAM,QAAQ,GAAa,IAAI;SAC5B,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEnD,OAAO,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildNormalizedPath.spec.d.ts","sourceRoot":"","sources":["../../../../src/http/calculations/buildNormalizedPath.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Pipe } from '@inversifyjs/framework-core';
|
|
2
|
+
import { ServiceIdentifier } from 'inversify';
|
|
3
|
+
import { CustomParameterDecoratorHandler } from '../models/CustomParameterDecoratorHandler';
|
|
4
|
+
import { RequestMethodParameterType } from '../models/RequestMethodParameterType';
|
|
5
|
+
import { RouteParamOptions } from '../models/RouteParamOptions';
|
|
6
|
+
export declare function buildRouteParameterDecorator(parameterType: RequestMethodParameterType, parameterPipeList: (ServiceIdentifier<Pipe> | Pipe)[], parameterNameOrPipe?: RouteParamOptions | (ServiceIdentifier<Pipe> | Pipe), customParameterDecoratorHandler?: CustomParameterDecoratorHandler): ParameterDecorator;
|
|
7
|
+
//# sourceMappingURL=buildRouteParameterDecorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildRouteParameterDecorator.d.ts","sourceRoot":"","sources":["../../../../src/http/calculations/buildRouteParameterDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGhE,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,0BAA0B,EACzC,iBAAiB,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,EACrD,mBAAmB,CAAC,EAAE,iBAAiB,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,EAC1E,+BAA+B,CAAC,EAAE,+BAA+B,GAChE,kBAAkB,CA2BpB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildRouteParameterDecorator = buildRouteParameterDecorator;
|
|
4
|
+
const framework_core_1 = require("@inversifyjs/framework-core");
|
|
5
|
+
const requestParam_1 = require("./requestParam");
|
|
6
|
+
function buildRouteParameterDecorator(parameterType, parameterPipeList, parameterNameOrPipe, customParameterDecoratorHandler) {
|
|
7
|
+
let parameterName = undefined;
|
|
8
|
+
const pipeList = [];
|
|
9
|
+
if (parameterNameOrPipe !== undefined) {
|
|
10
|
+
if (typeof parameterNameOrPipe === 'object' &&
|
|
11
|
+
!(0, framework_core_1.isPipe)(parameterNameOrPipe)) {
|
|
12
|
+
parameterName = parameterNameOrPipe.name;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
pipeList.push(parameterNameOrPipe);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (parameterPipeList.length > 0) {
|
|
19
|
+
pipeList.push(...parameterPipeList);
|
|
20
|
+
}
|
|
21
|
+
const controllerMethodParameterMetadata = {
|
|
22
|
+
customParameterDecoratorHandler,
|
|
23
|
+
parameterName,
|
|
24
|
+
parameterType,
|
|
25
|
+
pipeList,
|
|
26
|
+
};
|
|
27
|
+
return (0, requestParam_1.requestParam)(controllerMethodParameterMetadata);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=buildRouteParameterDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildRouteParameterDecorator.js","sourceRoot":"","sources":["../../../../src/http/calculations/buildRouteParameterDecorator.ts"],"names":[],"mappings":";;AASA,oEAgCC;AAzCD,gEAA2D;AAO3D,iDAA8C;AAE9C,SAAgB,4BAA4B,CAC1C,aAAyC,EACzC,iBAAqD,EACrD,mBAA0E,EAC1E,+BAAiE;IAEjE,IAAI,aAAa,GAAuB,SAAS,CAAC;IAClD,MAAM,QAAQ,GAAuC,EAAE,CAAC;IAExD,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACtC,IACE,OAAO,mBAAmB,KAAK,QAAQ;YACvC,CAAC,IAAA,uBAAM,EAAC,mBAAmB,CAAC,EAC5B,CAAC;YACD,aAAa,GAAG,mBAAmB,CAAC,IAAI,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,QAAQ,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,iCAAiC,GAAsC;QAC3E,+BAA+B;QAC/B,aAAa;QACb,aAAa;QACb,QAAQ;KACT,CAAC;IAEF,OAAO,IAAA,2BAAY,EAAC,iCAAiC,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildRouteParameterDecorator.spec.d.ts","sourceRoot":"","sources":["../../../../src/http/calculations/buildRouteParameterDecorator.spec.ts"],"names":[],"mappings":""}
|