{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"type": "object",
	"title": "ModuleManifest",
	"properties": {
		"$schema": {
			"type": "string"
		},
		"id": {
			"type": "string",
			"description": "Unique identifier for the module"
		},
		"name": {
			"type": "string",
			"description": "Name of the module"
		},
		"shortname": {
			"type": "string"
		},
		"description": {
			"type": "string",
			"description": "Description of the module "
		},
		"version": {
			"type": "string",
			"description": "Current version of the module"
		},
		"license": {
			"type": "string",
			"description": "SPDX identifier for license of the module"
		},
		"repository": {
			"type": "string",
			"description": "URL to the source repository"
		},
		"bugs": {
			"type": "string",
			"description": "URL to bug tracker"
		},
		"maintainers": {
			"type": "array",
			"description": "List of active maintiners",
			"uniqueItems": true,
			"items": {
				"type": "object",
				"title": "ModuleManifestMaintainer",
				"properties": {
					"name": {
						"type": "string"
					},
					"email": {
						"type": "string"
					},
					"github": {
						"type": "string"
					}
				},
				"required": ["name"]
			}
		},
		"legacyIds": {
			"type": "array",
			"description": "If the module had a different unique identifier previously, then specify it here",
			"uniqueItems": true,
			"items": {
				"type": "string"
			}
		},
		"runtime": {
			"type": "object",
			"title": "ModuleManifestRuntime",
			"description": "Information on how to execute the module",
			"properties": {
				"type": {
					"type": "string",
					"description": "Type of the module. Must be: node18 or node22",
					"enum": ["node18", "node22"]
				},
				"api": {
					"type": "string",
					"description": "Which host-api does it use. In the future alternate options will be allowed",
					"enum": ["nodejs-ipc"]
				},
				"apiVersion": {
					"type": "string",
					"description": "The version of the host-api used"
				},
				"entrypoint": {
					"type": "string",
					"description": "Entrypoint to pass to the runtime. eg index.js"
				}
			},
			"required": ["type", "api", "apiVersion", "entrypoint"]
		},
		"manufacturer": {
			"type": "string"
		},
		"products": {
			"type": "array",
			"uniqueItems": true,
			"items": {
				"type": "string"
			},
			"minItems": 1
		},
		"keywords": {
			"type": "array",
			"uniqueItems": true,
			"items": {
				"type": "string"
			}
		},
		"bonjourQueries": {
			"type": "object",
			"description": "If the device or software for your module supports bonjour announcements, Companion will offer an easy way to watch for these announcements.\nEach query you define must have a matching config field of type 'bonjour-device' with the same name",
			"patternProperties": {
				"": {
					"oneOf": [
						{
							"$ref": "#/definitions/bonjourQuery"
						},
						{
							"type": "array",
							"items": {
								"$ref": "#/definitions/bonjourQuery"
							}
						}
					]
				}
			},
			"additionalProperties": false
		}
	},
	"additionalProperties": false,
	"required": [
		"id",
		"name",
		"shortname",
		"description",
		"version",
		"license",
		"repository",
		"bugs",
		"maintainers",
		"legacyIds",
		"runtime",
		"manufacturer",
		"products",
		"keywords"
	],
	"definitions": {
		"bonjourQuery": {
			"type": "object",
			"title": "ModuleBonjourQuery",
			"description": "",
			"properties": {
				"type": {
					"type": "string"
				},
				"protocol": {
					"type": "string",
					"enum": ["tcp", "udp"]
				},
				"txt": {
					"type": "object",
					"description": "Match on any txt values returned in the query. This is useful to filter out devices of the same 'type' that are not supported",
					"patternProperties": {
						"": {
							"type": "string"
						}
					},
					"additionalProperties": false
				}
			},
			"required": ["type", "protocol"],
			"additionalProperties": false
		}
	}
}
