@maschinenlesbar.org/deutsche-digitale-bibliothek-cli
    Preparing search index...

    Class DdbClient

    Index
    • Fetch one component of an item by its 32-character id (defaults to view). Decodes by Content-Type: JSON components are parsed into json, while the XML / file components (edm, source-record, citation) are returned as text (plus the exact bytes). The id is trimmed and must then be exactly 32 upper-case letters and digits (normalizeItemId); anything else rejects with a DdbValidationError without a request. A part outside ITEM_PARTS (itemPartProblem) rejects with a DdbValidationError, a blank lang or a non-integer / negative rows/offset throws DdbError, both without a request, and lang outside ITEM_LANG_PARTS or rows/offset for any part but children rejects with a DdbValidationError (validateItemOptions). A JSON part whose body is not an object or array (null, empty, a scalar) or is an error document is a DdbParseError.

      Parameters

      • rawId: string
      • part:
            | "view"
            | "aip"
            | "edm"
            | "binaries"
            | "children"
            | "parents"
            | "source"
            | "source-description"
            | "source-record"
            | "iiif"
            | "citation" = "view"
      • opts: ItemOptions = {}

      Returns Promise<ItemResult>

    • Search the DDB object index via the v2 Solr passthrough (GET /2/search/index/{collection}/{requestHandler}). Values use Solr syntax; the response is native Solr JSON. wt=json is always forced, and rows defaults to DEFAULT_SEARCH_ROWS (10). The parameters are checked first (non-blank query and strings, integers from 0 to 2^31 - 1, facetLimit -1 or more and only with facetFields); a bad one throws DdbError without a request. collection and requestHandler must be letters, digits, ., _ and - (not "." or ".."; pathNameProblem), or the call rejects with a DdbValidationError without a request. A 2xx body without the documented shape — not a JSON object, an error document, no response object with an integer numFound and a docs array — raises DdbParseError. Only request handlers that return Solr's standard response envelope (such as the default select) are supported; for any other the DdbParseError names the handler and that rule (there is no fallback).

      Parameters

      Returns Promise<SolrResponse>

    • The version string of the DDB backend, with surrounding whitespace (the body's trailing newline, CRs) trimmed. Public — works without a key. A 2xx body that is not one short version token ("7.5": letters, digits, ., _, +, -) — an HTML page, JSON, an empty body — is a DdbParseError, so the call works as a connectivity check.

      Returns Promise<string>