@tramvai/tokens-http-client 1.41.2 → 1.44.4
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.
- package/README.md +2 -2
- package/lib/index.d.ts +15 -6
- package/lib/index.es.js +12 -6
- package/lib/index.js +12 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @tramvai/tokens-http-client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Tramvai tokens used for integration and extending `@tramvai/module-http-client`
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Tokens
|
|
6
6
|
|
|
7
7
|
@inline src/index.ts
|
package/lib/index.d.ts
CHANGED
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
import type { ApiService, HttpClient } from '@tramvai/http-client';
|
|
2
|
-
import type { TinkoffRequestOptions } from '@tramvai/tinkoff-request-http-client-adapter';
|
|
2
|
+
import type { TinkoffRequestOptions, Agent } from '@tramvai/tinkoff-request-http-client-adapter';
|
|
3
3
|
export declare type HttpClientFactoryOptions = TinkoffRequestOptions & {
|
|
4
4
|
name: string;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* @description
|
|
8
|
-
*
|
|
8
|
+
* Factory of HTTP clients with minimal base settings
|
|
9
9
|
*/
|
|
10
10
|
export declare const HTTP_CLIENT_FACTORY: (options: HttpClientFactoryOptions) => HttpClient;
|
|
11
11
|
/**
|
|
12
12
|
* @description
|
|
13
|
-
*
|
|
13
|
+
* Universal HTTP client for arbitrary requests
|
|
14
14
|
*/
|
|
15
15
|
export declare const HTTP_CLIENT: HttpClient;
|
|
16
16
|
/**
|
|
17
17
|
* @description
|
|
18
|
-
*
|
|
18
|
+
* Global HTTP and HTTPS agents for all clients
|
|
19
|
+
* https://nodejs.org/dist/latest-v16.x/docs/api/http.html#class-httpagent
|
|
20
|
+
*/
|
|
21
|
+
export declare const HTTP_CLIENT_AGENT: {
|
|
22
|
+
http: Agent;
|
|
23
|
+
https: Agent;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* @description
|
|
27
|
+
* List of HTTP headers that are proxied from app request to all of the backend API
|
|
19
28
|
*/
|
|
20
29
|
export declare const API_CLIENT_PASS_HEADERS: string[];
|
|
21
30
|
/**
|
|
22
31
|
* @description
|
|
23
|
-
*
|
|
24
|
-
*
|
|
32
|
+
* Internal api for app server.
|
|
33
|
+
* Uses the value of `APP_INFO_TOKEN` from di for constructing the request address
|
|
25
34
|
*/
|
|
26
35
|
export declare const PAPI_SERVICE: ApiService<import("@tramvai/http-client").HttpClientRequest>;
|
package/lib/index.es.js
CHANGED
|
@@ -2,26 +2,32 @@ import { createToken } from '@tinkoff/dippy';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @description
|
|
5
|
-
*
|
|
5
|
+
* Factory of HTTP clients with minimal base settings
|
|
6
6
|
*/
|
|
7
7
|
const HTTP_CLIENT_FACTORY = createToken('HTTP_CLIENT_FACTORY');
|
|
8
8
|
/**
|
|
9
9
|
* @description
|
|
10
|
-
*
|
|
10
|
+
* Universal HTTP client for arbitrary requests
|
|
11
11
|
*/
|
|
12
12
|
const HTTP_CLIENT = createToken('HTTP_CLIENT');
|
|
13
13
|
/**
|
|
14
14
|
* @description
|
|
15
|
-
*
|
|
15
|
+
* Global HTTP and HTTPS agents for all clients
|
|
16
|
+
* https://nodejs.org/dist/latest-v16.x/docs/api/http.html#class-httpagent
|
|
17
|
+
*/
|
|
18
|
+
const HTTP_CLIENT_AGENT = createToken('HTTP_CLIENT_AGENT');
|
|
19
|
+
/**
|
|
20
|
+
* @description
|
|
21
|
+
* List of HTTP headers that are proxied from app request to all of the backend API
|
|
16
22
|
*/
|
|
17
23
|
const API_CLIENT_PASS_HEADERS = createToken('apiClientPassHeaders', {
|
|
18
24
|
multi: true,
|
|
19
25
|
});
|
|
20
26
|
/**
|
|
21
27
|
* @description
|
|
22
|
-
*
|
|
23
|
-
*
|
|
28
|
+
* Internal api for app server.
|
|
29
|
+
* Uses the value of `APP_INFO_TOKEN` from di for constructing the request address
|
|
24
30
|
*/
|
|
25
31
|
const PAPI_SERVICE = createToken('papi service');
|
|
26
32
|
|
|
27
|
-
export { API_CLIENT_PASS_HEADERS, HTTP_CLIENT, HTTP_CLIENT_FACTORY, PAPI_SERVICE };
|
|
33
|
+
export { API_CLIENT_PASS_HEADERS, HTTP_CLIENT, HTTP_CLIENT_AGENT, HTTP_CLIENT_FACTORY, PAPI_SERVICE };
|
package/lib/index.js
CHANGED
|
@@ -6,29 +6,36 @@ var dippy = require('@tinkoff/dippy');
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @description
|
|
9
|
-
*
|
|
9
|
+
* Factory of HTTP clients with minimal base settings
|
|
10
10
|
*/
|
|
11
11
|
const HTTP_CLIENT_FACTORY = dippy.createToken('HTTP_CLIENT_FACTORY');
|
|
12
12
|
/**
|
|
13
13
|
* @description
|
|
14
|
-
*
|
|
14
|
+
* Universal HTTP client for arbitrary requests
|
|
15
15
|
*/
|
|
16
16
|
const HTTP_CLIENT = dippy.createToken('HTTP_CLIENT');
|
|
17
17
|
/**
|
|
18
18
|
* @description
|
|
19
|
-
*
|
|
19
|
+
* Global HTTP and HTTPS agents for all clients
|
|
20
|
+
* https://nodejs.org/dist/latest-v16.x/docs/api/http.html#class-httpagent
|
|
21
|
+
*/
|
|
22
|
+
const HTTP_CLIENT_AGENT = dippy.createToken('HTTP_CLIENT_AGENT');
|
|
23
|
+
/**
|
|
24
|
+
* @description
|
|
25
|
+
* List of HTTP headers that are proxied from app request to all of the backend API
|
|
20
26
|
*/
|
|
21
27
|
const API_CLIENT_PASS_HEADERS = dippy.createToken('apiClientPassHeaders', {
|
|
22
28
|
multi: true,
|
|
23
29
|
});
|
|
24
30
|
/**
|
|
25
31
|
* @description
|
|
26
|
-
*
|
|
27
|
-
*
|
|
32
|
+
* Internal api for app server.
|
|
33
|
+
* Uses the value of `APP_INFO_TOKEN` from di for constructing the request address
|
|
28
34
|
*/
|
|
29
35
|
const PAPI_SERVICE = dippy.createToken('papi service');
|
|
30
36
|
|
|
31
37
|
exports.API_CLIENT_PASS_HEADERS = API_CLIENT_PASS_HEADERS;
|
|
32
38
|
exports.HTTP_CLIENT = HTTP_CLIENT;
|
|
39
|
+
exports.HTTP_CLIENT_AGENT = HTTP_CLIENT_AGENT;
|
|
33
40
|
exports.HTTP_CLIENT_FACTORY = HTTP_CLIENT_FACTORY;
|
|
34
41
|
exports.PAPI_SERVICE = PAPI_SERVICE;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/tokens-http-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.44.4",
|
|
4
4
|
"initialVersion": "0.58.99",
|
|
5
5
|
"description": "Tramvai tokens for @tramvai/module-http-client",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@tramvai/http-client": "0.1.23",
|
|
24
|
-
"@tramvai/tinkoff-request-http-client-adapter": "0.8.
|
|
24
|
+
"@tramvai/tinkoff-request-http-client-adapter": "0.8.197"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@tinkoff/dippy": "0.7.35",
|