@arrowsphere/api-client 3.17.0-rc.3 → 3.17.0-rc.5
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/build/axiosSingleton.d.ts +8 -0
- package/build/axiosSingleton.js +26 -2
- package/package.json +3 -1
|
@@ -12,4 +12,12 @@ export declare class AxiosSingleton {
|
|
|
12
12
|
* @param response - Axios Response
|
|
13
13
|
*/
|
|
14
14
|
private static _handleResponse;
|
|
15
|
+
/**
|
|
16
|
+
* @param request - Axios Request
|
|
17
|
+
*/
|
|
18
|
+
private static cleanRequestLog;
|
|
19
|
+
/**
|
|
20
|
+
* @param response - Axios Response
|
|
21
|
+
*/
|
|
22
|
+
private static cleanResponseLog;
|
|
15
23
|
}
|
package/build/axiosSingleton.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AxiosSingleton = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const lodash_1 = require("lodash");
|
|
8
9
|
class AxiosSingleton {
|
|
9
10
|
static getInstance() {
|
|
10
11
|
if (!AxiosSingleton._axiosInstance) {
|
|
@@ -25,16 +26,39 @@ class AxiosSingleton {
|
|
|
25
26
|
* @param request - Axios Request
|
|
26
27
|
*/
|
|
27
28
|
static _handleRequest(request) {
|
|
28
|
-
console.log('AXIOS - Request : ', request);
|
|
29
|
+
console.log('AXIOS - Request : ', AxiosSingleton.cleanRequestLog(request));
|
|
29
30
|
return request;
|
|
30
31
|
}
|
|
31
32
|
/**
|
|
32
33
|
* @param response - Axios Response
|
|
33
34
|
*/
|
|
34
35
|
static _handleResponse(response) {
|
|
35
|
-
console.log('AXIOS - Response : ', response);
|
|
36
|
+
console.log('AXIOS - Response : ', AxiosSingleton.cleanResponseLog(response));
|
|
36
37
|
return response;
|
|
37
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* @param request - Axios Request
|
|
41
|
+
*/
|
|
42
|
+
static cleanRequestLog(request) {
|
|
43
|
+
var _a;
|
|
44
|
+
const tempRequest = lodash_1.cloneDeep(request);
|
|
45
|
+
// coverage bug delete undefined element
|
|
46
|
+
/* istanbul ignore next */
|
|
47
|
+
(_a = tempRequest.headers) === null || _a === void 0 ? true : delete _a.apiKey;
|
|
48
|
+
return tempRequest;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @param response - Axios Response
|
|
52
|
+
*/
|
|
53
|
+
static cleanResponseLog(response) {
|
|
54
|
+
var _a;
|
|
55
|
+
const tempResponse = lodash_1.cloneDeep(response);
|
|
56
|
+
// coverage bug delete undefined element
|
|
57
|
+
/* istanbul ignore next */
|
|
58
|
+
(_a = tempResponse.config.headers) === null || _a === void 0 ? true : delete _a.apiKey;
|
|
59
|
+
delete tempResponse.request;
|
|
60
|
+
return tempResponse;
|
|
61
|
+
}
|
|
38
62
|
}
|
|
39
63
|
exports.AxiosSingleton = AxiosSingleton;
|
|
40
64
|
//# sourceMappingURL=axiosSingleton.js.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "https://github.com/ArrowSphere/nodejs-api-client.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "3.17.0-rc.
|
|
7
|
+
"version": "3.17.0-rc.5",
|
|
8
8
|
"description": "Node.js client for ArrowSphere's public API",
|
|
9
9
|
"main": "build/index.js",
|
|
10
10
|
"types": "build/index.d.ts",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/chai": "4.2.15",
|
|
34
34
|
"@types/chai-as-promised": "7.1.3",
|
|
35
|
+
"@types/lodash": "^4.14.191",
|
|
35
36
|
"@types/mocha": "8.2.0",
|
|
36
37
|
"@types/node": "18.11.10",
|
|
37
38
|
"@types/sinon": "9.0.10",
|
|
@@ -82,6 +83,7 @@
|
|
|
82
83
|
"axios": "1.1.3",
|
|
83
84
|
"graphql": "^16.3.0",
|
|
84
85
|
"graphql-request": "4.2.0",
|
|
86
|
+
"lodash": "^4.17.21",
|
|
85
87
|
"validatorjs": "3.22.1"
|
|
86
88
|
}
|
|
87
89
|
}
|