@tramvai/tinkoff-request-http-client-adapter 0.9.461 → 0.10.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.
@@ -12,7 +12,7 @@ import { createAgent } from './agent/createAgent.browser.browser.js';
12
12
 
13
13
  const defaultAgent = createAgent();
14
14
  function createTinkoffRequest(options) {
15
- const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, agent, querySerializer, retryOptions, interceptors, ...defaults } = options;
15
+ const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, allowStale = true, agent, querySerializer, retryOptions, interceptors, ...defaults } = options;
16
16
  const log = logger && logger(`${name}:initialization`);
17
17
  const plugins = [];
18
18
  plugins.push({
@@ -64,7 +64,7 @@ function createTinkoffRequest(options) {
64
64
  plugins.push(memoryCache({
65
65
  shouldExecute: !disableCache,
66
66
  lruOptions,
67
- allowStale: true,
67
+ allowStale,
68
68
  getCacheKey,
69
69
  memoryConstructor: createCache,
70
70
  }));
@@ -26,6 +26,7 @@ export interface TinkoffRequestOptions extends HttpClientBaseOptions {
26
26
  maxAge: number;
27
27
  max: number;
28
28
  };
29
+ allowStale?: boolean;
29
30
  retryOptions?: {
30
31
  retry?: number;
31
32
  retryDelay?: number | ((attempt: number) => number);
@@ -12,7 +12,7 @@ import { createAgent } from './agent/createAgent.es.js';
12
12
 
13
13
  const defaultAgent = createAgent();
14
14
  function createTinkoffRequest(options) {
15
- const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, agent, querySerializer, retryOptions, interceptors, ...defaults } = options;
15
+ const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, allowStale = true, agent, querySerializer, retryOptions, interceptors, ...defaults } = options;
16
16
  const log = logger && logger(`${name}:initialization`);
17
17
  const plugins = [];
18
18
  plugins.push({
@@ -64,7 +64,7 @@ function createTinkoffRequest(options) {
64
64
  plugins.push(memoryCache({
65
65
  shouldExecute: !disableCache,
66
66
  lruOptions,
67
- allowStale: true,
67
+ allowStale,
68
68
  getCacheKey,
69
69
  memoryConstructor: createCache,
70
70
  }));
@@ -29,7 +29,7 @@ var retry__default = /*#__PURE__*/_interopDefaultLegacy(retry);
29
29
 
30
30
  const defaultAgent = createAgent.createAgent();
31
31
  function createTinkoffRequest(options) {
32
- const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, agent, querySerializer, retryOptions, interceptors, ...defaults } = options;
32
+ const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, allowStale = true, agent, querySerializer, retryOptions, interceptors, ...defaults } = options;
33
33
  const log = logger && logger(`${name}:initialization`);
34
34
  const plugins = [];
35
35
  plugins.push({
@@ -81,7 +81,7 @@ function createTinkoffRequest(options) {
81
81
  plugins.push(memoryCache__default["default"]({
82
82
  shouldExecute: !disableCache,
83
83
  lruOptions,
84
- allowStale: true,
84
+ allowStale,
85
85
  getCacheKey,
86
86
  memoryConstructor: createCache,
87
87
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/tinkoff-request-http-client-adapter",
3
- "version": "0.9.461",
3
+ "version": "0.10.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "browser": {
@@ -30,8 +30,8 @@
30
30
  "@tinkoff/request-plugin-validate": "^0.9.2",
31
31
  "@tinkoff/request-plugin-retry": "^0.2.3",
32
32
  "@tinkoff/utils": "^2.1.2",
33
- "@tramvai/http-client": "0.2.10",
34
- "@tramvai/tokens-common": "2.159.6",
33
+ "@tramvai/http-client": "0.3.0",
34
+ "@tramvai/tokens-common": "3.0.0",
35
35
  "tslib": "^2.4.0"
36
36
  },
37
37
  "sideEffects": false,