TfvcRestClient class
应使用 (派生自) 的基类向 VSS REST API 发出请求
- Extends
构造函数
Tfvc |
属性
RESOURCE_AREA_ID |
方法
构造函数详细信息
TfvcRestClient(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) Default: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) Default: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)
获取单个项的项元数据和/或内容。 download 参数用于指示内容是应作为下载内容提供,还是仅作为响应中的流发送。 不适用于始终作为下载返回的压缩内容。
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)
获取单个项的项元数据和/或内容。 download 参数用于指示内容是应作为下载内容提供,还是仅作为响应中的流发送。 不适用于始终作为下载返回的压缩内容。
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)
发布用于检索给定路径列表或长路径的一组项。 允许为每个路径指定 recursionLevel 和版本描述符。
function getItemsBatch(itemRequestData: TfvcItemRequestData, project?: string): Promise<TfvcItem[][]>
参数
- itemRequestData
- TfvcItemRequestData
- project
-
string
项目 ID 或项目名称
返回
Promise<TfvcItem[][]>
getItemsBatchZip(TfvcItemRequestData, string)
发布用于检索给定路径列表或长路径的一组项。 允许为每个路径指定 recursionLevel 和版本描述符。
function getItemsBatchZip(itemRequestData: TfvcItemRequestData, project?: string): Promise<ArrayBuffer>
参数
- itemRequestData
- TfvcItemRequestData
- project
-
string
项目 ID 或项目名称
返回
Promise<ArrayBuffer>
getItemText(string, string, string, boolean, string, VersionControlRecursionType, TfvcVersionDescriptor, boolean)
获取单个项的项元数据和/或内容。 download 参数用于指示内容是应作为下载内容提供,还是仅作为响应中的流发送。 不适用于始终作为下载返回的压缩内容。
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)
获取单个项的项元数据和/或内容。 download 参数用于指示内容是应作为下载内容提供,还是仅作为响应中的流发送。 不适用于始终作为下载返回的压缩内容。
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
Shelveset 的唯一 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
Shelveset 的唯一 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
Shelveset 的唯一 ID
返回
Promise<AssociatedWorkItem[]>
getTfvcStatistics(string, string)
为 TFVC 的特定范围内的集合/项目提供文件计数和未压缩字节数。
function getTfvcStatistics(project?: string, scopePath?: string): Promise<TfvcStatistics>
参数
- project
-
string
项目 ID 或项目名称
- scopePath
-
string
“$/”用于集合,“$/project”用于特定项目
返回
Promise<TfvcStatistics>