# ink.resenha.ebook

> One per file. Deleting the record lets the account's server delete the file.

- Kind: record
- Record key: tid
- Authority: resenha.ink
- Lexicon: 1
- Published by [resenha.ink](https://lexicon.garden/identity/did:plc:v7itjf4h3sb5zuegiiskctqb), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:v7itjf4h3sb5zuegiiskctqb/ink.resenha.ebook)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:v7itjf4h3sb5zuegiiskctqb/ink.resenha.ebook/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:v7itjf4h3sb5zuegiiskctqb/ink.resenha.ebook/analytics)

## Record (`ink.resenha.ebook`)

Type: record · key tid

### Properties

- `authors` (array)
  - Constraints: maxLength: 20
  - `items` (string)
    - Constraints: maxLength: 640, maxGraphemes: 64
- `book` (string · at-uri): The account's record for the same book, when the reader connected the file to their library: a buzz.bookhive.book, or a social.popfeed.feed.listItem for a book they keep in Popfeed.
- `bookRef` (ref): The book the file is of, in every key anyone uses.
  - Reference: `ink.resenha.defs#bookRef`
- `cover` (blob): A cover image for showing the book in a list, taken from the file.
  - Constraints: maxSize: 1000000, accept: image/png, image/jpeg, image/webp
- `createdAt` (string · datetime, required)
- `deletedAt` (string · datetime): When the reader moved the file to Resenha's trash. The file stays in the account, off the shelf, for 30 days from this moment, unless the reader restores it; then the record is deleted.
- `file` (blob, required): The book itself.
  - Constraints: accept: application/epub+zip, application/pdf, application/vnd.comicbook+zip, application/zip
- `format` (string, required): How to open the file. A comic archive is a zip of page images, read in file name order.
  - Constraints: knownValues: epub | pdf | cbz
- `title` (string, required): From the file's own metadata when it has some, otherwise from its file name.
  - Constraints: maxLength: 3000, maxGraphemes: 300

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "One per file. Deleting the record lets the account's server delete the file.",
      "key": "tid",
      "record": {
        "properties": {
          "authors": {
            "items": {
              "maxGraphemes": 64,
              "maxLength": 640,
              "type": "string"
            },
            "maxLength": 20,
            "type": "array"
          },
          "book": {
            "description": "The account's record for the same book, when the reader connected the file to their library: a buzz.bookhive.book, or a social.popfeed.feed.listItem for a book they keep in Popfeed.",
            "format": "at-uri",
            "type": "string"
          },
          "bookRef": {
            "description": "The book the file is of, in every key anyone uses.",
            "ref": "ink.resenha.defs#bookRef",
            "type": "ref"
          },
          "cover": {
            "accept": [
              "image/png",
              "image/jpeg",
              "image/webp"
            ],
            "description": "A cover image for showing the book in a list, taken from the file.",
            "maxSize": 1000000,
            "type": "blob"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "deletedAt": {
            "description": "When the reader moved the file to Resenha's trash. The file stays in the account, off the shelf, for 30 days from this moment, unless the reader restores it; then the record is deleted.",
            "format": "datetime",
            "type": "string"
          },
          "file": {
            "accept": [
              "application/epub+zip",
              "application/pdf",
              "application/vnd.comicbook+zip",
              "application/zip"
            ],
            "description": "The book itself.",
            "type": "blob"
          },
          "format": {
            "description": "How to open the file. A comic archive is a zip of page images, read in file name order.",
            "knownValues": [
              "epub",
              "pdf",
              "cbz"
            ],
            "type": "string"
          },
          "title": {
            "description": "From the file's own metadata when it has some, otherwise from its file name.",
            "maxGraphemes": 300,
            "maxLength": 3000,
            "type": "string"
          }
        },
        "required": [
          "file",
          "format",
          "title",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "A book file the account keeps for reading in Resenha: an EPUB, a PDF or a comic archive. The file is a blob in the account's repository, which keeps it only while a record refers to it.",
  "id": "ink.resenha.ebook",
  "lexicon": 1
}
```
