{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "checksum": {
      "description": "Cryptographic checksum for integrity verification.",
      "properties": {
        "algo": {
          "description": "Hash algorithm name.",
          "knownValues": [
            "sha256",
            "sha512",
            "blake3"
          ],
          "maxLength": 32,
          "type": "string"
        },
        "hash": {
          "description": "Hex or base64 encoded digest produced by the algorithm.",
          "maxLength": 128,
          "type": "string"
        }
      },
      "required": [
        "algo",
        "hash"
      ],
      "type": "object"
    },
    "file": {
      "description": "File metadata describing the uploaded blob.",
      "properties": {
        "mimeType": {
          "description": "MIME type, e.g. 'video/mp4'.",
          "maxLength": 255,
          "type": "string"
        },
        "modifiedAt": {
          "description": "Client-side last-modified timestamp.",
          "format": "datetime",
          "type": "string"
        },
        "name": {
          "description": "User-visible filename.",
          "maxLength": 512,
          "type": "string"
        },
        "size": {
          "description": "File size in bytes.",
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "name",
        "size"
      ],
      "type": "object"
    },
    "main": {
      "description": "A record representing an uploaded file blob with metadata.",
      "key": "any",
      "record": {
        "properties": {
          "attribution": {
            "description": "Handle or DID of the account to attribute this upload to.",
            "format": "at-identifier",
            "type": "string"
          },
          "blob": {
            "accept": [
              "*/*"
            ],
            "description": "The uploaded blob reference. Note: Individual PDS instances may enforce lower size limits.",
            "maxSize": 1000000000,
            "type": "blob"
          },
          "checksum": {
            "description": "Optional cryptographic checksum for integrity verification.",
            "ref": "#checksum",
            "type": "ref"
          },
          "createdAt": {
            "description": "Timestamp when this record was created.",
            "format": "datetime",
            "type": "string"
          },
          "file": {
            "description": "Metadata about the file.",
            "ref": "#file",
            "type": "ref"
          }
        },
        "required": [
          "blob",
          "createdAt",
          "file"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "A record for uploading and tracking binary blob files with metadata.",
  "id": "net.altq.aqfile",
  "lexicon": 1
}
