{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "baseballBoxScore": {
      "description": "Runs, hits, errors.",
      "properties": {
        "away": {
          "ref": "#baseballTeamLine",
          "type": "ref"
        },
        "home": {
          "ref": "#baseballTeamLine",
          "type": "ref"
        }
      },
      "required": [
        "home",
        "away"
      ],
      "type": "object"
    },
    "baseballSituation": {
      "description": "Baseball detail: count, outs and runners.",
      "properties": {
        "balls": {
          "maximum": 3,
          "minimum": 0,
          "type": "integer"
        },
        "onFirst": {
          "type": "boolean"
        },
        "onSecond": {
          "type": "boolean"
        },
        "onThird": {
          "type": "boolean"
        },
        "outs": {
          "maximum": 3,
          "minimum": 0,
          "type": "integer"
        },
        "strikes": {
          "maximum": 2,
          "minimum": 0,
          "type": "integer"
        }
      },
      "type": "object"
    },
    "baseballTeamLine": {
      "properties": {
        "errors": {
          "minimum": 0,
          "type": "integer"
        },
        "hits": {
          "minimum": 0,
          "type": "integer"
        },
        "leftOnBase": {
          "minimum": 0,
          "type": "integer"
        },
        "runs": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "runs",
        "hits",
        "errors"
      ],
      "type": "object"
    },
    "basketballBoxScore": {
      "description": "Basketball team stats.",
      "properties": {
        "away": {
          "ref": "#basketballTeamStats",
          "type": "ref"
        },
        "home": {
          "ref": "#basketballTeamStats",
          "type": "ref"
        }
      },
      "required": [
        "home",
        "away"
      ],
      "type": "object"
    },
    "basketballSituation": {
      "description": "Basketball detail.",
      "properties": {
        "awayFouls": {
          "minimum": 0,
          "type": "integer"
        },
        "awayTimeouts": {
          "minimum": 0,
          "type": "integer"
        },
        "bonus": {
          "description": "Which team is shooting bonus free throws.",
          "knownValues": [
            "home",
            "away",
            "both"
          ],
          "type": "string"
        },
        "homeFouls": {
          "description": "Team fouls this period.",
          "minimum": 0,
          "type": "integer"
        },
        "homeTimeouts": {
          "minimum": 0,
          "type": "integer"
        },
        "possession": {
          "knownValues": [
            "home",
            "away"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "basketballTeamStats": {
      "properties": {
        "assists": {
          "minimum": 0,
          "type": "integer"
        },
        "blocks": {
          "minimum": 0,
          "type": "integer"
        },
        "fieldGoals": {
          "description": "Made-attempted, e.g. '31-68'.",
          "maxLength": 8,
          "type": "string"
        },
        "freeThrows": {
          "maxLength": 8,
          "type": "string"
        },
        "rebounds": {
          "minimum": 0,
          "type": "integer"
        },
        "steals": {
          "minimum": 0,
          "type": "integer"
        },
        "threePointers": {
          "maxLength": 8,
          "type": "string"
        },
        "turnovers": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "type": "object"
    },
    "competitor": {
      "properties": {
        "abbreviation": {
          "maxLength": 8,
          "type": "string"
        },
        "color": {
          "description": "Primary hex color, e.g. '#FB4F14'.",
          "maxLength": 7,
          "type": "string"
        },
        "logo": {
          "accept": [
            "image/png",
            "image/svg+xml",
            "image/webp"
          ],
          "maxSize": 200000,
          "type": "blob"
        },
        "logoUrl": {
          "description": "Team logo image URL. Viewers may use it when there's no logo blob.",
          "format": "uri",
          "maxLength": 512,
          "type": "string"
        },
        "name": {
          "maxLength": 128,
          "type": "string"
        },
        "profile": {
          "description": "Optional atproto account for the team.",
          "format": "did",
          "type": "string"
        },
        "rank": {
          "description": "Poll ranking (college), e.g. 5 for #5.",
          "maximum": 99,
          "minimum": 1,
          "type": "integer"
        },
        "record": {
          "description": "Season record, e.g. '6-3'.",
          "maxLength": 16,
          "type": "string"
        },
        "score": {
          "minimum": 0,
          "type": "integer"
        },
        "secondaryColor": {
          "description": "Secondary hex color for stripes, e.g. '#000000'.",
          "maxLength": 7,
          "type": "string"
        }
      },
      "required": [
        "name",
        "score"
      ],
      "type": "object"
    },
    "entrant": {
      "description": "One player, driver or team in a leaderboard.",
      "properties": {
        "color": {
          "description": "Hex team color.",
          "maxLength": 7,
          "type": "string"
        },
        "country": {
          "description": "ISO 3166-1 alpha-3, for a flag.",
          "maxLength": 3,
          "type": "string"
        },
        "detail": {
          "description": "Secondary figure as shown, e.g. golf 'Thru 14', race '72 laps', a time '1:12.345'.",
          "maxLength": 16,
          "type": "string"
        },
        "laps": {
          "description": "Racing: laps completed.",
          "minimum": 0,
          "type": "integer"
        },
        "lapsLed": {
          "description": "Racing: laps led (NASCAR).",
          "minimum": 0,
          "type": "integer"
        },
        "members": {
          "description": "Standings: the drivers in a constructor or team, with their own places.",
          "items": {
            "ref": "#member",
            "type": "ref"
          },
          "maxLength": 4,
          "type": "array"
        },
        "name": {
          "maxLength": 128,
          "type": "string"
        },
        "number": {
          "description": "Car number.",
          "maxLength": 4,
          "type": "string"
        },
        "photoUrl": {
          "format": "uri",
          "maxLength": 512,
          "type": "string"
        },
        "points": {
          "description": "Points earned in this session, or season total on a standings record.",
          "minimum": 0,
          "type": "integer"
        },
        "position": {
          "description": "Numeric place, for sorting.",
          "minimum": 1,
          "type": "integer"
        },
        "positionLabel": {
          "description": "Place as shown, e.g. 'T3', 'CUT', 'DNF'.",
          "maxLength": 8,
          "type": "string"
        },
        "profile": {
          "description": "Optional atproto account.",
          "format": "did",
          "type": "string"
        },
        "rounds": {
          "description": "Golf: strokes per completed round.",
          "items": {
            "minimum": 0,
            "type": "integer"
          },
          "maxLength": 6,
          "type": "array"
        },
        "score": {
          "description": "Main figure as shown: golf to-par ('-12', 'E'), race gap ('+3.214', '+1 lap'), or points.",
          "maxLength": 16,
          "type": "string"
        },
        "shortName": {
          "description": "e.g. 'S. Scheffler', 'VER'.",
          "maxLength": 32,
          "type": "string"
        },
        "state": {
          "description": "Racing/golf status of this entrant.",
          "knownValues": [
            "active",
            "finished",
            "pit",
            "out",
            "cut",
            "withdrawn",
            "dnf",
            "dsq"
          ],
          "type": "string"
        },
        "team": {
          "description": "Constructor or race team, e.g. 'Red Bull Racing', 'Hendrick Motorsports'.",
          "maxLength": 64,
          "type": "string"
        },
        "thru": {
          "description": "Golf: holes completed this round, 'F' when done.",
          "maxLength": 4,
          "type": "string"
        },
        "toPar": {
          "description": "Golf: total relative to par.",
          "type": "integer"
        },
        "today": {
          "description": "Golf: this round to par, e.g. '-4'.",
          "maxLength": 8,
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "footballBoxScore": {
      "description": "Football team stats.",
      "properties": {
        "away": {
          "ref": "#footballTeamStats",
          "type": "ref"
        },
        "home": {
          "ref": "#footballTeamStats",
          "type": "ref"
        }
      },
      "required": [
        "home",
        "away"
      ],
      "type": "object"
    },
    "footballSituation": {
      "description": "Football detail: who has the ball, down and distance, field position.",
      "properties": {
        "distance": {
          "minimum": 0,
          "type": "integer"
        },
        "down": {
          "maximum": 4,
          "minimum": 1,
          "type": "integer"
        },
        "possession": {
          "knownValues": [
            "home",
            "away"
          ],
          "type": "string"
        },
        "yardLine": {
          "maxLength": 16,
          "type": "string"
        }
      },
      "type": "object"
    },
    "footballTeamStats": {
      "properties": {
        "firstDowns": {
          "minimum": 0,
          "type": "integer"
        },
        "passingYards": {
          "minimum": 0,
          "type": "integer"
        },
        "penalties": {
          "minimum": 0,
          "type": "integer"
        },
        "rushingYards": {
          "minimum": 0,
          "type": "integer"
        },
        "sacks": {
          "minimum": 0,
          "type": "integer"
        },
        "thirdDowns": {
          "description": "e.g. '5-12'.",
          "maxLength": 8,
          "type": "string"
        },
        "timeOfPossession": {
          "description": "e.g. '31:12'.",
          "maxLength": 8,
          "type": "string"
        },
        "totalYards": {
          "minimum": 0,
          "type": "integer"
        },
        "turnovers": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "type": "object"
    },
    "golfProgress": {
      "description": "Golf tournament progress.",
      "properties": {
        "cutLine": {
          "description": "Projected or actual cut, e.g. '+1'.",
          "maxLength": 8,
          "type": "string"
        },
        "playoff": {
          "type": "boolean"
        },
        "round": {
          "maximum": 6,
          "minimum": 1,
          "type": "integer"
        },
        "totalRounds": {
          "maximum": 6,
          "minimum": 1,
          "type": "integer"
        }
      },
      "type": "object"
    },
    "hockeySituation": {
      "description": "Hockey detail.",
      "properties": {
        "awaySkaters": {
          "maximum": 6,
          "minimum": 3,
          "type": "integer"
        },
        "emptyNet": {
          "knownValues": [
            "home",
            "away",
            "both"
          ],
          "type": "string"
        },
        "homeSkaters": {
          "maximum": 6,
          "minimum": 3,
          "type": "integer"
        },
        "powerPlay": {
          "knownValues": [
            "home",
            "away"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "leaderboardSnapshot": {
      "description": "Copy of a leaderboard when a post was made: top of the field plus anyone the post is about. Also used for posts about a standings record.",
      "properties": {
        "capturedAt": {
          "format": "datetime",
          "type": "string"
        },
        "progress": {
          "description": "Where a leaderboard event stands. Open.",
          "refs": [
            "com.professorbutts.sports.defs#golfProgress",
            "com.professorbutts.sports.defs#raceProgress"
          ],
          "type": "union"
        },
        "standings": {
          "items": {
            "ref": "#entrant",
            "type": "ref"
          },
          "maxLength": 10,
          "type": "array"
        },
        "status": {
          "knownValues": [
            "scheduled",
            "live",
            "halftime",
            "final",
            "postponed",
            "canceled"
          ],
          "type": "string"
        }
      },
      "required": [
        "capturedAt",
        "status",
        "standings"
      ],
      "type": "object"
    },
    "lineScore": {
      "description": "Score by period, for any sport.",
      "properties": {
        "periods": {
          "items": {
            "ref": "#periodScore",
            "type": "ref"
          },
          "maxLength": 30,
          "type": "array"
        }
      },
      "required": [
        "periods"
      ],
      "type": "object"
    },
    "member": {
      "description": "A driver within a constructor/team standings row, with their own standing.",
      "properties": {
        "name": {
          "maxLength": 128,
          "type": "string"
        },
        "points": {
          "minimum": 0,
          "type": "integer"
        },
        "position": {
          "minimum": 1,
          "type": "integer"
        },
        "positionLabel": {
          "maxLength": 8,
          "type": "string"
        },
        "score": {
          "maxLength": 16,
          "type": "string"
        },
        "shortName": {
          "maxLength": 32,
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "period": {
      "properties": {
        "label": {
          "description": "Display label, e.g. 'Q3', 'Top 7th', '2nd Half', 'OT'.",
          "maxLength": 16,
          "type": "string"
        },
        "number": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "number"
      ],
      "type": "object"
    },
    "periodScore": {
      "properties": {
        "away": {
          "minimum": 0,
          "type": "integer"
        },
        "home": {
          "minimum": 0,
          "type": "integer"
        },
        "label": {
          "description": "e.g. 'Q1', '7', 'OT'.",
          "maxLength": 16,
          "type": "string"
        }
      },
      "required": [
        "label",
        "home",
        "away"
      ],
      "type": "object"
    },
    "raceProgress": {
      "description": "Motorsport race progress.",
      "properties": {
        "flag": {
          "knownValues": [
            "green",
            "yellow",
            "red",
            "checkered",
            "safetyCar",
            "virtualSafetyCar",
            "white"
          ],
          "type": "string"
        },
        "lap": {
          "minimum": 0,
          "type": "integer"
        },
        "session": {
          "knownValues": [
            "practice",
            "qualifying",
            "sprint",
            "race"
          ],
          "type": "string"
        },
        "stage": {
          "description": "NASCAR stage.",
          "minimum": 1,
          "type": "integer"
        },
        "totalLaps": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "type": "object"
    },
    "snapshot": {
      "description": "Copy of the game state when a post was made. Game records are overwritten as the game goes on, so the post carries its own copy.",
      "properties": {
        "awayScore": {
          "minimum": 0,
          "type": "integer"
        },
        "capturedAt": {
          "format": "datetime",
          "type": "string"
        },
        "clock": {
          "maxLength": 16,
          "type": "string"
        },
        "homeScore": {
          "minimum": 0,
          "type": "integer"
        },
        "period": {
          "ref": "#period",
          "type": "ref"
        },
        "situation": {
          "description": "Sport-specific live detail. Open: viewers skip types they don't know.",
          "refs": [
            "com.professorbutts.sports.defs#footballSituation",
            "com.professorbutts.sports.defs#baseballSituation",
            "com.professorbutts.sports.defs#basketballSituation",
            "com.professorbutts.sports.defs#hockeySituation",
            "com.professorbutts.sports.defs#soccerSituation"
          ],
          "type": "union"
        },
        "status": {
          "knownValues": [
            "scheduled",
            "live",
            "halftime",
            "final",
            "postponed",
            "canceled"
          ],
          "type": "string"
        }
      },
      "required": [
        "capturedAt",
        "status",
        "homeScore",
        "awayScore"
      ],
      "type": "object"
    },
    "soccerSituation": {
      "description": "Soccer detail.",
      "properties": {
        "awayRedCards": {
          "minimum": 0,
          "type": "integer"
        },
        "homeRedCards": {
          "minimum": 0,
          "type": "integer"
        },
        "stoppageTime": {
          "description": "Announced added minutes, e.g. '3'.",
          "maxLength": 4,
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "description": "Shared types for com.professorbutts.sports records and the post-side scoreboard field.",
  "id": "com.professorbutts.sports.defs",
  "lexicon": 1
}
