@tramvai/module-http-client 2.0.7 → 2.3.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.
@@ -2,15 +2,16 @@ import type { MakeRequest } from '@tinkoff/request-core';
2
2
  import type { APP_INFO_TOKEN } from '@tramvai/core';
3
3
  import type { API_CLIENT_PASS_HEADERS, HttpClientFactoryOptions, HTTP_CLIENT_AGENT, HTTP_CLIENT_FACTORY, DISABLE_CIRCUIT_BREAKER } from '@tramvai/tokens-http-client';
4
4
  import type { LOGGER_TOKEN, CREATE_CACHE_TOKEN, ENV_MANAGER_TOKEN, REQUEST_MANAGER_TOKEN } from '@tramvai/tokens-common';
5
+ import type { ExtractDependencyType, ExtractTokenType } from '@tinkoff/dippy';
5
6
  export declare const httpClientFactory: ({ logger, envManager, appInfo, requestManager, headersList, createCache, makeRequestRegistry, agent, disableCircuitBreaker, defaultOptions, }: {
6
- logger: typeof LOGGER_TOKEN;
7
- envManager: typeof ENV_MANAGER_TOKEN;
8
- appInfo: typeof APP_INFO_TOKEN;
9
- requestManager?: typeof REQUEST_MANAGER_TOKEN;
10
- headersList?: typeof API_CLIENT_PASS_HEADERS;
11
- createCache?: typeof CREATE_CACHE_TOKEN;
7
+ logger: ExtractDependencyType<typeof LOGGER_TOKEN>;
8
+ envManager: ExtractDependencyType<typeof ENV_MANAGER_TOKEN>;
9
+ appInfo: ExtractDependencyType<typeof APP_INFO_TOKEN>;
10
+ requestManager?: ExtractDependencyType<typeof REQUEST_MANAGER_TOKEN>;
11
+ headersList?: ExtractDependencyType<typeof API_CLIENT_PASS_HEADERS>;
12
+ createCache?: ExtractDependencyType<typeof CREATE_CACHE_TOKEN>;
12
13
  makeRequestRegistry: Map<string, MakeRequest>;
13
- agent?: typeof HTTP_CLIENT_AGENT;
14
- disableCircuitBreaker: typeof DISABLE_CIRCUIT_BREAKER;
14
+ agent?: ExtractDependencyType<typeof HTTP_CLIENT_AGENT>;
15
+ disableCircuitBreaker: ExtractDependencyType<typeof DISABLE_CIRCUIT_BREAKER>;
15
16
  defaultOptions?: Partial<HttpClientFactoryOptions>;
16
- }) => typeof HTTP_CLIENT_FACTORY;
17
+ }) => ExtractTokenType<typeof HTTP_CLIENT_FACTORY>;
@@ -182,7 +182,6 @@ const HttpClientModule = /* @__PURE__ */ Module({
182
182
  { key: 'HTTP_CLIENT_CACHE_DISABLED', optional: true, dehydrate: false },
183
183
  { key: 'HTTP_CLIENT_CIRCUIT_BREAKER_DISABLED', optional: true, dehydrate: false },
184
184
  ],
185
- multi: true,
186
185
  }),
187
186
  /**
188
187
  * хранилище для экземпляров @tinkoff/request
@@ -221,7 +220,6 @@ const HttpClientModule = /* @__PURE__ */ Module({
221
220
  }),
222
221
  provide({
223
222
  provide: API_CLIENT_PASS_HEADERS,
224
- multi: true,
225
223
  useValue: ['x-request-id'],
226
224
  }),
227
225
  ],
package/lib/index.es.js CHANGED
@@ -229,7 +229,6 @@ const HttpClientModule = /* @__PURE__ */ Module({
229
229
  { key: 'HTTP_CLIENT_CACHE_DISABLED', optional: true, dehydrate: false },
230
230
  { key: 'HTTP_CLIENT_CIRCUIT_BREAKER_DISABLED', optional: true, dehydrate: false },
231
231
  ],
232
- multi: true,
233
232
  }),
234
233
  /**
235
234
  * хранилище для экземпляров @tinkoff/request
@@ -268,7 +267,6 @@ const HttpClientModule = /* @__PURE__ */ Module({
268
267
  }),
269
268
  provide({
270
269
  provide: API_CLIENT_PASS_HEADERS,
271
- multi: true,
272
270
  useValue: ['x-request-id'],
273
271
  }),
274
272
  ],
package/lib/index.js CHANGED
@@ -240,7 +240,6 @@ const HttpClientModule = /* @__PURE__ */ core.Module({
240
240
  { key: 'HTTP_CLIENT_CACHE_DISABLED', optional: true, dehydrate: false },
241
241
  { key: 'HTTP_CLIENT_CIRCUIT_BREAKER_DISABLED', optional: true, dehydrate: false },
242
242
  ],
243
- multi: true,
244
243
  }),
245
244
  /**
246
245
  * хранилище для экземпляров @tinkoff/request
@@ -279,7 +278,6 @@ const HttpClientModule = /* @__PURE__ */ core.Module({
279
278
  }),
280
279
  core.provide({
281
280
  provide: tokensHttpClient.API_CLIENT_PASS_HEADERS,
282
- multi: true,
283
281
  useValue: ['x-request-id'],
284
282
  }),
285
283
  ],
@@ -1,10 +1,11 @@
1
1
  import type { REQUEST_MANAGER_TOKEN } from '@tramvai/module-common';
2
2
  import type { API_CLIENT_PASS_HEADERS } from '@tramvai/tokens-http-client';
3
3
  import type { HttpClientRequest } from '@tramvai/http-client';
4
+ import type { ExtractDependencyType } from '@tinkoff/dippy';
4
5
  export declare const fillHeaderIp: ({ requestManager, }: {
5
- requestManager?: typeof REQUEST_MANAGER_TOKEN;
6
+ requestManager?: ExtractDependencyType<typeof REQUEST_MANAGER_TOKEN>;
6
7
  }) => (params: HttpClientRequest) => HttpClientRequest;
7
8
  export declare const fillHeaders: ({ requestManager, headersList, }: {
8
- requestManager?: typeof REQUEST_MANAGER_TOKEN;
9
- headersList: typeof API_CLIENT_PASS_HEADERS;
9
+ requestManager?: ExtractDependencyType<typeof REQUEST_MANAGER_TOKEN>;
10
+ headersList: ExtractDependencyType<typeof API_CLIENT_PASS_HEADERS>;
10
11
  }) => (params: HttpClientRequest) => HttpClientRequest;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-http-client",
3
- "version": "2.0.7",
3
+ "version": "2.3.0",
4
4
  "initialVersion": "0.58.99",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
@@ -25,22 +25,22 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@tramvai/http-client": "0.1.28",
28
- "@tramvai/tinkoff-request-http-client-adapter": "0.9.7",
29
- "@tramvai/tokens-http-client": "2.0.7",
30
- "@tramvai/tokens-common": "2.0.7",
31
- "@tramvai/tokens-server": "2.0.7"
28
+ "@tramvai/tinkoff-request-http-client-adapter": "0.9.14",
29
+ "@tramvai/tokens-http-client": "2.3.0",
30
+ "@tramvai/tokens-common": "2.3.0",
31
+ "@tramvai/tokens-server": "2.3.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@tinkoff/request-core": "^0.9.2"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@tinkoff/utils": "^2.1.2",
38
- "@tramvai/core": "2.0.7",
39
- "@tramvai/module-common": "2.0.7",
40
- "@tramvai/papi": "2.0.7",
41
- "@tramvai/test-helpers": "2.0.7",
42
- "@tramvai/test-mocks": "2.0.7",
43
- "@tinkoff/dippy": "0.7.42",
38
+ "@tramvai/core": "2.3.0",
39
+ "@tramvai/module-common": "2.3.0",
40
+ "@tramvai/papi": "2.3.0",
41
+ "@tramvai/test-helpers": "2.3.0",
42
+ "@tramvai/test-mocks": "2.3.0",
43
+ "@tinkoff/dippy": "0.7.43",
44
44
  "node-fetch": "^2.6.1",
45
45
  "tslib": "^2.0.3"
46
46
  },