github.com/jfrog/frogbot@v1.1.1-0.20231221090046-821a26f50338/action/node_modules/simple-git/dist/typings/response.d.ts (about) 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 linkedWorkTree: boolean; 9 } 10 11 export interface BranchSummary { 12 detached: boolean; 13 current: string; 14 all: string[]; 15 branches: { 16 [key: string]: BranchSummaryBranch; 17 }; 18 } 19 20 /** 21 * Represents the successful deletion of a single branch 22 */ 23 export interface BranchSingleDeleteSuccess { 24 branch: string; 25 hash: string; 26 success: true; 27 } 28 29 /** 30 * Represents the failure to delete a single branch 31 */ 32 export interface BranchSingleDeleteFailure { 33 branch: string; 34 hash: null; 35 success: false; 36 } 37 38 export type BranchSingleDeleteResult = BranchSingleDeleteFailure | BranchSingleDeleteSuccess; 39 40 /** 41 * Represents the status of having deleted a batch of branches 42 */ 43 export interface BranchMultiDeleteResult { 44 /** 45 * All branches included in the response 46 */ 47 all: BranchSingleDeleteResult[]; 48 49 /** 50 * Branches mapped by their branch name 51 */ 52 branches: { [branchName: string]: BranchSingleDeleteResult }; 53 54 /** 55 * Array of responses that are in error 56 */ 57 errors: BranchSingleDeleteResult[]; 58 59 /** 60 * Flag showing whether all branches were deleted successfully 61 */ 62 readonly success: boolean; 63 } 64 65 export interface CleanSummary { 66 readonly dryRun: boolean; 67 paths: string[]; 68 files: string[]; 69 folders: string[]; 70 } 71 72 export interface CommitResult { 73 author: null | { 74 email: string; 75 name: string; 76 }; 77 branch: string; 78 commit: string; 79 root: boolean; 80 summary: { 81 changes: number; 82 insertions: number; 83 deletions: number; 84 }; 85 } 86 87 /** Represents the response to using `git.getConfig` */ 88 export interface ConfigGetResult { 89 /** The key that was searched for */ 90 key: string; 91 92 /** The single value seen by `git` for this key (equivalent to `git config --get key`) */ 93 value: string | null; 94 95 /** All possible values for this key no matter the scope (equivalent to `git config --get-all key`) */ 96 values: string[]; 97 98 /** The file paths from which configuration was read */ 99 paths: string[]; 100 101 /** 102 * The full hierarchy of values the property can have had across the 103 * various scopes that were searched (keys in this Map are the strings 104 * also found in the `paths` array). 105 */ 106 scopes: Map<string, string[]>; 107 } 108 109 /** 110 * Represents the current git configuration, as defined by the output from `git log` 111 */ 112 export interface ConfigListSummary { 113 /** 114 * All configuration settings, where local/user settings override user/global settings 115 * the overridden value will appear in this object. 116 */ 117 readonly all: ConfigValues; 118 119 /** 120 * The file paths configuration was read from 121 */ 122 files: string[]; 123 124 /** 125 * The `ConfigValues` for each of the `files`, use this object to determine 126 * local repo, user and global settings. 127 */ 128 values: { [fileName: string]: ConfigValues }; 129 } 130 131 /** 132 * Represents the map of configuration settings 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 /** The total number of files changed as reported in the summary line */ 155 changed: number; 156 157 /** When present in the diff, lists the details of each file changed */ 158 files: Array<DiffResultTextFile | DiffResultBinaryFile>; 159 160 /** The number of files changed with insertions */ 161 insertions: number; 162 163 /** The number of files changed with deletions */ 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 updated: { 179 name: string; 180 tracking: string; 181 to: string; 182 from: string; 183 }[]; 184 deleted: { 185 tracking: string; 186 }[]; 187 } 188 189 /** Represents the response to git.grep */ 190 export interface GrepResult { 191 paths: Set<string>; 192 results: Record< 193 string, 194 Array<{ 195 line: number; 196 path: string; 197 preview: string; 198 }> 199 >; 200 } 201 202 /** 203 * The `InitResult` is returned when (re)initialising a git repo. 204 */ 205 export interface InitResult { 206 /** 207 * Boolean representing whether the `--bare` option was used 208 */ 209 readonly bare: boolean; 210 211 /** 212 * Boolean representing whether the repo already existed (re-initialised rather than initialised) 213 */ 214 readonly existing: boolean; 215 216 /** 217 * The path used when initialising 218 */ 219 readonly path: string; 220 221 /** 222 * The git configuration directory - for a bare repo this is the same as `path`, in non-bare repos 223 * this will usually be a sub-directory with the name `.git` (or value of the `$GIT_DIR` environment 224 * variable). 225 */ 226 readonly gitDir: string; 227 } 228 229 /** 230 * A parsed response summary for calls to `git mv` 231 */ 232 export interface MoveResult { 233 /** 234 * Array of files moved 235 */ 236 moves: Array<{ from: string; to: string }>; 237 } 238 239 export interface PullDetailFileChanges { 240 [fileName: string]: number; 241 } 242 243 export interface PullDetailSummary { 244 changes: number; 245 insertions: number; 246 deletions: number; 247 } 248 249 export interface PullDetail { 250 /** Array of all files that are referenced in the pull */ 251 files: string[]; 252 253 /** Map of file names to the number of insertions in that file */ 254 insertions: PullDetailFileChanges; 255 256 /** Map of file names to the number of deletions in that file */ 257 deletions: PullDetailFileChanges; 258 259 summary: PullDetailSummary; 260 261 /** Array of file names that have been created */ 262 created: string[]; 263 264 /** Array of file names that have been deleted */ 265 deleted: string[]; 266 } 267 268 export interface PullResult extends PullDetail, RemoteMessageResult {} 269 270 /** 271 * Wrapped with the `GitResponseError` as the exception thrown from a `git.pull` task 272 * to provide additional detail as to what failed. 273 */ 274 export interface PullFailedResult { 275 remote: string; 276 hash: { 277 local: string; 278 remote: string; 279 }; 280 branch: { 281 local: string; 282 remote: string; 283 }; 284 message: string; 285 } 286 287 /** 288 * Represents file name changes in a StatusResult 289 */ 290 export interface StatusResultRenamed { 291 from: string; 292 to: string; 293 } 294 295 export interface FileStatusResult { 296 /** Original location of the file, when the file has been moved */ 297 from?: string; 298 299 /** Path of the file */ 300 path: string; 301 302 /** First digit of the status code of the file, e.g. 'M' = modified. 303 Represents the status of the index if no merge conflicts, otherwise represents 304 status of one side of the merge. */ 305 index: string; 306 307 /** Second digit of the status code of the file. Represents status of the working directory 308 if no merge conflicts, otherwise represents status of other side of a merge. */ 309 working_dir: string; 310 } 311 312 /** 313 * The StatusResult is returned for calls to `git.status()`, represents the state of the 314 * working directory. 315 */ 316 export interface StatusResult { 317 not_added: string[]; 318 conflicted: string[]; 319 created: string[]; 320 deleted: string[]; 321 322 /** 323 * Ignored files are not listed by default, add `--ignored` to the task options in order to see 324 * this array of ignored files/paths. 325 * 326 * Note: ignored files will not be added to the `files` array, and will not be included in the 327 * `isClean()` calculation. 328 */ 329 ignored?: string[]; 330 modified: string[]; 331 renamed: StatusResultRenamed[]; 332 staged: string[]; 333 334 /** 335 * All files represented as an array of objects containing the `path` and status in `index` and 336 * in the `working_dir`. 337 */ 338 files: FileStatusResult[]; 339 340 /** 341 * Number of commits ahead of the tracked branch 342 */ 343 ahead: number; 344 345 /** 346 *Number of commits behind the tracked branch 347 */ 348 behind: number; 349 350 /** 351 * Name of the current branch 352 */ 353 current: string | null; 354 355 /** 356 * Name of the branch being tracked 357 */ 358 tracking: string | null; 359 360 /** 361 * Detached status of the working copy, for more detail of what the working branch 362 * is detached from use `git.branch()` 363 */ 364 detached: boolean; 365 366 /** 367 * Gets whether this represents a clean working branch. 368 */ 369 isClean(): boolean; 370 } 371 372 /** 373 * Response retrieved when using the `git.tags` method 374 */ 375 export interface TagResult { 376 /** 377 * All tag names 378 */ 379 all: string[]; 380 381 /** 382 * The semver latest tag name or `undefined` when no tags are named in the response 383 */ 384 latest: string | undefined; 385 } 386 387 /** 388 * The ListLogLine represents a single entry in the `git.log`, the properties on the object 389 * are mixed in depending on the names used in the format (see `DefaultLogFields`), but some 390 * properties are dependent on the command used. 391 */ 392 export interface ListLogLine { 393 /** 394 * When using a `--stat=4096` or `--shortstat` options in the `git.log` or `git.stashList`, 395 * each entry in the `ListLogSummary` will also have a `diff` property representing as much 396 * detail as was given in the response. 397 */ 398 diff?: DiffResult; 399 } 400 401 export interface LogResult<T = DefaultLogFields> { 402 all: ReadonlyArray<T & ListLogLine>; 403 total: number; 404 latest: (T & ListLogLine) | null; 405 } 406 407 /** 408 * Where the file was deleted, if there is a modify/delete conflict 409 */ 410 export interface MergeConflictDeletion { 411 deleteRef: string; 412 } 413 414 /** 415 * Represents a single file with conflicts in the MergeSummary 416 */ 417 export interface MergeConflict { 418 /** 419 * Type of conflict 420 */ 421 reason: string; 422 423 /** 424 * Path to file 425 */ 426 file: string | null; 427 428 /** 429 * Additional detail for the specific type of conflict 430 */ 431 meta?: MergeConflictDeletion; 432 } 433 434 export type MergeResultStatus = 'success' | string; 435 436 export interface MergeDetail { 437 conflicts: MergeConflict[]; 438 merges: string[]; 439 result: MergeResultStatus; 440 readonly failed: boolean; 441 } 442 443 export type MergeResult = PullResult & MergeDetail; 444 445 /** 446 * 447 */ 448 export interface PushResultPushedItem { 449 local: string; 450 remote: string; 451 452 readonly deleted: boolean; 453 readonly tag: boolean; 454 readonly branch: boolean; 455 readonly new: boolean; 456 readonly alreadyUpdated: boolean; 457 } 458 459 export interface RemoteMessagesObjectEnumeration { 460 enumerating: number; 461 counting: number; 462 compressing: number; 463 total: { 464 count: number; 465 delta: number; 466 }; 467 reused: { 468 count: number; 469 delta: number; 470 }; 471 packReused: number; 472 } 473 474 export interface RemoteMessages { 475 all: string[]; 476 objects?: RemoteMessagesObjectEnumeration; 477 } 478 479 export interface PushResultRemoteMessages extends RemoteMessages { 480 pullRequestUrl?: string; 481 vulnerabilities?: { 482 count: number; 483 summary: string; 484 url: string; 485 }; 486 } 487 488 export interface RemoteMessageResult<T extends RemoteMessages = RemoteMessages> { 489 remoteMessages: T; 490 } 491 492 export interface PushResultBranchUpdate { 493 head: { 494 local: string; 495 remote: string; 496 }; 497 hash: { 498 from: string; 499 to: string; 500 }; 501 } 502 503 export interface PushDetail { 504 repo?: string; 505 ref?: { 506 local: string; 507 }; 508 pushed: PushResultPushedItem[]; 509 branch?: { 510 local: string; 511 remote: string; 512 remoteName: string; 513 }; 514 update?: PushResultBranchUpdate; 515 } 516 517 export interface PushResult extends PushDetail, RemoteMessageResult<PushResultRemoteMessages> {} 518 519 /** 520 * @deprecated 521 * For consistent naming, please use `CommitResult` instead of `CommitSummary` 522 */ 523 export type CommitSummary = CommitResult; 524 525 /** 526 * @deprecated 527 * For consistent naming, please use `MergeResult` instead of `MergeSummary` 528 */ 529 export type MergeSummary = MergeResult; 530 531 /** 532 * @deprecated to aid consistent naming, please use `BranchSingleDeleteResult` instead of `BranchDeletionSummary`. 533 */ 534 export type BranchDeletionSummary = BranchSingleDeleteResult; 535 536 /** 537 * @deprecated to aid consistent naming, please use `BranchMultiDeleteResult` instead of `BranchDeletionBatchSummary`. 538 */ 539 export type BranchDeletionBatchSummary = BranchMultiDeleteResult; 540 541 export type MoveSummary = MoveResult; 542 543 /** 544 * @deprecated to aid consistent naming, please use `LogResult` instead of `ListLogSummary`. 545 */ 546 export type ListLogSummary<T = DefaultLogFields> = LogResult<T>;