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 | status?: DiffNameStatus;
|
148 | }
|
149 |
|
150 | export interface DiffResultBinaryFile {
|
151 | file: string;
|
152 | before: number;
|
153 | after: number;
|
154 | binary: true;
|
155 |
|
156 |
|
157 | status?: string;
|
158 | }
|
159 |
|
160 | export interface DiffResult {
|
161 |
|
162 | changed: number;
|
163 |
|
164 |
|
165 | files: Array<DiffResultTextFile | DiffResultBinaryFile>;
|
166 |
|
167 |
|
168 | insertions: number;
|
169 |
|
170 |
|
171 | deletions: number;
|
172 | }
|
173 |
|
174 | export interface FetchResult {
|
175 | raw: string;
|
176 | remote: string | null;
|
177 | branches: {
|
178 | name: string;
|
179 | tracking: string;
|
180 | }[];
|
181 | tags: {
|
182 | name: string;
|
183 | tracking: string;
|
184 | }[];
|
185 | updated: {
|
186 | name: string;
|
187 | tracking: string;
|
188 | to: string;
|
189 | from: string;
|
190 | }[];
|
191 | deleted: {
|
192 | tracking: string;
|
193 | }[];
|
194 | }
|
195 |
|
196 |
|
197 | export interface GrepResult {
|
198 | paths: Set<string>;
|
199 | results: Record<
|
200 | string,
|
201 | Array<{
|
202 | line: number;
|
203 | path: string;
|
204 | preview: string;
|
205 | }>
|
206 | >;
|
207 | }
|
208 |
|
209 |
|
210 |
|
211 |
|
212 | export interface InitResult {
|
213 | |
214 |
|
215 |
|
216 | readonly bare: boolean;
|
217 |
|
218 | |
219 |
|
220 |
|
221 | readonly existing: boolean;
|
222 |
|
223 | |
224 |
|
225 |
|
226 | readonly path: string;
|
227 |
|
228 | |
229 |
|
230 |
|
231 |
|
232 |
|
233 | readonly gitDir: string;
|
234 | }
|
235 |
|
236 |
|
237 |
|
238 |
|
239 | export interface MoveResult {
|
240 | |
241 |
|
242 |
|
243 | moves: Array<{ from: string; to: string }>;
|
244 | }
|
245 |
|
246 | export interface PullDetailFileChanges {
|
247 | [fileName: string]: number;
|
248 | }
|
249 |
|
250 | export interface PullDetailSummary {
|
251 | changes: number;
|
252 | insertions: number;
|
253 | deletions: number;
|
254 | }
|
255 |
|
256 | export interface PullDetail {
|
257 |
|
258 | files: string[];
|
259 |
|
260 |
|
261 | insertions: PullDetailFileChanges;
|
262 |
|
263 |
|
264 | deletions: PullDetailFileChanges;
|
265 |
|
266 | summary: PullDetailSummary;
|
267 |
|
268 |
|
269 | created: string[];
|
270 |
|
271 |
|
272 | deleted: string[];
|
273 | }
|
274 |
|
275 | export interface PullResult extends PullDetail, RemoteMessageResult {}
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 | export interface PullFailedResult {
|
282 | remote: string;
|
283 | hash: {
|
284 | local: string;
|
285 | remote: string;
|
286 | };
|
287 | branch: {
|
288 | local: string;
|
289 | remote: string;
|
290 | };
|
291 | message: string;
|
292 | }
|
293 |
|
294 |
|
295 |
|
296 |
|
297 | export interface StatusResultRenamed {
|
298 | from: string;
|
299 | to: string;
|
300 | }
|
301 |
|
302 | export interface FileStatusResult {
|
303 |
|
304 | from?: string;
|
305 |
|
306 |
|
307 | path: string;
|
308 |
|
309 | |
310 |
|
311 |
|
312 | index: string;
|
313 |
|
314 | |
315 |
|
316 |
|
317 |
|
318 | working_dir: string;
|
319 | }
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 | export interface StatusResult {
|
326 | not_added: string[];
|
327 | conflicted: string[];
|
328 | created: string[];
|
329 | deleted: string[];
|
330 |
|
331 | |
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 | ignored?: string[];
|
339 | modified: string[];
|
340 | renamed: StatusResultRenamed[];
|
341 | staged: string[];
|
342 |
|
343 | |
344 |
|
345 |
|
346 |
|
347 | files: FileStatusResult[];
|
348 |
|
349 | |
350 |
|
351 |
|
352 | ahead: number;
|
353 |
|
354 | |
355 |
|
356 |
|
357 | behind: number;
|
358 |
|
359 | |
360 |
|
361 |
|
362 | current: string | null;
|
363 |
|
364 | |
365 |
|
366 |
|
367 | tracking: string | null;
|
368 |
|
369 | |
370 |
|
371 |
|
372 |
|
373 | detached: boolean;
|
374 |
|
375 | |
376 |
|
377 |
|
378 | isClean(): boolean;
|
379 | }
|
380 |
|
381 |
|
382 |
|
383 |
|
384 | export interface TagResult {
|
385 | |
386 |
|
387 |
|
388 | all: string[];
|
389 |
|
390 | |
391 |
|
392 |
|
393 | latest: string | undefined;
|
394 | }
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 | export interface ListLogLine {
|
402 | |
403 |
|
404 |
|
405 |
|
406 |
|
407 | diff?: DiffResult;
|
408 | }
|
409 |
|
410 | export interface LogResult<T = DefaultLogFields> {
|
411 | all: ReadonlyArray<T & ListLogLine>;
|
412 | total: number;
|
413 | latest: (T & ListLogLine) | null;
|
414 | }
|
415 |
|
416 |
|
417 |
|
418 |
|
419 | export interface MergeConflictDeletion {
|
420 | deleteRef: string;
|
421 | }
|
422 |
|
423 |
|
424 |
|
425 |
|
426 | export interface MergeConflict {
|
427 | |
428 |
|
429 |
|
430 | reason: string;
|
431 |
|
432 | |
433 |
|
434 |
|
435 | file: string | null;
|
436 |
|
437 | |
438 |
|
439 |
|
440 | meta?: MergeConflictDeletion;
|
441 | }
|
442 |
|
443 | export type MergeResultStatus = 'success' | string;
|
444 |
|
445 | export interface MergeDetail {
|
446 | conflicts: MergeConflict[];
|
447 | merges: string[];
|
448 | result: MergeResultStatus;
|
449 | readonly failed: boolean;
|
450 | }
|
451 |
|
452 | export type MergeResult = PullResult & MergeDetail;
|
453 |
|
454 |
|
455 |
|
456 |
|
457 | export interface PushResultPushedItem {
|
458 | local: string;
|
459 | remote: string;
|
460 |
|
461 | readonly deleted: boolean;
|
462 | readonly tag: boolean;
|
463 | readonly branch: boolean;
|
464 | readonly new: boolean;
|
465 | readonly alreadyUpdated: boolean;
|
466 | }
|
467 |
|
468 | export interface RemoteMessagesObjectEnumeration {
|
469 | enumerating: number;
|
470 | counting: number;
|
471 | compressing: number;
|
472 | total: {
|
473 | count: number;
|
474 | delta: number;
|
475 | };
|
476 | reused: {
|
477 | count: number;
|
478 | delta: number;
|
479 | };
|
480 | packReused: number;
|
481 | }
|
482 |
|
483 | export interface RemoteMessages {
|
484 | all: string[];
|
485 | objects?: RemoteMessagesObjectEnumeration;
|
486 | }
|
487 |
|
488 | export interface PushResultRemoteMessages extends RemoteMessages {
|
489 | pullRequestUrl?: string;
|
490 | vulnerabilities?: {
|
491 | count: number;
|
492 | summary: string;
|
493 | url: string;
|
494 | };
|
495 | }
|
496 |
|
497 | export interface RemoteMessageResult<T extends RemoteMessages = RemoteMessages> {
|
498 | remoteMessages: T;
|
499 | }
|
500 |
|
501 | export interface PushResultBranchUpdate {
|
502 | head: {
|
503 | local: string;
|
504 | remote: string;
|
505 | };
|
506 | hash: {
|
507 | from: string;
|
508 | to: string;
|
509 | };
|
510 | }
|
511 |
|
512 | export interface PushDetail {
|
513 | repo?: string;
|
514 | ref?: {
|
515 | local: string;
|
516 | };
|
517 | pushed: PushResultPushedItem[];
|
518 | branch?: {
|
519 | local: string;
|
520 | remote: string;
|
521 | remoteName: string;
|
522 | };
|
523 | update?: PushResultBranchUpdate;
|
524 | }
|
525 |
|
526 | export interface PushResult extends PushDetail, RemoteMessageResult<PushResultRemoteMessages> {}
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 | export type CommitSummary = CommitResult;
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 | export type MergeSummary = MergeResult;
|
539 |
|
540 |
|
541 |
|
542 |
|
543 | export type BranchDeletionSummary = BranchSingleDeleteResult;
|
544 |
|
545 |
|
546 |
|
547 |
|
548 | export type BranchDeletionBatchSummary = BranchMultiDeleteResult;
|
549 |
|
550 | export type MoveSummary = MoveResult;
|
551 |
|
552 |
|
553 |
|
554 |
|
555 | export type ListLogSummary<T = DefaultLogFields> = LogResult<T>;
|