forked from
tangled.org/core
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 "fileTooLarge": {
85 "type": "boolean"
86 }
87 }
88 }
89 },
90 "errors": [
91 {
92 "name": "RepoNotFound",
93 "description": "Repository not found or access denied"
94 },
95 {
96 "name": "RefNotFound",
97 "description": "Git reference not found"
98 },
99 {
100 "name": "FileNotFound",
101 "description": "File not found at the specified path"
102 },
103 {
104 "name": "InvalidRequest",
105 "description": "Invalid request parameters"
106 }
107 ]
108 },
109 "lastCommit": {
110 "type": "object",
111 "required": [
112 "hash",
113 "message",
114 "when"
115 ],
116 "properties": {
117 "hash": {
118 "type": "string",
119 "description": "Commit hash"
120 },
121 "message": {
122 "type": "string",
123 "description": "Commit message"
124 },
125 "author": {
126 "type": "ref",
127 "ref": "#signature"
128 },
129 "when": {
130 "type": "string",
131 "format": "datetime",
132 "description": "Commit timestamp"
133 }
134 }
135 },
136 "signature": {
137 "type": "object",
138 "required": [
139 "name",
140 "email",
141 "when"
142 ],
143 "properties": {
144 "name": {
145 "type": "string",
146 "description": "Author name"
147 },
148 "email": {
149 "type": "string",
150 "description": "Author email"
151 },
152 "when": {
153 "type": "string",
154 "format": "datetime",
155 "description": "Author timestamp"
156 }
157 }
158 },
159 "submodule": {
160 "type": "object",
161 "required": [
162 "name",
163 "url"
164 ],
165 "properties": {
166 "name": {
167 "type": "string",
168 "description": "Submodule name"
169 },
170 "url": {
171 "type": "string",
172 "description": "Submodule repository URL"
173 },
174 "branch": {
175 "type": "string",
176 "description": "Branch to track in the submodule"
177 }
178 }
179 }
180 }
181}