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

    Interface OparlClientOptions

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

    Hierarchy (View Summary)

    Index
    bigIntegerKeys?: ReadonlySet<string>

    Member names whose number values may exceed 2^53 (a 64-bit id). The value of a declared member is delivered as its exact literal, as written, as a JSON string ("5"), so its type never depends on its size. A declared member whose value is not a number (a string, null, an object) is left as it is. Every undeclared number keeps the rule: exact, or an OparlParseError. Matched by name anywhere in a JSON answer, an escaped name ("\u0073ize") included. Defaults to none (OParl declares none); anything but a set or list of non-empty strings is an OparlValidationError. The set is copied.

    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, nor is an answer whose Retry-After is over MAX_RETRY_AFTER_MS (30 s): its error comes at once and names the wait.

    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.

    onWarning?: (message: string) => void

    Called with a one-line warning about an answer the engine delivered changed: characters that were not valid text — invalid bytes in the declared (or default UTF-8) charset, or a lone surrogate written as a JSON escape — replaced with U+FFFD. The message names the request and the count (GET <url>: 2 characters of the answer were not valid text …). Without it the replacement is silent. A throw is swallowed. The CLI logs it as a WARN record of oparl.api.

    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, up to 30 s; a longer one is not retried.

    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.