Fix build errors from fetchHttpClient and reference published isomorphic-tough-cookie

This commit is contained in:
Rikki Gibson 2018-05-17 17:33:53 -07:00
Родитель a1ec5314a1
Коммит ad10be3024
4 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -23,7 +23,7 @@ if (isNode) {
* A HttpClient implementation that uses axios to send HTTP requests.
*/
export class AxiosHttpClient implements HttpClient {
private readonly cookieJar = isNode ? new tough.CookieJar() : null;
private readonly cookieJar = isNode ? new tough.CookieJar() : undefined;
public async sendRequest(httpRequest: WebResource): Promise<HttpOperationResponse> {
if (!httpRequest) {
@ -90,6 +90,7 @@ export class AxiosHttpClient implements HttpClient {
method: httpRequest.method,
url: httpRequest.url,
headers: httpRequest.headers,
// tslint:disable-next-line:no-null-keyword
data: httpRequest.body === undefined ? null : httpRequest.body,
transformResponse: undefined,
validateStatus: () => true,

Просмотреть файл

@ -2,7 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
export { WebResource, RequestPrepareOptions, HttpMethods, ParameterValue, RequestOptionsBase } from "./webResource";
export { FetchHttpClient } from "./fetchHttpClient";
export { AxiosHttpClient } from "./axiosHttpClient";
export { HttpClient } from "./httpClient";
export { HttpHeaders } from "./httpHeaders";
export { HttpOperationResponse } from "./httpOperationResponse";

Просмотреть файл

@ -2,7 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
import { ServiceClientCredentials } from "./credentials/serviceClientCredentials";
import { FetchHttpClient } from "./fetchHttpClient";
import { AxiosHttpClient } from "./axiosHttpClient";
import { HttpClient } from "./httpClient";
import { HttpOperationResponse } from "./httpOperationResponse";
import { HttpPipelineLogger } from "./httpPipelineLogger";
@ -110,7 +110,7 @@ export class ServiceClient {
// do nothing
}
this._httpClient = options.httpClient || new FetchHttpClient();
this._httpClient = options.httpClient || new AxiosHttpClient();
this._requestPolicyOptions = new RequestPolicyOptions(options.httpPipelineLogger);
this._requestPolicyCreators = options.requestPolicyCreators || createDefaultRequestPolicyCreators(credentials, options, this.userAgentInfo.value);

Просмотреть файл

@ -40,7 +40,7 @@
"is-buffer": "^2.0.0",
"is-stream": "^1.1.0",
"isomorphic-xml2js": "^0.0.3",
"isomorphic-tough-cookie": "../isomorphic-tough-cookie",
"isomorphic-tough-cookie": "^0.0.1",
"url-parse": "^1.2.0",
"uuid": "^3.2.1"
},