@http-forge/core 0.6.18 → 0.6.21
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 +51 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +341 -340
- package/dist/index.mjs +341 -340
- package/dist/infrastructure/collection/collection-store.d.ts +1 -1
- package/dist/infrastructure/config/config.interface.d.ts +21 -0
- package/dist/infrastructure/http/native-http-client.d.ts +6 -1
- package/dist/infrastructure/script/interfaces.d.ts +3 -0
- package/dist/infrastructure/test-suite/interfaces.d.ts +103 -6
- package/dist/infrastructure/test-suite/statistics-service.d.ts +1 -1
- package/dist/infrastructure/test-suite/test-suite-service.d.ts +2 -2
- package/dist/infrastructure/test-suite/test-suite-store.d.ts +22 -8
- package/dist/runtime/mcp-tool-name.d.ts +4 -5
- package/dist/runtime/mcp-tool-schemas.d.ts +6 -0
- package/dist/types/types.d.ts +30 -0
- package/dist/utils/typed-value.d.ts +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
| **Built-in scripting and assertions** | Pre-request and post-response scripts with `pm.test()` and Chai `expect()` | API contract checks in CI/CD |
|
|
29
29
|
| **Variables and environments** | `{{variables}}` resolution across global, collection, environment, and runtime scopes; dynamic values like `{{$timestamp}}` and `{{$uuid}}` | Multi-environment testing (dev/staging/prod) |
|
|
30
30
|
| **Stateful request flows** | Automatic cookie persistence and flow control with `pm.setNextRequest()` / `pm.execution.skipRequest()` | Auth/login chains and dependent request sequences |
|
|
31
|
+
| **Suite flow nodes** | Conditional/loop/script orchestration via `suite.nodes` with reusable `scriptRef` library entries | Advanced API scenarios without creating script-only HTTP requests |
|
|
31
32
|
| **OpenAPI and docs-ready workflows** | Request metadata stays aligned with API contracts and generated artifacts | Spec-driven API lifecycle and governance |
|
|
32
33
|
| **Extensible architecture** | Custom HTTP clients, interceptors, module loaders, and file-watching hooks | Internal platform tooling and custom runners |
|
|
33
34
|
|
|
@@ -159,6 +160,56 @@ Learn more:
|
|
|
159
160
|
- Runtime API (MCP runtime): [RUNTIME-API.md](RUNTIME-API.md)
|
|
160
161
|
- MCP management tools reference: [docs/MCP_MANAGEMENT_TOOLS.md](docs/MCP_MANAGEMENT_TOOLS.md)
|
|
161
162
|
|
|
163
|
+
## 🔀 Suite Flow Nodes
|
|
164
|
+
|
|
165
|
+
`@http-forge/core` now supports graph-style suite execution through optional `nodes` on a suite definition.
|
|
166
|
+
|
|
167
|
+
What you can use:
|
|
168
|
+
- `request` nodes for normal HTTP steps
|
|
169
|
+
- `script` nodes for script-only orchestration steps
|
|
170
|
+
- `if`, `switch`, `for`, `while`, and `block` for flow control
|
|
171
|
+
- `scripts` library on the suite plus `scriptRef` on script nodes for reuse
|
|
172
|
+
|
|
173
|
+
Behavior notes:
|
|
174
|
+
- `if` nodes support `then`, optional `elseif[]`, and optional `else` branches.
|
|
175
|
+
- `switch` nodes support `cases[]` and optional `default`.
|
|
176
|
+
- `for` nodes prefer `loopCondition` for loop evaluation (legacy `condition` remains backward compatible).
|
|
177
|
+
|
|
178
|
+
Flow scripts run through the same script session runtime as request scripts, so you can use `pm.variables.set/get`, `pm.environment`, and `pm.globals` consistently.
|
|
179
|
+
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"id": "smoke-with-flow",
|
|
183
|
+
"name": "Smoke With Flow",
|
|
184
|
+
"requests": [],
|
|
185
|
+
"scripts": {
|
|
186
|
+
"setRole": "pm.variables.set('role', 'admin');"
|
|
187
|
+
},
|
|
188
|
+
"nodes": [
|
|
189
|
+
{ "type": "script", "scriptRef": "setRole" },
|
|
190
|
+
{
|
|
191
|
+
"type": "if",
|
|
192
|
+
"if": "pm.variables.get('role') === 'admin'",
|
|
193
|
+
"then": [
|
|
194
|
+
{
|
|
195
|
+
"type": "request",
|
|
196
|
+
"request": {
|
|
197
|
+
"collectionId": "my-api_abc123",
|
|
198
|
+
"requestId": "get-users_def456",
|
|
199
|
+
"name": "Get Users"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"config": { "iterations": 1 }
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
For the full runtime behavior and limits, see:
|
|
210
|
+
- [RUNTIME-API.md](RUNTIME-API.md)
|
|
211
|
+
- [docs/SUITE_FLOW_SCRIPT_SANDBOX_SOLUTION.md](docs/SUITE_FLOW_SCRIPT_SANDBOX_SOLUTION.md)
|
|
212
|
+
|
|
162
213
|
## 🎯 Installation
|
|
163
214
|
|
|
164
215
|
Requires Node.js `20+`.
|
package/dist/index.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ export { CONFIG_FILES, ConfigService, DEFAULT_CONFIG, ROOT_DIRECTORIES } from '.
|
|
|
124
124
|
export type { EnvironmentsConfig, HttpForgeConfig, IConfigService, McpConfig, McpCorsConfig, McpToolMode, ProxyConfig, RequestConfig, RestClientExportConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './infrastructure/config';
|
|
125
125
|
export { HtmlReportGenerator } from './infrastructure/test-suite/html-report-generator';
|
|
126
126
|
export { DEFAULT_SUITE_CONFIG } from './infrastructure/test-suite/interfaces';
|
|
127
|
-
export type { ErrorSummary, IStatisticsService, ITestSuiteService, RequestStatistics, RunStatistics, RunSummary, SuiteConfig, SuiteRequest, TestSuite } from './infrastructure/test-suite/interfaces';
|
|
127
|
+
export type { ErrorSummary, IStatisticsService, ITestSuiteService, RequestStatistics, RunStatistics, RunSummary, SuiteBlockNode, SuiteConfig, SuiteElseIfBranch, SuiteFlowNode, SuiteFlowNodeBase, SuiteForNode, SuiteIfNode, SuiteRequest, SuiteRequestNode, SuiteScriptNode, SuiteSwitchCase, SuiteSwitchNode, SuiteWhileNode, TestSuite } from './infrastructure/test-suite/interfaces';
|
|
128
128
|
export { JUnitReportGenerator } from './infrastructure/test-suite/junit-report-generator';
|
|
129
129
|
export { buildResultFileName, expandSummary, HTTP_METHOD_MAP, HTTP_METHOD_REVERSE } from './infrastructure/test-suite/result-storage';
|
|
130
130
|
export type { FullResultDetails, IndexPage, IResultStorageService, RecentError, RequestStats, ResultSummary, RunConfig, RunManifest, RunStats } from './infrastructure/test-suite/result-storage';
|
|
@@ -153,3 +153,4 @@ export { augmentWithDynamicVars, DYNAMIC_VARIABLES, resolveDynamicVariable, reso
|
|
|
153
153
|
export { evaluateExpression, isExpression } from './utils/expression-evaluator';
|
|
154
154
|
export { applyFilterChain, parseFilterChain } from './utils/filter-engine';
|
|
155
155
|
export { deepClone, formatBytes, formatDuration, generateId, generateUUID, isPlainObject, mergeHeadersCaseInsensitive, safeJsonParse, sanitizeName } from './utils/helpers';
|
|
156
|
+
export { deserializeTypedRecord, deserializeTypedValue, serializeTypedValue } from './utils/typed-value';
|