@maschinenlesbar.org/oparl-cli
    Preparing search index...

    Interface OparlClientOptions

    interface OparlClientOptions {
        curatedEndpoints?: readonly CuratedEndpoint[];
        defaultHeaders?: Record<string, string>;
        maxRedirects?: number;
        maxResponseBytes?: number;
        maxRetries?: number;
        onRetry?: (event: RetryEvent) => void;
        registryChecks?: readonly RegistryCheck[];
        registryUrl?: string;
        retryDelayMs?: number;
        sleep?: (ms: number) => Promise<void>;
        timeoutMs?: number;
        transport?: Transport;
        userAgent?: string;
    }

    Hierarchy (View Summary)

    Index
    curatedEndpoints?: readonly CuratedEndpoint[]

    Endpoints the registry lacks. Defaults to the list shipped with this package.

    defaultHeaders?: Record<string, string>

    Extra headers sent on every request. The values of credential headers (Authorization, Proxy-Authorization, X-API-Key, Cookie) are kept out of logged clients and errors, and go only to the origin of the URL a request starts at (see fetchJson).

    maxRedirects?: number

    Redirects (301/302/303/307/308) followed per request, same host only. Defaults to 3; 0 disables; at most MAX_REDIRECTS. Any other 3xx, one without a Location, and one past this limit surface as an OparlApiError naming the target.

    maxResponseBytes?: number

    Hard cap on response body size in bytes (defends against memory exhaustion from a hostile/buggy endpoint). Defaults to 100 MiB; set to 0 for no limit. A non-negative integer.

    maxRetries?: number

    Number of automatic retries for transient 429/503 responses and reset connections (ECONNRESET, EPIPE, ECONNABORTED, UND_ERR_SOCKET): 0 to MAX_RETRIES. Timeouts are not retried.

    onRetry?: (event: RetryEvent) => void

    Called once per retry, right before the backoff sleep, for each retried 429/503 and reset connection; never when there is no retry. A throw is swallowed.

    registryChecks?: readonly RegistryCheck[]

    Live checks of registry entries. Defaults to the checks shipped with this package.

    registryUrl?: string

    URL of the endpoint registry. Defaults to https://dev.oparl.org/api/endpoints. An http(s) URL, checked by the constructor (OparlValidationError); any userinfo is dropped.

    retryDelayMs?: number

    Base backoff between retries in milliseconds (default 500), 0 to MAX_RETRY_AFTER_MS (30 000). Grows linearly per attempt for a 503 and a reset; a 429 waits at least 1 s, doubling per attempt. A Retry-After header (seconds or an HTTP date) can lengthen a wait, never shorten it; every wait is capped at 30 s.

    sleep?: (ms: number) => Promise<void>

    Injectable sleep, primarily for deterministic tests.

    timeoutMs?: number

    Time limit per request in milliseconds, covering the whole response body, not only idle gaps (0 disables). Defaults to 120 s: some council systems take well over 30 s to render a single list page. A non-negative integer, capped at MAX_TIMEOUT_MS. The engine enforces it for every transport.

    transport?: Transport

    Swappable transport. Defaults to the built-in node http/https transport. The engine enforces timeoutMs and maxResponseBytes on any transport and checks the shape of what it returns (see HttpResponse).

    userAgent?: string

    Value of the User-Agent header.