{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "List protocube records by tag (feed/tag pages, newest-indexed first) or by repository (author pages, descending record key).",
      "errors": [
        {
          "name": "InvalidRequest"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cursor": {
              "type": "string"
            },
            "records": {
              "items": {
                "ref": "#recordView",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "records"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "collection": {
            "description": "at.protocube.walkthrough, at.protocube.series or at.protocube.path.",
            "format": "nsid",
            "type": "string"
          },
          "cursor": {
            "type": "string"
          },
          "did": {
            "description": "Repository filter. Requires order=rkey and excludes tag.",
            "format": "did",
            "type": "string"
          },
          "limit": {
            "default": 20,
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "order": {
            "default": "newest",
            "description": "newest = indexed_at DESC, uri DESC. rkey = record key DESC for one repository.",
            "enum": [
              "newest",
              "rkey"
            ],
            "type": "string"
          },
          "tag": {
            "description": "Full tag string, e.g. tag:protocube. Requires order=newest and excludes did.",
            "maxLength": 64,
            "type": "string"
          }
        },
        "required": [
          "collection"
        ],
        "type": "params"
      },
      "type": "query"
    },
    "recordView": {
      "properties": {
        "cid": {
          "format": "cid",
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        },
        "value": {
          "description": "The raw record value. The AppView never flattens or rewrites it; the client validates it.",
          "type": "unknown"
        }
      },
      "required": [
        "uri",
        "cid",
        "value"
      ],
      "type": "object"
    }
  },
  "id": "at.protocube.listRecords",
  "lexicon": 1
}
