Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions api/GalleryCompatHttpClientBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

// Licensed under the MIT license. See LICENSE file in the project root for full license information.


import Q = require('q');
import * as restm from 'typed-rest-client/RestClient';
import * as httpm from 'typed-rest-client/HttpClient';
import vsom = require('./VsoClient');
Expand Down
3 changes: 1 addition & 2 deletions api/WebApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ export function getPersonalAccessTokenHandler(token) {

// ---------------------------------------------------------------------------
// Factory to return client apis
// When new APIs are added, two methods must be added here to instantiate the
// API and its corresponding Q Promise-wrapped API
// When new APIs are added, a method must be added here to instantiate the API
//----------------------------------------------------------------------------
export class WebApi {

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vso-node-api",
"description": "Node client for Visual Studio Online/TFS REST APIs",
"version": "6.2.2-preview",
"version": "6.2.3-preview",
"main": "./WebApi.js",
"typings": "./WebApi.d.ts",
"scripts": {
Expand All @@ -21,7 +21,6 @@
],
"license": "MIT",
"dependencies": {
"q": "^1.0.1",
"tunnel": "0.0.4",
"typed-rest-client": "^0.10.0",
"underscore": "^1.8.3"
Expand Down
10 changes: 5 additions & 5 deletions samples/task.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as Q from 'q';
import * as fs from 'fs';
import * as path from 'path';
import * as stream from 'stream';
Expand Down Expand Up @@ -31,11 +30,12 @@ export async function run() {
let taskDefinition = tasks[0];
let file: NodeJS.WritableStream = fs.createWriteStream(sampleFilePath);
let stream = (await vstsTask.getTaskContentZip(taskDefinition.id, `${taskDefinition.version.major}.${taskDefinition.version.minor}.${taskDefinition.version.patch}`)).pipe(file);
let defer = Q.defer();
stream.on('finish', () => {
defer.resolve();
let promise = new Promise((resolve, reject) => {
stream.on('finish', () => {
resolve();
});
});
await defer.promise;
await promise;
console.log(`Downloaded task ${taskDefinition.name}`);
}

Expand Down