caccl-send-request 2.0.0-beta.15 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +0 -3
- package/lib/index.js +1 -6
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +0 -10
package/lib/index.d.ts
CHANGED
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
* @param [opts.headers] headers to include in the request
|
|
10
10
|
* @param [opts.numRetries=0] number of times to retry the request if it
|
|
11
11
|
* fails
|
|
12
|
-
* @param [opts.ignoreSSLIssues] if true, ignores SSL certificate
|
|
13
|
-
* issues. If host is localhost:8088, this will default to true
|
|
14
12
|
* @returns { body, status, headers } on success
|
|
15
13
|
*/
|
|
16
14
|
declare const sendRequest: (opts: {
|
|
@@ -24,7 +22,6 @@ declare const sendRequest: (opts: {
|
|
|
24
22
|
[x: string]: any;
|
|
25
23
|
};
|
|
26
24
|
numRetries?: number;
|
|
27
|
-
ignoreSSLIssues?: boolean;
|
|
28
25
|
}) => Promise<{
|
|
29
26
|
body: any;
|
|
30
27
|
status: number;
|
package/lib/index.js
CHANGED
|
@@ -70,12 +70,10 @@ var sendCrossDomainCredentials = (process.env.NODE_ENV === 'development');
|
|
|
70
70
|
* @param [opts.headers] headers to include in the request
|
|
71
71
|
* @param [opts.numRetries=0] number of times to retry the request if it
|
|
72
72
|
* fails
|
|
73
|
-
* @param [opts.ignoreSSLIssues] if true, ignores SSL certificate
|
|
74
|
-
* issues. If host is localhost:8088, this will default to true
|
|
75
73
|
* @returns { body, status, headers } on success
|
|
76
74
|
*/
|
|
77
75
|
var sendRequest = function (opts) { return __awaiter(void 0, void 0, void 0, function () {
|
|
78
|
-
var numRetries, method, stringifiedParams, query, url,
|
|
76
|
+
var numRetries, method, stringifiedParams, query, url, headers, data, response, err_1;
|
|
79
77
|
return __generator(this, function (_a) {
|
|
80
78
|
switch (_a.label) {
|
|
81
79
|
case 0:
|
|
@@ -93,9 +91,6 @@ var sendRequest = function (opts) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
93
91
|
else {
|
|
94
92
|
url = "https://".concat(opts.host).concat(opts.path).concat(query);
|
|
95
93
|
}
|
|
96
|
-
ignoreSSLIssues = (opts.ignoreSSLIssues !== undefined
|
|
97
|
-
? opts.ignoreSSLIssues
|
|
98
|
-
: opts.host === 'localhost:8088');
|
|
99
94
|
headers = opts.headers || {};
|
|
100
95
|
data = null;
|
|
101
96
|
if (!headers['Content-Type']) {
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,gDAA0B;AAC1B,0CAAoB;AAEpB,0BAA0B;AAC1B,4DAAqC;AAErC,sBAAsB;AACtB,0DAAoC;AAEpC,mDAAmD;AACnD,IAAM,0BAA0B,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC,CAAC;AAE5E
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,gDAA0B;AAC1B,0CAAoB;AAEpB,0BAA0B;AAC1B,4DAAqC;AAErC,sBAAsB;AACtB,0DAAoC;AAEpC,mDAAmD;AACnD,IAAM,0BAA0B,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC,CAAC;AAE5E;;;;;;;;;;;;GAYG;AACH,IAAM,WAAW,GAAG,UAClB,IAOC;;;;;gBAOK,UAAU,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAGrD,M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ACnB,MAAM,EAAE,QAAQ,CAAC,MAAM;wBACvB,OAAO,EAAE,QAAQ,CAAC,OAAO;qBAC1B,EAAC;;;gBAEF,iEAAiE;gBACjE,0EAA0E;gBAC1E,wCAAwC;gBACxC,IAAI,KAAG,CAAC,QAAQ,EAAE;oBAChB,wBAAwB;oBACxB,sBAAO;4BACL,IAAI,EAAE,KAAG,CAAC,QAAQ,CAAC,IAAI;4BACvB,MAAM,EAAE,KAAG,CAAC,QAAQ,CAAC,MAAM;4BAC3B,OAAO,EAAE,KAAG,CAAC,QAAQ,CAAC,OAAO;yBAC9B,EAAC;iBACH;gBAED,iDAAiD;gBACjD,IAAI,UAAU,GAAG,CAAC,EAAE;oBAClB,kCAAkC;oBAClC,sBAAO,WAAW,uBACb,IAAI,KACP,UAAU,EAAE,IAAI,CAAC,UAAU,GAAG,CAAC,IAC/B,EAAC;iBACJ;gBAED,iCAAiC;gBACjC,IAAI,KAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAAE;oBACnD,MAAM,IAAI,qBAAU,CAAC;wBACnB,OAAO,EAAE,iFAAiF;wBAC1F,IAAI,EAAE,mBAAS,CAAC,UAAU;qBAC3B,CAAC,CAAC;iBACJ;gBAED,gBAAgB;gBAChB,MAAM,IAAI,qBAAU,CAAC;oBACnB,OAAO,EAAE,0GAA0G;oBACnH,IAAI,EAAE,mBAAS,CAAC,YAAY;iBAC7B,CAAC,CAAC;;;;KAEN,CAAC;AAEF,kBAAe,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "caccl-send-request",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "The default request sender used throughout the CACCL project.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"typescript": "^4.5.5"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"caccl-error": "^2.0.0
|
|
40
|
+
"caccl-error": "^2.0.0",
|
|
41
41
|
"axios": "^0.21.4",
|
|
42
42
|
"qs": "^6.9.6"
|
|
43
43
|
}
|
package/src/index.ts
CHANGED
|
@@ -22,8 +22,6 @@ const sendCrossDomainCredentials = (process.env.NODE_ENV === 'development');
|
|
|
22
22
|
* @param [opts.headers] headers to include in the request
|
|
23
23
|
* @param [opts.numRetries=0] number of times to retry the request if it
|
|
24
24
|
* fails
|
|
25
|
-
* @param [opts.ignoreSSLIssues] if true, ignores SSL certificate
|
|
26
|
-
* issues. If host is localhost:8088, this will default to true
|
|
27
25
|
* @returns { body, status, headers } on success
|
|
28
26
|
*/
|
|
29
27
|
const sendRequest = async (
|
|
@@ -34,7 +32,6 @@ const sendRequest = async (
|
|
|
34
32
|
params?: { [k in string]: any },
|
|
35
33
|
headers?: { [k in string]: any },
|
|
36
34
|
numRetries?: number,
|
|
37
|
-
ignoreSSLIssues?: boolean,
|
|
38
35
|
},
|
|
39
36
|
): Promise<{
|
|
40
37
|
body: any,
|
|
@@ -63,13 +60,6 @@ const sendRequest = async (
|
|
|
63
60
|
url = `https://${opts.host}${opts.path}${query}`;
|
|
64
61
|
}
|
|
65
62
|
|
|
66
|
-
// Default ignoreSSLIssues
|
|
67
|
-
const ignoreSSLIssues = (
|
|
68
|
-
opts.ignoreSSLIssues !== undefined
|
|
69
|
-
? opts.ignoreSSLIssues
|
|
70
|
-
: opts.host === 'localhost:8088'
|
|
71
|
-
);
|
|
72
|
-
|
|
73
63
|
// Update headers
|
|
74
64
|
const headers = opts.headers || {};
|
|
75
65
|
let data = null;
|