@tramvai/tinkoff-request-http-client-adapter 0.14.118 → 0.14.119
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.
|
@@ -11,7 +11,7 @@ import circuitBreaker from '@tinkoff/request-plugin-circuit-breaker';
|
|
|
11
11
|
import retry from '@tinkoff/request-plugin-retry';
|
|
12
12
|
|
|
13
13
|
function createTinkoffRequest(options) {
|
|
14
|
-
const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, allowStale = true, agent, querySerializer, retryOptions, etagCacheOptions, interceptors, ...defaults } = options;
|
|
14
|
+
const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, allowStale = true, agent, querySerializer, logPluginExtensions, retryOptions, etagCacheOptions, interceptors, ...defaults } = options;
|
|
15
15
|
const log = logger && logger(`${name}:initialization`);
|
|
16
16
|
const createNamedCache = (type) => typeof createCache === 'function'
|
|
17
17
|
? // when memory and etag caches are used simultaneously, the cache name must be different
|
|
@@ -64,6 +64,7 @@ function createTinkoffRequest(options) {
|
|
|
64
64
|
name,
|
|
65
65
|
showQueryFields: true,
|
|
66
66
|
showPayloadFields: true,
|
|
67
|
+
extensions: logPluginExtensions,
|
|
67
68
|
}));
|
|
68
69
|
plugins.push(memoryCache({
|
|
69
70
|
shouldExecute: !disableCache,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Agent } from 'undici/types';
|
|
2
2
|
import type { ContextState, MakeRequest, Request } from '@tinkoff/request-core';
|
|
3
|
+
import type { LogExtension } from '@tinkoff/request-plugin-log';
|
|
3
4
|
import type { QuerySerializer } from '@tinkoff/request-plugin-protocol-http';
|
|
4
5
|
import type { Options as CircuitBreakerOptions } from '@tinkoff/request-plugin-circuit-breaker';
|
|
5
6
|
import type { HttpClientBaseOptions } from '@tramvai/http-client';
|
|
6
7
|
import type { LOGGER_TOKEN } from '@tramvai/tokens-common';
|
|
8
|
+
export type { LogExtension };
|
|
7
9
|
export type RequestValidator = {
|
|
8
10
|
(state: ContextState): any;
|
|
9
11
|
};
|
|
@@ -42,6 +44,7 @@ export interface TinkoffRequestOptions extends HttpClientBaseOptions {
|
|
|
42
44
|
https: Agent;
|
|
43
45
|
};
|
|
44
46
|
querySerializer?: QuerySerializer;
|
|
47
|
+
logPluginExtensions?: LogExtension[];
|
|
45
48
|
}
|
|
46
49
|
export declare function createTinkoffRequest(options: TinkoffRequestOptions): MakeRequest;
|
|
47
50
|
//# sourceMappingURL=createTinkoffRequest.d.ts.map
|
|
@@ -11,7 +11,7 @@ import circuitBreaker from '@tinkoff/request-plugin-circuit-breaker';
|
|
|
11
11
|
import retry from '@tinkoff/request-plugin-retry';
|
|
12
12
|
|
|
13
13
|
function createTinkoffRequest(options) {
|
|
14
|
-
const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, allowStale = true, agent, querySerializer, retryOptions, etagCacheOptions, interceptors, ...defaults } = options;
|
|
14
|
+
const { logger, name, disableCache, enableCircuitBreaker, createCache, cacheTime = 30000, defaultTimeout, validator, errorValidator, errorModificator, circuitBreakerOptions = {}, getCacheKey, lruOptions = { max: 1000, maxAge: cacheTime }, allowStale = true, agent, querySerializer, logPluginExtensions, retryOptions, etagCacheOptions, interceptors, ...defaults } = options;
|
|
15
15
|
const log = logger && logger(`${name}:initialization`);
|
|
16
16
|
const createNamedCache = (type) => typeof createCache === 'function'
|
|
17
17
|
? // when memory and etag caches are used simultaneously, the cache name must be different
|
|
@@ -64,6 +64,7 @@ function createTinkoffRequest(options) {
|
|
|
64
64
|
name,
|
|
65
65
|
showQueryFields: true,
|
|
66
66
|
showPayloadFields: true,
|
|
67
|
+
extensions: logPluginExtensions,
|
|
67
68
|
}));
|
|
68
69
|
plugins.push(memoryCache({
|
|
69
70
|
shouldExecute: !disableCache,
|
|
@@ -29,7 +29,7 @@ var circuitBreaker__default = /*#__PURE__*/_interopDefaultLegacy(circuitBreaker)
|
|
|
29
29
|
var retry__default = /*#__PURE__*/_interopDefaultLegacy(retry);
|
|
30
30
|
|
|
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 }, allowStale = true, agent, querySerializer, retryOptions, etagCacheOptions, 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, logPluginExtensions, retryOptions, etagCacheOptions, interceptors, ...defaults } = options;
|
|
33
33
|
const log = logger && logger(`${name}:initialization`);
|
|
34
34
|
const createNamedCache = (type) => typeof createCache === 'function'
|
|
35
35
|
? // when memory and etag caches are used simultaneously, the cache name must be different
|
|
@@ -82,6 +82,7 @@ function createTinkoffRequest(options) {
|
|
|
82
82
|
name,
|
|
83
83
|
showQueryFields: true,
|
|
84
84
|
showPayloadFields: true,
|
|
85
|
+
extensions: logPluginExtensions,
|
|
85
86
|
}));
|
|
86
87
|
plugins.push(memoryCache__default["default"]({
|
|
87
88
|
shouldExecute: !disableCache,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/tinkoff-request-http-client-adapter",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.119",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"@tinkoff/request-plugin-cache-etag": "^0.5.3",
|
|
28
28
|
"@tinkoff/request-plugin-cache-memory": "^0.10.2",
|
|
29
29
|
"@tinkoff/request-plugin-circuit-breaker": "^0.5.0",
|
|
30
|
-
"@tinkoff/request-plugin-log": "^0.
|
|
30
|
+
"@tinkoff/request-plugin-log": "^0.11.0",
|
|
31
31
|
"@tinkoff/request-plugin-protocol-http": "0.16.0",
|
|
32
32
|
"@tinkoff/request-plugin-retry": "^0.3.1",
|
|
33
33
|
"@tinkoff/request-plugin-transform-url": "^0.10.0",
|
|
34
34
|
"@tinkoff/request-plugin-validate": "^0.10.0",
|
|
35
35
|
"@tinkoff/utils": "^2.1.2",
|
|
36
36
|
"@tramvai/http-client": "0.7.1",
|
|
37
|
-
"@tramvai/tokens-common": "7.
|
|
37
|
+
"@tramvai/tokens-common": "7.28.0",
|
|
38
38
|
"tslib": "^2.4.0",
|
|
39
39
|
"undici": "^7.24.4"
|
|
40
40
|
},
|