File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ var collectionUrl = "https://fabrikam.visualstudio.com/defaultcollection";
2222
2323// ideally from config
2424let token: string = " cbdeb34vzyuk5l4gxc4qfczn3lko3avfkfqyb47etahq6axpcqha" ;
25-
25+
2626let authHandler = vm .getPersonalAccessTokenHandler (token);
2727var connect = new vsts.WebApi (collectionUrl, creds);
2828```
@@ -52,11 +52,17 @@ let vstsBuild: ba.IBuildApi = connection.getBuildApi();
5252
5353### Use the client
5454
55+ Coding is easy using linear coding with async/await in typescript
56+
5557``` javascript
5658import * as bi from ' vso-node-api/interfaces/BuildInterfaces' ;
5759
58- let project: string = ' myProject' ;
59- let defs: bi .DefinitionReference [] = await vstsBuild .getDefinitions (project);
60+ async function run () {
61+ let project: string = ' myProject' ;
62+ let defs: bi .DefinitionReference [] = await vstsBuild .getDefinitions (project);
63+ }
64+
65+ run ();
6066```
6167
6268## APIs
@@ -65,7 +71,8 @@ To see what APIs are available, see the appropriate client interface. For exampl
6571
6672## Running Samples
6773
68- Pre-reqs: [ Node >= 4.4.7 LTS] ( https://nodejs.org ) and [ typescript (tsc) >= 1.8] ( https://www.npmjs.com/package/typescript )
74+ Pre-reqs: [ Node >= 4.4.7 LTS] ( https://nodejs.org ) and [ typescript (tsc) >= 1.8] ( https://www.npmjs.com/package/typescript )
75+
6976Run ` npm install ` first
7077
7178Set environment variables using set or export:
You can’t perform that action at this time.
0 commit comments