{
  "lexicon": 1,
  "id": "sh.tangled.git.refUpdate",
  "defs": {
    "main": {
      "type": "record",
      "description": "An update to a git repository, emitted by knots.",
      "key": "tid",
      "record": {
        "type": "object",
        "required": [
          "ref",
          "committerDid",
          "repo",
          "oldSha",
          "newSha",
          "meta"
        ],
        "properties": {
          "ref": {
            "type": "string",
            "description": "Ref being updated",
            "maxGraphemes": 256,
            "maxLength": 2560
          },
          "committerDid": {
            "type": "string",
            "description": "did of the user that pushed this ref",
            "format": "did"
          },
          "ownerDid": {
            "type": "string",
            "description": "did of the owner of the repo",
            "format": "did"
          },
          "repo": {
            "type": "string",
            "description": "DID of the repo itself",
            "format": "did"
          },
          "oldSha": {
            "type": "string",
            "description": "old SHA of this ref",
            "minLength": 40,
            "maxLength": 40
          },
          "newSha": {
            "type": "string",
            "description": "new SHA of this ref",
            "minLength": 40,
            "maxLength": 40
          },
          "meta": {
            "type": "ref",
            "ref": "#meta"
          }
        }
      }
    },
    "meta": {
      "type": "object",
      "required": ["isDefaultRef", "commitCount"],
      "properties": {
        "isDefaultRef": {
          "type": "boolean",
          "default": false
        },
        "langBreakdown": {
          "type": "ref",
          "ref": "#langBreakdown"
        },
        "commitCount": {
          "type": "ref",
          "ref": "#commitCountBreakdown"
        }
      }
    },
    "langBreakdown": {
      "type": "object",
      "properties": {
        "inputs": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#individualLanguageSize"
          }
        }
      }
    },
    "individualLanguageSize": {
      "type": "object",
      "required": ["lang", "size"],
      "properties": {
        "lang": {
          "type": "string"
        },
        "size": {
          "type": "integer"
        }
      }
    },
    "commitCountBreakdown": {
      "type": "object",
      "required": [],
      "properties": {
        "byEmail": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#individualEmailCommitCount"
          }
        }
      }
    },
    "individualEmailCommitCount": {
      "type": "object",
      "required": ["email", "count"],
      "properties": {
        "email": {
          "type": "string"
        },
        "count": {
          "type": "integer"
        }
      }
    }
  }
}
