AniLink - v3.0.0
    Preparing search index...

    Function sendRequest

    • Sends a request to the specified URL through the ordered transport pipeline.

      GraphQL callers get envelope unwrapping by leaving protocol unset (or "graphql"); REST callers pass protocol: "rest" and receive the parsed body verbatim. REST HTTP failures return as AniLinkRestError; GraphQL HTTP failures return as AniLinkApiError.

      Type Parameters

      • T = unknown

        The expected response payload type.

      Parameters

      • url: string

        The URL to send the request to.

      • method: HttpMethod

        The HTTP method to use (GET, POST, PUT, or DELETE).

      • Optionaldata: string | object

        The data to send with the request, when present.

      • Optionalauth: RequestAuthInput

        The authentication material to include in the request headers. A string is treated as a bearer token for backwards compatibility.

      • OptionalsendOptions: SendRequestOptions

        Named trailing options; see SendRequestOptions.

      Returns Promise<T>

      The unwrapped response data. For documents with a single root field this is the bare field value; multi-root-field or zero-root-field documents return the full { data } envelope. With protocol: "rest", the parsed response body is returned as-is.

      AniLinkAuthError when authentication is required but no auth material is configured.

      AniLinkApiError for an upstream HTTP failure.

      AniLinkGraphQLError for GraphQL errors in an HTTP 200 envelope.

      AniLinkNetworkError for network, timeout, cancellation, or circuit-breaker failures.