@http-forge/core 0.6.27 → 0.6.28
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 -0
- package/dist/index.js +430 -394
- package/dist/index.mjs +426 -390
- package/dist/infrastructure/config/config.interface.d.ts +20 -0
- package/dist/infrastructure/http/native-http-client.d.ts +13 -2
- package/dist/infrastructure/test-suite/html-report-generator.d.ts +13 -1
- package/package.json +1 -1
|
@@ -72,6 +72,24 @@ export interface ScriptsConfig {
|
|
|
72
72
|
*/
|
|
73
73
|
timeout?: number;
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* HTML report generation options.
|
|
77
|
+
*/
|
|
78
|
+
export interface ReportConfig {
|
|
79
|
+
/**
|
|
80
|
+
* Maximum characters of a single request/response body embedded in the HTML
|
|
81
|
+
* report. Larger bodies are truncated (the full body stays in the on-disk
|
|
82
|
+
* result file). Guards against multi-GB reports on big collections.
|
|
83
|
+
*/
|
|
84
|
+
maxBodyChars: number;
|
|
85
|
+
/**
|
|
86
|
+
* Which requests get their request/response bodies embedded in the report:
|
|
87
|
+
* - 'all' — every request (largest reports)
|
|
88
|
+
* - 'failed' — only failed requests (default; passed requests show a note)
|
|
89
|
+
* - 'none' — no bodies embedded
|
|
90
|
+
*/
|
|
91
|
+
embedBodies: 'all' | 'failed' | 'none';
|
|
92
|
+
}
|
|
75
93
|
/**
|
|
76
94
|
* Runner configuration
|
|
77
95
|
*/
|
|
@@ -82,6 +100,8 @@ export interface RunnerConfig {
|
|
|
82
100
|
indexPageSize: number;
|
|
83
101
|
/** Maximum number of recent errors to track */
|
|
84
102
|
recentErrorsLimit: number;
|
|
103
|
+
/** HTML report generation options */
|
|
104
|
+
report: ReportConfig;
|
|
85
105
|
}
|
|
86
106
|
/**
|
|
87
107
|
* Environments configuration
|
|
@@ -21,16 +21,27 @@ import { HttpRequest, HttpResponse, RequestSettings } from '../../types/types';
|
|
|
21
21
|
* Same as plugin's DEFAULT_REQUEST_SETTINGS from shared/constants.ts
|
|
22
22
|
*/
|
|
23
23
|
export declare const DEFAULT_REQUEST_SETTINGS: Required<RequestSettings>;
|
|
24
|
+
/**
|
|
25
|
+
* Source of default request settings for {@link NodeHttpClient}.
|
|
26
|
+
*
|
|
27
|
+
* Pass a plain object for static settings, or a provider function to resolve
|
|
28
|
+
* settings lazily on every request. The provider form lets live configuration
|
|
29
|
+
* changes (e.g. newly added host certificates) take effect without recreating
|
|
30
|
+
* the client instance.
|
|
31
|
+
*/
|
|
32
|
+
export type RequestSettingsSource = Partial<RequestSettings> | (() => Partial<RequestSettings> | undefined);
|
|
24
33
|
/**
|
|
25
34
|
* Native HTTP client using Node.js http/https modules
|
|
26
35
|
*
|
|
27
36
|
* Implementation extracted 100% from plugin's HttpRequestService.executeInternal
|
|
28
37
|
*/
|
|
29
38
|
export declare class NodeHttpClient implements IHttpClient {
|
|
30
|
-
private
|
|
39
|
+
private readonly resolveDefaults;
|
|
31
40
|
private version;
|
|
32
41
|
private readonly basePath;
|
|
33
|
-
constructor(defaultSettings?:
|
|
42
|
+
constructor(defaultSettings?: RequestSettingsSource, basePath?: string);
|
|
43
|
+
/** Current default settings, resolved fresh from the configured source. */
|
|
44
|
+
private get settings();
|
|
34
45
|
/**
|
|
35
46
|
* Send an HTTP request
|
|
36
47
|
*/
|
|
@@ -13,9 +13,21 @@
|
|
|
13
13
|
* - Console output (if any)
|
|
14
14
|
* - Error message (if any)
|
|
15
15
|
*/
|
|
16
|
+
/** Options controlling how much request/response data the report embeds. */
|
|
17
|
+
export interface HtmlReportOptions {
|
|
18
|
+
/** Max characters per embedded request/response body. */
|
|
19
|
+
maxBodyChars: number;
|
|
20
|
+
/** Which requests embed their bodies: all, only failed, or none. */
|
|
21
|
+
embedBodies: 'all' | 'failed' | 'none';
|
|
22
|
+
}
|
|
16
23
|
export declare class HtmlReportGenerator {
|
|
17
24
|
private readonly basePath;
|
|
18
|
-
|
|
25
|
+
private readonly options;
|
|
26
|
+
constructor(basePath: string, options?: Partial<HtmlReportOptions>);
|
|
27
|
+
/** Whether a request with the given pass state should embed its bodies. */
|
|
28
|
+
private shouldEmbedBody;
|
|
29
|
+
/** Placeholder shown where a body was intentionally not embedded. */
|
|
30
|
+
private bodyOmittedNote;
|
|
19
31
|
/**
|
|
20
32
|
* Generate an HTML report for the given run.
|
|
21
33
|
* @returns absolute path to the written report.html
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@http-forge/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.28",
|
|
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",
|