Last Update: 9/26/2016

TfvcHttpClient2_1

This API is in private preview and subject to change.

Module path: TFS/VersionControl/TfvcRestClient

Initialization sample

  import RestClient = require("TFS/VersionControl/TfvcRestClient");

  // Get an instance of the client
  var client = RestClient.getClient();

  // Call a method on the client
  // e.g. client.getResource(...).then(...);

Methods

createChangeset()

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcChangesetRef> createChangeset(changeset, project)

Parameters

Returns

getBatchedChangesets()

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcChangesetRef[]> getBatchedChangesets(changesetsRequestData)

Parameters

Returns

getBranch()

Get a single branch hierarchy at the given path with parents or children (if specified)

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcBranch> getBranch(path, project, includeParent, includeChildren)

Parameters

  • path: string.
  • project: string. Optional.
  • includeParent: boolean. Optional.
  • includeChildren: boolean. Optional.

Returns

getBranches()

Get a collection of branch roots -- first-level children, branches with no parents

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcBranch[]> getBranches(project, includeParent, includeChildren, includeDeleted, includeLinks)

Parameters

  • project: string. Optional. Project ID or project name
  • includeParent: boolean. Optional.
  • includeChildren: boolean. Optional.
  • includeDeleted: boolean. Optional.
  • includeLinks: boolean. Optional.

Returns

getBranchRefs()

Get branch hierarchies below the specified scopePath

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcBranchRef[]> getBranchRefs(scopePath, project, includeDeleted, includeLinks)

Parameters

  • scopePath: string.
  • project: string. Optional.
  • includeDeleted: boolean. Optional.
  • includeLinks: boolean. Optional.

Returns

getChangeset()

Retrieve a Tfvc Changeset

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcChangeset> getChangeset(id, project, maxChangeCount, includeDetails, includeWorkItems, maxCommentLength, includeSourceRename, skip, top, orderby, searchCriteria)

Parameters

  • id: number.
  • project: string. Optional.
  • maxChangeCount: number. Optional.
  • includeDetails: boolean. Optional.
  • includeWorkItems: boolean. Optional.
  • maxCommentLength: number. Optional.
  • includeSourceRename: boolean. Optional.
  • skip: number. Optional.
  • top: number. Optional.
  • orderby: string. Optional.
  • searchCriteria: TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria. Optional.

Returns

getChangesetChanges()

Retrieve Tfvc changes for a given changeset

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcChange[]> getChangesetChanges(id, skip, top)

Parameters

  • id: number. Optional.
  • skip: number. Optional.
  • top: number. Optional.

Returns

getChangesets()

Retrieve Tfvc changesets

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcChangesetRef[]> getChangesets(project, maxChangeCount, includeDetails, includeWorkItems, maxCommentLength, includeSourceRename, skip, top, orderby, searchCriteria)

Parameters

  • project: string. Optional. Project ID or project name
  • maxChangeCount: number. Optional.
  • includeDetails: boolean. Optional.
  • includeWorkItems: boolean. Optional.
  • maxCommentLength: number. Optional.
  • includeSourceRename: boolean. Optional.
  • skip: number. Optional.
  • top: number. Optional.
  • orderby: string. Optional.
  • searchCriteria: TFS_VersionControl_Contracts.TfvcChangesetSearchCriteria. Optional.

Returns

getChangesetWorkItems()

Syntax

 IPromise<TFS_VersionControl_Contracts.AssociatedWorkItem[]> getChangesetWorkItems(id)

Parameters

  • id: number. Optional.

Returns

getItem()

Get Item Metadata and/or Content. 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.

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcItem> getItem(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor)

Parameters

Returns

getItemContent()

Get Item Metadata and/or Content. 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.

Syntax

 IPromise<ArrayBuffer> getItemContent(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor)

Parameters

Returns

getItems()

Get a list of Tfvc items

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcItem[]> getItems(project, scopePath, recursionLevel, includeLinks, versionDescriptor)

Parameters

Returns

getItemsBatch()

Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path.

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcItem[][]> getItemsBatch(itemRequestData, project)

Parameters

Returns

getItemsBatchZip()

Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path.

Syntax

 IPromise<ArrayBuffer> getItemsBatchZip(itemRequestData, project)

Parameters

Returns

getItemText()

Get Item Metadata and/or Content. 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.

Syntax

 IPromise<string> getItemText(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor)

Parameters

Returns

getItemZip()

Get Item Metadata and/or Content. 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.

Syntax

 IPromise<ArrayBuffer> getItemZip(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor)

Parameters

Returns

getLabel()

Get a single deep label.

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcLabel> getLabel(labelId, requestData, project)

Parameters

Returns

getLabelItems()

Get items under a label.

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcItem[]> getLabelItems(labelId, top, skip)

Parameters

  • labelId: string. Unique identifier of label
  • top: number. Optional. Max number of items to return
  • skip: number. Optional. Number of items to skip

Returns

getLabels()

Get a collection of shallow label references.

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcLabelRef[]> getLabels(requestData, project, top, skip)

Parameters

  • requestData: TFS_VersionControl_Contracts.TfvcLabelRequestData. labelScope, name, owner, and itemLabelFilter
  • project: string. Optional. Project ID or project name
  • top: number. Optional. Max number of labels to return
  • skip: number. Optional. Number of labels to skip

Returns

getProjectInfo()

[Obsolete - Use the Projects API instead] Retrieve the version control information for a given Team Project

Syntax

 IPromise<TFS_VersionControl_Contracts.VersionControlProjectInfo> getProjectInfo(projectId, project)

Parameters

  • projectId: string. The ID (or name) of the team project
  • project: string. Optional. Project ID or project name

Returns

getProjectInfos()

[Obsolete - Use the Projects API instead]

Syntax

 IPromise<TFS_VersionControl_Contracts.VersionControlProjectInfo[]> getProjectInfos(project)

Parameters

  • project: string. Optional. Project ID or project name

Returns

getShelveset()

Get a single deep shelveset.

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcShelveset> getShelveset(shelvesetId, requestData)

Parameters

Returns

getShelvesetChanges()

Get changes included in a shelveset.

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcChange[]> getShelvesetChanges(shelvesetId, top, skip)

Parameters

  • shelvesetId: string. Shelveset's unique ID
  • top: number. Optional. Max number of changes to return
  • skip: number. Optional. Number of changes to skip

Returns

getShelvesets()

Return a collection of shallow shelveset references.

Syntax

 IPromise<TFS_VersionControl_Contracts.TfvcShelvesetRef[]> getShelvesets(requestData, top, skip)

Parameters

Returns

getShelvesetWorkItems()

Get work items associated with a shelveset.

Syntax

 IPromise<TFS_VersionControl_Contracts.AssociatedWorkItem[]> getShelvesetWorkItems(shelvesetId)

Parameters

  • shelvesetId: string. Shelveset's unique ID

Returns