TfvcRestClient class

应使用基类(派生自)向 VSS REST API 发出请求

扩展

构造函数

TfvcRestClient(IVssRestClientOptions)

属性

RESOURCE_AREA_ID

方法

createChangeset(TfvcChangeset, string)

创建新的变更集。

getBatchedChangesets(TfvcChangesetsRequestData)

返回给定的变更集 ID 列表的更改集。

getBranch(string, string, boolean, boolean)

获取给定路径上的单个分支层次结构,其中指定了父级或子级。

getBranches(string, boolean, boolean, boolean, boolean)

获取分支根的集合 -- 一级子级,没有父级的分支。

getBranchRefs(string, string, boolean, boolean)

获取指定 scopePath 下方的分支层次结构

getChangeset(number, string, number, boolean, boolean, number, boolean, number, number, string, TfvcChangesetSearchCriteria)

检索 Tfvc 更改集

getChangesetChanges(number, number, number)

检索给定更改集的 Tfvc 更改。

getChangesets(string, number, number, number, string, TfvcChangesetSearchCriteria)

检索 Tfvc 更改集

getChangesetWorkItems(number)

检索与特定变更集关联的工作项。

getItem(string, string, string, boolean, string, VersionControlRecursionType, TfvcVersionDescriptor, boolean)

获取单个项的项元数据和/或内容。 下载参数是指示内容应作为下载提供,还是只是作为响应中的流发送。 不适用于始终作为下载返回的压缩内容。

getItemContent(string, string, string, boolean, string, VersionControlRecursionType, TfvcVersionDescriptor, boolean)

获取单个项的项元数据和/或内容。 下载参数是指示内容应作为下载提供,还是只是作为响应中的流发送。 不适用于始终作为下载返回的压缩内容。

getItems(string, string, VersionControlRecursionType, boolean, TfvcVersionDescriptor)

获取 Tfvc 项的列表

getItemsBatch(TfvcItemRequestData, string)

在给定路径列表或长路径的情况下检索一组项的帖子。 允许为每个路径指定递归Level 和版本描述符。

getItemsBatchZip(TfvcItemRequestData, string)

在给定路径列表或长路径的情况下检索一组项的帖子。 允许为每个路径指定递归Level 和版本描述符。

getItemText(string, string, string, boolean, string, VersionControlRecursionType, TfvcVersionDescriptor, boolean)

获取单个项的项元数据和/或内容。 下载参数是指示内容应作为下载提供,还是只是作为响应中的流发送。 不适用于始终作为下载返回的压缩内容。

getItemZip(string, string, string, boolean, string, VersionControlRecursionType, TfvcVersionDescriptor, boolean)

获取单个项的项元数据和/或内容。 下载参数是指示内容应作为下载提供,还是只是作为响应中的流发送。 不适用于始终作为下载返回的压缩内容。

getLabel(string, TfvcLabelRequestData, string)

获取单个深层标签。

getLabelItems(string, number, number)

获取标签下的项目。

getLabels(TfvcLabelRequestData, string, number, number)

获取浅表标签引用的集合。

getShelveset(string, TfvcShelvesetRequestData)

获取单个深层货架集。

getShelvesetChanges(string, number, number)

获取货架集中包含的更改。

getShelvesets(TfvcShelvesetRequestData, number, number)

返回浅架集引用的集合。

getShelvesetWorkItems(string)

获取与货架集关联的工作项。

getTfvcStatistics(string, string)

在 TFVC 的特定范围内为集合/项目提供文件计数和未压缩的字节数。

构造函数详细信息

TfvcRestClient(IVssRestClientOptions)

new TfvcRestClient(options: IVssRestClientOptions)

参数

属性详细信息

RESOURCE_AREA_ID

static RESOURCE_AREA_ID: string

属性值

string

方法详细信息

createChangeset(TfvcChangeset, string)

创建新的变更集。

function createChangeset(changeset: TfvcChangeset, project?: string): Promise<TfvcChangesetRef>

参数

changeset
TfvcChangeset
project

string

项目 ID 或项目名称

返回

Promise<TfvcChangesetRef>

getBatchedChangesets(TfvcChangesetsRequestData)

返回给定的变更集 ID 列表的更改集。

function getBatchedChangesets(changesetsRequestData: TfvcChangesetsRequestData): Promise<TfvcChangesetRef[]>

参数

changesetsRequestData
TfvcChangesetsRequestData

更改集 ID 的列表。

返回

Promise<TfvcChangesetRef[]>

getBranch(string, string, boolean, boolean)

获取给定路径上的单个分支层次结构,其中指定了父级或子级。

function getBranch(path: string, project?: string, includeParent?: boolean, includeChildren?: boolean): Promise<TfvcBranch>

参数

path

string

分支的完整路径。 默认值:$/ 示例:$/、$/MyProject、$/MyProject/SomeFolder。

project

string

项目 ID 或项目名称

includeParent

boolean

返回父分支(如果有)。 默认值:False

includeChildren

boolean

返回子分支(如果有)。 默认值:False

返回

Promise<TfvcBranch>

getBranches(string, boolean, boolean, boolean, boolean)

获取分支根的集合 -- 一级子级,没有父级的分支。

function getBranches(project?: string, includeParent?: boolean, includeChildren?: boolean, includeDeleted?: boolean, includeLinks?: boolean): Promise<TfvcBranch[]>

参数

project

string

项目 ID 或项目名称

includeParent

boolean

返回父分支(如果有)。 默认值:False

includeChildren

boolean

返回每个根分支的子分支。 默认值:False

includeDeleted

boolean

返回已删除的分支。 默认值:False

includeLinks

boolean

返回链接。 默认值:False

返回

Promise<TfvcBranch[]>

getBranchRefs(string, string, boolean, boolean)

获取指定 scopePath 下方的分支层次结构

function getBranchRefs(scopePath: string, project?: string, includeDeleted?: boolean, includeLinks?: boolean): Promise<TfvcBranchRef[]>

参数

scopePath

string

分支的完整路径。 默认值:$/ 示例:$/、$/MyProject、$/MyProject/SomeFolder。

project

string

项目 ID 或项目名称

includeDeleted

boolean

返回已删除的分支。 默认值:False

includeLinks

boolean

返回链接。 默认值:False

返回

Promise<TfvcBranchRef[]>

getChangeset(number, string, number, boolean, boolean, number, boolean, number, number, string, TfvcChangesetSearchCriteria)

检索 Tfvc 更改集

function getChangeset(id: number, project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TfvcChangesetSearchCriteria): Promise<TfvcChangeset>

参数

id

number

要检索的变更集 ID。

project

string

项目 ID 或项目名称

maxChangeCount

number

要返回的更改数(最多 100 个更改) 默认值:0

includeDetails

boolean

在响应中包含策略详细信息和签入说明。 默认值:false

includeWorkItems

boolean

包括工作项。 默认值:false

maxCommentLength

number

在响应中包含有关关联工作项的详细信息。 默认值:null

includeSourceRename

boolean

包括重命名。 默认值:false

skip

number

要跳过的结果数。 默认值:null

top

number

要返回的最大结果数。 默认值:null

orderby

string

默认情况下,结果按 ID 按降序排序。 使用 ID asc 按 ID 按升序排序。

searchCriteria
TfvcChangesetSearchCriteria

以下条件可用 (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) 默认值: null

返回

Promise<TfvcChangeset>

getChangesetChanges(number, number, number)

检索给定更改集的 Tfvc 更改。

function getChangesetChanges(id?: number, skip?: number, top?: number): Promise<PagedList<TfvcChange>>

参数

id

number

更改集的 ID。 默认值:null

skip

number

要跳过的结果数。 默认值:null

top

number

要返回的最大结果数。 默认值:null

返回

Promise<PagedList<TfvcChange>>

getChangesets(string, number, number, number, string, TfvcChangesetSearchCriteria)

检索 Tfvc 更改集

function getChangesets(project?: string, maxCommentLength?: number, skip?: number, top?: number, orderby?: string, searchCriteria?: TfvcChangesetSearchCriteria): Promise<TfvcChangesetRef[]>

参数

project

string

项目 ID 或项目名称

maxCommentLength

number

在响应中包含有关关联工作项的详细信息。 默认值:null

skip

number

要跳过的结果数。 默认值:null

top

number

要返回的最大结果数。 默认值:null

orderby

string

默认情况下,结果按 ID 按降序排序。 使用 ID asc 按 ID 按升序排序。

searchCriteria
TfvcChangesetSearchCriteria

以下条件可用 (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) 默认值: null

返回

Promise<TfvcChangesetRef[]>

getChangesetWorkItems(number)

检索与特定变更集关联的工作项。

function getChangesetWorkItems(id?: number): Promise<AssociatedWorkItem[]>

参数

id

number

更改集的 ID。

返回

Promise<AssociatedWorkItem[]>

getItem(string, string, string, boolean, string, VersionControlRecursionType, TfvcVersionDescriptor, boolean)

获取单个项的项元数据和/或内容。 下载参数是指示内容应作为下载提供,还是只是作为响应中的流发送。 不适用于始终作为下载返回的压缩内容。

function getItem(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: VersionControlRecursionType, versionDescriptor?: TfvcVersionDescriptor, includeContent?: boolean): Promise<TfvcItem>

参数

path

string

要返回的单个项的版本控制路径。

project

string

项目 ID 或项目名称

fileName

string

返回的项的文件名。

download

boolean

如果为 true,请创建可下载的附件。

scopePath

string

要返回多个项目的文件夹的版本控制路径。

recursionLevel
VersionControlRecursionType

无(仅项目)或 OneLevel(文件夹的内容)。

versionDescriptor
TfvcVersionDescriptor

版本描述符。 默认值为 null。

includeContent

boolean

设置为 true 以在请求 json 时包含项内容。 默认值为 false。

返回

Promise<TfvcItem>

getItemContent(string, string, string, boolean, string, VersionControlRecursionType, TfvcVersionDescriptor, boolean)

获取单个项的项元数据和/或内容。 下载参数是指示内容应作为下载提供,还是只是作为响应中的流发送。 不适用于始终作为下载返回的压缩内容。

function getItemContent(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: VersionControlRecursionType, versionDescriptor?: TfvcVersionDescriptor, includeContent?: boolean): Promise<ArrayBuffer>

参数

path

string

要返回的单个项的版本控制路径。

project

string

项目 ID 或项目名称

fileName

string

返回的项的文件名。

download

boolean

如果为 true,请创建可下载的附件。

scopePath

string

要返回多个项目的文件夹的版本控制路径。

recursionLevel
VersionControlRecursionType

无(仅项目)或 OneLevel(文件夹的内容)。

versionDescriptor
TfvcVersionDescriptor

版本描述符。 默认值为 null。

includeContent

boolean

设置为 true 以在请求 json 时包含项内容。 默认值为 false。

返回

Promise<ArrayBuffer>

getItems(string, string, VersionControlRecursionType, boolean, TfvcVersionDescriptor)

获取 Tfvc 项的列表

function getItems(project?: string, scopePath?: string, recursionLevel?: VersionControlRecursionType, includeLinks?: boolean, versionDescriptor?: TfvcVersionDescriptor): Promise<TfvcItem[]>

参数

project

string

项目 ID 或项目名称

scopePath

string

要返回多个项目的文件夹的版本控制路径。

recursionLevel
VersionControlRecursionType

无(仅项目)或 OneLevel(文件夹的内容)。

includeLinks

boolean

如果包含链接,则为 True。

versionDescriptor
TfvcVersionDescriptor

返回

Promise<TfvcItem[]>

getItemsBatch(TfvcItemRequestData, string)

在给定路径列表或长路径的情况下检索一组项的帖子。 允许为每个路径指定递归Level 和版本描述符。

function getItemsBatch(itemRequestData: TfvcItemRequestData, project?: string): Promise<TfvcItem[][]>

参数

itemRequestData
TfvcItemRequestData
project

string

项目 ID 或项目名称

返回

Promise<TfvcItem[][]>

getItemsBatchZip(TfvcItemRequestData, string)

在给定路径列表或长路径的情况下检索一组项的帖子。 允许为每个路径指定递归Level 和版本描述符。

function getItemsBatchZip(itemRequestData: TfvcItemRequestData, project?: string): Promise<ArrayBuffer>

参数

itemRequestData
TfvcItemRequestData
project

string

项目 ID 或项目名称

返回

Promise<ArrayBuffer>

getItemText(string, string, string, boolean, string, VersionControlRecursionType, TfvcVersionDescriptor, boolean)

获取单个项的项元数据和/或内容。 下载参数是指示内容应作为下载提供,还是只是作为响应中的流发送。 不适用于始终作为下载返回的压缩内容。

function getItemText(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: VersionControlRecursionType, versionDescriptor?: TfvcVersionDescriptor, includeContent?: boolean): Promise<string>

参数

path

string

要返回的单个项的版本控制路径。

project

string

项目 ID 或项目名称

fileName

string

返回的项的文件名。

download

boolean

如果为 true,请创建可下载的附件。

scopePath

string

要返回多个项目的文件夹的版本控制路径。

recursionLevel
VersionControlRecursionType

无(仅项目)或 OneLevel(文件夹的内容)。

versionDescriptor
TfvcVersionDescriptor

版本描述符。 默认值为 null。

includeContent

boolean

设置为 true 以在请求 json 时包含项内容。 默认值为 false。

返回

Promise<string>

getItemZip(string, string, string, boolean, string, VersionControlRecursionType, TfvcVersionDescriptor, boolean)

获取单个项的项元数据和/或内容。 下载参数是指示内容应作为下载提供,还是只是作为响应中的流发送。 不适用于始终作为下载返回的压缩内容。

function getItemZip(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: VersionControlRecursionType, versionDescriptor?: TfvcVersionDescriptor, includeContent?: boolean): Promise<ArrayBuffer>

参数

path

string

要返回的单个项的版本控制路径。

project

string

项目 ID 或项目名称

fileName

string

返回的项的文件名。

download

boolean

如果为 true,请创建可下载的附件。

scopePath

string

要返回多个项目的文件夹的版本控制路径。

recursionLevel
VersionControlRecursionType

无(仅项目)或 OneLevel(文件夹的内容)。

versionDescriptor
TfvcVersionDescriptor

版本描述符。 默认值为 null。

includeContent

boolean

设置为 true 以在请求 json 时包含项内容。 默认值为 false。

返回

Promise<ArrayBuffer>

getLabel(string, TfvcLabelRequestData, string)

获取单个深层标签。

function getLabel(labelId: string, requestData: TfvcLabelRequestData, project?: string): Promise<TfvcLabel>

参数

labelId

string

标签的唯一标识符

requestData
TfvcLabelRequestData

maxItemCount

project

string

项目 ID 或项目名称

返回

Promise<TfvcLabel>

getLabelItems(string, number, number)

获取标签下的项目。

function getLabelItems(labelId: string, top?: number, skip?: number): Promise<TfvcItem[]>

参数

labelId

string

标签的唯一标识符

top

number

要返回的最大项数

skip

number

要跳过的项目数

返回

Promise<TfvcItem[]>

getLabels(TfvcLabelRequestData, string, number, number)

获取浅表标签引用的集合。

function getLabels(requestData: TfvcLabelRequestData, project?: string, top?: number, skip?: number): Promise<TfvcLabelRef[]>

参数

requestData
TfvcLabelRequestData

labelScope、name、owner 和 itemLabelFilter

project

string

项目 ID 或项目名称

top

number

要返回的最大标签数,未定义时默认为 100

skip

number

要跳过的标签数

返回

Promise<TfvcLabelRef[]>

getShelveset(string, TfvcShelvesetRequestData)

获取单个深层货架集。

function getShelveset(shelvesetId: string, requestData?: TfvcShelvesetRequestData): Promise<TfvcShelveset>

参数

shelvesetId

string

货架集的唯一 ID

requestData
TfvcShelvesetRequestData

includeDetails、includeWorkItems、maxChangeCount 和 maxCommentLength

返回

Promise<TfvcShelveset>

getShelvesetChanges(string, number, number)

获取货架集中包含的更改。

function getShelvesetChanges(shelvesetId: string, top?: number, skip?: number): Promise<TfvcChange[]>

参数

shelvesetId

string

货架集的唯一 ID

top

number

要返回的最大更改数

skip

number

要跳过的更改数

返回

Promise<TfvcChange[]>

getShelvesets(TfvcShelvesetRequestData, number, number)

返回浅架集引用的集合。

function getShelvesets(requestData?: TfvcShelvesetRequestData, top?: number, skip?: number): Promise<TfvcShelvesetRef[]>

参数

requestData
TfvcShelvesetRequestData

name、owner 和 maxCommentLength

top

number

要返回的最大货架集数

skip

number

要跳过的货架集数

返回

Promise<TfvcShelvesetRef[]>

getShelvesetWorkItems(string)

获取与货架集关联的工作项。

function getShelvesetWorkItems(shelvesetId: string): Promise<AssociatedWorkItem[]>

参数

shelvesetId

string

货架集的唯一 ID

返回

Promise<AssociatedWorkItem[]>

getTfvcStatistics(string, string)

在 TFVC 的特定范围内为集合/项目提供文件计数和未压缩的字节数。

function getTfvcStatistics(project?: string, scopePath?: string): Promise<TfvcStatistics>

参数

project

string

项目 ID 或项目名称

scopePath

string

集合的“$/”,特定项目的“$/project”

返回

Promise<TfvcStatistics>