11// Copyright (c) Microsoft. All rights reserved.
22// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33
4- import restm = require( './RestClient' ) ;
5- import httpm = require( './HttpClient' ) ;
64import vsom = require( './VsoClient' ) ;
75import VsoBaseInterfaces = require( './interfaces/common/VsoBaseInterfaces' ) ;
86import serm = require( './Serialization' ) ;
@@ -15,11 +13,6 @@ export class ClientApiBase {
1513 http : hm . HttpClient ;
1614 rest : rm . RestClient ;
1715
18- // TODO: delete these three after regen
19- httpClient : httpm . HttpCallbackClient ;
20- restCallbackClient : restm . RestCallbackClient ;
21- restClient : restm . RestClient ;
22-
2316 vsoClient : vsom . VsoClient ;
2417
2518 constructor ( baseUrl : string , handlers : VsoBaseInterfaces . IRequestHandler [ ] , userAgent ?: string ) ;
@@ -30,36 +23,12 @@ export class ClientApiBase {
3023 this . http = new hm . HttpClient ( userAgent , handlers ) ;
3124 this . rest = new rm . RestClient ( userAgent , null , handlers ) ;
3225
33- // TODO: delete these three after regen
34- this . httpClient = new httpm . HttpCallbackClient ( userAgent , handlers ) ;
35- this . restCallbackClient = new restm . RestCallbackClient ( this . httpClient ) ;
36- this . restClient = new restm . RestClient ( userAgent , handlers ) ;
37-
38- this . vsoClient = new vsom . VsoClient ( baseUrl , this . restCallbackClient ) ;
39- this . userAgent = userAgent ;
40- }
41-
42- setUserAgent ( userAgent : string ) {
26+ this . vsoClient = new vsom . VsoClient ( baseUrl , this . rest ) ;
4327 this . userAgent = userAgent ;
44- this . httpClient . userAgent = userAgent ;
45- }
46-
47- public connect ( ) : Promise < any > {
48- return new Promise ( ( resolve , reject ) => {
49- this . restCallbackClient . get ( this . vsoClient . resolveUrl ( '/_apis/connectionData' ) , "" , ( err : any , statusCode : number , obj : any ) => {
50- if ( err ) {
51- err . statusCode = statusCode ;
52- reject ( err ) ;
53- }
54- else {
55- resolve ( obj ) ;
56- }
57- } , null ) ;
58- } ) ;
5928 }
6029
6130 public createAcceptHeader ( type : string , apiVersion ?: string ) : string {
62- return this . restCallbackClient . createAcceptHeader ( type , apiVersion ) ;
31+ return type + ( apiVersion ? ( ';api-version=' + apiVersion ) : '' ) ;
6332 }
6433
6534 public createRequestOptions ( type : string , apiVersion ?: string ) {
0 commit comments