forked from tangled.org/core
Monorepo for Tangled — https://tangled.org
1{ 2 "lexicon": 1, 3 "id": "sh.tangled.repo.tree", 4 "defs": { 5 "main": { 6 "type": "query", 7 "parameters": { 8 "type": "params", 9 "required": ["repo", "ref"], 10 "properties": { 11 "repo": { 12 "type": "string", 13 "description": "Repository identifier in format 'did:plc:.../repoName'" 14 }, 15 "ref": { 16 "type": "string", 17 "description": "Git reference (branch, tag, or commit SHA)" 18 }, 19 "path": { 20 "type": "string", 21 "description": "Path within the repository tree", 22 "default": "" 23 } 24 } 25 }, 26 "output": { 27 "encoding": "application/json", 28 "schema": { 29 "type": "object", 30 "required": ["ref", "files"], 31 "properties": { 32 "ref": { 33 "type": "string", 34 "description": "The git reference used" 35 }, 36 "parent": { 37 "type": "string", 38 "description": "The parent path in the tree" 39 }, 40 "dotdot": { 41 "type": "string", 42 "description": "Parent directory path" 43 }, 44 "readme": { 45 "type": "ref", 46 "ref": "#readme", 47 "description": "Readme for this file tree" 48 }, 49 "files": { 50 "type": "array", 51 "items": { 52 "type": "ref", 53 "ref": "#treeEntry" 54 } 55 } 56 } 57 } 58 }, 59 "errors": [ 60 { 61 "name": "RepoNotFound", 62 "description": "Repository not found or access denied" 63 }, 64 { 65 "name": "RefNotFound", 66 "description": "Git reference not found" 67 }, 68 { 69 "name": "PathNotFound", 70 "description": "Path not found in repository tree" 71 }, 72 { 73 "name": "InvalidRequest", 74 "description": "Invalid request parameters" 75 } 76 ] 77 }, 78 "readme": { 79 "type": "object", 80 "required": ["filename", "contents"], 81 "properties": { 82 "filename": { 83 "type": "string", 84 "description": "Name of the readme file" 85 }, 86 "contents": { 87 "type": "string", 88 "description": "Contents of the readme file" 89 } 90 } 91 }, 92 "treeEntry": { 93 "type": "object", 94 "required": ["name", "mode", "size"], 95 "properties": { 96 "name": { 97 "type": "string", 98 "description": "Relative file or directory name" 99 }, 100 "mode": { 101 "type": "string", 102 "description": "File mode" 103 }, 104 "size": { 105 "type": "integer", 106 "description": "File size in bytes" 107 }, 108 "last_commit": { 109 "type": "ref", 110 "ref": "#lastCommit" 111 } 112 } 113 }, 114 "lastCommit": { 115 "type": "object", 116 "required": ["hash", "message", "when"], 117 "properties": { 118 "hash": { 119 "type": "string", 120 "description": "Commit hash" 121 }, 122 "message": { 123 "type": "string", 124 "description": "Commit message" 125 }, 126 "when": { 127 "type": "string", 128 "format": "datetime", 129 "description": "Commit timestamp" 130 } 131 } 132 } 133 } 134}