@http-forge/core 0.6.30 → 0.6.31
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 +18 -0
- package/dist/index.js +283 -275
- package/dist/index.mjs +282 -274
- package/dist/infrastructure/config/config-service.d.ts +1 -0
- package/dist/infrastructure/config/config.interface.d.ts +8 -0
- package/dist/infrastructure/environment/environment-config-service.d.ts +29 -0
- package/dist/infrastructure/test-suite/html-report-generator.d.ts +10 -1
- package/dist/infrastructure/test-suite/interfaces.d.ts +1 -0
- package/dist/infrastructure/test-suite/markdown-summary-generator.d.ts +21 -0
- package/dist/infrastructure/test-suite/result-storage-service.d.ts +8 -0
- package/dist/infrastructure/test-suite/result-storage.d.ts +17 -0
- package/dist/infrastructure/test-suite/test-suite-service.d.ts +7 -0
- package/dist/types/environment-config.d.ts +7 -0
- package/package.json +1 -1
|
@@ -87,6 +87,7 @@ export declare class ConfigService implements IConfigService {
|
|
|
87
87
|
getScriptScope(): 'shared' | 'isolated';
|
|
88
88
|
getScriptTimeout(): number;
|
|
89
89
|
getWorkspacePath(): string;
|
|
90
|
+
onConfigReloaded?: () => void;
|
|
90
91
|
reload(): void;
|
|
91
92
|
configExists(): boolean;
|
|
92
93
|
createDefaultConfig(): Promise<void>;
|
|
@@ -197,6 +197,8 @@ export interface McpConfig {
|
|
|
197
197
|
* Proxy configuration
|
|
198
198
|
*/
|
|
199
199
|
export interface ProxyConfig {
|
|
200
|
+
/** Enable or disable the proxy without removing the config (default: true) */
|
|
201
|
+
enabled?: boolean;
|
|
200
202
|
/** HTTP proxy URL */
|
|
201
203
|
http?: string;
|
|
202
204
|
/** HTTPS proxy URL */
|
|
@@ -281,6 +283,12 @@ export interface IConfigService {
|
|
|
281
283
|
getMcpConfig(): McpConfig;
|
|
282
284
|
/** Get the resolved root path for HTTP Forge data */
|
|
283
285
|
getRootPath(): string;
|
|
286
|
+
/**
|
|
287
|
+
* Optional callback invoked after the config file is reloaded.
|
|
288
|
+
* Set by consumers (e.g. EnvironmentConfigService) that cache resolved configs
|
|
289
|
+
* derived from this config — they use this hook to invalidate their cache.
|
|
290
|
+
*/
|
|
291
|
+
onConfigReloaded?: () => void;
|
|
284
292
|
/** Get the resolved collections path */
|
|
285
293
|
getCollectionsPath(): string;
|
|
286
294
|
/** Get the resolved environments path */
|
|
@@ -22,6 +22,12 @@ export declare class EnvironmentConfigService implements IEnvironmentConfigServi
|
|
|
22
22
|
private localConfig;
|
|
23
23
|
private selectedEnvironment;
|
|
24
24
|
private fileWatcher?;
|
|
25
|
+
/**
|
|
26
|
+
* Cache of fully resolved HttpForgeConfig per environment name.
|
|
27
|
+
* Built from file-based variables only (NOT runtime pm.* values).
|
|
28
|
+
* Invalidated when config file or env files change.
|
|
29
|
+
*/
|
|
30
|
+
private resolvedConfigCache;
|
|
25
31
|
/**
|
|
26
32
|
* In-memory Local Values for variables (not persisted)
|
|
27
33
|
* These are set via forge.*.set() in scripts and override file values
|
|
@@ -119,6 +125,29 @@ export declare class EnvironmentConfigService implements IEnvironmentConfigServi
|
|
|
119
125
|
private createResolver;
|
|
120
126
|
private saveFolderSharedConfig;
|
|
121
127
|
reload(): void;
|
|
128
|
+
/**
|
|
129
|
+
* Invalidate the entire resolved config cache (called when config file or env files change).
|
|
130
|
+
*/
|
|
131
|
+
private invalidateResolvedConfigCache;
|
|
132
|
+
/**
|
|
133
|
+
* Build the set of file-only variables for an environment.
|
|
134
|
+
* Excludes runtime pm.environment.set / pm.globals.set values so the resolved
|
|
135
|
+
* config reflects only what is committed in env files.
|
|
136
|
+
*/
|
|
137
|
+
private getFileOnlyVariables;
|
|
138
|
+
/**
|
|
139
|
+
* Recursively resolve {{variable}} tokens in all string fields of any value.
|
|
140
|
+
* - Whole-value templates: {{ expr }} → evaluated, returned as native type (bool/number/string).
|
|
141
|
+
* - Partial templates: "prefix-{{ var }}-suffix" → string substitution.
|
|
142
|
+
* - Numbers/booleans/null → passed through unchanged.
|
|
143
|
+
*/
|
|
144
|
+
private resolveConfigValues;
|
|
145
|
+
/**
|
|
146
|
+
* Return the fully resolved HttpForgeConfig for the given environment.
|
|
147
|
+
* Result is cached; cache is invalidated on config/env file changes and env switch.
|
|
148
|
+
* Uses file-only variables — NOT runtime pm.* writes.
|
|
149
|
+
*/
|
|
150
|
+
getResolvedConfig(envName?: string): import('../config/config.interface').HttpForgeConfig;
|
|
122
151
|
getAllEnvironments(): Array<{
|
|
123
152
|
id: string;
|
|
124
153
|
name: string;
|
|
@@ -30,9 +30,18 @@ export declare class HtmlReportGenerator {
|
|
|
30
30
|
private bodyOmittedNote;
|
|
31
31
|
/**
|
|
32
32
|
* Generate an HTML report for the given run.
|
|
33
|
-
*
|
|
33
|
+
* The filename is derived from the run's environment and start time:
|
|
34
|
+
* report-<env>-<yyyy-MM-dd>-HH-mm.html
|
|
35
|
+
* Spaces in the environment name are replaced with underscores.
|
|
36
|
+
* @returns absolute path to the written report file.
|
|
34
37
|
*/
|
|
35
38
|
generate(suiteId: string, runId: string): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Build the report filename from manifest metadata.
|
|
41
|
+
* Format: report-<env>-<yyyy-MM-dd>-<HH>-<mm>.html
|
|
42
|
+
* Spaces in env name are replaced with underscores.
|
|
43
|
+
*/
|
|
44
|
+
private buildReportFileName;
|
|
36
45
|
private loadAllSummaries;
|
|
37
46
|
/** Load every result file for every request (pass + fail). */
|
|
38
47
|
private loadAllDetails;
|
|
@@ -245,6 +245,7 @@ export interface ITestSuiteService {
|
|
|
245
245
|
duplicateSuite(sourceId: string, newName: string): Promise<TestSuite>;
|
|
246
246
|
createTempSuiteFromCollection(collectionId: string): Promise<TestSuite | undefined>;
|
|
247
247
|
createTempSuiteFromFolder(collectionId: string, folderPath: string, recursive?: boolean): Promise<TestSuite | undefined>;
|
|
248
|
+
createTempSuiteFromRequest(collectionId: string, requestId: string): Promise<TestSuite | undefined>;
|
|
248
249
|
saveTempSuite(suite: TestSuite, name: string): Promise<TestSuite>;
|
|
249
250
|
}
|
|
250
251
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown Summary Generator for Test Suite Run Results
|
|
3
|
+
*
|
|
4
|
+
* Generates run-summary.md alongside the HTML report in each run folder.
|
|
5
|
+
* Designed to be consumed by AI tools (Claude Code, GitHub Copilot, Cursor, etc.)
|
|
6
|
+
* to analyse failures from a business perspective.
|
|
7
|
+
*
|
|
8
|
+
* Output: {basePath}/{suiteId}/{runId}/run-summary.md
|
|
9
|
+
*/
|
|
10
|
+
export declare class MarkdownSummaryGenerator {
|
|
11
|
+
private readonly basePath;
|
|
12
|
+
constructor(basePath: string);
|
|
13
|
+
/**
|
|
14
|
+
* Generate run-summary.md for the given run.
|
|
15
|
+
* @returns absolute path to the written file
|
|
16
|
+
*/
|
|
17
|
+
generate(suiteId: string, runId: string): Promise<string>;
|
|
18
|
+
private loadAllSummaries;
|
|
19
|
+
private loadDetails;
|
|
20
|
+
private buildMarkdown;
|
|
21
|
+
}
|
|
@@ -53,6 +53,14 @@ export declare class ResultStorageService implements IResultStorageService {
|
|
|
53
53
|
} | null;
|
|
54
54
|
getCurrentRunId(): string | null;
|
|
55
55
|
getCurrentSuiteId(): string | null;
|
|
56
|
+
/**
|
|
57
|
+
* Regenerate the HTML report for any completed run — callable after finalizeRun.
|
|
58
|
+
*/
|
|
59
|
+
regenerateHtmlReport(suiteId: string, runId: string): Promise<string | null>;
|
|
60
|
+
/**
|
|
61
|
+
* Generate a JUnit XML report for any completed run.
|
|
62
|
+
*/
|
|
63
|
+
generateJunitReport(suiteId: string, runId: string): Promise<string | null>;
|
|
56
64
|
getResultDetails(suiteId: string, runId: string, resultFile: string): Promise<FullResultDetails>;
|
|
57
65
|
getIndexPage(suiteId: string, runId: string, page: number): Promise<IndexPage>;
|
|
58
66
|
getManifest(suiteId: string, runId: string): Promise<RunManifest>;
|
|
@@ -309,6 +309,23 @@ export interface IResultStorageService {
|
|
|
309
309
|
* @returns path to the generated HTML report, or null if not generated / generation failed
|
|
310
310
|
*/
|
|
311
311
|
finalizeRun(status: 'completed' | 'aborted' | 'error', generateHtmlReport?: boolean): Promise<string | null>;
|
|
312
|
+
/**
|
|
313
|
+
* Regenerate (or generate for the first time) the HTML report for a completed run.
|
|
314
|
+
* Safe to call after finalizeRun; does not require an active run.
|
|
315
|
+
* @returns absolute path to the report file, or null if generation failed
|
|
316
|
+
*/
|
|
317
|
+
regenerateHtmlReport(suiteId: string, runId: string): Promise<string | null>;
|
|
318
|
+
/**
|
|
319
|
+
* Generate a JUnit XML report for a completed run.
|
|
320
|
+
* Uses the persisted run artifacts (manifest + index pages + result files).
|
|
321
|
+
* @returns absolute path to the written junit.xml, or null if generation failed
|
|
322
|
+
*/
|
|
323
|
+
generateJunitReport(suiteId: string, runId: string): Promise<string | null>;
|
|
324
|
+
/**
|
|
325
|
+
* Generate a JUnit XML report for a completed run.
|
|
326
|
+
* @returns absolute path to the written junit.xml, or null if generation failed
|
|
327
|
+
*/
|
|
328
|
+
generateJunitReport(suiteId: string, runId: string): Promise<string | null>;
|
|
312
329
|
/**
|
|
313
330
|
* Get current run stats
|
|
314
331
|
*/
|
|
@@ -87,6 +87,13 @@ export declare class TestSuiteService implements ITestSuiteService {
|
|
|
87
87
|
* @param recursive - include requests in nested subfolders (default: true)
|
|
88
88
|
*/
|
|
89
89
|
createTempSuiteFromFolder(collectionId: string, folderPath: string, recursive?: boolean): Promise<TestSuite | undefined>;
|
|
90
|
+
/**
|
|
91
|
+
* Create a temporary performance-test suite for a single request.
|
|
92
|
+
* The request is wrapped in a `for` loop node (100 iterations) so users
|
|
93
|
+
* can prepend login/auth steps before the loop if needed.
|
|
94
|
+
* The suite itself runs with iterations = 1.
|
|
95
|
+
*/
|
|
96
|
+
createTempSuiteFromRequest(collectionId: string, requestId: string): Promise<TestSuite | undefined>;
|
|
90
97
|
/** Convert a folder path into an id-safe slug. */
|
|
91
98
|
private slugifyFolderPath;
|
|
92
99
|
/**
|
|
@@ -135,6 +135,13 @@ export interface IEnvironmentConfigService extends IEnvironmentConfigReader, IEn
|
|
|
135
135
|
deleteSecretVariable(envName: string, key: string): Promise<void>;
|
|
136
136
|
/** Load all secrets for an environment (or current) into cache. */
|
|
137
137
|
loadSecretVariables(envName?: string): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Return the fully resolved HttpForgeConfig for the given environment.
|
|
140
|
+
* {{variable}} tokens are substituted using file-only env variables
|
|
141
|
+
* (env.json, global.json, *.local.json) — NOT runtime pm.* values.
|
|
142
|
+
* Result is cached and invalidated on config/env file changes or env switch.
|
|
143
|
+
*/
|
|
144
|
+
getResolvedConfig(envName?: string): import('../infrastructure/config/config.interface').HttpForgeConfig;
|
|
138
145
|
}
|
|
139
146
|
/**
|
|
140
147
|
* Interface for storing and retrieving environment variables
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@http-forge/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.31",
|
|
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",
|