{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A revision to a note. It holds either a diff from the previous revision or the complete new body, depending on diffFormat.",
      "key": "tid",
      "record": {
        "properties": {
          "blobs": {
            "description": "Blobs the content references. Each is identified by the uploading repo's DID and the blob CID. Content points at one with ![alt](/blob/<did>/<cid>), the path lichen serves it from. Listing the ref here keeps the blob alive in the PDS.",
            "items": {
              "accept": [
                "image/jpeg",
                "image/png",
                "image/gif",
                "image/webp"
              ],
              "maxSize": 2097152,
              "type": "blob"
            },
            "type": "array"
          },
          "createdAt": {
            "description": "When this revision was created.",
            "format": "datetime",
            "type": "string"
          },
          "diff": {
            "description": "The revision payload. With \"diff-match-patch\" it is a patch against parentRevision. With \"full-text\" it is the note's whole new body, and it is only accepted when parentRevision is the current head.",
            "maxLength": 1000000,
            "type": "string"
          },
          "diffFormat": {
            "description": "How to read the diff field. \"diff-match-patch\" means a patch against parentRevision. \"full-text\" means the whole note body.",
            "knownValues": [
              "diff-match-patch",
              "full-text"
            ],
            "maxLength": 32,
            "type": "string"
          },
          "message": {
            "description": "Optional commit message describing this revision.",
            "maxGraphemes": 1024,
            "maxLength": 10240,
            "type": "string"
          },
          "noteRef": {
            "description": "AT-URI of the parent note record.",
            "format": "at-uri",
            "type": "string"
          },
          "parentRevision": {
            "description": "AT-URI of the previous revision. Omitted for the first revision of a note.",
            "format": "at-uri",
            "type": "string"
          },
          "status": {
            "description": "Set to \"deleted\" to take the note out of its wiki, keeping its history, and to \"live\" to restore it. A revision without it keeps the status.",
            "knownValues": [
              "live",
              "deleted"
            ],
            "maxLength": 32,
            "type": "string"
          },
          "title": {
            "description": "Renames the note from this revision on. A revision that leaves it out keeps the title.",
            "maxGraphemes": 256,
            "maxLength": 2560,
            "type": "string"
          }
        },
        "required": [
          "noteRef",
          "diff",
          "diffFormat",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "wiki.lichen.noteRevision",
  "lexicon": 1
}
