Logos DX
    Preparing search index...

    Interface InternalReqOptions<H, P, S>

    Internal normalized request options - flat structure used throughout FetchEngine.

    This is the single source of truth for all request data, flowing to:

    • Cache/dedupe serializers (satisfies RequestKeyOptions)
    • Event data (spread directly into events)
    • Request execution (attemptCall → makeCall)

    Extends native RequestInit (minus headers/signal/body/method which we handle) to support instance-level defaults for credentials, mode, cache, etc.

    interface InternalReqOptions<H = unknown, P = unknown, S = unknown> {
        attempt?: number;
        attemptTimeout?: number;
        body?: BodyInit;
        cache?: RequestCache;
        controller: AbortController;
        credentials?: RequestCredentials;
        determineType?: (
            response: Response,
        ) => { isJson: boolean; type: "arrayBuffer" | "blob" | "json" | "text" };
        getDirective?: () => ResponseDirective | undefined;
        getTotalTimeoutFired?: () => boolean;
        headers: DictAndT<H>;
        integrity?: string;
        keepalive?: boolean;
        method: string;
        mode?: RequestMode;
        onAfterRequest?: (
            response: Response,
            opts: unknown,
        ) => void | Promise<void>;
        onBeforeRequest?: (opts: unknown) => void | Promise<void>;
        onError?: (error: Error) => void;
        params: DictAndT<P>;
        path: string;
        payload?: unknown;
        priority?: RequestPriority;
        redirect?: RequestRedirect;
        referrer?: string;
        referrerPolicy?: ReferrerPolicy;
        requestId?: string;
        requestStart?: number;
        retry?: RetryConfig;
        signal: AbortSignal;
        state: S;
        timeout?: number;
        url: URL;
        window?: null;
    }

    Type Parameters

    • H = unknown

      Headers type

    • P = unknown

      Params type

    • S = unknown

      State type

    Hierarchy (View Summary)

    • Omit<RequestInit, "headers" | "signal" | "body" | "method">
      • InternalReqOptions
    Index

    Properties

    attempt?: number

    Current attempt number (1-based)

    attemptTimeout?: number

    Per-attempt timeout (ms)

    body?: BodyInit

    Serialized request body

    cache?: RequestCache

    A string indicating how the request will interact with the browser's cache to set request's cache.

    controller: AbortController

    AbortController (for child signals in retry)

    credentials?: RequestCredentials

    A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.

    determineType?: (
        response: Response,
    ) => { isJson: boolean; type: "arrayBuffer" | "blob" | "json" | "text" }

    Response type determination function

    getDirective?: () => ResponseDirective | undefined

    Returns the active response directive from FetchPromise

    getTotalTimeoutFired?: () => boolean

    Function to check if total timeout has fired

    headers: DictAndT<H>

    Merged headers (instance + method + request)

    integrity?: string

    A cryptographic hash of the resource to be fetched by request. Sets request's integrity.

    keepalive?: boolean

    A boolean to set request's keepalive.

    method: string

    HTTP method (uppercase)

    A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.

    onAfterRequest?: (response: Response, opts: unknown) => void | Promise<void>

    Called after request (before parse)

    onBeforeRequest?: (opts: unknown) => void | Promise<void>

    Called before request

    onError?: (error: Error) => void

    Called on error

    params: DictAndT<P>

    URL parameters as flat object (from url.searchParams)

    path: string

    Original request path

    payload?: unknown

    Request payload/body

    priority?: RequestPriority
    redirect?: RequestRedirect

    A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.

    referrer?: string

    A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer.

    referrerPolicy?: ReferrerPolicy

    A referrer policy to set request's referrerPolicy.

    requestId?: string

    Unique ID for this request, flows through all events

    requestStart?: number

    Timestamp (ms) when the request entered the execution pipeline

    retry?: RetryConfig

    Retry configuration (true normalized to {})

    signal: AbortSignal

    AbortSignal for cancellation

    state: S

    Instance state

    timeout?: number

    Request timeout (ms) - deprecated, use totalTimeout

    url: URL

    Fully constructed URL

    window?: null

    Can only be null. Used to disassociate request from any Window.