{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tentacular.harmonyfidelis.com/schemas/tentacular-update-manifest-v1.schema.json",
  "title": "Tentacular signed update manifest",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "product", "channel", "version", "sequence", "publishedAt", "expiresAt", "minimumVersion", "mandatory", "artifact", "signature"],
  "properties": {
    "schemaVersion": { "const": 1 },
    "product": { "const": "Tentacular" },
    "channel": { "const": "stable" },
    "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
    "sequence": { "type": "integer", "minimum": 1 },
    "publishedAt": { "type": "string", "format": "date-time" },
    "expiresAt": { "type": "string", "format": "date-time" },
    "minimumVersion": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
    "mandatory": { "type": "boolean", "default": false },
    "releaseNotesUrl": { "type": "string", "format": "uri", "pattern": "^https://" },
    "artifact": {
      "type": "object",
      "additionalProperties": false,
      "required": ["url", "size", "sha256", "authenticodePublisher"],
      "properties": {
        "url": { "type": "string", "format": "uri", "pattern": "^https://" },
        "size": { "type": "integer", "minimum": 1 },
        "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
        "authenticodePublisher": { "type": "string", "minLength": 3, "maxLength": 256 }
      }
    },
    "signature": {
      "type": "object",
      "additionalProperties": false,
      "required": ["algorithm", "keyId", "value"],
      "properties": {
        "algorithm": { "const": "Ed25519" },
        "keyId": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{2,63}$" },
        "value": { "type": "string", "minLength": 80, "maxLength": 128 }
      }
    }
  }
}
