@http-forge/core 0.2.3 → 0.2.5
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 +33 -0
- package/dist/index.js +99 -97
- package/dist/index.mjs +98 -96
- package/dist/infrastructure/collection/collection-service.d.ts +7 -2
- package/dist/infrastructure/collection/folder-collection-loader.d.ts +1 -1
- package/dist/infrastructure/environment/environment-config-service.d.ts +12 -3
- package/dist/infrastructure/openapi/openapi-exporter.d.ts +31 -0
- package/dist/infrastructure/openapi/openapi-importer.d.ts +10 -0
- package/dist/types/types.d.ts +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
- 📝 **JavaScript Scripting** - Pre-request and post-response scripts with full `pm.*` API (variables, assertions, execution flow, visualizer)
|
|
15
15
|
- 🔄 **Dynamic Variables** - Built-in generators: `{{$randomInt}}`, `{{$timestamp}}`, `{{$uuid}}`, `{{$guid}}`, etc.
|
|
16
16
|
- 🌍 **Environments** - Full variable scoping (globals, collection, environment, session, iterationData)
|
|
17
|
+
- 👁️ **File Watching** - Automatic reload on collection/environment file changes with notification callbacks
|
|
17
18
|
- 🍪 **Cookie Persistence** - Automatic cookie storage and reuse, `pm.cookies.jar()` and `.toObject()`
|
|
18
19
|
- 📊 **Test Assertions** - BDD-style testing with `pm.test()` (sync/async) and full Chai `expect()` chains
|
|
19
20
|
- 🔐 **CryptoJS** - Full crypto library: hash, HMAC, AES/DES/TripleDES, PBKDF2, encoding helpers
|
|
@@ -77,6 +78,25 @@ forge.setEnvironment({
|
|
|
77
78
|
const result = await forge.execute(request, collection);
|
|
78
79
|
```
|
|
79
80
|
|
|
81
|
+
### URL Path Parameters
|
|
82
|
+
|
|
83
|
+
If your request URL uses Express-style route parameters, provide values using the request `params` field.
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
const request = {
|
|
87
|
+
name: 'Redirect Test',
|
|
88
|
+
method: 'GET',
|
|
89
|
+
url: '{{baseUrl}}/redirect/:redirectNumber',
|
|
90
|
+
params: {
|
|
91
|
+
redirectNumber: '3'
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const result = await forge.execute(request, collection);
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The engine will substitute `:redirectNumber` before execution, while still resolving environment variables and dynamic template expressions.
|
|
99
|
+
|
|
80
100
|
### With Custom Configuration
|
|
81
101
|
|
|
82
102
|
```typescript
|
|
@@ -391,6 +411,9 @@ interface ForgeContainerOptions {
|
|
|
391
411
|
// History
|
|
392
412
|
enableHistory?: boolean; // Enable request history
|
|
393
413
|
maxHistoryEntries?: number; // Max history size
|
|
414
|
+
|
|
415
|
+
// File Watching
|
|
416
|
+
fileWatcherFactory?: IFileWatcherFactory; // Watch for collection/environment file changes
|
|
394
417
|
}
|
|
395
418
|
```
|
|
396
419
|
|
|
@@ -614,9 +637,11 @@ my-api/
|
|
|
614
637
|
requests/
|
|
615
638
|
login/
|
|
616
639
|
request.json
|
|
640
|
+
doc.md # Optional request documentation (Markdown)
|
|
617
641
|
users/
|
|
618
642
|
get-users/
|
|
619
643
|
request.json
|
|
644
|
+
doc.md
|
|
620
645
|
create-user/
|
|
621
646
|
request.json
|
|
622
647
|
```
|
|
@@ -637,6 +662,14 @@ MIT © Henry Huang
|
|
|
637
662
|
|
|
638
663
|
## 📝 Changelog
|
|
639
664
|
|
|
665
|
+
### 0.2.4 (File Watching & Request Documentation)
|
|
666
|
+
|
|
667
|
+
- ✅ **File watching for CollectionService** - Automatic reload and `onCollectionsChanged` callback when collection files change on disk
|
|
668
|
+
- ✅ **File watching for EnvironmentConfigService** - Automatic reload and `onEnvironmentsChanged` callback when environment JSON files change on disk
|
|
669
|
+
- ✅ **Request documentation (`doc.md`)** - Persist per-request Markdown documentation as `doc.md` alongside `request.json`
|
|
670
|
+
- ✅ **`doc` field on UnifiedRequest / CollectionRequest** - Optional `doc?: string` field for request documentation content
|
|
671
|
+
- ✅ **`fileWatcherFactory` bootstrap option** - Pass `IFileWatcherFactory` to enable file watching in both collection and environment services
|
|
672
|
+
|
|
640
673
|
### 0.2.0 (Postman API Parity)
|
|
641
674
|
|
|
642
675
|
- ✅ **Async `pm.test()` support** - Tests with async callbacks are properly awaited
|