@vtex/api 6.45.13-beta.6 → 6.45.13

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/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [6.45.13] - 2022-12-12
11
+ ### Changed
12
+ - Deterministic cache for getWithBody
13
+ - Remove socket metrics per origin
14
+
10
15
  ## [6.45.12] - 2022-04-14
11
16
 
12
17
  ### Fixed
@@ -1734,3 +1739,7 @@ instead
1734
1739
  ### Changed
1735
1740
 
1736
1741
  - `HttpClient` now adds `'Accept-Encoding': 'gzip'` header by default.
1742
+
1743
+
1744
+ [Unreleased]: https://github.com/vtex/node-vtex-api/compare/v6.45.13...HEAD
1745
+ [6.45.13]: https://github.com/vtex/node-vtex-api/compare/v6.45.12...v6.45.13
@@ -3,12 +3,9 @@ export declare class HttpAgentSingleton {
3
3
  static getHttpAgent(): HttpAgent;
4
4
  static httpAgentStats(): {
5
5
  freeSockets: number;
6
- freeSocketsPerOrigin: Record<string, number>;
7
6
  pendingRequests: number;
8
- pendingRequestsPerOrigin: Record<string, number>;
9
7
  sockets: number;
10
- socketsPerOrigin: Record<string, number>;
11
8
  };
12
9
  private static httpAgent;
13
- private static countPerOrigin;
10
+ private static count;
14
11
  }
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const ramda_1 = require("ramda");
4
3
  const agents_1 = require("../../agents");
5
4
  class HttpAgentSingleton {
6
5
  static getHttpAgent() {
@@ -10,27 +9,21 @@ class HttpAgentSingleton {
10
9
  return HttpAgentSingleton.httpAgent;
11
10
  }
12
11
  static httpAgentStats() {
13
- const socketsPerOrigin = HttpAgentSingleton.countPerOrigin(HttpAgentSingleton.httpAgent.sockets);
14
- const sockets = ramda_1.sum(ramda_1.values(socketsPerOrigin));
15
- const freeSocketsPerOrigin = HttpAgentSingleton.countPerOrigin(HttpAgentSingleton.httpAgent.freeSockets);
16
- const freeSockets = ramda_1.sum(ramda_1.values(freeSocketsPerOrigin));
17
- const pendingRequestsPerOrigin = HttpAgentSingleton.countPerOrigin(HttpAgentSingleton.httpAgent.requests);
18
- const pendingRequests = ramda_1.sum(ramda_1.values(pendingRequestsPerOrigin));
12
+ const sockets = HttpAgentSingleton.count(HttpAgentSingleton.httpAgent.sockets);
13
+ const freeSockets = HttpAgentSingleton.count(HttpAgentSingleton.httpAgent.freeSockets);
14
+ const pendingRequests = HttpAgentSingleton.count(HttpAgentSingleton.httpAgent.requests);
19
15
  return {
20
16
  freeSockets,
21
- freeSocketsPerOrigin,
22
17
  pendingRequests,
23
- pendingRequestsPerOrigin,
24
18
  sockets,
25
- socketsPerOrigin,
26
19
  };
27
20
  }
28
- static countPerOrigin(obj) {
21
+ static count(obj) {
29
22
  try {
30
- return ramda_1.mapObjIndexed(val => val.length, obj);
23
+ return Object.values(obj).reduce((acc, val) => acc += val.length, 0);
31
24
  }
32
25
  catch (_) {
33
- return {};
26
+ return 0;
34
27
  }
35
28
  }
36
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtex/api",
3
- "version": "6.45.13-beta.6",
3
+ "version": "6.45.13",
4
4
  "description": "VTEX I/O API client",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",