{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api.devflowcmf.com/schemas/extension-registry.v1.json",
  "title": "Devflow Extension Registry",
  "type": "object",
  "required": ["schema", "version", "kind", "generated_at", "count", "packages"],
  "properties": {
    "schema": {
      "type": "string"
    },
    "version": {
      "type": "integer",
      "const": 1
    },
    "kind": {
      "type": "string",
      "enum": ["plugin", "theme"]
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "count": {
      "type": "integer",
      "minimum": 0
    },
    "packages": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["name", "vendor", "package", "description", "url", "downloads", "favers"],
        "properties": {
          "name": {
            "type": "string"
          },
          "vendor": {
            "type": "string"
          },
          "package": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "repository": {
            "type": ["string", "null"]
          },
          "downloads": {
            "type": "object",
            "required": ["total", "monthly", "daily"],
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "monthly": {
                "type": "integer",
                "minimum": 0
              },
              "daily": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "favers": {
            "type": "integer",
            "minimum": 0
          }
        }
      }
    }
  }
}
