зеркало из https://github.com/Azure/ms-rest-js.git
Require granular uuidv4. Remove process polyfill. Remove withCredentials: true in axios.
This commit is contained in:
Родитель
31beb0d1eb
Коммит
b1bf582203
|
@ -122,8 +122,6 @@ export class AxiosHttpClient implements HttpClient {
|
||||||
data: axiosBody,
|
data: axiosBody,
|
||||||
transformResponse: undefined,
|
transformResponse: undefined,
|
||||||
validateStatus: () => true,
|
validateStatus: () => true,
|
||||||
maxRedirects: 0,
|
|
||||||
withCredentials: true,
|
|
||||||
// Workaround for https://github.com/axios/axios/issues/1362
|
// Workaround for https://github.com/axios/axios/issues/1362
|
||||||
maxContentLength: 1024 * 1024 * 1024 * 10,
|
maxContentLength: 1024 * 1024 * 1024 * 10,
|
||||||
responseType: httpRequest.rawResponse ? (isNode ? "stream" : "blob") : "text",
|
responseType: httpRequest.rawResponse ? (isNode ? "stream" : "blob") : "text",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
|
||||||
import * as xml2js from "isomorphic-xml2js";
|
import * as xml2js from "isomorphic-xml2js";
|
||||||
import * as uuid from "uuid";
|
import * as uuidv4 from "uuid/v4";
|
||||||
import { HttpOperationResponse } from "../httpOperationResponse";
|
import { HttpOperationResponse } from "../httpOperationResponse";
|
||||||
import { RestError } from "../restError";
|
import { RestError } from "../restError";
|
||||||
import { WebResource } from "../webResource";
|
import { WebResource } from "../webResource";
|
||||||
|
@ -132,7 +132,7 @@ export function objectValues(obj: { [key: string]: any; }): any[] {
|
||||||
* @return {string} RFC4122 v4 UUID.
|
* @return {string} RFC4122 v4 UUID.
|
||||||
*/
|
*/
|
||||||
export function generateUuid(): string {
|
export function generateUuid(): string {
|
||||||
return uuid.v4();
|
return uuidv4();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -200,9 +200,9 @@ export function promiseToCallback(promise: Promise<any>): Function {
|
||||||
}
|
}
|
||||||
return (cb: Function): void => {
|
return (cb: Function): void => {
|
||||||
promise.then((data: any) => {
|
promise.then((data: any) => {
|
||||||
process.nextTick(cb, undefined, data);
|
cb(undefined, data);
|
||||||
}, (err: Error) => {
|
}, (err: Error) => {
|
||||||
process.nextTick(cb, err);
|
cb(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
|
||||||
// parseInt just gives NaN (falsy) for undefined/null
|
// parseInt just gives NaN (falsy) for undefined/null
|
||||||
const port = parseInt(process.env.PORT!) || 3001;
|
const port = (typeof process !== "undefined" && parseInt(process.env.PORT!)) || 3001;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base URL for the ms-rest-js testserver.
|
* Base URL for the ms-rest-js testserver.
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "es6"
|
"module": "es6",
|
||||||
|
"outDir": "es"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -31,7 +31,7 @@ const config: webpack.Configuration = {
|
||||||
tty: false,
|
tty: false,
|
||||||
v8: false,
|
v8: false,
|
||||||
Buffer: false,
|
Buffer: false,
|
||||||
process: true,
|
process: false,
|
||||||
stream: false
|
stream: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,7 +34,7 @@ const config: webpack.Configuration = {
|
||||||
tty: false,
|
tty: false,
|
||||||
v8: false,
|
v8: false,
|
||||||
Buffer: false,
|
Buffer: false,
|
||||||
process: true,
|
process: false,
|
||||||
stream: false
|
stream: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче