Basic tag search and range
parent: tbd commit: 112ca96
1 | use ; |
2 | |
3 | use crate:: |
4 | , |
5 | , | Object
6 | , | ObjectBackend
7 | , | GiteratedOperation
8 | ; |
9 | |
10 | use |
11 | Commit, IssueLabel, Repository, RepositoryBranch, RepositoryBranchFilter, RepositoryDiff, |
12 | RepositoryFile, RepositoryIssue, RepositoryStatistics, RepositoryTag, RepositoryTreeEntry, |
13 | RepositoryView, |
14 | ; |
15 | |
16 | /// A request to get a repository's information. |
17 | /// |
18 | /// # Authentication |
19 | /// - Instance Authentication |
20 | /// - Validate request against the `issued_for` public key |
21 | /// - Validate User token against the user's instance's public key |
22 | /// # Authorization |
23 | /// - User Authorization |
24 | /// - Potential User permissions checks |
25 | |
26 | |
27 | pub extra_metadata: bool, |
28 | pub rev: , |
29 | pub path: , |
30 | |
31 | |
32 | |
33 | type Success = RepositoryView; |
34 | type Failure = RepositoryError; |
35 | |
36 | |
37 | /// A request to get a file from a repository using the given id. |
38 | /// |
39 | /// # Authentication |
40 | /// - Instance Authentication |
41 | /// - Validate request against the `issued_for` public key |
42 | /// - Validate User token against the user's instance's public key |
43 | /// # Authorization |
44 | /// - User Authorization |
45 | /// - Potential User permissions checks |
46 | |
47 | ; |
48 | |
49 | |
50 | type Success = RepositoryFile; |
51 | type Failure = RepositoryError; |
52 | |
53 | |
54 | /// A request to get a file from a repository using the given relative path. |
55 | /// Also returns the commit id of the rev. |
56 | /// |
57 | /// # Authentication |
58 | /// - Instance Authentication |
59 | /// - Validate request against the `issued_for` public key |
60 | /// - Validate User token against the user's instance's public key |
61 | /// # Authorization |
62 | /// - User Authorization |
63 | /// - Potential User permissions checks |
64 | |
65 | |
66 | pub rev: , |
67 | pub path: String, |
68 | |
69 | |
70 | |
71 | type Success = ; |
72 | type Failure = RepositoryError; |
73 | |
74 | |
75 | /// A request to get the last commit made to a file, using a starting point and the path. |
76 | /// |
77 | /// # Authentication |
78 | /// - Instance Authentication |
79 | /// - Validate request against the `issued_for` public key |
80 | /// - Validate User token against the user's instance's public key |
81 | /// # Authorization |
82 | /// - User Authorization |
83 | /// - Potential User permissions checks |
84 | |
85 | |
86 | /// ID of commit to start at |
87 | pub start_commit: String, |
88 | // Path of the file |
89 | pub path: String, |
90 | |
91 | |
92 | |
93 | type Success = Commit; |
94 | type Failure = RepositoryError; |
95 | |
96 | |
97 | /// A request to get the commit by the specified id. |
98 | /// |
99 | /// # Authentication |
100 | /// - Instance Authentication |
101 | /// - Validate request against the `issued_for` public key |
102 | /// - Validate User token against the user's instance's public key |
103 | /// # Authorization |
104 | /// - User Authorization |
105 | /// - Potential User permissions checks |
106 | |
107 | ; |
108 | |
109 | |
110 | type Success = Commit; |
111 | type Failure = RepositoryError; |
112 | |
113 | |
114 | /// A request to get the difference between two repository trees. |
115 | /// |
116 | /// # Authentication |
117 | /// - Instance Authentication |
118 | /// - Validate request against the `issued_for` public key |
119 | /// - Validate User token against the user's instance's public key |
120 | /// # Authorization |
121 | /// - User Authorization |
122 | /// - Potential User permissions checks |
123 | |
124 | |
125 | pub old_id: String, |
126 | pub new_id: String, |
127 | |
128 | |
129 | |
130 | type Success = RepositoryDiff; |
131 | type Failure = RepositoryError; |
132 | |
133 | |
134 | /// A request to get the difference between two repository trees as a unified git patch. |
135 | /// |
136 | /// # Authentication |
137 | /// - Instance Authentication |
138 | /// - Validate request against the `issued_for` public key |
139 | /// - Validate User token against the user's instance's public key |
140 | /// # Authorization |
141 | /// - User Authorization |
142 | /// - Potential User permissions checks |
143 | |
144 | |
145 | pub old_id: String, |
146 | pub new_id: String, |
147 | |
148 | |
149 | |
150 | type Success = String; |
151 | type Failure = RepositoryError; |
152 | |
153 | |
154 | /// A request to get the commit before the one with the passed id |
155 | /// |
156 | /// # Authentication |
157 | /// - Instance Authentication |
158 | /// - Validate request against the `issued_for` public key |
159 | /// - Validate User token against the user's instance's public key |
160 | /// # Authorization |
161 | /// - User Authorization |
162 | /// - Potential User permissions checks |
163 | |
164 | ; |
165 | |
166 | |
167 | type Success = Commit; |
168 | type Failure = RepositoryError; |
169 | |
170 | |
171 | |
172 | ; |
173 | |
174 | |
175 | type Success = u64; |
176 | type Failure = RepositoryError; |
177 | |
178 | |
179 | /// A request to get a repository's issues count. |
180 | /// |
181 | /// # Authentication |
182 | /// - Instance Authentication |
183 | /// - Validate request against the `issued_for` public key |
184 | /// - Validate User token against the user's instance's public key |
185 | /// # Authorization |
186 | /// - User Authorization |
187 | /// - Potential User permissions checks |
188 | |
189 | ; |
190 | |
191 | |
192 | type Success = ; |
193 | type Failure = RepositoryError; |
194 | |
195 | |
196 | /// A request to get a repository's issue labels. |
197 | /// |
198 | /// # Authentication |
199 | /// - Instance Authentication |
200 | /// - Validate request against the `issued_for` public key |
201 | /// - Validate User token against the user's instance's public key |
202 | /// # Authorization |
203 | /// - User Authorization |
204 | /// - Potential User permissions checks |
205 | |
206 | ; |
207 | |
208 | |
209 | type Success = ; |
210 | type Failure = RepositoryError; |
211 | |
212 | |
213 | /// A request to inspect the tree of a repository. |
214 | /// |
215 | /// # Authentication |
216 | /// - Instance Authentication |
217 | /// - Validate request against the `issued_for` public key |
218 | /// - Validate User token against the user's instance's public key |
219 | /// # Authorization |
220 | /// - User Authorization |
221 | /// - Potential User permissions checks |
222 | |
223 | |
224 | /// Whether to get extra metadata for every entry (file mode, size and last commit made to it). |
225 | pub extra_metadata: bool, |
226 | /// Revision of the repository to get (branch, commit id). |
227 | pub rev: , |
228 | /// If not given a path, it'll default to the base. |
229 | pub path: , |
230 | |
231 | |
232 | |
233 | type Success = ; |
234 | type Failure = RepositoryError; |
235 | |
236 | |
237 | /// A request to get the statistics of repository. |
238 | /// |
239 | /// # Authentication |
240 | /// - Instance Authentication |
241 | /// - Validate request against the `issued_for` public key |
242 | /// - Validate User token against the user's instance's public key |
243 | /// # Authorization |
244 | /// - User Authorization |
245 | /// - Potential User permissions checks |
246 | |
247 | |
248 | /// Revision of the repository to get (branch, commit id). |
249 | pub rev: , |
250 | |
251 | |
252 | |
253 | type Success = RepositoryStatistics; |
254 | type Failure = RepositoryError; |
255 | |
256 | |
257 | /// A request to get a list of branches in the repository. |
258 | /// Also returns the total amount of branches after the filter is applied. |
259 | /// |
260 | /// Optional search parameter that'll search through the filtered branches |
261 | /// |
262 | /// Skips over references with invalid UTF-8 names. |
263 | /// |
264 | /// # Authentication |
265 | /// - Instance Authentication |
266 | /// - Validate request against the `issued_for` public key |
267 | /// - Validate User token against the user's instance's public key |
268 | /// # Authorization |
269 | /// - User Authorization |
270 | /// - Potential User permissions checks |
271 | |
272 | |
273 | pub filter: RepositoryBranchFilter, |
274 | pub range: (usize, usize), |
275 | // pub sort: Option<???> |
276 | pub search: , |
277 | |
278 | |
279 | |
280 | type Success = ; |
281 | type Failure = RepositoryError; |
282 | |
283 | |
284 | /// A request to get a specific branch using its name |
285 | /// |
286 | /// # Authentication |
287 | /// - Instance Authentication |
288 | /// - Validate request against the `issued_for` public key |
289 | /// - Validate User token against the user's instance's public key |
290 | /// # Authorization |
291 | /// - User Authorization |
292 | /// - Potential User permissions checks |
293 | |
294 | |
295 | pub name: String, |
296 | |
297 | |
298 | |
299 | type Success = RepositoryBranch; |
300 | type Failure = RepositoryError; |
301 | |
302 | |
303 | /// A request to get a list of tags in the repository. |
304 | /// Also returns the total amount of tags. |
305 | /// |
306 | /// Optional search parameter that'll search through the tags |
307 | /// |
308 | /// # Authentication |
309 | /// - Instance Authentication |
310 | /// - Validate request against the `issued_for` public key |
311 | /// - Validate User token against the user's instance's public key |
312 | /// # Authorization |
313 | /// - User Authorization |
314 | /// - Potential User permissions checks |
315 | |
316 | |
317 | // pub filter: Option<???>, |
318 | pub range: (usize, usize), |
319 | // pub sort: Option<???>, |
320 | pub search: , |
321 | |
322 | |
323 | |
324 | type Success = ; |
325 | type Failure = RepositoryError; |
326 | |
327 | |
328 | |
329 | pub async |
330 | &mut self, |
331 | extra_metadata: bool, |
332 | rev: , |
333 | path: , |
334 | operation_state: &S, |
335 | |
336 | self. |
337 | RepositoryInfoRequest |
338 | extra_metadata, |
339 | rev, |
340 | path, |
341 | , |
342 | operation_state, |
343 | |
344 | .await |
345 | |
346 | |
347 | pub async |
348 | &mut self, |
349 | id: String, |
350 | operation_state: &S, |
351 | |
352 | self. |
353 | RepositoryFileFromIdRequest, |
354 | operation_state, |
355 | |
356 | .await |
357 | |
358 | |
359 | pub async |
360 | &mut self, |
361 | rev: , |
362 | path: String, |
363 | operation_state: &S, |
364 | |
365 | self. |
366 | RepositoryFileFromPathRequest , |
367 | operation_state, |
368 | |
369 | .await |
370 | |
371 | |
372 | pub async |
373 | &mut self, |
374 | start_commit: String, |
375 | path: String, |
376 | operation_state: &S, |
377 | |
378 | self. |
379 | RepositoryLastCommitOfFileRequest , |
380 | operation_state, |
381 | |
382 | .await |
383 | |
384 | |
385 | pub async |
386 | &mut self, |
387 | id: String, |
388 | operation_state: &S, |
389 | |
390 | self. |
391 | RepositoryCommitFromIdRequest, |
392 | operation_state, |
393 | |
394 | .await |
395 | |
396 | |
397 | pub async |
398 | &mut self, |
399 | old_id: String, |
400 | new_id: String, |
401 | operation_state: &S, |
402 | |
403 | self. |
404 | RepositoryDiffRequest , |
405 | operation_state, |
406 | |
407 | .await |
408 | |
409 | |
410 | pub async |
411 | &mut self, |
412 | old_id: String, |
413 | new_id: String, |
414 | operation_state: &S, |
415 | |
416 | self. |
417 | RepositoryDiffPatchRequest , |
418 | operation_state, |
419 | |
420 | .await |
421 | |
422 | |
423 | pub async |
424 | &mut self, |
425 | id: String, |
426 | operation_state: &S, |
427 | |
428 | self. |
429 | RepositoryCommitBeforeRequest, |
430 | operation_state, |
431 | |
432 | .await |
433 | |
434 | |
435 | pub async |
436 | &mut self, |
437 | rev: , |
438 | operation_state: &S, |
439 | |
440 | self. |
441 | RepositoryStatisticsRequest , |
442 | operation_state, |
443 | |
444 | .await |
445 | |
446 | |
447 | pub async |
448 | &mut self, |
449 | filter: RepositoryBranchFilter, |
450 | range_start: usize, |
451 | range_end: usize, |
452 | search: , |
453 | operation_state: &S, |
454 | |
455 | self. |
456 | RepositoryBranchesRequest |
457 | filter, |
458 | range: , |
459 | search, |
460 | , |
461 | operation_state, |
462 | |
463 | .await |
464 | |
465 | |
466 | pub async |
467 | &mut self, |
468 | name: &str, |
469 | operation_state: &S, |
470 | |
471 | self. |
472 | RepositoryBranchRequest |
473 | name: name.to_string, |
474 | , |
475 | operation_state, |
476 | |
477 | .await |
478 | |
479 | |
480 | pub async |
481 | &mut self, |
482 | range_start: usize, |
483 | range_end: usize, |
484 | search: , |
485 | operation_state: &S, |
486 | |
487 | self. |
488 | RepositoryTagsRequest |
489 | range: , |
490 | search, |
491 | , |
492 | operation_state, |
493 | |
494 | .await |
495 | |
496 | |
497 | // pub async fn issues_count(&mut self) -> Result<u64, OperationError<RepositoryError>> { |
498 | // self.request::<RepositoryIssuesCountRequest>(RepositoryIssuesCountRequest) |
499 | // .await |
500 | // } |
501 | |
502 | pub async |
503 | &mut self, |
504 | operation_state: &S, |
505 | |
506 | self. |
507 | .await |
508 | |
509 | |
510 | pub async |
511 | &mut self, |
512 | operation_state: &S, |
513 | |
514 | self. |
515 | .await |
516 | |
517 | |
518 | pub async |
519 | &mut self, |
520 | extra_metadata: bool, |
521 | rev: , |
522 | path: , |
523 | operation_state: &S, |
524 | |
525 | self. |
526 | RepositoryFileInspectRequest |
527 | extra_metadata, |
528 | rev: rev.map, |
529 | path: path.map, |
530 | , |
531 | operation_state, |
532 | |
533 | .await |
534 | |
535 | |
536 |