Hierarchy (View Summary)

Implements

Constructors

Properties

Methods

createAcceptHeader createAnnotatedTag createAttachment createCherryPick createComment createCommitStatus createFavorite createForkSyncRequest createImportRequest createLike createMergeRequest createPullRequest createPullRequestIterationStatus createPullRequestLabel createPullRequestReviewer createPullRequestReviewers createPullRequestStatus createPush createRepository createRequestOptions createRevert createThread createUnmaterializedPullRequestReviewer deleteAttachment deleteComment deleteEnablementStatus deleteLike deletePullRequestIterationStatus deletePullRequestLabels deletePullRequestReviewer deletePullRequestStatus deleteRefFavorite deleteRepository deleteRepositoryFromRecycleBin formatResponse getAnnotatedTag getAttachmentContent getAttachments getAttachmentZip getBillableCommitters getBillableCommittersDetail getBlob getBlobContent getBlobsZip getBlobZip getBranch getBranches getBranchStatsBatch getChanges getCherryPick getCherryPickConflict getCherryPickConflicts getCherryPickForRefName getCherryPickRelationships getComment getComments getCommit getCommitDiffs getCommits getCommitsBatch getDeletedRepositories getEnablementStatus getEnableOnCreateHost getEnableOnCreateProject getEstimatedBillableCommittersRepo getEstimatedBillablePushersOrg getEstimatedBillablePushersProject getFileDiffs getForks getForkSyncRequest getForkSyncRequests getImportRequest getItem getItemContent getItems getItemsBatch getItemText getItemZip getLikes getMergeBases getMergeRequest getPermission getPullRequest getPullRequestById getPullRequestCommits getPullRequestConflict getPullRequestConflicts getPullRequestIteration getPullRequestIterationChanges getPullRequestIterationCommits getPullRequestIterations getPullRequestIterationStatus getPullRequestIterationStatuses getPullRequestLabel getPullRequestLabels getPullRequestProperties getPullRequestQuery getPullRequestReviewer getPullRequestReviewers getPullRequests getPullRequestsByProject getPullRequestStatus getPullRequestStatuses getPullRequestThread getPullRequestWorkItemRefs getPush getPushCommits getPushes getRecycleBinRepositories getRefFavorite getRefFavorites getRefFavoritesForProject getRefs getRepositories getRepository getRepositoryWithParent getRevert getRevertConflict getRevertConflicts getRevertForRefName getStatuses getSuggestions getThreads getTree getTreeZip queryImportRequests restoreRepositoryFromRecycleBin setEnableOnCreateHost setEnableOnCreateProject sharePullRequest updateCherryPickConflict updateCherryPickConflicts updateComment updateEnablementStatus updateImportRequest updatePullRequest updatePullRequestConflict updatePullRequestConflicts updatePullRequestIterationStatuses updatePullRequestProperties updatePullRequestReviewer updatePullRequestReviewers updatePullRequestStatuses updateRef updateRefs updateRepository updateRevertConflict updateRevertConflicts updateThread

Constructors

Properties

baseUrl: string
http: HttpClient
rest: RestClient
userAgent: string
vsoClient: VsoClient
RESOURCE_AREA_ID: "4e080c62-fa21-4fbc-8fef-2a10a2b38049"

Methods

  • Attach a new file to a pull request.

    Parameters

    • customHeaders: any
    • contentStream: ReadableStream

      Content to upload

    • fileName: string

      The name of the file.

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<Attachment>

  • Create a comment on a specific thread in a pull request (up to 500 comments can be created per thread).

    Parameters

    • comment: Comment

      The comment to create. Comments can be up to 150,000 characters.

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • threadId: number

      ID of the thread that the desired comment is in.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<Comment>

  • Add a like on a comment.

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • threadId: number

      The ID of the thread that contains the comment.

    • commentId: number

      The ID of the comment.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<void>

  • Request a git merge operation. Currently we support merging only 2 commits.

    Parameters

    • mergeParameters: GitMergeParameters

      Parents commitIds and merge commit messsage.

    • project: string

      Project ID or project name

    • repositoryNameOrId: string

      The name or ID of the repository.

    • OptionalincludeLinks: boolean

      True to include links

    Returns Promise<GitMerge>

  • Create a pull request.

    Parameters

    • gitPullRequestToCreate: GitPullRequest

      The pull request to create.

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • Optionalproject: string

      Project ID or project name

    • OptionalsupportsIterations: boolean

      If true, subsequent pushes to the pull request will be individually reviewable. Set this to false for large pull requests for performance reasons if this functionality is not needed.

    Returns Promise<GitPullRequest>

  • Create a pull request status on the iteration. This operation will have the same result as Create status on pull request with specified iteration ID in the request body.

    Parameters

    • status: GitPullRequestStatus

      Pull request status to create.

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • iterationId: number

      ID of the pull request iteration.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<GitPullRequestStatus>

  • Add a reviewer to a pull request or cast a vote.

    Parameters

    • reviewer: IdentityRefWithVote

      Reviewer's vote.
      If the reviewer's ID is included here, it must match the reviewerID parameter.
      Reviewers can set their own vote with this method. When adding other reviewers, vote must be set to zero.

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • reviewerId: string

      ID of the reviewer.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<IdentityRefWithVote>

  • Delete a pull request attachment.

    Parameters

    • fileName: string

      The name of the attachment to delete.

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<void>

  • Delete a comment associated with a specific thread in a pull request.

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • threadId: number

      ID of the thread that the desired comment is in.

    • commentId: number

      ID of the comment.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<void>

  • DELETE Deletes Enablement status and BillableCommitters data from DB. Deleting the enablement data will effectively disable it for the repositories affected.

    Parameters

    • allProjects: boolean
    • OptionalincludeBillableCommitters: boolean
    • OptionalprojectIds: string[]

    Returns Promise<void>

  • Delete a like on a comment.

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • threadId: number

      The ID of the thread that contains the comment.

    • commentId: number

      The ID of the comment.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<void>

  • Delete pull request iteration status.

    Parameters

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • iterationId: number

      ID of the pull request iteration.

    • statusId: number

      ID of the pull request status.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<void>

  • Removes a label (tag) from the set of those assigned to the pull request. The tag itself will not be deleted.

    Parameters

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • labelIdOrName: string

      The name or ID of the label requested.

    • Optionalproject: string

      Project ID or project name

    • OptionalprojectId: string

      Project ID or project name.

    Returns Promise<void>

  • Remove a reviewer from a pull request.

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • reviewerId: string

      ID of the reviewer to remove.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<void>

  • Delete pull request status.

    Parameters

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • statusId: number

      ID of the pull request status.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<void>

  • Get the file content of a pull request attachment.

    Parameters

    • fileName: string

      The name of the attachment.

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<ReadableStream>

  • Get a list of files attached to a given pull request.

    Parameters

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<Attachment[]>

  • Get the file content of a pull request attachment.

    Parameters

    • fileName: string

      The name of the attachment.

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<ReadableStream>

  • Retrieve actual billable committers for Advanced Security service for a given date.

    Parameters

    • project: string

      Project ID or project name

    • OptionalbillingDate: Date

      UTC expected. If not specified defaults to the previous billing day.

    • Optionalskip: number

      Skip X rows of resultset to simulate paging.

    • Optionaltake: number

      Return Y rows of resultset to simulate paging.

    Returns Promise<BillableCommitter[]>

  • Retrieve detailed actual billable committers for Advanced Security service for a given date. Detailed results intentionally does not filter out soft deleted projects and repositories to help diagnose billing issues.

    Parameters

    • project: string

      Project ID or project name

    • includeDetails: string

      Return all the details on the billable committers.

    • OptionalbillingDate: Date

      UTC expected. If not specified defaults to the previous billing day.

    Returns Promise<BillableCommitterDetail[]>

  • Get a single blob.

    Parameters

    • repositoryId: string

      The name or ID of the repository.

    • sha1: string

      SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint.

    • Optionalproject: string

      Project ID or project name

    • Optionaldownload: boolean

      If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip

    • OptionalfileName: string

      Provide a fileName to use for a download.

    • OptionalresolveLfs: boolean

      If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types

    Returns Promise<GitBlobRef>

  • Get a single blob.

    Parameters

    • repositoryId: string

      The name or ID of the repository.

    • sha1: string

      SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint.

    • Optionalproject: string

      Project ID or project name

    • Optionaldownload: boolean

      If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip

    • OptionalfileName: string

      Provide a fileName to use for a download.

    • OptionalresolveLfs: boolean

      If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types

    Returns Promise<ReadableStream>

  • Gets one or more blobs in a zip file download.

    Parameters

    • blobIds: string[]

      Blob IDs (SHA1 hashes) to be returned in the zip file.

    • repositoryId: string

      The name or ID of the repository.

    • Optionalproject: string

      Project ID or project name

    • Optionalfilename: string

    Returns Promise<ReadableStream>

  • Get a single blob.

    Parameters

    • repositoryId: string

      The name or ID of the repository.

    • sha1: string

      SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint.

    • Optionalproject: string

      Project ID or project name

    • Optionaldownload: boolean

      If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip

    • OptionalfileName: string

      Provide a fileName to use for a download.

    • OptionalresolveLfs: boolean

      If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types

    Returns Promise<ReadableStream>

  • Retrieve changes for a particular commit.

    Parameters

    • commitId: string

      The id of the commit.

    • repositoryId: string

      The id or friendly name of the repository. To use the friendly name, projectId must also be specified.

    • Optionalproject: string

      Project ID or project name

    • Optionaltop: number

      The maximum number of changes to return.

    • Optionalskip: number

      The number of changes to skip.

    Returns Promise<GitCommitChanges>

  • Retrieve all conflicts for a cherry pick

    Parameters

    • repositoryId: string
    • cherryPickId: number
    • Optionalproject: string

      Project ID or project name

    • OptionalcontinuationToken: string
    • Optionaltop: number
    • OptionalexcludeResolved: boolean
    • OptionalonlyResolved: boolean
    • OptionalincludeObsolete: boolean

    Returns Promise<PagedList<GitConflict>>

  • Retrieve information about a cherry pick operation for a specific branch. This operation is expensive due to the underlying object structure, so this API only looks at the 1000 most recent cherry pick operations.

    Parameters

    • project: string

      Project ID or project name

    • repositoryId: string

      ID of the repository.

    • refName: string

      The GitAsyncRefOperationParameters generatedRefName used for the cherry pick operation.

    Returns Promise<GitCherryPick>

  • Given a commitId, returns a list of commits that are in the same cherry-pick family.

    Parameters

    • repositoryNameOrId: string
    • commitId: string
    • Optionalproject: string

      Project ID or project name

    • OptionalincludeLinks: boolean

    Returns Promise<GitCommitRef[]>

  • Retrieve a comment associated with a specific thread in a pull request.

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • threadId: number

      ID of the thread that the desired comment is in.

    • commentId: number

      ID of the comment.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<Comment>

  • Retrieve all comments associated with a specific thread in a pull request.

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • threadId: number

      ID of the thread.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<Comment[]>

  • Retrieve a particular commit.

    Parameters

    • commitId: string

      The id of the commit.

    • repositoryId: string

      The id or friendly name of the repository. To use the friendly name, projectId must also be specified.

    • Optionalproject: string

      Project ID or project name

    • OptionalchangeCount: number

      The number of changes to include in the result.

    Returns Promise<GitCommit>

  • Find the closest common commit (the merge base) between base and target commits, and get the diff between either the base and target commits or common and target commits.

    Parameters

    • repositoryId: string

      The name or ID of the repository.

    • Optionalproject: string

      Project ID or project name

    • OptionaldiffCommonCommit: boolean

      If true, diff between common and target commits. If false, diff between base and target commits.

    • Optionaltop: number

      Maximum number of changes to return. Defaults to 100.

    • Optionalskip: number

      Number of changes to skip

    • OptionalbaseVersionDescriptor: GitBaseVersionDescriptor

      Descriptor for base commit.

    • OptionaltargetVersionDescriptor: GitTargetVersionDescriptor

      Descriptor for target commit.

    Returns Promise<GitCommitDiffs>

  • Retrieve git commits for a project matching the search criteria

    Parameters

    • searchCriteria: GitQueryCommitsCriteria

      Search options

    • repositoryId: string

      The name or ID of the repository.

    • Optionalproject: string

      Project ID or project name

    • Optionalskip: number

      Number of commits to skip. The value cannot exceed 3,000,000.

    • Optionaltop: number

      Maximum number of commits to return. The value cannot exceed 50,000.

    • OptionalincludeStatuses: boolean

      True to include additional commit status information.

    Returns Promise<GitCommitRef[]>

  • GET Enablement status for project's repositories.

    Parameters

    • OptionalprojectIds: string[]

      Null defaults to all projects in the host, list of project's repos status to return

    • OptionalbillingDate: Date

      UTC expected, Null defaults to UtcNow(), can be provided for a point in time status

    • Optionalskip: number

      Skip X rows of resultset to simulate paging.

    • Optionaltake: number

      Return Y rows of resultset to simulate paging.

    Returns Promise<AdvSecEnablementStatus[]>

  • Retrieve all forks of a repository in the collection.

    Parameters

    • repositoryNameOrId: string

      The name or ID of the repository.

    • collectionId: string

      Team project collection ID.

    • Optionalproject: string

      Project ID or project name

    • OptionalincludeLinks: boolean

      True to include links.

    Returns Promise<GitRepositoryRef[]>

  • Get a specific fork sync operation's details.

    Parameters

    • repositoryNameOrId: string

      The name or ID of the repository.

    • forkSyncOperationId: number

      OperationId of the sync request.

    • Optionalproject: string

      Project ID or project name

    • OptionalincludeLinks: boolean

      True to include links.

    Returns Promise<GitForkSyncRequest>

  • Retrieve all requested fork sync operations on this repository.

    Parameters

    • repositoryNameOrId: string

      The name or ID of the repository.

    • Optionalproject: string

      Project ID or project name

    • OptionalincludeAbandoned: boolean

      True to include abandoned requests.

    • OptionalincludeLinks: boolean

      True to include links.

    Returns Promise<GitForkSyncRequest[]>

  • Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.

    Parameters

    • repositoryId: string

      The name or ID of the repository.

    • path: string

      The item path.

    • Optionalproject: string

      Project ID or project name

    • OptionalscopePath: string

      The path scope. The default is null.

    • OptionalrecursionLevel: VersionControlRecursionType

      The recursion level of this request. The default is 'none', no recursion.

    • OptionalincludeContentMetadata: boolean

      Set to true to include content metadata. Default is false.

    • OptionallatestProcessedChange: boolean

      Set to true to include the latest changes. Default is false.

    • Optionaldownload: boolean

      Set to true to download the response as a file. Default is false.

    • OptionalversionDescriptor: GitVersionDescriptor

      Version descriptor. Default is the default branch for the repository.

    • OptionalincludeContent: boolean

      Set to true to include item content when requesting json. Default is false.

    • OptionalresolveLfs: boolean

      Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.

    • Optionalsanitize: boolean

      Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false.

    Returns Promise<GitItem>

  • Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.

    Parameters

    • repositoryId: string

      The name or ID of the repository.

    • path: string

      The item path.

    • Optionalproject: string

      Project ID or project name

    • OptionalscopePath: string

      The path scope. The default is null.

    • OptionalrecursionLevel: VersionControlRecursionType

      The recursion level of this request. The default is 'none', no recursion.

    • OptionalincludeContentMetadata: boolean

      Set to true to include content metadata. Default is false.

    • OptionallatestProcessedChange: boolean

      Set to true to include the latest changes. Default is false.

    • Optionaldownload: boolean

      Set to true to download the response as a file. Default is false.

    • OptionalversionDescriptor: GitVersionDescriptor

      Version descriptor. Default is the default branch for the repository.

    • OptionalincludeContent: boolean

      Set to true to include item content when requesting json. Default is false.

    • OptionalresolveLfs: boolean

      Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.

    • Optionalsanitize: boolean

      Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false.

    Returns Promise<ReadableStream>

  • Get Item Metadata and/or Content for a collection of items. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download.

    Parameters

    • repositoryId: string

      The name or ID of the repository.

    • Optionalproject: string

      Project ID or project name

    • OptionalscopePath: string

      The path scope. The default is null.

    • OptionalrecursionLevel: VersionControlRecursionType

      The recursion level of this request. The default is 'none', no recursion.

    • OptionalincludeContentMetadata: boolean

      Set to true to include content metadata. Default is false.

    • OptionallatestProcessedChange: boolean

      Set to true to include the latest changes. Default is false.

    • Optionaldownload: boolean

      Set to true to download the response as a file. Default is false.

    • OptionalincludeLinks: boolean

      Set to true to include links to items. Default is false.

    • OptionalversionDescriptor: GitVersionDescriptor

      Version descriptor. Default is the default branch for the repository.

    • OptionalzipForUnix: boolean

      Set to true to keep the file permissions for unix (and POSIX) systems like executables and symlinks

    Returns Promise<GitItem[]>

  • Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path

    Parameters

    • requestData: GitItemRequestData

      Request data attributes: ItemDescriptors, IncludeContentMetadata, LatestProcessedChange, IncludeLinks. ItemDescriptors: Collection of items to fetch, including path, version, and recursion level. IncludeContentMetadata: Whether to include metadata for all items LatestProcessedChange: Whether to include shallow ref to commit that last changed each item. IncludeLinks: Whether to include the _links field on the shallow references.

    • repositoryId: string

      The name or ID of the repository

    • Optionalproject: string

      Project ID or project name

    Returns Promise<GitItem[][]>

  • Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.

    Parameters

    • repositoryId: string

      The name or ID of the repository.

    • path: string

      The item path.

    • Optionalproject: string

      Project ID or project name

    • OptionalscopePath: string

      The path scope. The default is null.

    • OptionalrecursionLevel: VersionControlRecursionType

      The recursion level of this request. The default is 'none', no recursion.

    • OptionalincludeContentMetadata: boolean

      Set to true to include content metadata. Default is false.

    • OptionallatestProcessedChange: boolean

      Set to true to include the latest changes. Default is false.

    • Optionaldownload: boolean

      Set to true to download the response as a file. Default is false.

    • OptionalversionDescriptor: GitVersionDescriptor

      Version descriptor. Default is the default branch for the repository.

    • OptionalincludeContent: boolean

      Set to true to include item content when requesting json. Default is false.

    • OptionalresolveLfs: boolean

      Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.

    • Optionalsanitize: boolean

      Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false.

    Returns Promise<ReadableStream>

  • Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.

    Parameters

    • repositoryId: string

      The name or ID of the repository.

    • path: string

      The item path.

    • Optionalproject: string

      Project ID or project name

    • OptionalscopePath: string

      The path scope. The default is null.

    • OptionalrecursionLevel: VersionControlRecursionType

      The recursion level of this request. The default is 'none', no recursion.

    • OptionalincludeContentMetadata: boolean

      Set to true to include content metadata. Default is false.

    • OptionallatestProcessedChange: boolean

      Set to true to include the latest changes. Default is false.

    • Optionaldownload: boolean

      Set to true to download the response as a file. Default is false.

    • OptionalversionDescriptor: GitVersionDescriptor

      Version descriptor. Default is the default branch for the repository.

    • OptionalincludeContent: boolean

      Set to true to include item content when requesting json. Default is false.

    • OptionalresolveLfs: boolean

      Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.

    • Optionalsanitize: boolean

      Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false.

    Returns Promise<ReadableStream>

  • Get likes for a comment.

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • threadId: number

      The ID of the thread that contains the comment.

    • commentId: number

      The ID of the comment.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<IdentityRef[]>

  • Find the merge bases of two commits, optionally across forks. If otherRepositoryId is not specified, the merge bases will only be calculated within the context of the local repositoryNameOrId.

    Parameters

    • repositoryNameOrId: string

      ID or name of the local repository.

    • commitId: string

      First commit, usually the tip of the target branch of the potential merge.

    • otherCommitId: string

      Other commit, usually the tip of the source branch of the potential merge.

    • Optionalproject: string

      Project ID or project name

    • OptionalotherCollectionId: string

      The collection ID where otherCommitId lives.

    • OptionalotherRepositoryId: string

      The repository ID where otherCommitId lives.

    Returns Promise<GitCommitRef[]>

  • Get a specific merge operation's details.

    Parameters

    • project: string

      Project ID or project name

    • repositoryNameOrId: string

      The name or ID of the repository.

    • mergeOperationId: number

      OperationId of the merge request.

    • OptionalincludeLinks: boolean

      True to include links

    Returns Promise<GitMerge>

  • GET Advanced Security Permission status.

    Parameters

    • OptionalprojectName: string
    • OptionalrepositoryId: string

      Repository user is trying to access

    • Optionalpermission: string

      Permission being requestd, must be "viewAlert" "dismissAlert" "manage" "viewEnablement" or "repoRead"

    Returns Promise<boolean>

  • Retrieve a pull request.

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      The ID of the pull request to retrieve.

    • Optionalproject: string

      Project ID or project name

    • OptionalmaxCommentLength: number

      Not used.

    • Optionalskip: number

      Not used.

    • Optionaltop: number

      Not used.

    • OptionalincludeCommits: boolean

      If true, the pull request will be returned with the associated commits.

    • OptionalincludeWorkItemRefs: boolean

      If true, the pull request will be returned with the associated work item references.

    Returns Promise<GitPullRequest>

  • Retrieve all conflicts for a pull request

    Parameters

    • repositoryId: string

      The repository of the Pull Request.

    • pullRequestId: number

      The pull request ID.

    • Optionalproject: string

      Project ID or project name

    • Optionalskip: number

      Conflicts to skip.

    • Optionaltop: number

      Conflicts to return after skip.

    • OptionalincludeObsolete: boolean

      Includes obsolete conflicts.

    • OptionalexcludeResolved: boolean

      Excludes conflicts already resolved.

    • OptionalonlyResolved: boolean

      Returns only the conflicts that are resolved.

    Returns Promise<GitConflict[]>

  • Retrieve the changes made in a pull request between two iterations.

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • iterationId: number

      ID of the pull request iteration.
      Iteration one is the head of the source branch at the time the pull request is created and subsequent iterations are created when there are pushes to the source branch. Allowed values are between 1 and the maximum iteration on this pull request.

    • Optionalproject: string

      Project ID or project name

    • Optionaltop: number

      Optional. The number of changes to retrieve. The default value is 100 and the maximum value is 2000.

    • Optionalskip: number

      Optional. The number of changes to ignore. For example, to retrieve changes 101-150, set top 50 and skip to 100.

    • OptionalcompareTo: number

      ID of the pull request iteration to compare against. The default value is zero which indicates the comparison is made against the common commit between the source and target branches

    Returns Promise<GitPullRequestIterationChanges>

  • Get the commits for the specified iteration of a pull request.

    Parameters

    • repositoryId: string

      ID or name of the repository.

    • pullRequestId: number

      ID of the pull request.

    • iterationId: number

      ID of the iteration from which to get the commits.

    • Optionalproject: string

      Project ID or project name

    • Optionaltop: number

      Maximum number of commits to return. The maximum number of commits that can be returned per batch is 500.

    • Optionalskip: number

      Number of commits to skip.

    Returns Promise<GitCommitRef[]>

  • Get the list of iterations for the specified pull request.

    Parameters

    • repositoryId: string

      ID or name of the repository.

    • pullRequestId: number

      ID of the pull request.

    • Optionalproject: string

      Project ID or project name

    • OptionalincludeCommits: boolean

      If true, include the commits associated with each iteration in the response.

    Returns Promise<GitPullRequestIteration[]>

  • Get the specific pull request iteration status by ID. The status ID is unique within the pull request across all iterations.

    Parameters

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • iterationId: number

      ID of the pull request iteration.

    • statusId: number

      ID of the pull request status.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<GitPullRequestStatus>

  • Get all the statuses associated with a pull request iteration.

    Parameters

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • iterationId: number

      ID of the pull request iteration.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<GitPullRequestStatus[]>

  • Retrieves a single label (tag) that has been assigned to a pull request.

    Parameters

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • labelIdOrName: string

      The name or ID of the label requested.

    • Optionalproject: string

      Project ID or project name

    • OptionalprojectId: string

      Project ID or project name.

    Returns Promise<WebApiTagDefinition>

  • Get all the labels (tags) assigned to a pull request.

    Parameters

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • Optionalproject: string

      Project ID or project name

    • OptionalprojectId: string

      Project ID or project name.

    Returns Promise<WebApiTagDefinition[]>

  • Get external properties of the pull request.

    Parameters

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<any>

  • This API is used to find what pull requests are related to a given commit. It can be used to either find the pull request that created a particular merge commit or it can be used to find all pull requests that have ever merged a particular commit. The input is a list of queries which each contain a list of commits. For each commit that you search against, you will get back a dictionary of commit -> pull requests.

    Parameters

    • queries: GitPullRequestQuery

      The list of queries to perform.

    • repositoryId: string

      ID of the repository.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<GitPullRequestQuery>

  • Retrieve information about a particular reviewer on a pull request

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • reviewerId: string

      ID of the reviewer.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<IdentityRefWithVote>

  • Retrieve all pull requests matching a specified criteria.

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • searchCriteria: GitPullRequestSearchCriteria

      Pull requests will be returned that match this search criteria.

    • Optionalproject: string

      Project ID or project name

    • OptionalmaxCommentLength: number

      Not used.

    • Optionalskip: number

      The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100.

    • Optionaltop: number

      The number of pull requests to retrieve.

    Returns Promise<GitPullRequest[]>

  • Get the specific pull request status by ID. The status ID is unique within the pull request across all iterations.

    Parameters

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • statusId: number

      ID of the pull request status.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<GitPullRequestStatus>

  • Retrieve a thread in a pull request.

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • threadId: number

      ID of the thread.

    • Optionalproject: string

      Project ID or project name

    • Optionaliteration: number

      If specified, thread position will be tracked using this iteration as the right side of the diff.

    • OptionalbaseIteration: number

      If specified, thread position will be tracked using this iteration as the left side of the diff.

    Returns Promise<GitPullRequestCommentThread>

  • Retrieves a particular push.

    Parameters

    • repositoryId: string

      The name or ID of the repository.

    • pushId: number

      ID of the push.

    • Optionalproject: string

      Project ID or project name

    • OptionalincludeCommits: number

      The number of commits to include in the result.

    • OptionalincludeRefUpdates: boolean

      If true, include the list of refs that were updated by the push.

    Returns Promise<GitPush>

  • Retrieve a list of commits associated with a particular push.

    Parameters

    • repositoryId: string

      The id or friendly name of the repository. To use the friendly name, projectId must also be specified.

    • pushId: number

      The id of the push.

    • Optionalproject: string

      Project ID or project name

    • Optionaltop: number

      The maximum number of commits to return ("get the top x commits").

    • Optionalskip: number

      The number of commits to skip.

    • OptionalincludeLinks: boolean

      Set to false to avoid including REST Url links for resources. Defaults to true.

    Returns Promise<GitCommitRef[]>

  • Retrieves pushes associated with the specified repository.

    Parameters

    • repositoryId: string

      The name or ID of the repository.

    • Optionalproject: string

      Project ID or project name

    • Optionalskip: number

      Number of pushes to skip.

    • Optionaltop: number

      Number of pushes to return.

    • OptionalsearchCriteria: GitPushSearchCriteria

      Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references.

    Returns Promise<GitPush[]>

  • Gets the refs favorites for a repo and an identity.

    Parameters

    • project: string

      Project ID or project name

    • OptionalrepositoryId: string

      The id of the repository.

    • OptionalidentityId: string

      The id of the identity whose favorites are to be retrieved. If null, the requesting identity is used.

    Returns Promise<GitRefFavorite[]>

  • Queries the provided repository for its refs and returns them.

    Parameters

    • repositoryId: string

      The name or ID of the repository.

    • Optionalproject: string

      Project ID or project name

    • Optionalfilter: string

      [optional] A filter to apply to the refs (starts with).

    • OptionalincludeLinks: boolean

      [optional] Specifies if referenceLinks should be included in the result. default is false.

    • OptionalincludeStatuses: boolean

      [optional] Includes up to the first 1000 commit statuses for each ref. The default value is false.

    • OptionalincludeMyBranches: boolean

      [optional] Includes only branches that the user owns, the branches the user favorites, and the default branch. The default value is false. Cannot be combined with the filter parameter.

    • OptionallatestStatusesOnly: boolean

      [optional] True to include only the tip commit status for each ref. This option requires includeStatuses to be true. The default value is false.

    • OptionalpeelTags: boolean

      [optional] Annotated tags will populate the PeeledObjectId property. default is false.

    • OptionalfilterContains: string

      [optional] A filter to apply to the refs (contains).

    Returns Promise<PagedList<GitRef>>

  • Retrieve git repositories.

    Parameters

    • Optionalproject: string

      Project ID or project name

    • OptionalincludeLinks: boolean

      [optional] True to include reference links. The default value is false.

    • OptionalincludeAllUrls: boolean

      [optional] True to include all remote URLs. The default value is false.

    • OptionalincludeHidden: boolean

      [optional] True to include hidden repositories. The default value is false.

    Returns Promise<GitRepository[]>

  • Retrieve information about a revert operation by revert Id.

    Parameters

    • project: string

      Project ID or project name

    • revertId: number

      ID of the revert operation.

    • repositoryId: string

      ID of the repository.

    Returns Promise<GitRevert>

  • Retrieve all conflicts for a revert

    Parameters

    • repositoryId: string
    • revertId: number
    • Optionalproject: string

      Project ID or project name

    • OptionalcontinuationToken: string
    • Optionaltop: number
    • OptionalexcludeResolved: boolean
    • OptionalonlyResolved: boolean
    • OptionalincludeObsolete: boolean

    Returns Promise<PagedList<GitConflict>>

  • Retrieve information about a revert operation for a specific branch.

    Parameters

    • project: string

      Project ID or project name

    • repositoryId: string

      ID of the repository.

    • refName: string

      The GitAsyncRefOperationParameters generatedRefName used for the revert operation.

    Returns Promise<GitRevert>

  • Get statuses associated with the Git commit.

    Parameters

    • commitId: string

      ID of the Git commit.

    • repositoryId: string

      ID of the repository.

    • Optionalproject: string

      Project ID or project name

    • Optionaltop: number

      Optional. The number of statuses to retrieve. Default is 1000.

    • Optionalskip: number

      Optional. The number of statuses to ignore. Default is 0. For example, to retrieve results 101-150, set top to 50 and skip to 100.

    • OptionallatestOnly: boolean

      The flag indicates whether to get only latest statuses grouped by Context.Name and Context.Genre.

    Returns Promise<GitStatus[]>

  • Retrieve a pull request suggestion for a particular repository or team project.

    Parameters

    • repositoryId: string

      ID of the git repository.

    • Optionalproject: string

      Project ID or project name

    • OptionalpreferCompareBranch: boolean

      If true, prefer the compare branch over the default branch as target branch for pull requests.

    Returns Promise<GitSuggestion[]>

  • Retrieve all threads in a pull request.

    Parameters

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • Optionalproject: string

      Project ID or project name

    • Optionaliteration: number

      If specified, thread positions will be tracked using this iteration as the right side of the diff.

    • OptionalbaseIteration: number

      If specified, thread positions will be tracked using this iteration as the left side of the diff.

    Returns Promise<GitPullRequestCommentThread[]>

  • The Tree endpoint returns the collection of objects underneath the specified tree. Trees are folders in a Git repository.

    Parameters

    • repositoryId: string

      Repository Id.

    • sha1: string

      SHA1 hash of the tree object.

    • Optionalproject: string

      Project ID or project name

    • OptionalprojectId: string

      Project Id.

    • Optionalrecursive: boolean

      Search recursively. Include trees underneath this tree. Default is false.

    • OptionalfileName: string

      Name to use if a .zip file is returned. Default is the object ID.

    Returns Promise<GitTreeRef>

  • The Tree endpoint returns the collection of objects underneath the specified tree. Trees are folders in a Git repository.

    Parameters

    • repositoryId: string

      Repository Id.

    • sha1: string

      SHA1 hash of the tree object.

    • Optionalproject: string

      Project ID or project name

    • OptionalprojectId: string

      Project Id.

    • Optionalrecursive: boolean

      Search recursively. Include trees underneath this tree. Default is false.

    • OptionalfileName: string

      Name to use if a .zip file is returned. Default is the object ID.

    Returns Promise<ReadableStream>

  • Update a comment associated with a specific thread in a pull request.

    Parameters

    • comment: Comment

      The comment content that should be updated. Comments can be up to 150,000 characters.

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request.

    • threadId: number

      ID of the thread that the desired comment is in.

    • commentId: number

      ID of the comment to update.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<Comment>

  • Retry or abandon a failed import request.

    Parameters

    • importRequestToUpdate: GitImportRequest

      The updated version of the import request. Currently, the only change allowed is setting the Status to Queued or Abandoned.

    • project: string

      Project ID or project name

    • repositoryId: string

      The name or ID of the repository.

    • importRequestId: number

      The unique identifier for the import request to update.

    Returns Promise<GitImportRequest>

  • Update pull request iteration statuses collection. The only supported operation type is remove.

    Parameters

    • customHeaders: any
    • patchDocument: JsonPatchDocument

      Operations to apply to the pull request statuses in JSON Patch format.

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • iterationId: number

      ID of the pull request iteration.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<void>

  • Create or update pull request external properties. The patch operation can be add, replace or remove. For add operation, the path can be empty. If the path is empty, the value must be a list of key value pairs. For replace operation, the path cannot be empty. If the path does not exist, the property will be added to the collection. For remove operation, the path cannot be empty. If the path does not exist, no action will be performed.

    Parameters

    • customHeaders: any
    • patchDocument: JsonPatchDocument

      Properties to add, replace or remove in JSON Patch format.

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<any>

  • Reset the votes of multiple reviewers on a pull request. NOTE: This endpoint only supports updating votes, but does not support updating required reviewers (use policy) or display names.

    Parameters

    • patchVotes: IdentityRefWithVote[]

      IDs of the reviewers whose votes will be reset to zero

    • repositoryId: string

      The repository ID of the pull request's target branch.

    • pullRequestId: number

      ID of the pull request

    • Optionalproject: string

      Project ID or project name

    Returns Promise<void>

  • Update pull request statuses collection. The only supported operation type is remove.

    Parameters

    • customHeaders: any
    • patchDocument: JsonPatchDocument

      Operations to apply to the pull request statuses in JSON Patch format.

    • repositoryId: string

      The repository ID of the pull request’s target branch.

    • pullRequestId: number

      ID of the pull request.

    • Optionalproject: string

      Project ID or project name

    Returns Promise<void>

  • Lock or Unlock a branch.

    Parameters

    • newRefInfo: GitRefUpdate

      The ref update action (lock/unlock) to perform

    • repositoryId: string

      The name or ID of the repository.

    • filter: string

      The name of the branch to lock/unlock

    • Optionalproject: string

      Project ID or project name

    • OptionalprojectId: string

      ID or name of the team project. Optional if specifying an ID for repository.

    Returns Promise<GitRef>

  • Creating, updating, or deleting refs(branches).

    Parameters

    • refUpdates: GitRefUpdate[]

      List of ref updates to attempt to perform

    • repositoryId: string

      The name or ID of the repository.

    • Optionalproject: string

      Project ID or project name

    • OptionalprojectId: string

      ID or name of the team project. Optional if specifying an ID for repository.

    Returns Promise<GitRefUpdateResult[]>