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