{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://glass.spboucher.ai/registry/schema/lock.schema.json",
  "title": "spglass.lock.json",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "registry",
    "items",
    "themes"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "registry": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "version",
          "kind",
          "requested",
          "dependencies",
          "digest",
          "files"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
            "maxLength": 64
          },
          "version": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z]+(\\.[0-9A-Za-z]+)*)?$",
            "maxLength": 64
          },
          "kind": {
            "type": "string"
          },
          "requested": {
            "type": "boolean"
          },
          "dependencies": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
              "maxLength": 64
            }
          },
          "digest": {
            "type": "string"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "path",
                "sha256",
                "bytes"
              ],
              "properties": {
                "path": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 240,
                  "pattern": "^(?!/)(?!~)(?!.*(^|/)\\.)(?!.*//)[A-Za-z0-9+_. /-]+$",
                  "description": "Relative path with forward slashes. No component may be empty, start with a dot, or be '.' or '..'."
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "bytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1048576
                }
              }
            }
          }
        }
      }
    },
    "themes": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "version",
          "path",
          "sha256"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
            "maxLength": 64
          },
          "version": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z]+(\\.[0-9A-Za-z]+)*)?$",
            "maxLength": 64
          },
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240,
            "pattern": "^(?!/)(?!~)(?!.*(^|/)\\.)(?!.*//)[A-Za-z0-9+_. /-]+$",
            "description": "Relative path with forward slashes. No component may be empty, start with a dot, or be '.' or '..'."
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        }
      }
    }
  }
}
