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

    Class RequestEngine

    Index
    bigIntegerKeys: ReadonlySet<string>

    EngineOptions.bigIntegerKeys, copied.

    • Build a fully-qualified URL from a path and optional query parameters. It keeps any userinfo of the base URL (http://user:pw@mirror/…); request() leaves it out and sends it as an Authorization header instead (see basicAuthorization).

      Parameters

      Returns string

    • The request URL as an error about the answer shows it: absolute (so a message names the host that gave a bad answer, which matters with a custom base URL), without the base URL's userinfo (as the network errors show it), cut at MAX_QUOTED_URL_LENGTH characters (urlForMessage). 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 a StrahlParseError: the WFS always answers with a document. Every error about the answer names the request (GET <url>: …, without the userinfo, as the network errors show it).

      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 a 2xx answer that one of the client's own messages quotes (the kenn of a feature for another station), as "<text>": the base URL's credentials scrubbed, then made safe and short (serverTextForMessage: cleaned to one line, cut at max characters), and scrubbed again in between, so neither a cut nor a control character dropped from inside an echo leaves any part of a credential. serverTextForMessage alone cuts first: a password echoed there kept its first max characters.

      Parameters

      • value: string
      • max: number = 200

      Returns string