{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hipdiscovery.github.io/Free-Sound-Effects/resources.schema.json",
  "title": "Creator Asset Library source and art-direction catalog",
  "description": "Metadata for outbound licensed resource pages, individual fonts, and creative-direction recipes. This is not an asset-download API or redistribution grant.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "updated",
    "curator",
    "fonts",
    "assets",
    "directions",
    "selectionPolicy"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "updated": {
      "type": "string",
      "format": "date",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "curator": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "role": {
          "type": "string",
          "minLength": 1
        },
        "profileUrl": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        }
      }
    },
    "fonts": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "style",
          "source",
          "licenseStatus",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "style": {
            "type": "string",
            "enum": [
              "Playful",
              "Bold",
              "Clean",
              "Tech",
              "Retro",
              "Handwritten"
            ]
          },
          "source": {
            "type": "string",
            "minLength": 1
          },
          "licenseStatus": {
            "type": "string",
            "enum": [
              "Open-source font"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
          }
        }
      }
    },
    "assets": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "category",
          "kind",
          "format",
          "description",
          "workflow",
          "link",
          "publisher",
          "license",
          "licenseUrl",
          "rights",
          "attribution",
          "access",
          "caveat",
          "checkedOn",
          "tags",
          "styleTags",
          "priority",
          "sourceType"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$"
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "category": {
            "type": "string",
            "enum": [
              "Audio",
              "Video",
              "Motion",
              "Images",
              "Graphics",
              "Fonts",
              "Tools"
            ]
          },
          "kind": {
            "type": "string",
            "minLength": 1
          },
          "format": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "workflow": {
            "type": "string",
            "minLength": 1
          },
          "capcut": {
            "type": "string"
          },
          "link": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
          },
          "publisher": {
            "type": "string",
            "minLength": 1
          },
          "license": {
            "type": "string",
            "minLength": 1
          },
          "licenseUrl": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
          },
          "rights": {
            "type": "string",
            "enum": [
              "cc0",
              "cc0-filter",
              "video-commercial",
              "open-notice",
              "tool",
              "media-only",
              "cc-by",
              "free-generated",
              "font-commercial"
            ]
          },
          "attribution": {
            "type": "string",
            "enum": [
              "none",
              "notice",
              "per-item",
              "credit"
            ]
          },
          "access": {
            "type": "string",
            "minLength": 1
          },
          "caveat": {
            "type": "string",
            "minLength": 1
          },
          "checkedOn": {
            "type": "string",
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "tags": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "styleTags": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[a-z-]+$"
            }
          },
          "priority": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3
          },
          "sourceType": {
            "type": "string",
            "enum": [
              "library",
              "archive",
              "licensed-search",
              "generator",
              "editor",
              "reference"
            ]
          }
        }
      }
    },
    "directions": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "tone",
          "useCase",
          "assetIds",
          "fontIds",
          "palette",
          "motion",
          "sound",
          "avoid"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "tone": {
            "type": "string",
            "minLength": 1
          },
          "useCase": {
            "type": "string",
            "minLength": 1
          },
          "assetIds": {
            "type": "array",
            "minItems": 4,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$"
            }
          },
          "fontIds": {
            "type": "array",
            "minItems": 3,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$"
            }
          },
          "palette": {
            "type": "array",
            "minItems": 3,
            "maxItems": 3,
            "items": {
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            }
          },
          "motion": {
            "type": "string",
            "minLength": 1
          },
          "sound": {
            "type": "string",
            "minLength": 1
          },
          "avoid": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "selectionPolicy": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "version",
        "steps"
      ],
      "properties": {
        "version": {
          "const": 1
        },
        "steps": {
          "type": "array",
          "minItems": 6,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "avoidConsecutive": {
          "type": "object",
          "additionalProperties": {
            "type": "boolean"
          }
        },
        "rank": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    }
  }
}
