{
	"$id": "https://registry.atlas-cmdb.com/schema/atlas-index.schema.json",
	"title": "Atlas extension registry index",
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"type": "object",
	"properties": {
		"format": {
			"type": "number",
			"const": 1
		},
		"name": {
			"type": "string",
			"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
		},
		"serial": {
			"type": "integer",
			"minimum": 0,
			"maximum": 9007199254740991
		},
		"generated_at": {
			"type": "string"
		},
		"expires_at": {
			"type": "string"
		},
		"publishers": {
			"type": "object",
			"propertyNames": {
				"type": "string",
				"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
			},
			"additionalProperties": {
				"type": "object",
				"properties": {
					"name": {
						"type": "string"
					},
					"keys": {
						"maxItems": 10,
						"type": "array",
						"items": {
							"type": "string"
						}
					}
				},
				"required": [
					"keys"
				]
			}
		},
		"packages": {
			"type": "object",
			"propertyNames": {
				"type": "string",
				"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
			},
			"additionalProperties": {
				"type": "object",
				"properties": {
					"name": {
						"type": "string",
						"minLength": 1,
						"maxLength": 80
					},
					"description": {
						"type": "string",
						"maxLength": 500
					},
					"publisher": {
						"type": "string",
						"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
					},
					"homepage": {
						"type": "string",
						"format": "uri"
					},
					"icon": {
						"type": "string",
						"maxLength": 64
					},
					"versions": {
						"minItems": 1,
						"maxItems": 200,
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"version": {
									"type": "string"
								},
								"atlasApi": {
									"type": "string",
									"minLength": 1,
									"maxLength": 40
								},
								"url": {
									"type": "string",
									"format": "uri"
								},
								"sha256": {
									"type": "string",
									"pattern": "^[a-f0-9]{64}$"
								},
								"size": {
									"type": "integer",
									"exclusiveMinimum": 0,
									"maximum": 9007199254740991
								},
								"digest": {
									"type": "string",
									"pattern": "^[a-f0-9]{64}$"
								},
								"scopes": {
									"default": [],
									"maxItems": 50,
									"type": "array",
									"items": {
										"type": "string"
									}
								},
								"image": {
									"type": "string"
								},
								"lifecycle": {
									"maxItems": 3,
									"type": "array",
									"items": {
										"type": "string"
									}
								},
								"published_at": {
									"type": "string"
								},
								"yanked": {
									"type": "boolean"
								}
							},
							"required": [
								"version",
								"atlasApi",
								"url",
								"sha256",
								"size",
								"digest"
							]
						}
					}
				},
				"required": [
					"name",
					"publisher",
					"versions"
				]
			}
		}
	},
	"required": [
		"format",
		"name",
		"serial",
		"generated_at",
		"expires_at",
		"publishers",
		"packages"
	]
}
