Skip to content

Axosoft/azure-devops-node-api

Repository files navigation

Build Status

Azure DevOps Client for Node.js

Integrate with Azure DevOps from your Node.js apps.

Install the library

npm install azure-devops-node-api --save 

News

vso-node-api has been renamed and released as azure-devops-node-api

Get started

Samples

See samples for complete coding examples

Install the library

npm install azure-devops-node-api --save 

Intellisense

Create a connection

import*asazdevfrom"azure-devops-node-api";// your collection urlletorgUrl="https://dev.azure.com/yourorgname"; let token: string=process.env.AZURE_PERSONAL_ACCESS_TOKEN;// e.g "cbdeb34vzyuk5l4gxc4qfczn3lko3avfkfqyb47etahq6axpcqha"; letauthHandler=azdev.getPersonalAccessTokenHandler(token);letconnection=newazdev.WebApi(orgUrl,authHandler);

Get an instance of a client

import*asbafrom"azure-devops-node-api/BuildApi"; let build: ba.IBuildApi=awaitconnection.getBuildApi();

Available clients

These clients are available:

  • Build
  • Core
  • Dashboard
  • ExtensionManagement
  • FeatureManagement
  • FileContainer
  • Git
  • Locations
  • Notification
  • Policy
  • Profile
  • ProjectAnalysis
  • Release
  • SecurityRoles
  • TaskAgent
  • Task
  • Test
  • Tfvc
  • Wiki
  • Work
  • WorkItemTracking
  • WorkItemTrackingProcess
  • WorkItemTrackingProcessDefinitions

Use the client

Coding is easy using linear coding with async/await in TypeScript

import*asbifrom"azure-devops-node-api/interfaces/BuildInterfaces";asyncfunctionrun(){ let project: string="myProject";letdefs: bi.DefinitionReference[]=awaitbuild.getDefinitions(project);defs.forEach((defRef: bi.DefinitionReference)=>{console.log(`${defRef.name} (${defRef.id})`);});}run();

APIs

To see what APIs are available, see the appropriate client interface. For example, GitApi.ts

More detailed information for the endpoints of each API can be found at https://docs.microsoft.com/en-us/rest/api/vsts/?view=vsts-rest-4.1

Running Samples

Pre-reqs: Node >= 4.4.7 LTS and typescript (tsc) >= 1.8

Run npm install first

Set environment variables using set or export:

API_URL=https://dev.azure.com/yourorgname // use your token API_TOKEN=cbdeb34vzyuk5l4gxc4qfczn3lko3avfkfqyb47etahq6axpcqha API_PROJECT=myProject 

Run samples:

$ npm run samples

Run a specific sample:

$ npm run samples -- projectAnalysis

API and TFS Mapping

Below you'll find a quick mapping of azure-devops-node-api versions and their corresponding TFS releases. All API versions will work on the TFS version mentioned as well as later TFS versions.

TFS VersionNode API VERSION
Azure DevOps Server vNext8.0.0
Azure DevOps Server 20197.0.0
TFS 2018 Update 26.6.2
TFS 2017 Update 26.2.8-preview
TFS 2017 Update 15.1.2
TFS 2017 RTW5.0.0
TFS 2015 Update 20.7.0

Contributing

To contribute to this repository, see the contribution guide

Issues

Feel free to file an issue in this repo.

Do you think there might be a security issue? Have you been phished or identified a security vulnerability? Please don't report it here - let us know by sending an email to [email protected].

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

About

Azure DevOps Client for Node.js

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript99.4%
  • JavaScript0.6%