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