{
  "lexicon": 1,
  "id": "org.tangled.temp.repo.getSiteConfig",
  "defs": {
    "main": {
      "type": "query",
      "description": "Get the site configuration for a repository, if one exists.",
      "parameters": {
        "type": "params",
        "required": ["repoDid"],
        "properties": {
          "repoDid": {
            "type": "string",
            "format": "did",
            "description": "DID of the repository as minted by the knot."
          }
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "properties": {
            "config": {
              "type": "ref",
              "ref": "#siteConfig",
              "description": "Site config for the repository. Absent if no site is configured."
            }
          }
        }
      },
      "errors": [
        { "name": "NotOwner", "description": "The account does not own this repository." },
        { "name": "RepoNotFound", "description": "No repository record publishes this repo DID." },
        { "name": "OwnershipUnverifiable", "description": "Repository ownership could not be verified." }
      ]
    },
    "siteConfig": {
      "type": "object",
      "required": ["branch", "dir", "isIndex"],
      "properties": {
        "branch": {
          "type": "string",
          "description": "Branch to deploy from."
        },
        "dir": {
          "type": "string",
          "description": "Directory within the repository to deploy (e.g. '/' or '/docs')."
        },
        "isIndex": {
          "type": "boolean",
          "description": "Whether this repo serves as the index (root) for the domain."
        }
      }
    }
  }
}
