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