1 | import { DefaultLogFields } from '../src/lib/tasks/log';
|
2 |
|
3 | export interface BranchSummaryBranch {
|
4 | current: boolean;
|
5 | name: string;
|
6 | commit: string;
|
7 | label: string;
|
8 | }
|
9 |
|
10 | export interface BranchSummary {
|
11 | detached: boolean;
|
12 | current: string;
|
13 | all: string[];
|
14 | branches: {
|
15 | [key: string]: BranchSummaryBranch;
|
16 | };
|
17 | }
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export interface BranchSingleDeleteSuccess {
|
23 | branch: string;
|
24 | hash: string;
|
25 | success: true;
|
26 | }
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | export interface BranchSingleDeleteFailure {
|
32 | branch: string;
|
33 | hash: null;
|
34 | success: false;
|
35 | }
|
36 |
|
37 | export type BranchSingleDeleteResult = BranchSingleDeleteFailure | BranchSingleDeleteSuccess;
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | export interface BranchMultiDeleteResult {
|
43 | |
44 |
|
45 |
|
46 | all: BranchSingleDeleteResult[];
|
47 |
|
48 | |
49 |
|
50 |
|
51 | branches: { [branchName: string]: BranchSingleDeleteResult };
|
52 |
|
53 | |
54 |
|
55 |
|
56 | errors: BranchSingleDeleteResult[];
|
57 |
|
58 | |
59 |
|
60 |
|
61 | readonly success: boolean;
|
62 | }
|
63 |
|
64 | export interface CleanSummary {
|
65 | readonly dryRun: boolean;
|
66 | paths: string[];
|
67 | files: string[];
|
68 | folders: string[];
|
69 | }
|
70 |
|
71 | export interface CommitResult {
|
72 | author: null | {
|
73 | email: string;
|
74 | name: string;
|
75 | };
|
76 | branch: string;
|
77 | commit: string;
|
78 | root: boolean;
|
79 | summary: {
|
80 | changes: number;
|
81 | insertions: number;
|
82 | deletions: number;
|
83 | };
|
84 | }
|
85 |
|
86 |
|
87 | export interface ConfigGetResult {
|
88 |
|
89 | key: string;
|
90 |
|
91 |
|
92 | value: string | null;
|
93 |
|
94 |
|
95 | values: string[];
|
96 |
|
97 |
|
98 | paths: string[];
|
99 |
|
100 | |
101 |
|
102 |
|
103 |
|
104 |
|
105 | scopes: Map<string, string[]>;
|
106 | }
|
107 |
|
108 |
|
109 |
|
110 |
|
111 | export interface ConfigListSummary {
|
112 |
|
113 | |
114 |
|
115 |
|
116 |
|
117 | readonly all: ConfigValues;
|
118 |
|
119 | |
120 |
|
121 |
|
122 | files: string[];
|
123 |
|
124 | |
125 |
|
126 |
|
127 |
|
128 | values: { [fileName: string]: ConfigValues };
|
129 | }
|
130 |
|
131 |
|
132 |
|
133 |
|
134 | export interface ConfigValues {
|
135 | [key: string]: string | string[];
|
136 | }
|
137 |
|
138 | export interface DiffResultTextFile {
|
139 | file: string;
|
140 | changes: number;
|
141 | insertions: number;
|
142 | deletions: number;
|
143 | binary: false;
|
144 | }
|
145 |
|
146 | export interface DiffResultBinaryFile {
|
147 | file: string;
|
148 | before: number;
|
149 | after: number;
|
150 | binary: true;
|
151 | }
|
152 |
|
153 | export interface DiffResult {
|
154 |
|
155 | changed: number;
|
156 |
|
157 |
|
158 | files: Array<DiffResultTextFile | DiffResultBinaryFile>;
|
159 |
|
160 |
|
161 | insertions: number;
|
162 |
|
163 |
|
164 | deletions: number;
|
165 | }
|
166 |
|
167 | export interface FetchResult {
|
168 | raw: string;
|
169 | remote: string | null;
|
170 | branches: {
|
171 | name: string;
|
172 | tracking: string;
|
173 | }[];
|
174 | tags: {
|
175 | name: string;
|
176 | tracking: string;
|
177 | }[];
|
178 | }
|
179 |
|
180 |
|
181 |
|
182 |
|
183 | export interface InitResult {
|
184 | |
185 |
|
186 |
|
187 | readonly bare: boolean;
|
188 |
|
189 | |
190 |
|
191 |
|
192 | readonly existing: boolean;
|
193 |
|
194 | |
195 |
|
196 |
|
197 | readonly path: string;
|
198 |
|
199 | |
200 |
|
201 |
|
202 |
|
203 |
|
204 | readonly gitDir: string;
|
205 | }
|
206 |
|
207 |
|
208 |
|
209 |
|
210 | export interface MoveResult {
|
211 | |
212 |
|
213 |
|
214 | moves: Array<{from: string, to: string}>;
|
215 | }
|
216 |
|
217 | export interface PullDetailFileChanges {
|
218 | [fileName: string]: number;
|
219 | }
|
220 |
|
221 | export interface PullDetailSummary {
|
222 | changes: number;
|
223 | insertions: number;
|
224 | deletions: number;
|
225 | }
|
226 |
|
227 | export interface PullDetail {
|
228 |
|
229 | files: string[];
|
230 |
|
231 |
|
232 | insertions: PullDetailFileChanges;
|
233 |
|
234 |
|
235 | deletions: PullDetailFileChanges;
|
236 |
|
237 | summary: PullDetailSummary;
|
238 |
|
239 |
|
240 | created: string[];
|
241 |
|
242 |
|
243 | deleted: string[];
|
244 | }
|
245 |
|
246 | export interface PullResult extends PullDetail, RemoteMessageResult {
|
247 | }
|
248 |
|
249 |
|
250 |
|
251 |
|
252 | export interface StatusResultRenamed {
|
253 | from: string;
|
254 | to: string;
|
255 | }
|
256 |
|
257 | export interface FileStatusResult {
|
258 |
|
259 |
|
260 | from?: string
|
261 |
|
262 |
|
263 | path: string;
|
264 |
|
265 | |
266 |
|
267 |
|
268 | index: string;
|
269 |
|
270 | |
271 |
|
272 | working_dir: string;
|
273 | }
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 | export interface StatusResult {
|
280 | not_added: string[];
|
281 | conflicted: string[];
|
282 | created: string[];
|
283 | deleted: string[];
|
284 | modified: string[];
|
285 | renamed: StatusResultRenamed[];
|
286 | staged: string[];
|
287 | files: FileStatusResult[];
|
288 | ahead: number;
|
289 | behind: number;
|
290 | current: string | null;
|
291 | tracking: string | null;
|
292 |
|
293 | |
294 |
|
295 |
|
296 | isClean(): boolean;
|
297 | }
|
298 |
|
299 |
|
300 |
|
301 |
|
302 | export interface TagResult {
|
303 | |
304 |
|
305 |
|
306 | all: string[];
|
307 |
|
308 | |
309 |
|
310 |
|
311 | latest: string | undefined;
|
312 | }
|
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 | export interface ListLogLine {
|
320 | |
321 |
|
322 |
|
323 |
|
324 |
|
325 | diff?: DiffResult;
|
326 | }
|
327 |
|
328 | export interface LogResult<T = DefaultLogFields> {
|
329 | all: ReadonlyArray<T & ListLogLine>;
|
330 | total: number;
|
331 | latest: (T & ListLogLine) | null;
|
332 | }
|
333 |
|
334 |
|
335 |
|
336 |
|
337 | export interface MergeConflictDeletion {
|
338 | deleteRef: string;
|
339 | }
|
340 |
|
341 |
|
342 |
|
343 |
|
344 | export interface MergeConflict {
|
345 |
|
346 | |
347 |
|
348 |
|
349 | reason: string;
|
350 |
|
351 | |
352 |
|
353 |
|
354 | file: string | null;
|
355 |
|
356 | |
357 |
|
358 |
|
359 | meta?: MergeConflictDeletion;
|
360 | }
|
361 |
|
362 | export type MergeResultStatus = 'success' | string;
|
363 |
|
364 | export interface MergeDetail {
|
365 | conflicts: MergeConflict[];
|
366 | merges: string[];
|
367 | result: MergeResultStatus;
|
368 | readonly failed: boolean;
|
369 | }
|
370 |
|
371 | export type MergeResult = PullResult & MergeDetail;
|
372 |
|
373 |
|
374 |
|
375 |
|
376 | export interface PushResultPushedItem {
|
377 | local: string;
|
378 | remote: string;
|
379 |
|
380 | readonly deleted: boolean;
|
381 | readonly tag: boolean;
|
382 | readonly branch: boolean;
|
383 | readonly new: boolean;
|
384 | readonly alreadyUpdated: boolean;
|
385 | }
|
386 |
|
387 | export interface RemoteMessagesObjectEnumeration {
|
388 | enumerating: number,
|
389 | counting: number,
|
390 | compressing: number,
|
391 | total: {
|
392 | count: number,
|
393 | delta: number,
|
394 | },
|
395 | reused: {
|
396 | count: number,
|
397 | delta: number,
|
398 | },
|
399 | packReused: number,
|
400 | }
|
401 |
|
402 | export interface RemoteMessages {
|
403 | all: string[];
|
404 | objects?: RemoteMessagesObjectEnumeration;
|
405 | }
|
406 |
|
407 | export interface PushResultRemoteMessages extends RemoteMessages {
|
408 | pullRequestUrl?: string;
|
409 | vulnerabilities?: {
|
410 | count: number;
|
411 | summary: string;
|
412 | url: string;
|
413 | };
|
414 | }
|
415 |
|
416 | export interface RemoteMessageResult<T extends RemoteMessages = RemoteMessages> {
|
417 | remoteMessages: T;
|
418 | }
|
419 |
|
420 | export interface PushResultBranchUpdate {
|
421 | head: {
|
422 | local: string;
|
423 | remote: string;
|
424 | };
|
425 | hash: {
|
426 | from: string;
|
427 | to: string;
|
428 | };
|
429 | }
|
430 |
|
431 | export interface PushDetail {
|
432 | repo?: string;
|
433 | ref?: {
|
434 | local: string;
|
435 | };
|
436 | pushed: PushResultPushedItem[];
|
437 | branch?: {
|
438 | local: string;
|
439 | remote: string;
|
440 | remoteName: string;
|
441 | };
|
442 | update?: PushResultBranchUpdate;
|
443 | }
|
444 |
|
445 | export interface PushResult extends PushDetail, RemoteMessageResult<PushResultRemoteMessages> {
|
446 | }
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 | export type CommitSummary = CommitResult;
|
453 |
|
454 |
|
455 |
|
456 |
|
457 |
|
458 | export type MergeSummary = MergeResult;
|
459 |
|
460 |
|
461 |
|
462 |
|
463 | export type BranchDeletionSummary = BranchSingleDeleteResult;
|
464 |
|
465 |
|
466 |
|
467 |
|
468 | export type BranchDeletionBatchSummary = BranchMultiDeleteResult;
|
469 |
|
470 | export type MoveSummary = MoveResult;
|
471 |
|
472 |
|
473 |
|
474 |
|
475 | export type ListLogSummary<T = DefaultLogFields> = LogResult<T>;
|