TfvcRestClient class
應該用來對 VSS REST API 提出要求的基類(衍生自)
- Extends
方法
建構函式詳細資料
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
項目識別碼或項目名稱
傳回
Promise<TfvcChangesetRef>
getBatchedChangesets(TfvcChangesetsRequestData)
傳回指定變更集識別碼清單的變更集。
function getBatchedChangesets(changesetsRequestData: TfvcChangesetsRequestData): Promise<TfvcChangesetRef[]>
參數
- changesetsRequestData
- TfvcChangesetsRequestData
變更集識別碼清單。
傳回
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
項目識別碼或項目名稱
- 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
項目識別碼或項目名稱
- 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
項目識別碼或項目名稱
- 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
要擷取的變更集識別碼。
- project
-
string
項目識別碼或項目名稱
- 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
變更集的識別碼。 預設值: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
項目識別碼或項目名稱
- 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
變更集的識別碼。
傳回
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
項目識別碼或項目名稱
- fileName
-
string
傳回項目的檔案名稱。
- download
-
boolean
如果為true,請建立可下載的附件。
- scopePath
-
string
資料夾的版本控制路徑,以傳回多個專案。
- recursionLevel
- VersionControlRecursionType
None (只是項目) 或 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
項目識別碼或項目名稱
- fileName
-
string
傳回項目的檔案名稱。
- download
-
boolean
如果為true,請建立可下載的附件。
- scopePath
-
string
資料夾的版本控制路徑,以傳回多個專案。
- recursionLevel
- VersionControlRecursionType
None (只是項目) 或 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
項目識別碼或項目名稱
- scopePath
-
string
資料夾的版本控制路徑,以傳回多個專案。
- recursionLevel
- VersionControlRecursionType
None (只是項目) 或 OneLevel (資料夾的內容)。
- includeLinks
-
boolean
True 是表示 包含連結。
- versionDescriptor
- TfvcVersionDescriptor
傳回
Promise<TfvcItem[]>
getItemsBatch(TfvcItemRequestData, string)
Post 用於檢索一組給定路徑清單或長路徑的項目。 允許為每個路徑指定 recursionLevel 和版本描述符。
function getItemsBatch(itemRequestData: TfvcItemRequestData, project?: string): Promise<TfvcItem[][]>
參數
- itemRequestData
- TfvcItemRequestData
- project
-
string
項目識別碼或項目名稱
傳回
Promise<TfvcItem[][]>
getItemsBatchZip(TfvcItemRequestData, string)
Post 用於檢索一組給定路徑清單或長路徑的項目。 允許為每個路徑指定 recursionLevel 和版本描述符。
function getItemsBatchZip(itemRequestData: TfvcItemRequestData, project?: string): Promise<ArrayBuffer>
參數
- itemRequestData
- TfvcItemRequestData
- project
-
string
項目識別碼或項目名稱
傳回
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
項目識別碼或項目名稱
- fileName
-
string
傳回項目的檔案名稱。
- download
-
boolean
如果為true,請建立可下載的附件。
- scopePath
-
string
資料夾的版本控制路徑,以傳回多個專案。
- recursionLevel
- VersionControlRecursionType
None (只是項目) 或 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
項目識別碼或項目名稱
- fileName
-
string
傳回項目的檔案名稱。
- download
-
boolean
如果為true,請建立可下載的附件。
- scopePath
-
string
資料夾的版本控制路徑,以傳回多個專案。
- recursionLevel
- VersionControlRecursionType
None (只是項目) 或 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
最大項目計數
- project
-
string
項目識別碼或項目名稱
傳回
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
項目識別碼或項目名稱
- top
-
number
要傳回的標籤數目上限,未定義時預設為 100
- skip
-
number
要略過的標籤數目
傳回
Promise<TfvcLabelRef[]>
getShelveset(string, TfvcShelvesetRequestData)
買一個深層架。
function getShelveset(shelvesetId: string, requestData?: TfvcShelvesetRequestData): Promise<TfvcShelveset>
參數
- shelvesetId
-
string
擱置集的唯一識別碼
- requestData
- TfvcShelvesetRequestData
includeDetails、includeWorkItems、maxChangeCount 和 maxCommentLength
傳回
Promise<TfvcShelveset>
getShelvesetChanges(string, number, number)
取得擱置集中包含的變更。
function getShelvesetChanges(shelvesetId: string, top?: number, skip?: number): Promise<TfvcChange[]>
參數
- shelvesetId
-
string
擱置集的唯一識別碼
- 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
擱置集的唯一識別碼
傳回
Promise<AssociatedWorkItem[]>
getTfvcStatistics(string, string)
在 TFVC 的特定範圍內,為集合/專案提供檔案計數和未壓縮的位元組。
function getTfvcStatistics(project?: string, scopePath?: string): Promise<TfvcStatistics>
參數
- project
-
string
項目識別碼或項目名稱
- scopePath
-
string
'$/' 代表集合,'$/project' 代表特定專案
傳回
Promise<TfvcStatistics>