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

    Class RequestEngine

    Index
    bigIntegerKeys: ReadonlySet<string>

    EngineOptions.bigIntegerKeys, copied.

    • The request as an answer error names it: <METHOD> <url> of the request the engine sends for path + query (a GET, or the form POST of a long query, whose URL is the bare path), userinfo redacted and cut at MAX_MESSAGE_VALUE_LENGTH characters. Every error about an answer (bad JSON, an unknown charset, an inexact number, the wrong shape) starts with it, as a network error does, so a caller making several requests can tell which one it was.

      Parameters

      Returns string

    • The error for an ArcGIS "HTTP 200 + error" envelope (a bad where, "Token Required"): a LadesaeulenApiError with arcgisCode set, naming the request the engine sent for path + query (URL redacted), with the server text stripped of control characters and of the base URL's credentials.

      Parameters

      • path: string
      • query: QueryParams
      • envelope: unknown
      • error: unknown

      Returns LadesaeulenApiError

    • Request a path with query params and parse the JSON reply into T. A number in it that JSON.parse can't carry exactly (firstInexactNumber) is a LadesaeulenParseError; the number of a member named in bigIntegerKeys is delivered as its exact literal, a string.

      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 quoted for an error message (quoteValue), the base URL's credentials scrubbed first, before the cut: a 2xx answer (a shape the client refuses) can echo them as well as an error body. API code quotes server values with this.

      Parameters

      • value: string

      Returns string

    • Perform a request (GET, or a form POST for a long query — see requestTarget) with Accept negotiation and transient-error retries. Redirects are NOT followed — the canonical host answers directly, so a 3xx surfaces as an error. Every transport is held to the same contract: the timeoutMs deadline and the maxResponseBytes cap apply whatever it does, headers may be a record in any case, a Headers object or a Map, the body any ArrayBuffer view, and anything else it throws or returns is a LadesaeulenNetworkError. 429/503 statuses are retried, and so is a GET whose connection was reset (see hasTransientCode); a form POST is not re-sent after a reset, and no other network error is retried.

      Parameters

      • path: string
      • Optionalquery: QueryParams
      • accept: string = "application/json"

      Returns Promise<RawResponse>

    • text without the base URL's credentials: server text (an error body that echoes the request URL) and transport text (fetch's "Request cannot be constructed from a URL that includes credentials: ") can carry them.

      Parameters

      • text: string

      Returns string