{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"$id": "https://2timer.app/omx/schemas/destination-card-v1.schema.json",
	"$comment": "Generated from meet-document-v1.schema.json by npm run sync:omx.",
	"title": "Open Meet Exchange — Destination Card v1",
	"description": "One destination, with its token, as a Publisher gives it to a timer to paste into Meet Operations. It is a credential.",
	"type": "object",
	"required": ["omx_destination"],
	"properties": {
		"$schema": {
			"type": "string"
		},
		"omx_destination": {
			"$ref": "#/definitions/publishDestination"
		}
	},
	"definitions": {
		"id": {
			"type": "string",
			"description": "Opaque identifier chosen by the product that wrote the document. Stable for the life of the meet. A reader never parses it.",
			"minLength": 1,
			"maxLength": 128
		},
		"laterValue": {
			"not": {}
		},
		"publishDestination": {
			"type": "object",
			"description": "One Publisher Meet Operations hands the results to. The credential here is separate from the document URL's; holding the read link never grants the right to write.",
			"required": ["id", "url", "token"],
			"properties": {
				"id": {
					"$ref": "#/definitions/id",
					"description": "Identifier for this destination, unique within the document and stable for the life of the meet."
				},
				"label": {
					"type": "string",
					"description": "Human name for this destination, shown to the timer when they are asked to approve it. Strongly recommended: without one the timer is asked to trust a bare URL."
				},
				"url": {
					"type": "string",
					"pattern": "^https://",
					"description": "Where Meet Operations POSTs each results document."
				},
				"token": {
					"type": "string",
					"description": "Sent as `Authorization: Bearer <token>` on every handoff. Never placed in a query string. Issued by whoever runs this destination, with at least 128 bits from a cryptographically secure generator (22 or more base62 characters; 32 recommended). A readable prefix is allowed and does not count toward the 128 bits. The Publisher decides how long it works and answers 410 once it stops."
				},
				"deliver": {
					"type": "string",
					"description": "How often this destination wants results. `final` (the default): `full` documents once every round is official or cancelled, and again for each correction. `progressive`: a first `full` document, then `partial` ones as each round is seeded, goes official, or changes. `live`: everything `progressive` gets, plus a `partial` document every few seconds while a round runs. Meet Operations may always send `full` instead of `partial`. Open: a value Meet Operations does not know is read as `final`.",
					"anyOf": [
						{
							"enum": ["final", "progressive", "live"]
						},
						{
							"$ref": "#/definitions/laterValue"
						}
					],
					"default": "final"
				},
				"content": {
					"type": "array",
					"description": "What this destination wants. `results` (the default): entries once a round is under way. `start_lists`: also heat-sheet entries for rounds that have not run yet. Open: Meet Operations ignores a value it does not know.",
					"items": {
						"type": "string",
						"anyOf": [
							{
								"enum": ["results", "start_lists"]
							},
							{
								"$ref": "#/definitions/laterValue"
							}
						]
					}
				},
				"accepts": {
					"type": "array",
					"description": "The Open Meet Exchange versions this destination reads, newest first, such as [\"1.0\"]. Listing a version accepts every later minor of its major: [\"1.0\"] reads every 1.x. Optional: without it, Meet Operations writes a version of the major of the document or card that named this destination. Meet Operations sends only a major listed here.",
					"minItems": 1,
					"items": {
						"type": "string",
						"pattern": "^\\d+\\.\\d+$"
					}
				}
			}
		}
	}
}
