FileContainerRestClient class

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

扩展

构造函数

FileContainerRestClient(IVssRestClientOptions)

方法

createItems(VssJsonCollectionWrapperV<FileContainerItem[]>, number, string)

在引用的容器中创建指定的项。

deleteItem(number, string, string)

删除容器中的指定项目。

getContainers(string, string)

获取按逗号分隔的项目 uris 列表筛选的容器同一范围内,如果未指定,则返回所有容器

getItems(number, string, string, boolean, string, string, boolean, boolean, boolean, boolean, boolean, boolean)

以依赖于给定参数或 HTTP Accept 请求标头的格式获取指定的文件容器对象

构造函数详细信息

FileContainerRestClient(IVssRestClientOptions)

new FileContainerRestClient(options: IVssRestClientOptions)

参数

方法详细信息

createItems(VssJsonCollectionWrapperV<FileContainerItem[]>, number, string)

在引用的容器中创建指定的项。

function createItems(items: VssJsonCollectionWrapperV<FileContainerItem[]>, containerId: number, scope?: string): Promise<FileContainerItem[]>

参数

containerId

number

scope

string

表示容器范围的 GUID。 这通常是项目 ID。

返回

Promise<FileContainerItem[]>

deleteItem(number, string, string)

删除容器中的指定项目。

function deleteItem(containerId: number, itemPath: string, scope?: string): Promise<void>

参数

containerId

number

容器 ID。

itemPath

string

要删除的路径。

scope

string

表示容器范围的 GUID。 这通常是项目 ID。

返回

Promise<void>

getContainers(string, string)

获取按逗号分隔的项目 uris 列表筛选的容器同一范围内,如果未指定,则返回所有容器

function getContainers(scope?: string, artifactUris?: string): Promise<FileContainer[]>

参数

scope

string

表示容器范围的 GUID。 这通常是项目 ID。

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

请求的容器 ID

scope

string

表示容器范围的 GUID。 这通常是项目 ID。

itemPath

string

感兴趣项的路径

metadata

boolean

如果为 true,这将覆盖任何指定的格式参数或 HTTP Accept 请求标头,为给定的 itemPath 提供非递归信息

format

string

如果指定,这将覆盖 HTTP Accept 请求标头以返回“json”或“zip”。 如果指定了$format,则还应将 api-version 指定为查询参数。

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[]>