Fixes and cleanup
parent: tbd commit: 555bd26
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 commit before the one with the passed id |
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 | |
85 | |
86 | type Success = Commit; |
87 | type Failure = RepositoryError; |
88 | |
89 | |
90 | |
91 | ; |
92 | |
93 | |
94 | type Success = u64; |
95 | type Failure = RepositoryError; |
96 | |
97 | |
98 | /// A request to get a repository's issues count. |
99 | /// |
100 | /// # Authentication |
101 | /// - Instance Authentication |
102 | /// - Validate request against the `issued_for` public key |
103 | /// - Validate User token against the user's instance's public key |
104 | /// # Authorization |
105 | /// - User Authorization |
106 | /// - Potential User permissions checks |
107 | |
108 | ; |
109 | |
110 | |
111 | type Success = ; |
112 | type Failure = RepositoryError; |
113 | |
114 | |
115 | /// A request to get a repository's issue labels. |
116 | /// |
117 | /// # Authentication |
118 | /// - Instance Authentication |
119 | /// - Validate request against the `issued_for` public key |
120 | /// - Validate User token against the user's instance's public key |
121 | /// # Authorization |
122 | /// - User Authorization |
123 | /// - Potential User permissions checks |
124 | |
125 | ; |
126 | |
127 | |
128 | type Success = ; |
129 | type Failure = RepositoryError; |
130 | |
131 | |
132 | /// A request to inspect the tree of a repository. |
133 | /// |
134 | /// # Authentication |
135 | /// - Instance Authentication |
136 | /// - Validate request against the `issued_for` public key |
137 | /// - Validate User token against the user's instance's public key |
138 | /// # Authorization |
139 | /// - User Authorization |
140 | /// - Potential User permissions checks |
141 | |
142 | |
143 | /// Whether to get extra metadata for every entry (file mode, size and last commit made to it). |
144 | pub extra_metadata: bool, |
145 | /// Revision of the repository to get (branch, commit id). |
146 | pub rev: , |
147 | /// If not given a path, it'll default to the base. |
148 | pub path: , |
149 | |
150 | |
151 | |
152 | type Success = ; |
153 | type Failure = RepositoryError; |
154 | |
155 | |
156 | |
157 | pub async |
158 | &mut self, |
159 | extra_metadata: bool, |
160 | rev: , |
161 | path: , |
162 | |
163 | self. |
164 | extra_metadata, |
165 | rev, |
166 | path, |
167 | |
168 | .await |
169 | |
170 | |
171 | pub async |
172 | &mut self, |
173 | id: String, |
174 | |
175 | self. |
176 | .await |
177 | |
178 | |
179 | pub async |
180 | &mut self, |
181 | old_id: String, |
182 | new_id: String, |
183 | |
184 | self. |
185 | .await |
186 | |
187 | |
188 | pub async |
189 | &mut self, |
190 | id: String, |
191 | |
192 | self. |
193 | .await |
194 | |
195 | |
196 | // pub async fn issues_count(&mut self) -> Result<u64, OperationError<RepositoryError>> { |
197 | // self.request::<RepositoryIssuesCountRequest>(RepositoryIssuesCountRequest) |
198 | // .await |
199 | // } |
200 | |
201 | pub async |
202 | &mut self, |
203 | |
204 | self. |
205 | .await |
206 | |
207 | |
208 | pub async |
209 | &mut self, |
210 | |
211 | self. |
212 | .await |
213 | |
214 | |
215 | pub async |
216 | &mut self, |
217 | extra_metadata: bool, |
218 | rev: , |
219 | path: , |
220 | |
221 | self. |
222 | extra_metadata, |
223 | rev: rev.map, |
224 | path: path.map, |
225 | |
226 | .await |
227 | |
228 | |
229 |