fix(core): update
This commit is contained in:
parent
d204059313
commit
f4f50c6a94
4321
package-lock.json
generated
4321
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
13
package.json
13
package.json
@ -23,16 +23,17 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/smartrequest#README",
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"agentkeepalive": "^4.1.3",
|
||||
"form-data": "^3.0.0"
|
||||
"@pushrocks/smartpromise": "^3.1.5",
|
||||
"@pushrocks/smarturl": "^2.0.1",
|
||||
"agentkeepalive": "^4.1.4",
|
||||
"form-data": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tsrun": "^1.2.12",
|
||||
"@gitzone/tstest": "^1.0.44",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@types/node": "^14.6.0",
|
||||
"@gitzone/tstest": "^1.0.54",
|
||||
"@pushrocks/tapbundle": "^3.2.14",
|
||||
"@types/node": "^15.3.0",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
|
@ -5,4 +5,5 @@ export interface ISmartRequestOptions extends https.RequestOptions {
|
||||
keepAlive?: boolean;
|
||||
requestBody?: any;
|
||||
autoJsonParse?: boolean;
|
||||
queryParams?: {[key: string]: string}
|
||||
}
|
||||
|
@ -1,15 +1,19 @@
|
||||
import formData from 'form-data';
|
||||
// node native scope
|
||||
import * as fs from 'fs';
|
||||
import * as http from 'http';
|
||||
import * as https from 'https';
|
||||
import * as path from 'path';
|
||||
import * as url from 'url';
|
||||
|
||||
export { http, https, fs, path };
|
||||
|
||||
// pushrocks scope
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smarturl from '@pushrocks/smarturl';
|
||||
|
||||
export { formData, http, https, fs, path, url, smartpromise };
|
||||
export { smartpromise, smarturl };
|
||||
|
||||
// third party scope
|
||||
import * as agentkeepalive from 'agentkeepalive';
|
||||
import agentkeepalive from 'agentkeepalive';
|
||||
import formData from 'form-data';
|
||||
|
||||
export { agentkeepalive };
|
||||
export { agentkeepalive, formData };
|
||||
|
@ -57,7 +57,7 @@ const parseSocketPathAndRoute = (stringToParseArg: string) => {
|
||||
/**
|
||||
* a custom http agent to make sure we can set custom keepAlive options for speedy subsequent calls
|
||||
*/
|
||||
const httpAgent = new plugins.agentkeepalive.default();
|
||||
const httpAgent = new plugins.agentkeepalive();
|
||||
|
||||
/**
|
||||
* a custom http agent to make sure we can set custom keepAlive options for speedy subsequent calls
|
||||
@ -103,12 +103,15 @@ export let request = async (
|
||||
};
|
||||
|
||||
// parse url
|
||||
const parsedUrl = plugins.url.parse(urlArg);
|
||||
const parsedUrl = plugins.smarturl.Smarturl.createFromUrl(urlArg, {
|
||||
searchParams: optionsArg.queryParams || {}
|
||||
});
|
||||
optionsArg.hostname = parsedUrl.hostname;
|
||||
if (parsedUrl.port) {
|
||||
optionsArg.port = parseInt(parsedUrl.port, 10);
|
||||
}
|
||||
optionsArg.path = parsedUrl.path;
|
||||
optionsArg.queryParams = parsedUrl.searchParams;
|
||||
|
||||
// determine if unixsock
|
||||
if (testForUnixSock(urlArg)) {
|
||||
|
Loading…
Reference in New Issue
Block a user