Experimental repository diff structure
parent: tbd commit: 0ef533d
1 | use ; |
2 | |
3 | use crate:: |
4 | , |
5 | , | Object
6 | , | ObjectBackend
7 | , | GiteratedOperation
8 | ; |
9 | |
10 | use |
11 | Commit, IssueLabel, Repository, RepositoryDiff, RepositoryFile, RepositoryIssue, |
12 | RepositoryTreeEntry, RepositoryView, |
13 | ; |
14 | |
15 | /// A request to get a repository's information. |
16 | /// |
17 | /// # Authentication |
18 | /// - Instance Authentication |
19 | /// - Validate request against the `issued_for` public key |
20 | /// - Validate User token against the user's instance's public key |
21 | /// # Authorization |
22 | /// - User Authorization |
23 | /// - Potential User permissions checks |
24 | |
25 | |
26 | pub extra_metadata: bool, |
27 | pub rev: , |
28 | pub path: , |
29 | |
30 | |
31 | |
32 | type Success = RepositoryView; |
33 | type Failure = RepositoryError; |
34 | |
35 | |
36 | /// A request to get a file from a repository using the given id. |
37 | /// |
38 | /// # Authentication |
39 | /// - Instance Authentication |
40 | /// - Validate request against the `issued_for` public key |
41 | /// - Validate User token against the user's instance's public key |
42 | /// # Authorization |
43 | /// - User Authorization |
44 | /// - Potential User permissions checks |
45 | |
46 | ; |
47 | |
48 | |
49 | type Success = RepositoryFile; |
50 | type Failure = RepositoryError; |
51 | |
52 | |
53 | /// A request to get the difference between two repository trees. |
54 | /// |
55 | /// # Authentication |
56 | /// - Instance Authentication |
57 | /// - Validate request against the `issued_for` public key |
58 | /// - Validate User token against the user's instance's public key |
59 | /// # Authorization |
60 | /// - User Authorization |
61 | /// - Potential User permissions checks |
62 | |
63 | |
64 | pub old_id: String, |
65 | pub new_id: String, |
66 | |
67 | |
68 | |
69 | type Success = RepositoryDiff; |
70 | type Failure = RepositoryError; |
71 | |
72 | |
73 | /// A request to get the difference between two repository trees as a unified git patch. |
74 | /// |
75 | /// # Authentication |
76 | /// - Instance Authentication |
77 | /// - Validate request against the `issued_for` public key |
78 | /// - Validate User token against the user's instance's public key |
79 | /// # Authorization |
80 | /// - User Authorization |
81 | /// - Potential User permissions checks |
82 | |
83 | |
84 | pub old_id: String, |
85 | pub new_id: String, |
86 | |
87 | |
88 | |
89 | type Success = String; |
90 | type Failure = RepositoryError; |
91 | |
92 | |
93 | /// A request to get the commit before the one with the passed id |
94 | /// |
95 | /// # Authentication |
96 | /// - Instance Authentication |
97 | /// - Validate request against the `issued_for` public key |
98 | /// - Validate User token against the user's instance's public key |
99 | /// # Authorization |
100 | /// - User Authorization |
101 | /// - Potential User permissions checks |
102 | |
103 | ; |
104 | |
105 | |
106 | type Success = Commit; |
107 | type Failure = RepositoryError; |
108 | |
109 | |
110 | |
111 | ; |
112 | |
113 | |
114 | type Success = u64; |
115 | type Failure = RepositoryError; |
116 | |
117 | |
118 | /// A request to get a repository's issues count. |
119 | /// |
120 | /// # Authentication |
121 | /// - Instance Authentication |
122 | /// - Validate request against the `issued_for` public key |
123 | /// - Validate User token against the user's instance's public key |
124 | /// # Authorization |
125 | /// - User Authorization |
126 | /// - Potential User permissions checks |
127 | |
128 | ; |
129 | |
130 | |
131 | type Success = ; |
132 | type Failure = RepositoryError; |
133 | |
134 | |
135 | /// A request to get a repository's issue labels. |
136 | /// |
137 | /// # Authentication |
138 | /// - Instance Authentication |
139 | /// - Validate request against the `issued_for` public key |
140 | /// - Validate User token against the user's instance's public key |
141 | /// # Authorization |
142 | /// - User Authorization |
143 | /// - Potential User permissions checks |
144 | |
145 | ; |
146 | |
147 | |
148 | type Success = ; |
149 | type Failure = RepositoryError; |
150 | |
151 | |
152 | /// A request to inspect the tree of a repository. |
153 | /// |
154 | /// # Authentication |
155 | /// - Instance Authentication |
156 | /// - Validate request against the `issued_for` public key |
157 | /// - Validate User token against the user's instance's public key |
158 | /// # Authorization |
159 | /// - User Authorization |
160 | /// - Potential User permissions checks |
161 | |
162 | |
163 | /// Whether to get extra metadata for every entry (file mode, size and last commit made to it). |
164 | pub extra_metadata: bool, |
165 | /// Revision of the repository to get (branch, commit id). |
166 | pub rev: , |
167 | /// If not given a path, it'll default to the base. |
168 | pub path: , |
169 | |
170 | |
171 | |
172 | type Success = ; |
173 | type Failure = RepositoryError; |
174 | |
175 | |
176 | |
177 | pub async |
178 | &mut self, |
179 | extra_metadata: bool, |
180 | rev: , |
181 | path: , |
182 | operation_state: &S, |
183 | |
184 | self. |
185 | RepositoryInfoRequest |
186 | extra_metadata, |
187 | rev, |
188 | path, |
189 | , |
190 | operation_state, |
191 | |
192 | .await |
193 | |
194 | |
195 | pub async |
196 | &mut self, |
197 | id: String, |
198 | operation_state: &S, |
199 | |
200 | self. |
201 | RepositoryFileFromIdRequest, |
202 | operation_state, |
203 | |
204 | .await |
205 | |
206 | |
207 | pub async |
208 | &mut self, |
209 | old_id: String, |
210 | new_id: String, |
211 | operation_state: &S, |
212 | |
213 | self. |
214 | RepositoryDiffRequest , |
215 | operation_state, |
216 | |
217 | .await |
218 | |
219 | |
220 | pub async |
221 | &mut self, |
222 | old_id: String, |
223 | new_id: String, |
224 | operation_state: &S, |
225 | |
226 | self. |
227 | RepositoryDiffPatchRequest , |
228 | operation_state, |
229 | |
230 | .await |
231 | |
232 | |
233 | pub async |
234 | &mut self, |
235 | id: String, |
236 | operation_state: &S, |
237 | |
238 | self. |
239 | RepositoryCommitBeforeRequest, |
240 | operation_state, |
241 | |
242 | .await |
243 | |
244 | |
245 | // pub async fn issues_count(&mut self) -> Result<u64, OperationError<RepositoryError>> { |
246 | // self.request::<RepositoryIssuesCountRequest>(RepositoryIssuesCountRequest) |
247 | // .await |
248 | // } |
249 | |
250 | pub async |
251 | &mut self, |
252 | operation_state: &S, |
253 | |
254 | self. |
255 | .await |
256 | |
257 | |
258 | pub async |
259 | &mut self, |
260 | operation_state: &S, |
261 | |
262 | self. |
263 | .await |
264 | |
265 | |
266 | pub async |
267 | &mut self, |
268 | extra_metadata: bool, |
269 | rev: , |
270 | path: , |
271 | operation_state: &S, |
272 | |
273 | self. |
274 | RepositoryFileInspectRequest |
275 | extra_metadata, |
276 | rev: rev.map, |
277 | path: path.map, |
278 | , |
279 | operation_state, |
280 | |
281 | .await |
282 | |
283 | |
284 |