{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "One per book. The record key is the book's BookHive ID (hiveId); a book with no match yet is keyed popfeed-<record key of its first listItem>.",
      "key": "any",
      "record": {
        "properties": {
          "book": {
            "description": "The book in every key anyone uses: the link's own fields say which records are the book, this says which book.",
            "ref": "ink.resenha.defs#bookRef",
            "type": "ref"
          },
          "bookhive": {
            "description": "The reader's buzz.bookhive.book record for the book, when they have one.",
            "format": "at-uri",
            "type": "string"
          },
          "hiveId": {
            "description": "The book's BookHive ID. Absent when no match was found.",
            "maxLength": 64,
            "type": "string"
          },
          "isbn13": {
            "description": "The edition the reader's records name, when they name one.",
            "maxLength": 13,
            "type": "string"
          },
          "matchedBy": {
            "description": "identifiers: an ISBN or Goodreads number agreed, or the item named its BookHive ID. search: title and author agreed. reader: chosen by the reader, and never changed automatically. none: no match yet.",
            "knownValues": [
              "identifiers",
              "search",
              "reader",
              "none"
            ],
            "type": "string"
          },
          "popfeed": {
            "description": "The reader's social.popfeed.feed.listItem records for the book. A book can be on more than one list.",
            "items": {
              "format": "at-uri",
              "type": "string"
            },
            "maxLength": 20,
            "type": "array"
          },
          "reading": {
            "description": "The reader's ink.resenha.reading record for the book, when that's where they keep it. A reading and the reader's Popfeed items named here are one book.",
            "format": "at-uri",
            "type": "string"
          },
          "updatedAt": {
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "matchedBy",
          "updatedAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "Which catalog book a book in the reader's library is, and which of the reader's records in each book app are that book. Resenha writes these when it matches a reader's Popfeed books to BookHive's catalog, so Popfeed's and BookHive's own records are never changed to hold the match.",
  "id": "ink.resenha.bookLink",
  "lexicon": 1
}
