@tramvai/tinkoff-request-http-client-adapter 0.9.24 → 0.9.51

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.
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type { ContextState, MakeRequest, Request } from '@tinkoff/request-core';
3
+ import type { QuerySerializer } from '@tinkoff/request-plugin-protocol-http';
3
4
  import type { Options as CircuitBreakerOptions } from '@tinkoff/request-plugin-circuit-breaker';
4
5
  import type { HttpClientBaseOptions } from '@tramvai/http-client';
5
6
  import type { LOGGER_TOKEN } from '@tramvai/tokens-common';
@@ -34,5 +35,6 @@ export interface TinkoffRequestOptions extends HttpClientBaseOptions {
34
35
  http: Agent;
35
36
  https: Agent;
36
37
  };
38
+ querySerializer?: QuerySerializer;
37
39
  }
38
40
  export declare function createTinkoffRequest(options: TinkoffRequestOptions): MakeRequest;
@@ -15,7 +15,7 @@ const createAgent = () => { };
15
15
 
16
16
  const defaultAgent = createAgent();
17
17
  function createTinkoffRequest(options) {
18
- const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, agent, retryOptions, ...defaults } = options;
18
+ const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, agent, querySerializer, retryOptions, ...defaults } = options;
19
19
  const log = logger && logger(`${name}:initialization`);
20
20
  const plugins = [];
21
21
  plugins.push({
@@ -97,7 +97,10 @@ function createTinkoffRequest(options) {
97
97
  allowFallback: true,
98
98
  }));
99
99
  }
100
- plugins.push(http({ agent: agent || defaultAgent }));
100
+ plugins.push(http({
101
+ agent: agent || defaultAgent,
102
+ querySerializer: querySerializer || undefined,
103
+ }));
101
104
  if (retryOptions) {
102
105
  plugins.push(retry(retryOptions));
103
106
  }
package/lib/index.es.js CHANGED
@@ -25,7 +25,7 @@ const createAgent = (options = {
25
25
 
26
26
  const defaultAgent = createAgent();
27
27
  function createTinkoffRequest(options) {
28
- const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, agent, retryOptions, ...defaults } = options;
28
+ const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, agent, querySerializer, retryOptions, ...defaults } = options;
29
29
  const log = logger && logger(`${name}:initialization`);
30
30
  const plugins = [];
31
31
  plugins.push({
@@ -107,7 +107,10 @@ function createTinkoffRequest(options) {
107
107
  allowFallback: true,
108
108
  }));
109
109
  }
110
- plugins.push(http$1({ agent: agent || defaultAgent }));
110
+ plugins.push(http$1({
111
+ agent: agent || defaultAgent,
112
+ querySerializer: querySerializer || undefined,
113
+ }));
111
114
  if (retryOptions) {
112
115
  plugins.push(retry(retryOptions));
113
116
  }
package/lib/index.js CHANGED
@@ -45,7 +45,7 @@ const createAgent = (options = {
45
45
 
46
46
  const defaultAgent = createAgent();
47
47
  function createTinkoffRequest(options) {
48
- const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, agent, retryOptions, ...defaults } = options;
48
+ const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, agent, querySerializer, retryOptions, ...defaults } = options;
49
49
  const log = logger && logger(`${name}:initialization`);
50
50
  const plugins = [];
51
51
  plugins.push({
@@ -127,7 +127,10 @@ function createTinkoffRequest(options) {
127
127
  allowFallback: true,
128
128
  }));
129
129
  }
130
- plugins.push(http__default$1["default"]({ agent: agent || defaultAgent }));
130
+ plugins.push(http__default$1["default"]({
131
+ agent: agent || defaultAgent,
132
+ querySerializer: querySerializer || undefined,
133
+ }));
131
134
  if (retryOptions) {
132
135
  plugins.push(retry__default["default"](retryOptions));
133
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/tinkoff-request-http-client-adapter",
3
- "version": "0.9.24",
3
+ "version": "0.9.51",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "browser": {
@@ -23,16 +23,16 @@
23
23
  "dependencies": {
24
24
  "@tinkoff/request-core": "^0.9.2",
25
25
  "@tinkoff/request-plugin-cache-deduplicate": "^0.9.2",
26
- "@tinkoff/request-plugin-cache-memory": "^0.9.2",
26
+ "@tinkoff/request-plugin-cache-memory": "^0.9.3",
27
27
  "@tinkoff/request-plugin-circuit-breaker": "^0.3.2",
28
28
  "@tinkoff/request-plugin-log": "^0.9.2",
29
- "@tinkoff/request-plugin-protocol-http": "^0.11.4",
29
+ "@tinkoff/request-plugin-protocol-http": "^0.11.6",
30
30
  "@tinkoff/request-plugin-transform-url": "^0.9.2",
31
31
  "@tinkoff/request-plugin-validate": "^0.9.2",
32
32
  "@tinkoff/request-plugin-retry": "^0.2.3",
33
33
  "@tinkoff/utils": "^2.1.2",
34
- "@tramvai/http-client": "0.1.28",
35
- "@tramvai/tokens-common": "2.7.1",
34
+ "@tramvai/http-client": "0.2.2",
35
+ "@tramvai/tokens-common": "2.20.0",
36
36
  "tslib": "^2.0.3"
37
37
  },
38
38
  "sideEffects": false,