{
	"lexicon": 1,
	"id": "pub.byline.defs",
	"defs": {
		"published": {
			"type": "token",
			"description": "The work is published and available."
		},
		"forthcoming": {
			"type": "token",
			"description": "Announced with a release date, not yet available."
		},
		"draft": {
			"type": "token",
			"description": "In progress, not announced."
		},
		"outOfPrint": {
			"type": "token",
			"description": "Previously published, no longer in print."
		},
		"contributor": {
			"type": "object",
			"description": "A person credited on the work.",
			"required": ["name"],
			"properties": {
				"name": {
					"type": "string",
					"maxLength": 256
				},
				"role": {
					"type": "string",
					"maxLength": 128,
					"description": "e.g. author, co-author, translator, editor, illustrator, narrator."
				},
				"did": {
					"type": "string",
					"format": "did",
					"description": "AT Protocol identity of the contributor, if any."
				}
			}
		},
		"identifiers": {
			"type": "object",
			"description": "External identifiers used to correlate this work across catalogues.",
			"properties": {
				"isbn13": {
					"type": "string"
				},
				"isbn10": {
					"type": "string"
				},
				"hiveId": {
					"type": "string",
					"description": "BookHive internal id, for reader-app correlation."
				},
				"hiveBookUri": {
					"type": "string",
					"format": "at-uri",
					"description": "AT-URI of the canonical buzz.bookhive.catalogBook record, if one exists."
				},
				"goodreadsId": {
					"type": "string"
				},
				"asin": {
					"type": "string"
				}
			}
		},
		"edition": {
			"type": "object",
			"description": "A single published edition or format of the work.",
			"required": ["format"],
			"properties": {
				"format": {
					"type": "string",
					"knownValues": ["hardcover", "paperback", "ebook", "audiobook"]
				},
				"isbn13": {
					"type": "string"
				},
				"isbn10": {
					"type": "string"
				},
				"publisher": {
					"type": "string",
					"maxLength": 256
				},
				"pageCount": {
					"type": "integer",
					"minimum": 1
				},
				"durationMinutes": {
					"type": "integer",
					"minimum": 1,
					"description": "Runtime for audiobook editions."
				},
				"fileFormats": {
					"type": "array",
					"items": {
						"type": "string",
						"maxLength": 32
					},
					"description": "File formats for a digital edition, e.g. epub, pdf, mobi, m4b."
				},
				"releaseDate": {
					"type": "string",
					"format": "datetime"
				},
				"links": {
					"type": "array",
					"description": "Buy or sample links specific to this edition.",
					"items": {
						"type": "ref",
						"ref": "pub.byline.defs#link"
					}
				}
			}
		},
		"seriesMembership": {
			"type": "object",
			"description": "Series membership, if any. Book points at the series; the series record never points back.",
			"properties": {
				"ref": {
					"type": "ref",
					"ref": "com.atproto.repo.strongRef",
					"description": "strongRef to a pub.byline.series record."
				},
				"name": {
					"type": "string",
					"maxLength": 256,
					"description": "Series name, denormalized for display."
				},
				"position": {
					"type": "integer",
					"minimum": 1,
					"description": "Reading order within the series."
				}
			}
		},
		"link": {
			"type": "object",
			"required": ["url"],
			"properties": {
				"url": {
					"type": "string",
					"format": "uri"
				},
				"label": {
					"type": "string",
					"maxLength": 128
				},
				"kind": {
					"type": "string",
					"knownValues": [
						"retailer",
						"direct",
						"universal",
						"support",
						"sample",
						"review",
						"author",
						"publisher",
						"discussion",
						"social"
					]
				},
				"retailer": {
					"type": "string",
					"description": "Retailer name when kind is retailer, e.g. Smashwords."
				},
				"isAffiliate": {
					"type": "boolean",
					"description": "True when this is an affiliate link, for disclosure."
				},
				"primary": {
					"type": "boolean",
					"description": "Marks the preferred call-to-action link. At most one per book should set this."
				}
			}
		}
	}
}
