{
	"lexicon": 1,
	"id": "pub.byline.book",
	"defs": {
		"main": {
			"type": "record",
			"key": "tid",
			"description": "An author-authoritative record of a published or forthcoming work, signed by the author's own repository.",
			"record": {
				"type": "object",
				"required": ["title", "createdAt"],
				"properties": {
					"title": {
						"type": "string",
						"minLength": 1,
						"maxLength": 512
					},
					"subtitle": {
						"type": "string",
						"maxLength": 512
					},
					"tagline": {
						"type": "string",
						"maxGraphemes": 200,
						"description": "One-line hook for hero or featured display. Plain text, no markdown."
					},
					"authors": {
						"type": "array",
						"description": "Credited contributors. The repo owner is presumed primary author unless roles say otherwise.",
						"items": {
							"type": "ref",
							"ref": "pub.byline.defs#contributor"
						}
					},
					"shortDescription": {
						"type": "string",
						"maxGraphemes": 500,
						"description": "Card and grid summary. Markdown; consumers render or strip."
					},
					"description": {
						"type": "string",
						"maxGraphemes": 5000,
						"description": "Long blurb / marketing copy. Markdown; consumers render or strip."
					},
					"cover": {
						"type": "blob",
						"accept": ["image/png", "image/jpeg", "image/webp"],
						"maxSize": 2000000,
						"description": "Cover image, stored as a blob in the author's own repository."
					},
					"coverAlt": {
						"type": "string",
						"maxLength": 1000,
						"description": "Alt text describing the cover image, for accessibility."
					},
					"status": {
						"type": "string",
						"knownValues": [
							"pub.byline.defs#published",
							"pub.byline.defs#forthcoming",
							"pub.byline.defs#draft",
							"pub.byline.defs#outOfPrint"
						]
					},
					"publicationDate": {
						"type": "string",
						"format": "datetime",
						"description": "Actual or planned first-publication date."
					},
					"copyrightYear": {
						"type": "integer",
						"description": "Year of first copyright for the work."
					},
					"language": {
						"type": "string",
						"description": "BCP-47 language tag, e.g. en, en-CA."
					},
					"publisher": {
						"type": "string",
						"maxLength": 256,
						"description": "Work-level publisher. An edition's publisher overrides this when present."
					},
					"pageCount": {
						"type": "integer",
						"minimum": 1,
						"description": "Work-level page count. An edition's pageCount overrides this when present."
					},
					"series": {
						"type": "ref",
						"ref": "pub.byline.defs#seriesMembership",
						"description": "Series membership, if any. Book points at the series; the series record never points back."
					},
					"editions": {
						"type": "array",
						"items": {
							"type": "ref",
							"ref": "pub.byline.defs#edition"
						}
					},
					"identifiers": {
						"type": "ref",
						"ref": "pub.byline.defs#identifiers"
					},
					"genres": {
						"type": "array",
						"items": {
							"type": "string",
							"maxLength": 128,
							"maxGraphemes": 128
						},
						"description": "Shelf-category genres for the work. Freeform; byline's authoring tool suggests existing values to encourage convergence, but no value is enforced."
					},
					"links": {
						"type": "array",
						"description": "Work-level links not tied to a specific edition.",
						"items": {
							"type": "ref",
							"ref": "pub.byline.defs#link"
						}
					},
					"discussions": {
						"type": "array",
						"description": "Strong references to atproto-native discussion threads about this work (e.g. a Bluesky post, a pub.byline.comment). Off-protocol social goes in links[] with kind=discussion or social.",
						"items": {
							"type": "ref",
							"ref": "com.atproto.repo.strongRef"
						}
					},
					"tags": {
						"type": "array",
						"items": {
							"type": "string",
							"maxLength": 128,
							"maxGraphemes": 128
						},
						"description": "Freeform descriptors. Genre lives in genres[]; tags are everything else."
					},
					"createdAt": {
						"type": "string",
						"format": "datetime"
					},
					"updatedAt": {
						"type": "string",
						"format": "datetime"
					}
				}
			}
		}
	}
}
