{
  "$id": "https://visual-feedback/schema/export.schema.json",
  "title": "Framehuddle export",
  "description": "One immutable export. Screen IDs are unique across the export; (section, column, row) cells are unique. section is a nested path, not a slash-delimited string. image is raw base64 PNG/JPEG/WebP, required in import files and omitted in API manifests. At most 3 MB/image, 20 megapixels/image and 100 MB decoded/export.",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "number",
      "const": 1
    },
    "export": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80,
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        "commit": {
          "type": "string",
          "maxLength": 80
        },
        "notes": {
          "type": "string",
          "maxLength": 2000
        }
      },
      "required": [
        "version",
        "title"
      ],
      "additionalProperties": false
    },
    "screens": {
      "minItems": 1,
      "maxItems": 200,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*$"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "column": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50
          },
          "row": {
            "type": "integer",
            "minimum": -30,
            "maximum": 30
          },
          "width": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8192
          },
          "height": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8192
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "image": {
            "type": "string",
            "maxLength": 4200000
          },
          "section": {
            "default": [],
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            }
          },
          "tags": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 40
            }
          }
        },
        "required": [
          "id",
          "title",
          "column",
          "row",
          "width",
          "height",
          "sha256",
          "section",
          "tags"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "schemaVersion",
    "export",
    "screens"
  ],
  "additionalProperties": false
}
