rest-vir - v1.0.0
    Preparing search index...

    Function handleSearchParams

    • Handles a request's search params and compares it against the route's required search params shape, if it has any.

      Parameters

      • __namedParameters: Readonly<
            {
                request: Readonly<Pick<ServerRequest, "originalUrl">>;
                route: Readonly<
                    SelectFrom<
                        ImplementedEndpoint
                        | ImplementedWebSocket,
                        {
                            isEndpoint: true;
                            isWebSocket: true;
                            path: true;
                            searchParamsShape: true;
                            service: { logger: true; serviceName: true };
                        },
                    >,
                >;
            },
        >

      Returns
          | {
              body?: string;
              statusCode: | BadRequest
              | Unauthorized
              | PaymentRequired
              | Forbidden
              | NotFound
              | MethodNotAllowed
              | NotAcceptable
              | ProxyAuthenticationRequired
              | RequestTimeout
              | Conflict
              | Gone
              | LengthRequired
              | PreconditionFailed
              | PayloadTooLarge
              | UriTooLong
              | UnsupportedMediaType
              | RangeNotSatisfiable
              | ExpectationFailed
              | ImATeapot
              | MisdirectedRequest
              | UnprocessableContent
              | Locked
              | FailedDependency
              | TooEarly
              | UpgradeRequired
              | PreconditionRequired
              | TooManyRequests
              | RequestHeaderFieldsTooLarge
              | UnavailableForLegalReasons
              | InternalServerError
              | NotImplemented
              | BadGateway
              | ServiceUnavailable
              | GatewayTimeout
              | HttpVersionNotSupported
              | VariantAlsoNegotiates
              | InsufficientStorage
              | LoopDetected
              | NotExtended
              | NetworkAuthenticationRequired;
          }
          | { data: BaseSearchParams }

      • {
            body?: string;
            statusCode:
                | BadRequest
                | Unauthorized
                | PaymentRequired
                | Forbidden
                | NotFound
                | MethodNotAllowed
                | NotAcceptable
                | ProxyAuthenticationRequired
                | RequestTimeout
                | Conflict
                | Gone
                | LengthRequired
                | PreconditionFailed
                | PayloadTooLarge
                | UriTooLong
                | UnsupportedMediaType
                | RangeNotSatisfiable
                | ExpectationFailed
                | ImATeapot
                | MisdirectedRequest
                | UnprocessableContent
                | Locked
                | FailedDependency
                | TooEarly
                | UpgradeRequired
                | PreconditionRequired
                | TooManyRequests
                | RequestHeaderFieldsTooLarge
                | UnavailableForLegalReasons
                | InternalServerError
                | NotImplemented
                | BadGateway
                | ServiceUnavailable
                | GatewayTimeout
                | HttpVersionNotSupported
                | VariantAlsoNegotiates
                | InsufficientStorage
                | LoopDetected
                | NotExtended
                | NetworkAuthenticationRequired;
        }
        • Optionalbody?: string
        • statusCode:
              | BadRequest
              | Unauthorized
              | PaymentRequired
              | Forbidden
              | NotFound
              | MethodNotAllowed
              | NotAcceptable
              | ProxyAuthenticationRequired
              | RequestTimeout
              | Conflict
              | Gone
              | LengthRequired
              | PreconditionFailed
              | PayloadTooLarge
              | UriTooLong
              | UnsupportedMediaType
              | RangeNotSatisfiable
              | ExpectationFailed
              | ImATeapot
              | MisdirectedRequest
              | UnprocessableContent
              | Locked
              | FailedDependency
              | TooEarly
              | UpgradeRequired
              | PreconditionRequired
              | TooManyRequests
              | RequestHeaderFieldsTooLarge
              | UnavailableForLegalReasons
              | InternalServerError
              | NotImplemented
              | BadGateway
              | ServiceUnavailable
              | GatewayTimeout
              | HttpVersionNotSupported
              | VariantAlsoNegotiates
              | InsufficientStorage
              | LoopDetected
              | NotExtended
              | NetworkAuthenticationRequired

          If this is set, then the response is sent with this status code and the given body (if any).

      • { data: BaseSearchParams }