@http-forge/core 0.2.14 → 0.2.17

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.
Files changed (83) hide show
  1. package/README.md +40 -0
  2. package/dist/index.js +131 -131
  3. package/dist/index.mjs +129 -129
  4. package/dist/infrastructure/collection/collection-service.d.ts +3 -0
  5. package/dist/infrastructure/collection/collection-store.d.ts +5 -1
  6. package/dist/infrastructure/collection/folder-collection-store.d.ts +4 -0
  7. package/dist/infrastructure/collection/folder-io.d.ts +1 -0
  8. package/dist/infrastructure/collection/json-collection-loader.d.ts +5 -0
  9. package/dist/types/collection.d.ts +2 -0
  10. package/package.json +1 -1
  11. package/dist/application/dto/index.d.ts +0 -8
  12. package/dist/application/dto/request-dtos.d.ts +0 -105
  13. package/dist/application/dto/response-dtos.d.ts +0 -185
  14. package/dist/application/events/application-events.d.ts +0 -53
  15. package/dist/application/events/index.d.ts +0 -6
  16. package/dist/application/index.d.ts +0 -25
  17. package/dist/application/mappers/collection-mapper.d.ts +0 -39
  18. package/dist/application/mappers/execution-result-mapper.d.ts +0 -16
  19. package/dist/application/mappers/index.d.ts +0 -9
  20. package/dist/application/mappers/request-mapper.d.ts +0 -29
  21. package/dist/application/queries/get-request-schema.query.d.ts +0 -32
  22. package/dist/application/queries/index.d.ts +0 -6
  23. package/dist/application/use-cases/create-request.use-case.d.ts +0 -23
  24. package/dist/application/use-cases/delete-request.use-case.d.ts +0 -15
  25. package/dist/application/use-cases/execute-request.use-case.d.ts +0 -46
  26. package/dist/application/use-cases/export-collection.use-case.d.ts +0 -22
  27. package/dist/application/use-cases/get-collection.use-case.d.ts +0 -13
  28. package/dist/application/use-cases/index.d.ts +0 -12
  29. package/dist/application/use-cases/list-requests.use-case.d.ts +0 -14
  30. package/dist/application/use-cases/load-collection.use-case.d.ts +0 -30
  31. package/dist/application/use-cases/save-collection.use-case.d.ts +0 -25
  32. package/dist/application/use-cases/update-request.use-case.d.ts +0 -17
  33. package/dist/domain/errors/domain-errors.d.ts +0 -52
  34. package/dist/domain/errors/index.d.ts +0 -4
  35. package/dist/domain/index.d.ts +0 -24
  36. package/dist/domain/models/execution.d.ts +0 -88
  37. package/dist/domain/models/index.d.ts +0 -4
  38. package/dist/domain/services/domain-events.d.ts +0 -60
  39. package/dist/domain/services/execution-planner.domain-service.d.ts +0 -40
  40. package/dist/domain/services/index.d.ts +0 -9
  41. package/dist/domain/services/schema-inference.domain-service.d.ts +0 -54
  42. package/dist/domain/value-objects/entity-id.d.ts +0 -26
  43. package/dist/domain/value-objects/http-method.d.ts +0 -30
  44. package/dist/domain/value-objects/index.d.ts +0 -9
  45. package/dist/domain/value-objects/request-url.d.ts +0 -28
  46. package/dist/infrastructure/adapters/index.d.ts +0 -5
  47. package/dist/infrastructure/adapters/logger.adapter.d.ts +0 -25
  48. package/dist/infrastructure/adapters/node-file-system.adapter.d.ts +0 -18
  49. package/dist/infrastructure/di/complete-bootstrap.d.ts +0 -24
  50. package/dist/infrastructure/di/index.d.ts +0 -6
  51. package/dist/infrastructure/di/infrastructure-di-config.d.ts +0 -33
  52. package/dist/infrastructure/di/simple-event-publisher.d.ts +0 -17
  53. package/dist/infrastructure/environment/interfaces.d.ts +0 -139
  54. package/dist/infrastructure/http/index.d.ts +0 -4
  55. package/dist/infrastructure/http/node-http-executor.adapter.d.ts +0 -25
  56. package/dist/infrastructure/index.d.ts +0 -31
  57. package/dist/infrastructure/persistence/file-system-history-loader.d.ts +0 -31
  58. package/dist/infrastructure/persistence/index.d.ts +0 -6
  59. package/dist/infrastructure/repositories/file-system/fs-collection-repository.d.ts +0 -72
  60. package/dist/infrastructure/repositories/file-system/fs-environment-file-loader.adapter.d.ts +0 -41
  61. package/dist/infrastructure/repositories/file-system/fs-environment-repository.d.ts +0 -34
  62. package/dist/infrastructure/repositories/file-system/fs-request-repository.d.ts +0 -31
  63. package/dist/infrastructure/repositories/file-system/index.d.ts +0 -7
  64. package/dist/infrastructure/repositories/in-memory/in-memory-collection-repository.d.ts +0 -18
  65. package/dist/infrastructure/repositories/in-memory/in-memory-environment-repository.d.ts +0 -25
  66. package/dist/infrastructure/repositories/in-memory/in-memory-request-repository.d.ts +0 -25
  67. package/dist/infrastructure/repositories/in-memory/index.d.ts +0 -7
  68. package/dist/infrastructure/script/index.d.ts +0 -4
  69. package/dist/infrastructure/script/vm-script-executor.adapter.d.ts +0 -19
  70. package/dist/infrastructure/test-suite/index.d.ts +0 -10
  71. package/dist/ports/executors/index.d.ts +0 -5
  72. package/dist/ports/external/file-system.interface.d.ts +0 -44
  73. package/dist/ports/external/http-client.interface.d.ts +0 -25
  74. package/dist/ports/external/index.d.ts +0 -7
  75. package/dist/ports/index.d.ts +0 -17
  76. package/dist/ports/parsers/index.d.ts +0 -4
  77. package/dist/ports/repositories/collection-repository.interface.d.ts +0 -32
  78. package/dist/ports/repositories/environment-repository.interface.d.ts +0 -31
  79. package/dist/ports/repositories/index.d.ts +0 -6
  80. package/dist/ports/repositories/request-repository.interface.d.ts +0 -32
  81. package/dist/ports/storage/cache-store.interface.d.ts +0 -26
  82. package/dist/ports/storage/history-loader.interface.d.ts +0 -37
  83. package/dist/ports/storage/index.d.ts +0 -5
package/README.md CHANGED
@@ -31,6 +31,8 @@
31
31
 
32
32
  ## 🎯 Installation
33
33
 
34
+ Requires Node.js `20+`.
35
+
34
36
  ```bash
35
37
  npm install @http-forge/core
36
38
  ```
@@ -518,6 +520,38 @@ interface PathParamEntry {
518
520
  }
519
521
  ```
520
522
 
523
+ ### Postman Collection Import / Export
524
+
525
+ `CollectionService` can import and export Postman Collection v2.1 JSON files, preserving all request body types, auth, scripts, and folder structure.
526
+
527
+ **Import** (`importCollection(filePath)`):
528
+
529
+ Detects Postman format by `info._postman_id` and converts all five body modes:
530
+
531
+ | Postman `mode` | HTTP Forge `type` | Notes |
532
+ |---|---|---|
533
+ | `raw` | `raw` | `format` inferred from `options.raw.language` (json/xml/html/javascript/text) |
534
+ | `urlencoded` | `x-www-form-urlencoded` | Fields mapped to `[{key, value, enabled}]` |
535
+ | `formdata` | `form-data` | Fields mapped to `[{key, value, type, enabled}]` |
536
+ | `graphql` | `graphql` | `variables` JSON string parsed to object |
537
+ | `binary` | `binary` | File path not portable; imported with empty content |
538
+
539
+ Auth types `bearer`, `basic`, and `apikey` are converted. Pre-request and test scripts (`prerequest`/`test` events) are imported as `scripts.preRequest`/`scripts.postResponse`. Folder hierarchy and item order are preserved.
540
+
541
+ **Export** (`exportCollection(collectionId, filePath)`):
542
+
543
+ Converts back to Postman v2.1 JSON. All body types round-trip correctly: `x-www-form-urlencoded` exports as `mode: "urlencoded"`, `form-data` as `mode: "formdata"`, `graphql` as `mode: "graphql"`, and `binary` as `mode: "binary"`.
544
+
545
+ ```typescript
546
+ const service = container.getCollectionService();
547
+
548
+ // Import
549
+ const collection = await service.importCollection('./my-api.postman_collection.json');
550
+
551
+ // Export
552
+ await service.exportCollection(collection.id, './exported.postman_collection.json');
553
+ ```
554
+
521
555
  ### OpenAPI Import / Export
522
556
 
523
557
  The core library includes full OpenAPI 3.0.3 import and export with constraint preservation.
@@ -727,6 +761,12 @@ MIT © Henry Huang
727
761
 
728
762
  ## 📝 Changelog
729
763
 
764
+ ### 0.2.16 (Duplicate Collection & Folder)
765
+
766
+ - ✅ **`duplicateCollection(sourceId, newName)`** — Duplicates a collection including all nested folders, requests, scripts, and schemas
767
+ - ✅ **`duplicateFolder(collectionId, folderId, newName)`** — Duplicates a folder within a collection, preserving all nested request content
768
+ - ✅ **`getItemPath(collectionId, itemId)`** — Resolves the disk path of a folder or request within a collection
769
+
730
770
  ### 0.2.5 (OpenAPI Constraint Round-Trip & Collision Merging)
731
771
 
732
772
  - ✅ **Full parameter constraint round-trip** — OpenAPI import/export now preserves all schema constraint fields: `pattern`, `minimum`, `maximum`, `exclusiveMinimum`, `exclusiveMaximum`, `minLength`, `maxLength`, and `oneOf` on both `KeyValueEntry` and `PathParamEntry`