CoreRestClient class

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

Extends

Constructors

CoreRestClient(IVssRestClientOptions)

Properties

RESOURCE_AREA_ID

Methods

createConnectedService(WebApiConnectedServiceDetails, string)
createIdentityMru(IdentityData, string)
createOrUpdateProxy(Proxy)
createTeam(WebApiTeam, string)

Create a team in a team project.

deleteIdentityMru(IdentityData, string)
deleteProxy(string, string)
deleteTeam(string, string)

Delete a team.

getAllTeams(boolean, number, number, boolean)

Get a list of all teams.

getConnectedServiceDetails(string, string)
getConnectedServices(string, ConnectedServiceKind)
getIdentityMru(string)
getProcessById(string)

Get a process by ID.

getProcesses()

Get a list of processes.

getProject(string, boolean, boolean)

Get project with the specified id or name, optionally including capabilities.

getProjectCollection(string)

Get project collection with the specified id or name.

getProjectCollections(number, number)

Get project collection references for this application.

getProjectHistoryEntries(number)

Gets the history of changes to the project.

getProjectProperties(string, string[])

Get a collection of team project properties.

getProjects(any, number, number, number, boolean)

Get all projects in the organization that the authenticated user has access to.

getProjectsProperties(string[], string[])

Get a collection of team project properties for multiple projects.

getProjectTeamsByCategory(string, boolean, number, number)

Gets list of user readable teams in a project and teams user is member of (excluded from readable list).

getProxies(string)
getTeam(string, string, boolean)

Get a specific team.

getTeamMembersWithExtendedProperties(string, string, number, number)

Get a list of members for a specific team.

getTeams(string, boolean, number, number, boolean)

Get a list of teams.

queueCreateProject(TeamProject)

Queues a project to be created. Use the GetOperation to periodically check for create project status.

queueDeleteProject(string)

Queues a project to be deleted. Use the GetOperation to periodically check for delete project status.

removeProjectAvatar(string)

Removes the avatar for the project.

setProjectAvatar(ProjectAvatar, string)

Sets the avatar for the project.

setProjectProperties(string, JsonPatchDocument)

Create, update, and delete team project properties.

updateIdentityMru(IdentityData, string)
updateProject(TeamProject, string)

Update an existing project's name, abbreviation, description, or restore a project.

updateTeam(WebApiTeam, string, string)

Update a team's name and/or description.

Constructor Details

CoreRestClient(IVssRestClientOptions)

new CoreRestClient(options: IVssRestClientOptions)

Parameters

Property Details

RESOURCE_AREA_ID

static RESOURCE_AREA_ID: string

Property Value

string

Method Details

createConnectedService(WebApiConnectedServiceDetails, string)

function createConnectedService(connectedServiceCreationData: WebApiConnectedServiceDetails, projectId: string): Promise<WebApiConnectedService>

Parameters

connectedServiceCreationData
WebApiConnectedServiceDetails
projectId

string

Returns

createIdentityMru(IdentityData, string)

function createIdentityMru(mruData: IdentityData, mruName: string): Promise<void>

Parameters

mruData
IdentityData
mruName

string

Returns

Promise<void>

createOrUpdateProxy(Proxy)

function createOrUpdateProxy(proxy: Proxy): Promise<Proxy>

Parameters

proxy
Proxy

Returns

Promise<Proxy>

createTeam(WebApiTeam, string)

Create a team in a team project.

function createTeam(team: WebApiTeam, projectId: string): Promise<WebApiTeam>

Parameters

team
WebApiTeam

The team data used to create the team.

projectId

string

The name or ID (GUID) of the team project in which to create the team.

Returns

Promise<WebApiTeam>

deleteIdentityMru(IdentityData, string)

function deleteIdentityMru(mruData: IdentityData, mruName: string): Promise<void>

Parameters

mruData
IdentityData
mruName

string

Returns

Promise<void>

deleteProxy(string, string)

function deleteProxy(proxyUrl: string, site?: string): Promise<void>

Parameters

proxyUrl

string

site

string

Returns

Promise<void>

deleteTeam(string, string)

Delete a team.

function deleteTeam(projectId: string, teamId: string): Promise<void>

Parameters

projectId

string

The name or ID (GUID) of the team project containing the team to delete.

teamId

string

The name or ID of the team to delete.

Returns

Promise<void>

getAllTeams(boolean, number, number, boolean)

Get a list of all teams.

function getAllTeams(mine?: boolean, top?: number, skip?: number, expandIdentity?: boolean): Promise<WebApiTeam[]>

Parameters

mine

boolean

If true, then return all teams requesting user is member. Otherwise return all teams user has read access.

top

number

Maximum number of teams to return.

skip

number

Number of teams to skip.

expandIdentity

boolean

A value indicating whether or not to expand Identity information in the result WebApiTeam object.

Returns

Promise<WebApiTeam[]>

getConnectedServiceDetails(string, string)

function getConnectedServiceDetails(projectId: string, name: string): Promise<WebApiConnectedServiceDetails>

Parameters

projectId

string

name

string

Returns

getConnectedServices(string, ConnectedServiceKind)

function getConnectedServices(projectId: string, kind?: ConnectedServiceKind): Promise<WebApiConnectedService[]>

Parameters

projectId

string

Returns

getIdentityMru(string)

function getIdentityMru(mruName: string): Promise<IdentityRef[]>

Parameters

mruName

string

Returns

Promise<IdentityRef[]>

getProcessById(string)

Get a process by ID.

function getProcessById(processId: string): Promise<Process>

Parameters

processId

string

ID for a process.

Returns

Promise<Process>

getProcesses()

Get a list of processes.

function getProcesses(): Promise<Process[]>

Returns

Promise<Process[]>

getProject(string, boolean, boolean)

Get project with the specified id or name, optionally including capabilities.

function getProject(projectId: string, includeCapabilities?: boolean, includeHistory?: boolean): Promise<TeamProject>

Parameters

projectId

string

includeCapabilities

boolean

Include capabilities (such as source control) in the team project result (default: false).

includeHistory

boolean

Search within renamed projects (that had such name in the past).

Returns

Promise<TeamProject>

getProjectCollection(string)

Get project collection with the specified id or name.

function getProjectCollection(collectionId: string): Promise<TeamProjectCollection>

Parameters

collectionId

string

Returns

getProjectCollections(number, number)

Get project collection references for this application.

function getProjectCollections(top?: number, skip?: number): Promise<TeamProjectCollectionReference[]>

Parameters

top

number

skip

number

Returns

getProjectHistoryEntries(number)

Gets the history of changes to the project.

function getProjectHistoryEntries(minRevision?: number): Promise<ProjectInfo[]>

Parameters

minRevision

number

The minimum revision number to return in the history.

Returns

Promise<ProjectInfo[]>

getProjectProperties(string, string[])

Get a collection of team project properties.

function getProjectProperties(projectId: string, keys?: string[]): Promise<ProjectProperty[]>

Parameters

projectId

string

The team project ID.

keys

string[]

A comma-delimited string of team project property names. Wildcard characters ("?" and "*") are supported. If no key is specified, all properties will be returned.

Returns

Promise<ProjectProperty[]>

getProjects(any, number, number, number, boolean)

Get all projects in the organization that the authenticated user has access to.

function getProjects(stateFilter?: any, top?: number, skip?: number, continuationToken?: number, getDefaultTeamImageUrl?: boolean): Promise<PagedList<TeamProjectReference>>

Parameters

stateFilter

any

Filter on team projects in a specific team project state (default: WellFormed).

top

number

skip

number

continuationToken

number

Pointer that shows how many projects already been fetched.

getDefaultTeamImageUrl

boolean

Returns

getProjectsProperties(string[], string[])

Get a collection of team project properties for multiple projects.

function getProjectsProperties(projectIds: string[], properties?: string[]): Promise<ProjectProperties[]>

Parameters

projectIds

string[]

A comma-delimited string of team project IDs

properties

string[]

Returns

Promise<ProjectProperties[]>

getProjectTeamsByCategory(string, boolean, number, number)

Gets list of user readable teams in a project and teams user is member of (excluded from readable list).

function getProjectTeamsByCategory(projectId: string, expandIdentity?: boolean, top?: number, skip?: number): Promise<CategorizedWebApiTeams>

Parameters

projectId

string

The name or ID (GUID) of the team project containing the teams to retrieve.

expandIdentity

boolean

A value indicating whether or not to expand Identity information in the result WebApiTeam object.

top

number

Maximum number of teams to return.

skip

number

Number of teams to skip.

Returns

getProxies(string)

function getProxies(proxyUrl?: string): Promise<Proxy[]>

Parameters

proxyUrl

string

Returns

Promise<Proxy[]>

getTeam(string, string, boolean)

Get a specific team.

function getTeam(projectId: string, teamId: string, expandIdentity?: boolean): Promise<WebApiTeam>

Parameters

projectId

string

The name or ID (GUID) of the team project containing the team.

teamId

string

The name or ID (GUID) of the team.

expandIdentity

boolean

A value indicating whether or not to expand Identity information in the result WebApiTeam object.

Returns

Promise<WebApiTeam>

getTeamMembersWithExtendedProperties(string, string, number, number)

Get a list of members for a specific team.

function getTeamMembersWithExtendedProperties(projectId: string, teamId: string, top?: number, skip?: number): Promise<TeamMember[]>

Parameters

projectId

string

The name or ID (GUID) of the team project the team belongs to.

teamId

string

The name or ID (GUID) of the team .

top

number

skip

number

Returns

Promise<TeamMember[]>

getTeams(string, boolean, number, number, boolean)

Get a list of teams.

function getTeams(projectId: string, mine?: boolean, top?: number, skip?: number, expandIdentity?: boolean): Promise<WebApiTeam[]>

Parameters

projectId

string

mine

boolean

If true return all the teams requesting user is member, otherwise return all the teams user has read access.

top

number

Maximum number of teams to return.

skip

number

Number of teams to skip.

expandIdentity

boolean

A value indicating whether or not to expand Identity information in the result WebApiTeam object.

Returns

Promise<WebApiTeam[]>

queueCreateProject(TeamProject)

Queues a project to be created. Use the GetOperation to periodically check for create project status.

function queueCreateProject(projectToCreate: TeamProject): Promise<OperationReference>

Parameters

projectToCreate
TeamProject

The project to create.

Returns

queueDeleteProject(string)

Queues a project to be deleted. Use the GetOperation to periodically check for delete project status.

function queueDeleteProject(projectId: string): Promise<OperationReference>

Parameters

projectId

string

The project id of the project to delete.

Returns

removeProjectAvatar(string)

Removes the avatar for the project.

function removeProjectAvatar(projectId: string): Promise<void>

Parameters

projectId

string

The ID or name of the project.

Returns

Promise<void>

setProjectAvatar(ProjectAvatar, string)

Sets the avatar for the project.

function setProjectAvatar(avatarBlob: ProjectAvatar, projectId: string): Promise<void>

Parameters

avatarBlob
ProjectAvatar

The avatar blob data object to upload.

projectId

string

The ID or name of the project.

Returns

Promise<void>

setProjectProperties(string, JsonPatchDocument)

Create, update, and delete team project properties.

function setProjectProperties(projectId: string, patchDocument: JsonPatchDocument): Promise<void>

Parameters

projectId

string

The team project ID.

patchDocument
JsonPatchDocument

A JSON Patch document that represents an array of property operations. See RFC 6902 for more details on JSON Patch. The accepted operation verbs are Add and Remove, where Add is used for both creating and updating properties. The path consists of a forward slash and a property name.

Returns

Promise<void>

updateIdentityMru(IdentityData, string)

function updateIdentityMru(mruData: IdentityData, mruName: string): Promise<void>

Parameters

mruData
IdentityData
mruName

string

Returns

Promise<void>

updateProject(TeamProject, string)

Update an existing project's name, abbreviation, description, or restore a project.

function updateProject(projectUpdate: TeamProject, projectId: string): Promise<OperationReference>

Parameters

projectUpdate
TeamProject

The updates for the project. The state must be set to wellFormed to restore the project.

projectId

string

The project id of the project to update.

Returns

updateTeam(WebApiTeam, string, string)

Update a team's name and/or description.

function updateTeam(teamData: WebApiTeam, projectId: string, teamId: string): Promise<WebApiTeam>

Parameters

teamData
WebApiTeam
projectId

string

The name or ID (GUID) of the team project containing the team to update.

teamId

string

The name of ID of the team to update.

Returns

Promise<WebApiTeam>