{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aidenid.com/for-agents/schemas/media.schema.json",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "version",
    "locale",
    "generatorVersion",
    "items"
  ],
  "properties": {
    "version": {
      "const": 1
    },
    "locale": {
      "const": "en"
    },
    "generatorVersion": {
      "const": "aidenid-media/1"
    },
    "items": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "assetId",
          "kind",
          "url",
          "pages",
          "descriptionUrl",
          "description",
          "status",
          "sourceHash",
          "cacheKey",
          "provenance"
        ],
        "properties": {
          "assetId": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "illustration",
              "animation",
              "decoration",
              "canvas",
              "chart",
              "image",
              "video"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "pages": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "home",
                "why",
                "how",
                "commerce",
                "trust",
                "savings",
                "traffic",
                "store",
                "report",
                "install",
                "docs",
                "about",
                "login"
              ]
            }
          },
          "descriptionUrl": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "described",
              "unavailable"
            ]
          },
          "unavailableReason": {
            "type": "string",
            "minLength": 1
          },
          "sourceHash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "cacheKey": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "provenance": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "basis",
              "simulated",
              "sourceUrls"
            ],
            "properties": {
              "basis": {
                "type": "string",
                "enum": [
                  "authored-svg",
                  "authored-css",
                  "authored-interaction",
                  "authored-canvas",
                  "authored-demo-catalog",
                  "existing-alt-or-caption",
                  "reviewed-media-description",
                  "explicitly-unavailable"
                ]
              },
              "simulated": {
                "type": "boolean"
              },
              "sourceUrls": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        }
      }
    }
  }
}
