@http-forge/core 0.6.28 → 0.6.30
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 +6 -0
- package/dist/index.js +204 -200
- package/dist/index.mjs +205 -201
- package/dist/infrastructure/http/native-http-client.d.ts +20 -1
- package/package.json +1 -1
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { IHttpClient } from '../../types/platform';
|
|
18
18
|
import { HttpRequest, HttpResponse, RequestSettings } from '../../types/types';
|
|
19
|
+
import { ProxyConfig } from '../config/config.interface';
|
|
19
20
|
/**
|
|
20
21
|
* Default request settings
|
|
21
22
|
* Same as plugin's DEFAULT_REQUEST_SETTINGS from shared/constants.ts
|
|
@@ -30,6 +31,11 @@ export declare const DEFAULT_REQUEST_SETTINGS: Required<RequestSettings>;
|
|
|
30
31
|
* the client instance.
|
|
31
32
|
*/
|
|
32
33
|
export type RequestSettingsSource = Partial<RequestSettings> | (() => Partial<RequestSettings> | undefined);
|
|
34
|
+
/**
|
|
35
|
+
* Source of proxy configuration for {@link NodeHttpClient}.
|
|
36
|
+
* May be a static config object or a provider function for live config reloads.
|
|
37
|
+
*/
|
|
38
|
+
export type ProxySource = ProxyConfig | null | undefined | (() => ProxyConfig | null | undefined);
|
|
33
39
|
/**
|
|
34
40
|
* Native HTTP client using Node.js http/https modules
|
|
35
41
|
*
|
|
@@ -37,9 +43,10 @@ export type RequestSettingsSource = Partial<RequestSettings> | (() => Partial<Re
|
|
|
37
43
|
*/
|
|
38
44
|
export declare class NodeHttpClient implements IHttpClient {
|
|
39
45
|
private readonly resolveDefaults;
|
|
46
|
+
private readonly resolveProxy;
|
|
40
47
|
private version;
|
|
41
48
|
private readonly basePath;
|
|
42
|
-
constructor(defaultSettings?: RequestSettingsSource, basePath?: string);
|
|
49
|
+
constructor(defaultSettings?: RequestSettingsSource, basePath?: string, proxySource?: ProxySource);
|
|
43
50
|
/** Current default settings, resolved fresh from the configured source. */
|
|
44
51
|
private get settings();
|
|
45
52
|
/**
|
|
@@ -57,6 +64,18 @@ export declare class NodeHttpClient implements IHttpClient {
|
|
|
57
64
|
* Implementation extracted 100% from plugin's HttpRequestService.executeInternal
|
|
58
65
|
*/
|
|
59
66
|
private executeInternal;
|
|
67
|
+
/**
|
|
68
|
+
* Build an http.Agent that routes plain-HTTP requests through an HTTP proxy.
|
|
69
|
+
*/
|
|
70
|
+
private buildHttpProxyAgent;
|
|
71
|
+
/**
|
|
72
|
+
* Build an https.Agent that tunnels HTTPS through an HTTP proxy using CONNECT.
|
|
73
|
+
*/
|
|
74
|
+
private buildHttpsProxyAgent;
|
|
75
|
+
/**
|
|
76
|
+
* Check whether a host matches a bypass pattern (exact or wildcard).
|
|
77
|
+
*/
|
|
78
|
+
private hostMatchesBypass;
|
|
60
79
|
private resolveTlsSettings;
|
|
61
80
|
private findCertificateMapping;
|
|
62
81
|
private mappingMatchesHost;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@http-forge/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.30",
|
|
4
4
|
"description": "Headless Postman-compatible API testing engine for Node.js, CI/CD, OpenAPI workflows, and HTTP Forge automation",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|