AniLink - v2.0.0
    Preparing search index...

    Interface MalRequestOptions

    MalRequestOptions is the public request options shared by MAL endpoint methods.

    It extends RequestOptions with the MyAnimeList fields selector consumed by MalAnimeOperation.get and MalUserOperation.me through MyAnimeListApi. Transport settings are merged over the instance defaults from MalCredentials via buildMyAnimeListApi.

    interface MalRequestOptions {
        circuitBreaker?: { cooldownMs: number; threshold: number };
        exposeRawAxiosError?: boolean;
        fields?: string | readonly string[];
        onError?: OnErrorHandler;
        onRequestStart?: OnRequestStartHandler;
        onResponse?: OnResponseHandler;
        onRetry?: OnErrorHandler;
        paceWithRateLimit?: boolean;
        rateLimitFloor?: number;
        retry?: boolean | Partial<RetryPolicy>;
        signal?: AbortSignal;
        timeout?: number;
    }

    Hierarchy (View Summary)

    Index
    circuitBreaker?: { cooldownMs: number; threshold: number }

    Opt into a per-client circuit breaker for sustained upstream outages: after threshold consecutive failed attempts, further requests fail fast with a CIRCUIT_OPEN_ERROR network error until cooldownMs has elapsed since the last failure, after which the next request is allowed through as a probe. Off by default; when unset, no failure accounting happens across requests.

    exposeRawAxiosError?: boolean

    Attach the original Axios error to thrown errors as rawAxiosError (and cause) for local debugging. Defaults to false because raw errors can contain request configuration and bearer-token headers.

    fields?: string | readonly string[]

    A comma-separated field selector, or the same selector as an array.

    onError?: OnErrorHandler

    Invoked when an attempt fails, and once more when retries are exhausted.

    onRequestStart?: OnRequestStartHandler

    Invoked just before each attempt is sent.

    onResponse?: OnResponseHandler

    Invoked after each attempt completes with the elapsed durationMs.

    onRetry?: OnErrorHandler

    Invoked before each retry wait with the scheduled delay in nextDelayMs. Falls back to per-attempt onError calls when unset.

    paceWithRateLimit?: boolean

    Opt into proactive request pacing driven by the x-ratelimit-* headers of every successful response: when the reported remaining quota drops below rateLimitFloor (default 1), the next attempt waits until the window resets instead of discovering the limit via a 429. Off by default.

    rateLimitFloor?: number

    Remaining-quota threshold below which RequestOptions.paceWithRateLimit delays the next request until the window resets. Defaults to 1.

    retry?: boolean | Partial<RetryPolicy>

    Automatic retries for transient failures. Defaults to the built-in policy (maxRetries: 3, jittered exponential backoff over HTTP 429 and 5xx responses plus network and timeout errors). Pass false to opt out and send every request exactly once, or pass a partial policy to tune individual knobs on top of the defaults.

    signal?: AbortSignal

    Signal used to cancel in-flight requests.

    timeout?: number

    Milliseconds before a request is aborted. 0 disables the Axios timeout. Defaults to DEFAULT_REQUEST_TIMEOUT; timeout errors carry the effective duration as AniLinkNetworkError.timeoutMs.