@vroskus/library-api 1.0.21 → 1.0.24
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/dist/index.d.ts +1 -1
- package/dist/index.js +4 -7
- package/dist/types.d.ts +3 -0
- package/package.json +9 -10
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare class ApiService<C extends $Config> {
|
|
|
12
12
|
responseContextListener: $ResponseContextListener;
|
|
13
13
|
mock: AxiosMockAdapter | null;
|
|
14
14
|
path: (arg0: string) => RegExp | string;
|
|
15
|
-
constructor({ apiUrl, timeout, }: C);
|
|
15
|
+
constructor({ apiUrl, headers, httpsAgent, timeout, }: C);
|
|
16
16
|
setUnauthenticatedHandler({ handler, }: {
|
|
17
17
|
handler: $UnauthenticatedHandler;
|
|
18
18
|
}): void;
|
package/dist/index.js
CHANGED
|
@@ -42,7 +42,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
42
42
|
const axios = __importStar(require("axios"));
|
|
43
43
|
const axios_mock_adapter_1 = __importDefault(require("axios-mock-adapter"));
|
|
44
44
|
const lodash_1 = __importDefault(require("lodash"));
|
|
45
|
-
const uuid_1 = require("uuid");
|
|
46
45
|
__exportStar(require("./types"), exports);
|
|
47
46
|
const unauthenticatedStatus = 401;
|
|
48
47
|
const defaultRetryDelay = 3000;
|
|
@@ -50,13 +49,11 @@ const defaultRetryQuantity = 3;
|
|
|
50
49
|
const defaultRetryIncrementor = 1;
|
|
51
50
|
const zeroValue = 0;
|
|
52
51
|
class ApiService {
|
|
53
|
-
constructor({ apiUrl, timeout, }) {
|
|
52
|
+
constructor({ apiUrl, headers, httpsAgent, timeout, }) {
|
|
54
53
|
const connectionConfig = {
|
|
55
54
|
baseURL: apiUrl,
|
|
56
|
-
headers: {
|
|
57
|
-
|
|
58
|
-
'Content-Type': 'application/json',
|
|
59
|
-
},
|
|
55
|
+
headers: Object.assign({ Accept: 'application/json', 'Content-Type': 'application/json' }, (headers || {})),
|
|
56
|
+
httpsAgent,
|
|
60
57
|
timeout,
|
|
61
58
|
withCredentials: true,
|
|
62
59
|
};
|
|
@@ -100,7 +97,7 @@ class ApiService {
|
|
|
100
97
|
return Promise.reject(error);
|
|
101
98
|
});
|
|
102
99
|
this.connection.interceptors.request.use((config) => {
|
|
103
|
-
const requestId =
|
|
100
|
+
const requestId = crypto.randomUUID();
|
|
104
101
|
lodash_1.default.set(config, 'headers.X-Request-Id', requestId);
|
|
105
102
|
const startTimestamp = performance.now();
|
|
106
103
|
lodash_1.default.set(config, 'startTimestamp', startTimestamp);
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vroskus/library-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24",
|
|
4
4
|
"description": "Api",
|
|
5
5
|
"author": "Vilius Roškus <vilius@regattas.eu>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,16 +24,15 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"axios": "^1.8.4",
|
|
26
26
|
"axios-mock-adapter": "^2.1.0",
|
|
27
|
-
"lodash": "^4.17.21"
|
|
28
|
-
"uuid": "^11.1.0"
|
|
27
|
+
"lodash": "^4.17.21"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
31
|
-
"@types/jest": "^
|
|
30
|
+
"@types/jest": "^30.0.0",
|
|
32
31
|
"@types/lodash": "^4.17.16",
|
|
33
|
-
"@types/node": "^
|
|
32
|
+
"@types/node": "^25.0.3",
|
|
34
33
|
"@types/query-string": "^6.3.0",
|
|
35
|
-
"@vroskus/eslint-config": "^1.0.
|
|
36
|
-
"jest": "^
|
|
34
|
+
"@vroskus/eslint-config": "^1.0.30",
|
|
35
|
+
"jest": "^30.2.0",
|
|
37
36
|
"jest-coverage-thresholds-bumper": "^1.1.0",
|
|
38
37
|
"ts-jest": "^29.3.1",
|
|
39
38
|
"typescript": "^5.8.3"
|
|
@@ -51,10 +50,10 @@
|
|
|
51
50
|
],
|
|
52
51
|
"coverageThreshold": {
|
|
53
52
|
"global": {
|
|
54
|
-
"branches":
|
|
53
|
+
"branches": 52.63,
|
|
55
54
|
"functions": 50,
|
|
56
|
-
"lines": 68.
|
|
57
|
-
"statements": 65.
|
|
55
|
+
"lines": 68.42,
|
|
56
|
+
"statements": 65.45
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
}
|