File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ import patm = require('./handlers/personalaccesstoken');
3838import * as rm from 'typed-rest-client/RestClient' ;
3939//import * as hm from 'typed-rest-client/HttpClient';
4040import vsom = require( './VsoClient' ) ;
41+ import lim = require( "./interfaces/LocationsInterfaces" ) ;
4142
4243/**
4344 * Methods to return handler objects (see handlers folder)
@@ -93,10 +94,11 @@ export class WebApi {
9394 return new this ( defaultUrl , bearerHandler ) ;
9495 }
9596
96- public async connect ( ) : Promise < any > {
97- return new Promise ( async ( resolve , reject ) => {
97+ public async connect ( ) : Promise < lim . ConnectionData > {
98+ return new Promise < lim . ConnectionData > ( async ( resolve , reject ) => {
9899 try {
99- let res : rm . IRestResponse < any > = await this . rest . get < any > ( this . vsoClient . resolveUrl ( '/_apis/connectionData' ) ) ;
100+ let res : rm . IRestResponse < lim . ConnectionData > ;
101+ res = await this . rest . get < lim . ConnectionData > ( this . vsoClient . resolveUrl ( '/_apis/connectionData' ) ) ;
100102 resolve ( res . result ) ;
101103 }
102104 catch ( err ) {
Original file line number Diff line number Diff line change 11/// <reference path="typings/index.d.ts" />
22
33import * as vm from 'vso-node-api' ;
4+ import * as lim from 'vso-node-api/interfaces/LocationsInterfaces' ;
45
56function getEnv ( name : string ) : string {
67 let val = process . env [ name ] ;
@@ -19,7 +20,7 @@ export async function getWebApi(): Promise<vm.WebApi> {
1920 let authHandler = vm . getPersonalAccessTokenHandler ( token ) ;
2021
2122 let vsts : vm . WebApi = new vm . WebApi ( serverUrl , authHandler ) ;
22- let connData = await vsts . connect ( ) ;
23+ let connData : lim . ConnectionData = await vsts . connect ( ) ;
2324 console . log ( 'Hello ' + connData . authorizedUser . customDisplayName ) ;
2425 resolve ( vsts ) ;
2526 }
You can’t perform that action at this time.
0 commit comments