FileContainerRestClient class

Base class that should be used (derived from) to make requests to VSS REST apis

Extends

Constructors

FileContainerRestClient(IVssRestClientOptions)

Methods

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

Creates the specified items in the referenced container.

deleteItem(number, string, string)

Deletes the specified items in a container.

getContainers(string, string)

Gets containers filtered by a comma separated list of artifact uris within the same scope, if not specified returns all containers

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

Gets the specified file container object in a format dependent upon the given parameters or HTTP Accept request header

Constructor Details

FileContainerRestClient(IVssRestClientOptions)

new FileContainerRestClient(options: IVssRestClientOptions)

Parameters

Method Details

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

Creates the specified items in the referenced container.

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

Parameters

containerId

number

scope

string

A guid representing the scope of the container. This is often the project id.

Returns

Promise<FileContainerItem[]>

deleteItem(number, string, string)

Deletes the specified items in a container.

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

Parameters

containerId

number

Container Id.

itemPath

string

Path to delete.

scope

string

A guid representing the scope of the container. This is often the project id.

Returns

Promise<void>

getContainers(string, string)

Gets containers filtered by a comma separated list of artifact uris within the same scope, if not specified returns all containers

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

Parameters

scope

string

A guid representing the scope of the container. This is often the project id.

artifactUris

string

Returns

Promise<FileContainer[]>

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

Gets the specified file container object in a format dependent upon the given parameters or HTTP Accept request header

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

Parameters

containerId

number

The requested container Id

scope

string

A guid representing the scope of the container. This is often the project id.

itemPath

string

The path to the item of interest

metadata

boolean

If true, this overrides any specified format parameter or HTTP Accept request header to provide non-recursive information for the given itemPath

format

string

If specified, this overrides the HTTP Accept request header to return either 'json' or 'zip'. If $format is specified, then api-version should also be specified as a query parameter.

downloadFileName

string

If specified and returning other than JSON format, then this download name will be used (else defaults to itemPath)

includeDownloadTickets

boolean

isShallow

boolean

If true, returns only immediate children(files & folders) for the given itemPath. False will return all items recursively within itemPath.

ignoreRequestedMediaType

boolean

Set to true to ignore the HTTP Accept request header. Default is false.

includeBlobMetadata

boolean

saveAbsolutePath

boolean

Set to false to not save the absolute path to the specified directory of the artifact in the returned archive. Works only for artifact directories. Default is true.

preferRedirect

boolean

Set to true to get the redirect response which leads to the stream with content. Default is false.

Returns

Promise<FileContainerItem[]>