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

    Class RequestEngine

    Index
    bigIntegerKeys: ReadonlySet<string>

    EngineOptions.bigIntegerKeys, copied.

    • The request URL as error messages show it: absolute (so a message names the host that gave a bad answer, which matters with a mirror), userinfo redacted and cut at MAX_MESSAGE_TEXT characters. It never throws: describing a URL for a message does not validate it.

      Parameters

      Returns string

    • Perform a GET expecting JSON and parse it into T. An empty (or whitespace-only) body is an AwParseError: every endpoint answers with a JSON document. Every error about the answer names the request (GET <url>: …, userinfo redacted).

      The text is never changed silently: bytes that are not valid in the charset, and lone surrogates written as JSON escapes (\ud800), are replaced with U+FFFD, so the result is well-formed text (jq rejects a lone surrogate, and with it the whole output), and onWarning is told how many. One bad character never sinks a whole answer.

      Type Parameters

      • T

      Parameters

      Returns Promise<T>

    • A value from an answer, as an error message quotes it: the base URL's credentials scrubbed first, then cleaned (sanitizeServerText) and cut at max characters (cutForMessage, default MAX_MESSAGE_TEXT), so a cut never leaves part of a credential behind. A 2xx answer (an error envelope, a value the client refuses) can echo them as well as an error body. API code quotes server values with this.

      Parameters

      • value: string
      • max: number = MAX_MESSAGE_TEXT

      Returns string

    • Perform a request with Accept negotiation and transient-error retries.

      Parameters

      • method: string
      • path: string
      • options: { accept: string; query?: QueryParams; signal?: AbortSignal } = ...

      Returns Promise<RawResponse>