@trayio/axios 5.12.0 → 5.13.0

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.
@@ -7,6 +7,8 @@ type AxiosOptions = {
7
7
  rejectUnauthorized: boolean;
8
8
  followRedirects: boolean;
9
9
  retries?: number;
10
+ keepAlive?: boolean;
11
+ maxSockets?: number;
10
12
  };
11
13
  export declare class AxiosHttpClient implements HttpClient {
12
14
  private readonly fileStorage;
@@ -1 +1 @@
1
- {"version":3,"file":"AxiosHttpClient.d.ts","sourceRoot":"","sources":["../../src/http/AxiosHttpClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAEN,UAAU,EACV,WAAW,EAEX,YAAY,EAEZ,MAAM,2BAA2B,CAAC;AAWnC,OAAO,QAAQ,GAAG,QAAQ,WAAW,CAAC,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAMxD,KAAK,YAAY,GAAG;IACnB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,eAAgB,YAAW,UAAU;IAKhD,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAL9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAQ;IAC1C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA8B;gBAG1C,WAAW,GAAE,WAAqC,EAClD,YAAY,GAAE,YAI9B;IAmCF,OAAO,CACN,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,WAAW,GAClB,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC;IA4GrC,OAAO,CAAC,wBAAwB;I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pClient {
52
52
  // We need a keep-alive heartbeat shorter than 350 seconds to bypass the idle timeout in AWS NAT/LB servers:
53
53
  // https://repost.aws/knowledge-center/lambda-vpc-timeout
54
54
  this.defaultHttpsAgent = new https_1.Agent({
55
- keepAlive: true,
55
+ keepAlive: this.axiosOptions.keepAlive || true,
56
56
  keepAliveMsecs: 42000,
57
57
  rejectUnauthorized: this.axiosOptions.rejectUnauthorized,
58
+ maxSockets: this.axiosOptions.maxSockets,
58
59
  });
59
60
  // Validate and clamp retries to 0-10 range, default to 0
60
61
  const retries = Math.max(0, Math.min(10, this.axiosOptions.retries ?? 0));
@@ -95,9 +96,10 @@ class AxiosHttpClient {
95
96
  const axiosHttpsAgent = (0, function_1.pipe)(request.agent, O.chain((agent) => agent.certificate), O.match(() => this.defaultHttpsAgent, (certificate) => new https_1.Agent({
96
97
  cert: certificate.cert,
97
98
  key: certificate.key,
98
- keepAlive: true,
99
+ keepAlive: this.axiosOptions.keepAlive || true,
99
100
  keepAliveMsecs: 42000,
100
101
  rejectUnauthorized: this.axiosOptions.rejectUnauthorized,
102
+ maxSockets: this.axiosOptions.maxSockets,
101
103
  })));
102
104
  if (headers['content-type'] &&
103
105
  headers['content-type'].includes(Http_1.HttpContentType.MultipartRequestBody)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trayio/axios",
3
- "version": "5.12.0",
3
+ "version": "5.13.0",
4
4
  "description": "Axios extensions and implementations",
5
5
  "exports": {
6
6
  "./*": "./dist/*.js"
@@ -14,7 +14,7 @@
14
14
  "access": "public"
15
15
  },
16
16
  "dependencies": {
17
- "@trayio/commons": "5.12.0",
17
+ "@trayio/commons": "5.13.0",
18
18
  "axios": "1.12.0",
19
19
  "axios-retry": "4.5.0",
20
20
  "form-data": "4.0.4"