FileContainerRestClient class
應該用來對 VSS REST API 提出要求的基類(衍生自)
- Extends
方法
| create |
在參考的容器中建立指定的專案。 |
| delete |
刪除容器中的指定專案。 |
| get |
如果未指定,則取得以逗號分隔的成品 URI 清單篩選的容器,如果未指定,則會傳回所有容器 |
| get |
根據指定的參數或 HTTP Accept 要求標頭,以格式取得指定的檔案容器物件 |
建構函式詳細資料
FileContainerRestClient(IVssRestClientOptions)
方法詳細資料
createItems(VssJsonCollectionWrapperV<FileContainerItem[]>, number, string)
在參考的容器中建立指定的專案。
function createItems(items: VssJsonCollectionWrapperV<FileContainerItem[]>, containerId: number, scope?: string): Promise<FileContainerItem[]>
參數
- containerId
-
number
- scope
-
string
GUID,表示容器的範圍。 這通常是專案標識碼。
傳回
Promise<FileContainerItem[]>
deleteItem(number, string, string)
刪除容器中的指定專案。
function deleteItem(containerId: number, itemPath: string, scope?: string): Promise<void>
參數
- containerId
-
number
容器標識碼。
- itemPath
-
string
要刪除的路徑。
- scope
-
string
GUID,表示容器的範圍。 這通常是專案標識碼。
傳回
Promise<void>
getContainers(string, string)
如果未指定,則取得以逗號分隔的成品 URI 清單篩選的容器,如果未指定,則會傳回所有容器
function getContainers(scope?: string, artifactUris?: string): Promise<FileContainer[]>
參數
- scope
-
string
GUID,表示容器的範圍。 這通常是專案標識碼。
- artifactUris
-
string
傳回
Promise<FileContainer[]>
getItems(number, string, string, boolean, string, string, boolean, boolean, boolean, boolean, boolean, boolean)
根據指定的參數或 HTTP Accept 要求標頭,以格式取得指定的檔案容器物件
function getItems(containerId: number, scope?: string, itemPath?: string, metadata?: boolean, format?: string, downloadFileName?: string, includeDownloadTickets?: boolean, isShallow?: boolean, ignoreRequestedMediaType?: boolean, includeBlobMetadata?: boolean, saveAbsolutePath?: boolean, preferRedirect?: boolean): Promise<FileContainerItem[]>
參數
- containerId
-
number
要求的容器標識碼
- scope
-
string
GUID,表示容器的範圍。 這通常是專案標識碼。
- itemPath
-
string
感興趣的項目路徑
- metadata
-
boolean
如果為 true,這會覆寫任何指定的格式參數或 HTTP Accept 要求標頭,以提供指定 itemPath 的非遞歸資訊
- format
-
string
如果指定,這會覆寫 HTTP Accept 要求標頭,以傳回 'json' 或 'zip'。 如果指定$format,則 api 版本也應該指定為查詢參數。
- downloadFileName
-
string
如果指定並傳回 JSON 格式以外的格式,則會使用此下載名稱(否則會預設為 itemPath)
- includeDownloadTickets
-
boolean
- isShallow
-
boolean
如果為true,則僅傳回指定itemPath的直接子系(檔案和資料夾)。 False 會以遞歸方式傳回 itemPath 內的所有專案。
- ignoreRequestedMediaType
-
boolean
設定為 true 以忽略 HTTP Accept 要求標頭。 默認值為 false。
- includeBlobMetadata
-
boolean
- saveAbsolutePath
-
boolean
將 設定為 false,不會將絕對路徑儲存至傳回封存中成品的指定目錄。 僅適用於成品目錄。 默認值為 true。
- preferRedirect
-
boolean
設定為 true 以取得導致內容數據流的重新導向回應。 默認值為 false。
傳回
Promise<FileContainerItem[]>