File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1212
13-
14- import Q = require( 'q' ) ;
1513import * as restm from 'typed-rest-client/RestClient' ;
1614import * as httpm from 'typed-rest-client/HttpClient' ;
1715import vsom = require( './VsoClient' ) ;
Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ export function getPersonalAccessTokenHandler(token) {
6262
6363// ---------------------------------------------------------------------------
6464// Factory to return client apis
65- // When new APIs are added, two methods must be added here to instantiate the
66- // API and its corresponding Q Promise-wrapped API
65+ // When new APIs are added, a method must be added here to instantiate the API
6766//----------------------------------------------------------------------------
6867export class WebApi {
6968
Original file line number Diff line number Diff line change 11{
22 "name" : " vso-node-api" ,
33 "description" : " Node client for Visual Studio Online/TFS REST APIs" ,
4- "version" : " 6.2.2 -preview" ,
4+ "version" : " 6.2.3 -preview" ,
55 "main" : " ./WebApi.js" ,
66 "typings" : " ./WebApi.d.ts" ,
77 "scripts" : {
2121 ],
2222 "license" : " MIT" ,
2323 "dependencies" : {
24- "q" : " ^1.0.1" ,
2524 "tunnel" : " 0.0.4" ,
2625 "typed-rest-client" : " ^0.10.0" ,
2726 "underscore" : " ^1.8.3"
Original file line number Diff line number Diff line change 1- import * as Q from 'q' ;
21import * as fs from 'fs' ;
32import * as path from 'path' ;
43import * as stream from 'stream' ;
@@ -31,11 +30,12 @@ export async function run() {
3130 let taskDefinition = tasks [ 0 ] ;
3231 let file : NodeJS . WritableStream = fs . createWriteStream ( sampleFilePath ) ;
3332 let stream = ( await vstsTask . getTaskContentZip ( taskDefinition . id , `${ taskDefinition . version . major } .${ taskDefinition . version . minor } .${ taskDefinition . version . patch } ` ) ) . pipe ( file ) ;
34- let defer = Q . defer ( ) ;
35- stream . on ( 'finish' , ( ) => {
36- defer . resolve ( ) ;
33+ let promise = new Promise ( ( resolve , reject ) => {
34+ stream . on ( 'finish' , ( ) => {
35+ resolve ( ) ;
36+ } ) ;
3737 } ) ;
38- await defer . promise ;
38+ await promise ;
3939 console . log ( `Downloaded task ${ taskDefinition . name } ` ) ;
4040 }
4141
You can’t perform that action at this time.
0 commit comments