@http-forge/core 0.2.0 → 0.2.2
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 +25 -4
- package/dist/application/dto/index.d.ts +8 -0
- package/dist/application/dto/request-dtos.d.ts +105 -0
- package/dist/application/dto/response-dtos.d.ts +185 -0
- package/dist/application/events/application-events.d.ts +53 -0
- package/dist/application/events/index.d.ts +6 -0
- package/dist/application/index.d.ts +25 -0
- package/dist/application/mappers/collection-mapper.d.ts +39 -0
- package/dist/application/mappers/execution-result-mapper.d.ts +16 -0
- package/dist/application/mappers/index.d.ts +9 -0
- package/dist/application/mappers/request-mapper.d.ts +29 -0
- package/dist/application/queries/get-request-schema.query.d.ts +32 -0
- package/dist/application/queries/index.d.ts +6 -0
- package/dist/application/use-cases/create-request.use-case.d.ts +23 -0
- package/dist/application/use-cases/delete-request.use-case.d.ts +15 -0
- package/dist/application/use-cases/execute-request.use-case.d.ts +46 -0
- package/dist/application/use-cases/export-collection.use-case.d.ts +22 -0
- package/dist/application/use-cases/get-collection.use-case.d.ts +13 -0
- package/dist/application/use-cases/index.d.ts +12 -0
- package/dist/application/use-cases/list-requests.use-case.d.ts +14 -0
- package/dist/application/use-cases/load-collection.use-case.d.ts +30 -0
- package/dist/application/use-cases/save-collection.use-case.d.ts +25 -0
- package/dist/application/use-cases/update-request.use-case.d.ts +17 -0
- package/dist/container.d.ts +34 -18
- package/dist/di/core-bootstrap.d.ts +25 -0
- package/dist/di/index.d.ts +19 -0
- package/dist/di/platform-adapters.d.ts +66 -0
- package/dist/di/service-container.d.ts +97 -0
- package/dist/di/service-identifiers.d.ts +34 -0
- package/dist/domain/errors/domain-errors.d.ts +52 -0
- package/dist/domain/errors/index.d.ts +4 -0
- package/dist/domain/index.d.ts +24 -0
- package/dist/domain/models/execution.d.ts +88 -0
- package/dist/domain/models/index.d.ts +4 -0
- package/dist/domain/services/domain-events.d.ts +60 -0
- package/dist/domain/services/execution-planner.domain-service.d.ts +40 -0
- package/dist/domain/services/index.d.ts +9 -0
- package/dist/domain/services/schema-inference.domain-service.d.ts +54 -0
- package/dist/domain/value-objects/entity-id.d.ts +26 -0
- package/dist/domain/value-objects/http-method.d.ts +30 -0
- package/dist/domain/value-objects/index.d.ts +9 -0
- package/dist/domain/value-objects/request-url.d.ts +28 -0
- package/dist/index.d.ts +90 -84
- package/dist/index.js +187 -187
- package/dist/index.mjs +187 -187
- package/dist/infrastructure/adapters/index.d.ts +5 -0
- package/dist/infrastructure/adapters/logger.adapter.d.ts +25 -0
- package/dist/infrastructure/adapters/node-file-system.adapter.d.ts +18 -0
- package/dist/{auth → infrastructure/auth}/interfaces.d.ts +1 -1
- package/dist/{auth → infrastructure/auth}/oauth2-token-manager.d.ts +3 -3
- package/dist/{collection → infrastructure/collection}/collection-loader.d.ts +3 -3
- package/dist/{collection → infrastructure/collection}/collection-service.d.ts +2 -2
- package/dist/{collection → infrastructure/collection}/collection-store.d.ts +2 -2
- package/dist/infrastructure/collection/folder-collection-loader.d.ts +45 -0
- package/dist/{collection → infrastructure/collection}/folder-collection-store.d.ts +9 -2
- package/dist/infrastructure/collection/folder-io.d.ts +113 -0
- package/dist/{collection → infrastructure/collection}/json-collection-loader.d.ts +1 -1
- package/dist/{collection → infrastructure/collection}/parser-registry.d.ts +1 -1
- package/dist/{config → infrastructure/config}/config-service.d.ts +1 -1
- package/dist/{cookie → infrastructure/cookie}/cookie-service.d.ts +1 -1
- package/dist/infrastructure/di/complete-bootstrap.d.ts +24 -0
- package/dist/infrastructure/di/index.d.ts +6 -0
- package/dist/infrastructure/di/infrastructure-di-config.d.ts +33 -0
- package/dist/infrastructure/di/simple-event-publisher.d.ts +17 -0
- package/dist/{environment → infrastructure/environment}/environment-config-service.d.ts +6 -3
- package/dist/infrastructure/environment/environment-file-loader.d.ts +42 -0
- package/dist/{environment → infrastructure/environment}/environment-resolver.d.ts +1 -1
- package/dist/{environment → infrastructure/environment}/forge-env.d.ts +1 -1
- package/dist/{environment → infrastructure/environment}/variable-interpolator.d.ts +1 -1
- package/dist/{execution → infrastructure/execution}/collection-request-executor-interfaces.d.ts +1 -1
- package/dist/{execution → infrastructure/execution}/collection-request-executor.d.ts +3 -3
- package/dist/{execution → infrastructure/execution}/request-executor.d.ts +4 -4
- package/dist/{execution → infrastructure/execution}/request-preparer-interfaces.d.ts +2 -2
- package/dist/{execution → infrastructure/execution}/request-preparer.d.ts +5 -5
- package/dist/{graphql → infrastructure/graphql}/graphql-schema-service.d.ts +1 -1
- package/dist/{history → infrastructure/history}/history-interfaces.d.ts +1 -1
- package/dist/{history → infrastructure/history}/request-history.d.ts +1 -1
- package/dist/{http → infrastructure/http}/fetch-http-client.d.ts +2 -2
- package/dist/{http → infrastructure/http}/http-request-service.d.ts +2 -2
- package/dist/infrastructure/http/index.d.ts +4 -0
- package/dist/{http → infrastructure/http}/interceptor-chain.d.ts +1 -1
- package/dist/{http → infrastructure/http}/interfaces.d.ts +1 -1
- package/dist/{http → infrastructure/http}/merge-request-settings.d.ts +1 -1
- package/dist/{http → infrastructure/http}/native-http-client.d.ts +2 -2
- package/dist/infrastructure/http/node-http-executor.adapter.d.ts +25 -0
- package/dist/{http → infrastructure/http}/request-preprocessor.d.ts +1 -1
- package/dist/{import-export → infrastructure/import-export}/import-postman-environment.d.ts +3 -3
- package/dist/{import-export → infrastructure/import-export}/rest-client-export.d.ts +3 -3
- package/dist/infrastructure/index.d.ts +31 -0
- package/dist/{openapi → infrastructure/openapi}/example-generator.d.ts +1 -1
- package/dist/{openapi → infrastructure/openapi}/history-analyzer.d.ts +1 -1
- package/dist/{openapi → infrastructure/openapi}/interfaces.d.ts +2 -2
- package/dist/{openapi → infrastructure/openapi}/openapi-exporter.d.ts +2 -2
- package/dist/{openapi → infrastructure/openapi}/openapi-importer.d.ts +2 -2
- package/dist/{openapi → infrastructure/openapi}/schema-inference-service.d.ts +1 -1
- package/dist/{openapi → infrastructure/openapi}/schema-inferrer.d.ts +1 -1
- package/dist/infrastructure/parsers/collection-parser.adapter.d.ts +32 -0
- package/dist/{parsers → infrastructure/parsers}/http-forge-parser.d.ts +2 -2
- package/dist/infrastructure/parsers/index.d.ts +7 -0
- package/dist/infrastructure/persistence/file-system-history-loader.d.ts +31 -0
- package/dist/infrastructure/persistence/index.d.ts +6 -0
- package/dist/{platform → infrastructure/platform}/node-file-system.d.ts +1 -1
- package/dist/infrastructure/repositories/file-system/fs-collection-repository.d.ts +72 -0
- package/dist/infrastructure/repositories/file-system/fs-environment-file-loader.adapter.d.ts +41 -0
- package/dist/infrastructure/repositories/file-system/fs-environment-repository.d.ts +34 -0
- package/dist/infrastructure/repositories/file-system/fs-request-repository.d.ts +31 -0
- package/dist/infrastructure/repositories/file-system/index.d.ts +7 -0
- package/dist/infrastructure/repositories/in-memory/in-memory-collection-repository.d.ts +18 -0
- package/dist/infrastructure/repositories/in-memory/in-memory-environment-repository.d.ts +25 -0
- package/dist/infrastructure/repositories/in-memory/in-memory-request-repository.d.ts +25 -0
- package/dist/infrastructure/repositories/in-memory/index.d.ts +7 -0
- package/dist/infrastructure/script/index.d.ts +4 -0
- package/dist/{script → infrastructure/script}/interfaces.d.ts +13 -1
- package/dist/{script → infrastructure/script}/request-script-session.d.ts +3 -0
- package/dist/{script → infrastructure/script}/script-factories.d.ts +15 -4
- package/dist/{script → infrastructure/script}/script-utils.d.ts +3 -2
- package/dist/infrastructure/script/vm-script-executor.adapter.d.ts +19 -0
- package/dist/{test-suite → infrastructure/test-suite}/result-storage-service.d.ts +1 -1
- package/dist/{test-suite → infrastructure/test-suite}/result-storage.d.ts +1 -1
- package/dist/{test-suite → infrastructure/test-suite}/test-suite-service.d.ts +1 -1
- package/dist/{test-suite → infrastructure/test-suite}/test-suite-store.d.ts +1 -1
- package/dist/ports/executors/http-executor.interface.d.ts +34 -0
- package/dist/ports/executors/index.d.ts +5 -0
- package/dist/ports/executors/script-executor.interface.d.ts +43 -0
- package/dist/ports/external/file-system.interface.d.ts +44 -0
- package/dist/ports/external/http-client.interface.d.ts +25 -0
- package/dist/ports/external/index.d.ts +7 -0
- package/dist/ports/external/logger.interface.d.ts +17 -0
- package/dist/ports/index.d.ts +17 -0
- package/dist/ports/parsers/collection-parser.interface.d.ts +23 -0
- package/dist/ports/parsers/index.d.ts +4 -0
- package/dist/ports/repositories/collection-repository.interface.d.ts +32 -0
- package/dist/ports/repositories/environment-repository.interface.d.ts +31 -0
- package/dist/ports/repositories/index.d.ts +6 -0
- package/dist/ports/repositories/request-repository.interface.d.ts +32 -0
- package/dist/ports/storage/cache-store.interface.d.ts +26 -0
- package/dist/ports/storage/history-loader.interface.d.ts +37 -0
- package/dist/ports/storage/index.d.ts +5 -0
- package/dist/{collection/collection-service-interfaces.d.ts → types/collection.d.ts} +19 -4
- package/dist/types/environment-config.d.ts +143 -0
- package/dist/types/types.d.ts +27 -7
- package/package.json +2 -2
- package/dist/collection/folder-collection-loader.d.ts +0 -256
- package/dist/collection/interfaces.d.ts +0 -32
- package/dist/parsers/index.d.ts +0 -6
- package/dist/{collection → infrastructure/collection}/collection-loader-factory.d.ts +1 -1
- package/dist/{config → infrastructure/config}/config.interface.d.ts +0 -0
- package/dist/{config → infrastructure/config}/default-config.d.ts +0 -0
- package/dist/{config → infrastructure/config}/index.d.ts +0 -0
- package/dist/{cookie → infrastructure/cookie}/cookie-jar.d.ts +0 -0
- package/dist/{cookie → infrastructure/cookie}/cookie-utils.d.ts +0 -0
- package/dist/{cookie → infrastructure/cookie}/in-memory-cookie-jar.d.ts +1 -1
- package/dist/{cookie → infrastructure/cookie}/interfaces.d.ts +0 -0
- package/dist/{cookie → infrastructure/cookie}/persistent-cookie-jar.d.ts +1 -1
- package/dist/{environment → infrastructure/environment}/interfaces.d.ts +0 -0
- package/dist/{graphql → infrastructure/graphql}/graphql-completion-provider.d.ts +0 -0
- package/dist/{history → infrastructure/history}/request-history-service-interfaces.d.ts +0 -0
- package/dist/{history → infrastructure/history}/request-history-service.d.ts +0 -0
- package/dist/{http → infrastructure/http}/url-builder.d.ts +0 -0
- package/dist/{openapi → infrastructure/openapi}/index.d.ts +0 -0
- package/dist/{openapi → infrastructure/openapi}/ref-resolver.d.ts +0 -0
- package/dist/{openapi → infrastructure/openapi}/script-analyzer.d.ts +0 -0
- package/dist/{platform → infrastructure/platform}/data-file-parser.d.ts +0 -0
- package/dist/{script → infrastructure/script}/module-loader.d.ts +0 -0
- package/dist/{script → infrastructure/script}/script-executor.d.ts +1 -1
- /package/dist/{test-suite → infrastructure/test-suite}/index.d.ts +0 -0
- /package/dist/{test-suite → infrastructure/test-suite}/interfaces.d.ts +0 -0
- /package/dist/{test-suite → infrastructure/test-suite}/statistics-service.d.ts +0 -0
package/README.md
CHANGED
|
@@ -11,11 +11,14 @@
|
|
|
11
11
|
|
|
12
12
|
**Core Features:**
|
|
13
13
|
- 🚀 **Postman Collections** - Load and execute `.postman_collection.json` and `.forge.json` files
|
|
14
|
-
- 📝 **JavaScript Scripting** - Pre-request and post-response scripts with `pm.*` API (
|
|
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
|
-
- 🌍 **Environments** - Full variable scoping (globals, collection, environment, session,
|
|
17
|
-
- 🍪 **Cookie Persistence** - Automatic cookie storage and reuse
|
|
18
|
-
- 📊 **Test Assertions** - BDD-style testing with `pm.test()` and `expect()` chains
|
|
16
|
+
- 🌍 **Environments** - Full variable scoping (globals, collection, environment, session, iterationData)
|
|
17
|
+
- 🍪 **Cookie Persistence** - Automatic cookie storage and reuse, `pm.cookies.jar()` and `.toObject()`
|
|
18
|
+
- 📊 **Test Assertions** - BDD-style testing with `pm.test()` (sync/async) and full Chai `expect()` chains
|
|
19
|
+
- 🔐 **CryptoJS** - Full crypto library: hash, HMAC, AES/DES/TripleDES, PBKDF2, encoding helpers
|
|
20
|
+
- 🎯 **Execution Flow** - `pm.setNextRequest()`, `pm.execution.skipRequest()` for suite runner flow control
|
|
21
|
+
- 📈 **Visualizer** - `pm.visualizer.set(template, data)` for custom Handlebars-based HTML output
|
|
19
22
|
- 🔌 **Extensible** - Custom interceptors, HTTP clients, and module loaders
|
|
20
23
|
|
|
21
24
|
**Ideal for:**
|
|
@@ -634,6 +637,24 @@ MIT © Henry Huang
|
|
|
634
637
|
|
|
635
638
|
## 📝 Changelog
|
|
636
639
|
|
|
640
|
+
### 0.2.0 (Postman API Parity)
|
|
641
|
+
|
|
642
|
+
- ✅ **Async `pm.test()` support** - Tests with async callbacks are properly awaited
|
|
643
|
+
- ✅ **Expect chain assertions** - `.a(type)`, `.an(type)`, `.deep.equal()`, `.lengthOf()`, `.exist`, `.members()`, `.keys()`, `.string()`
|
|
644
|
+
- ✅ **`pm.iterationData`** scope - Data-driven testing with iteration variables
|
|
645
|
+
- ✅ **Response status getters** - `response.to.be.ok`, `.error`, `.clientError`, `.serverError` work as getters and functions
|
|
646
|
+
- ✅ **Response headers HeaderList** - `.get()`, `.has()`, `.toObject()`, `.each()` on `pm.response.headers`
|
|
647
|
+
- ✅ **`pm.cookies.toObject()`** - Flat `{name: value}` cookie map
|
|
648
|
+
- ✅ **`replaceIn()` on all scopes** - Available on `pm.variables`, `pm.environment`, `pm.collectionVariables`, `pm.globals`
|
|
649
|
+
- ✅ **Sandbox globals** - `xml2Json()`, `jsonStringify()`, `jsonParse()` available in scripts
|
|
650
|
+
- ✅ **Request headers API** - `.toObject()`, `.each()` on `pm.request.headers`
|
|
651
|
+
- ✅ **`pm.execution.setNextRequest()`** - Runner flow control (jump to named request or stop with `null`)
|
|
652
|
+
- ✅ **`pm.execution.skipRequest()`** - Skip HTTP call from pre-request scripts
|
|
653
|
+
- ✅ **`pm.setNextRequest()`** - Top-level alias for flow control
|
|
654
|
+
- ✅ **`pm.visualizer.set(template, data)`** - Custom HTML visualization with Handlebars templates
|
|
655
|
+
- ✅ **`pm.request.url` as Url object** - Postman SDK-compatible Url with `getHost()`, `getPath()`, `getQueryString()`, `protocol`, `host`, `port`, `path`, `query`, `hash`
|
|
656
|
+
- ✅ **Full CryptoJS** - AES/DES/TripleDES encrypt/decrypt, PBKDF2, all hash algorithms (SHA1/256/384/512/SHA3/MD5/RIPEMD160), HMAC, encoding helpers (Hex/Base64/Utf8/Latin1/Utf16)
|
|
657
|
+
|
|
637
658
|
### 0.1.0 (Initial Release)
|
|
638
659
|
|
|
639
660
|
- ✅ **Core request execution** with Postman collection support
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application DTOs
|
|
3
|
+
*
|
|
4
|
+
* Data Transfer Objects decouple use-case inputs/outputs
|
|
5
|
+
* from domain internals and infrastructure types.
|
|
6
|
+
*/
|
|
7
|
+
export type { CreateRequestInput, UpdateRequestInput, DeleteRequestInput, ListRequestsInput, GetCollectionInput, ExecuteRequestInput, LoadCollectionInput, SaveCollectionInput, ExportCollectionInput, GetRequestSchemaInput, ExportFormat, } from './request-dtos';
|
|
8
|
+
export type { RequestSummaryDto, RequestDetailDto, CollectionSummaryDto, CollectionDetailDto, CollectionItemDto, ScriptResultDto, AssertionResultDto, ExecuteRequestOutput, RequestSchemaOutput, CreateRequestOutput, UpdateRequestOutput, DeleteRequestOutput, SaveCollectionOutput, ExportCollectionOutput, LoadCollectionOutput, ListRequestsOutput, GetCollectionOutput, } from './response-dtos';
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application DTOs — Request Input Types
|
|
3
|
+
*
|
|
4
|
+
* Standardized input objects for all use-cases.
|
|
5
|
+
* These decouple the public API from internal domain types.
|
|
6
|
+
*/
|
|
7
|
+
import { BodySchemaDefinition, KeyValueEntry, PathParamEntry, RequestBody, RequestScripts, RequestSettings, ResponseSchemaDefinition } from '../../types/types';
|
|
8
|
+
export interface CreateRequestInput {
|
|
9
|
+
collectionId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
method: string;
|
|
12
|
+
url: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
/** Headers with enabled/disabled flag */
|
|
15
|
+
headers?: KeyValueEntry[];
|
|
16
|
+
/** Query parameters with enabled/disabled flag */
|
|
17
|
+
query?: KeyValueEntry[];
|
|
18
|
+
/** Path parameters */
|
|
19
|
+
params?: Record<string, string | PathParamEntry>;
|
|
20
|
+
/** Request body - supports raw, form-data, url-encoded, graphql, binary, or none */
|
|
21
|
+
body?: RequestBody;
|
|
22
|
+
/** Content-Type override */
|
|
23
|
+
bodyContentType?: string;
|
|
24
|
+
/** Request-level settings */
|
|
25
|
+
settings?: RequestSettings;
|
|
26
|
+
/** Request scripts (pre/post) */
|
|
27
|
+
scripts?: RequestScripts;
|
|
28
|
+
/** Authentication config (basic, bearer, apikey - no oauth2 at collection level) */
|
|
29
|
+
auth?: any;
|
|
30
|
+
/** Mark as disabled */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** Mark as deprecated */
|
|
33
|
+
deprecated?: boolean;
|
|
34
|
+
/** Response schema */
|
|
35
|
+
responseSchema?: ResponseSchemaDefinition;
|
|
36
|
+
/** Body schema */
|
|
37
|
+
bodySchema?: BodySchemaDefinition;
|
|
38
|
+
}
|
|
39
|
+
export interface UpdateRequestInput {
|
|
40
|
+
collectionId: string;
|
|
41
|
+
requestId: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
method?: string;
|
|
44
|
+
url?: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
/** Headers with enabled/disabled flag */
|
|
47
|
+
headers?: KeyValueEntry[];
|
|
48
|
+
/** Query parameters with enabled/disabled flag */
|
|
49
|
+
query?: KeyValueEntry[];
|
|
50
|
+
/** Path parameters */
|
|
51
|
+
params?: Record<string, string | PathParamEntry>;
|
|
52
|
+
/** Request body - supports raw, form-data, url-encoded, graphql, binary, or none */
|
|
53
|
+
body?: RequestBody;
|
|
54
|
+
/** Content-Type override */
|
|
55
|
+
bodyContentType?: string;
|
|
56
|
+
/** Request-level settings */
|
|
57
|
+
settings?: RequestSettings;
|
|
58
|
+
/** Request scripts (pre/post) */
|
|
59
|
+
scripts?: RequestScripts;
|
|
60
|
+
/** Authentication config (basic, bearer, apikey - no oauth2 at collection level) */
|
|
61
|
+
auth?: any;
|
|
62
|
+
/** Mark as disabled */
|
|
63
|
+
disabled?: boolean;
|
|
64
|
+
/** Mark as deprecated */
|
|
65
|
+
deprecated?: boolean;
|
|
66
|
+
/** Response schema */
|
|
67
|
+
responseSchema?: ResponseSchemaDefinition;
|
|
68
|
+
/** Body schema */
|
|
69
|
+
bodySchema?: BodySchemaDefinition;
|
|
70
|
+
}
|
|
71
|
+
export interface DeleteRequestInput {
|
|
72
|
+
collectionId: string;
|
|
73
|
+
requestId: string;
|
|
74
|
+
}
|
|
75
|
+
export interface ListRequestsInput {
|
|
76
|
+
collectionId: string;
|
|
77
|
+
}
|
|
78
|
+
export interface GetCollectionInput {
|
|
79
|
+
collectionId: string;
|
|
80
|
+
}
|
|
81
|
+
export interface ExecuteRequestInput {
|
|
82
|
+
collectionId: string;
|
|
83
|
+
requestId: string;
|
|
84
|
+
overrides?: {
|
|
85
|
+
variables?: Record<string, any>;
|
|
86
|
+
environment?: Record<string, any>;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export interface LoadCollectionInput {
|
|
90
|
+
filePath: string;
|
|
91
|
+
}
|
|
92
|
+
export interface SaveCollectionInput {
|
|
93
|
+
filePath: string;
|
|
94
|
+
collectionId: string;
|
|
95
|
+
}
|
|
96
|
+
export type ExportFormat = 'postman' | 'openapi';
|
|
97
|
+
export interface ExportCollectionInput {
|
|
98
|
+
collectionId: string;
|
|
99
|
+
format: ExportFormat;
|
|
100
|
+
outputPath: string;
|
|
101
|
+
}
|
|
102
|
+
export interface GetRequestSchemaInput {
|
|
103
|
+
collectionId: string;
|
|
104
|
+
requestId: string;
|
|
105
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application DTOs — Response Output Types
|
|
3
|
+
*
|
|
4
|
+
* Standardized output objects for all use-cases.
|
|
5
|
+
* These shield consumers from internal domain model changes.
|
|
6
|
+
*/
|
|
7
|
+
import { BodySchemaDefinition, KeyValueEntry, RequestBody, RequestScripts, RequestSettings, ResponseSchemaDefinition } from '../../types/types';
|
|
8
|
+
export interface RequestSummaryDto {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
method: string;
|
|
12
|
+
url: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
deprecated?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface RequestDetailDto {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
method: string;
|
|
21
|
+
url: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
/** Headers with per-header enabled/disabled flag */
|
|
24
|
+
headers: KeyValueEntry[];
|
|
25
|
+
/** Query parameters with per-item enabled/disabled flag */
|
|
26
|
+
query: KeyValueEntry[];
|
|
27
|
+
body?: RequestBody;
|
|
28
|
+
bodyContentType?: string;
|
|
29
|
+
auth?: any;
|
|
30
|
+
settings?: RequestSettings;
|
|
31
|
+
scripts?: RequestScripts;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
deprecated?: boolean;
|
|
34
|
+
responseSchema?: ResponseSchemaDefinition;
|
|
35
|
+
bodySchema?: BodySchemaDefinition;
|
|
36
|
+
hasPreScript: boolean;
|
|
37
|
+
hasPostScript: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface CollectionSummaryDto {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
requestCount: number;
|
|
44
|
+
folderCount: number;
|
|
45
|
+
}
|
|
46
|
+
export interface CollectionItemDto {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
type: 'request' | 'folder';
|
|
50
|
+
method?: string;
|
|
51
|
+
url?: string;
|
|
52
|
+
childCount?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface CollectionDetailDto {
|
|
55
|
+
id: string;
|
|
56
|
+
name: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
items: CollectionItemDto[];
|
|
59
|
+
requestCount: number;
|
|
60
|
+
folderCount: number;
|
|
61
|
+
meta?: Record<string, any>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Full Collection Detail with all nested request/folder metadata
|
|
65
|
+
* Used by LoadCollectionUseCase to return COMPLETE data (not filtered)
|
|
66
|
+
*/
|
|
67
|
+
export interface CollectionFullDetailDto {
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
/** Full nested structure with all request/folder metadata preserved */
|
|
72
|
+
items: (CollectionFullItemDto)[];
|
|
73
|
+
variables?: Record<string, string>;
|
|
74
|
+
auth?: any;
|
|
75
|
+
scripts?: RequestScripts;
|
|
76
|
+
meta?: Record<string, any>;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Full collection item (request or folder) with ALL metadata
|
|
80
|
+
*/
|
|
81
|
+
export type CollectionFullItemDto = CollectionFullRequestDto | CollectionFullFolderDto;
|
|
82
|
+
/**
|
|
83
|
+
* Full request DTO with all fields preserved (headers, query, body, scripts, etc.)
|
|
84
|
+
*/
|
|
85
|
+
export interface CollectionFullRequestDto {
|
|
86
|
+
type: 'request';
|
|
87
|
+
id: string;
|
|
88
|
+
name: string;
|
|
89
|
+
method: string;
|
|
90
|
+
url: string;
|
|
91
|
+
description?: string;
|
|
92
|
+
headers: KeyValueEntry[];
|
|
93
|
+
query: KeyValueEntry[];
|
|
94
|
+
body?: RequestBody;
|
|
95
|
+
bodyContentType?: string;
|
|
96
|
+
auth?: any;
|
|
97
|
+
settings?: RequestSettings;
|
|
98
|
+
scripts?: RequestScripts;
|
|
99
|
+
disabled?: boolean;
|
|
100
|
+
deprecated?: boolean;
|
|
101
|
+
responseSchema?: ResponseSchemaDefinition;
|
|
102
|
+
bodySchema?: BodySchemaDefinition;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Full folder DTO with nested items preserved
|
|
106
|
+
*/
|
|
107
|
+
export interface CollectionFullFolderDto {
|
|
108
|
+
type: 'folder';
|
|
109
|
+
id: string;
|
|
110
|
+
name: string;
|
|
111
|
+
description?: string;
|
|
112
|
+
auth?: any;
|
|
113
|
+
scripts?: RequestScripts;
|
|
114
|
+
items: (CollectionFullItemDto)[];
|
|
115
|
+
}
|
|
116
|
+
export interface ScriptResultDto {
|
|
117
|
+
success: boolean;
|
|
118
|
+
output?: any;
|
|
119
|
+
errors: string[];
|
|
120
|
+
}
|
|
121
|
+
export interface AssertionResultDto {
|
|
122
|
+
name: string;
|
|
123
|
+
passed: boolean;
|
|
124
|
+
expected?: any;
|
|
125
|
+
actual?: any;
|
|
126
|
+
message?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface ExecuteRequestOutput {
|
|
129
|
+
requestId: string;
|
|
130
|
+
status: 'success' | 'failed' | 'partial';
|
|
131
|
+
duration: number;
|
|
132
|
+
response: {
|
|
133
|
+
status: number;
|
|
134
|
+
statusText: string;
|
|
135
|
+
headers: Record<string, string | string[]>;
|
|
136
|
+
bodySize?: number;
|
|
137
|
+
};
|
|
138
|
+
preScriptResult?: ScriptResultDto;
|
|
139
|
+
postScriptResult?: ScriptResultDto & {
|
|
140
|
+
assertions?: AssertionResultDto[];
|
|
141
|
+
};
|
|
142
|
+
variableChanges?: Record<string, any>;
|
|
143
|
+
error?: string;
|
|
144
|
+
}
|
|
145
|
+
export interface RequestSchemaOutput {
|
|
146
|
+
requestId: string;
|
|
147
|
+
schema: any;
|
|
148
|
+
sources: ('user' | 'history' | 'script')[];
|
|
149
|
+
confidence: 'high' | 'medium' | 'low';
|
|
150
|
+
}
|
|
151
|
+
export interface CreateRequestOutput {
|
|
152
|
+
request: RequestDetailDto;
|
|
153
|
+
}
|
|
154
|
+
export interface UpdateRequestOutput {
|
|
155
|
+
request: RequestDetailDto;
|
|
156
|
+
}
|
|
157
|
+
export interface DeleteRequestOutput {
|
|
158
|
+
requestId: string;
|
|
159
|
+
collectionId: string;
|
|
160
|
+
deletedAt: string;
|
|
161
|
+
}
|
|
162
|
+
export interface SaveCollectionOutput {
|
|
163
|
+
filePath: string;
|
|
164
|
+
collectionName: string;
|
|
165
|
+
savedAt: string;
|
|
166
|
+
}
|
|
167
|
+
export interface ExportCollectionOutput {
|
|
168
|
+
collectionId: string;
|
|
169
|
+
format: string;
|
|
170
|
+
outputPath: string;
|
|
171
|
+
exportedAt: string;
|
|
172
|
+
}
|
|
173
|
+
export interface LoadCollectionOutput {
|
|
174
|
+
/** Full collection with ALL nested metadata preserved */
|
|
175
|
+
collection: CollectionFullDetailDto;
|
|
176
|
+
loadedFrom: string;
|
|
177
|
+
}
|
|
178
|
+
export interface ListRequestsOutput {
|
|
179
|
+
collectionId: string;
|
|
180
|
+
requests: RequestSummaryDto[];
|
|
181
|
+
total: number;
|
|
182
|
+
}
|
|
183
|
+
export interface GetCollectionOutput {
|
|
184
|
+
collection: CollectionDetailDto;
|
|
185
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application Events
|
|
3
|
+
*
|
|
4
|
+
* Higher-level events published by use-cases to notify the outer system
|
|
5
|
+
* (e.g. VS Code extension, CLI) about completed operations.
|
|
6
|
+
*
|
|
7
|
+
* These are distinct from domain events:
|
|
8
|
+
* - Domain events: model business invariants (RequestExecutedEvent, VariableUpdatedEvent)
|
|
9
|
+
* - Application events: notify about user actions (RequestCreatedEvent, CollectionExportedEvent)
|
|
10
|
+
*/
|
|
11
|
+
import { DomainEvent } from '../../domain/services/domain-events';
|
|
12
|
+
export declare class RequestCreatedEvent extends DomainEvent {
|
|
13
|
+
readonly collectionId: string;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly method: string;
|
|
16
|
+
readonly url: string;
|
|
17
|
+
constructor(requestId: string, collectionId: string, name: string, method: string, url: string);
|
|
18
|
+
}
|
|
19
|
+
export declare class RequestUpdatedEvent extends DomainEvent {
|
|
20
|
+
readonly collectionId: string;
|
|
21
|
+
readonly changes: string[];
|
|
22
|
+
constructor(requestId: string, collectionId: string, changes: string[]);
|
|
23
|
+
}
|
|
24
|
+
export declare class RequestDeletedEvent extends DomainEvent {
|
|
25
|
+
readonly collectionId: string;
|
|
26
|
+
constructor(requestId: string, collectionId: string);
|
|
27
|
+
}
|
|
28
|
+
export declare class CollectionLoadedEvent extends DomainEvent {
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly source: string;
|
|
31
|
+
readonly requestCount: number;
|
|
32
|
+
constructor(collectionId: string, name: string, source: string, // file path or identifier
|
|
33
|
+
requestCount: number);
|
|
34
|
+
}
|
|
35
|
+
export declare class CollectionSavedEvent extends DomainEvent {
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly filePath: string;
|
|
38
|
+
constructor(collectionId: string, name: string, filePath: string);
|
|
39
|
+
}
|
|
40
|
+
export declare class CollectionExportedEvent extends DomainEvent {
|
|
41
|
+
readonly format: string;
|
|
42
|
+
readonly outputPath: string;
|
|
43
|
+
constructor(collectionId: string, format: string, outputPath: string);
|
|
44
|
+
}
|
|
45
|
+
export declare const ApplicationEventTypes: {
|
|
46
|
+
readonly REQUEST_CREATED: "REQUEST_CREATED";
|
|
47
|
+
readonly REQUEST_UPDATED: "REQUEST_UPDATED";
|
|
48
|
+
readonly REQUEST_DELETED: "REQUEST_DELETED";
|
|
49
|
+
readonly COLLECTION_LOADED: "COLLECTION_LOADED";
|
|
50
|
+
readonly COLLECTION_SAVED: "COLLECTION_SAVED";
|
|
51
|
+
readonly COLLECTION_EXPORTED: "COLLECTION_EXPORTED";
|
|
52
|
+
};
|
|
53
|
+
export type ApplicationEventType = typeof ApplicationEventTypes[keyof typeof ApplicationEventTypes];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application Events
|
|
3
|
+
*
|
|
4
|
+
* Events published by use-cases to notify about completed user actions.
|
|
5
|
+
*/
|
|
6
|
+
export { RequestCreatedEvent, RequestUpdatedEvent, RequestDeletedEvent, CollectionLoadedEvent, CollectionSavedEvent, CollectionExportedEvent, ApplicationEventTypes, type ApplicationEventType, } from './application-events';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application Layer - Use Cases and Queries
|
|
3
|
+
*
|
|
4
|
+
* Contains:
|
|
5
|
+
* - Use Cases (commands that modify state)
|
|
6
|
+
* - Queries (read-only operations)
|
|
7
|
+
* - Data Transfer Objects (DTOs)
|
|
8
|
+
* - Application Events
|
|
9
|
+
* - Mappers (domain ↔ DTO conversion)
|
|
10
|
+
*
|
|
11
|
+
* Constraints:
|
|
12
|
+
* - Depends on Domain and Ports layers
|
|
13
|
+
* - Orchestrates between Domain and Infrastructure
|
|
14
|
+
* - Never directly depends on Infrastructure implementations
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* - Called by controllers/handlers
|
|
18
|
+
* - Uses repositories and executors from ports
|
|
19
|
+
* - Publishes domain events
|
|
20
|
+
*/
|
|
21
|
+
export * from './use-cases';
|
|
22
|
+
export * from './queries';
|
|
23
|
+
export * from './dto';
|
|
24
|
+
export * from './events';
|
|
25
|
+
export * from './mappers';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CollectionMapper
|
|
3
|
+
*
|
|
4
|
+
* Maps between UnifiedCollection (domain/infrastructure type) and
|
|
5
|
+
* application-layer DTOs (CollectionDetailDto, CollectionSummaryDto, CollectionFullDetailDto).
|
|
6
|
+
*
|
|
7
|
+
* Provides two mapping strategies:
|
|
8
|
+
* - toDetail() / toSummary() - Filtered summaries for list/UI views
|
|
9
|
+
* - toFullDetail() - Complete metadata for full collection operations (load, edit)
|
|
10
|
+
*/
|
|
11
|
+
import { UnifiedCollection } from '../../types/types';
|
|
12
|
+
import { CollectionDetailDto, CollectionFullDetailDto, CollectionSummaryDto } from '../dto/response-dtos';
|
|
13
|
+
export declare class CollectionMapper {
|
|
14
|
+
/**
|
|
15
|
+
* Map domain collection to a summary DTO
|
|
16
|
+
*/
|
|
17
|
+
static toSummary(collection: UnifiedCollection): CollectionSummaryDto;
|
|
18
|
+
/**
|
|
19
|
+
* Map domain collection to a full detail DTO
|
|
20
|
+
*/
|
|
21
|
+
static toDetail(collection: UnifiedCollection): CollectionDetailDto;
|
|
22
|
+
/**
|
|
23
|
+
* Map domain collection to a full detail DTO (preserves ALL metadata)
|
|
24
|
+
* Used by LoadCollectionUseCase to return complete collection with all fields
|
|
25
|
+
*/
|
|
26
|
+
static toFullDetail(collection: UnifiedCollection): CollectionFullDetailDto;
|
|
27
|
+
/**
|
|
28
|
+
* Map top-level items to full detail items (preserves ALL metadata per request/folder)
|
|
29
|
+
*/
|
|
30
|
+
private static toFullItems;
|
|
31
|
+
/**
|
|
32
|
+
* Map top-level items to flat CollectionItemDto list
|
|
33
|
+
*/
|
|
34
|
+
private static mapItems;
|
|
35
|
+
/**
|
|
36
|
+
* Recursively count requests and folders
|
|
37
|
+
*/
|
|
38
|
+
private static countItems;
|
|
39
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExecutionResultMapper
|
|
3
|
+
*
|
|
4
|
+
* Maps between IExecutionResult (domain model) and
|
|
5
|
+
* ExecuteRequestOutput (application DTO).
|
|
6
|
+
*/
|
|
7
|
+
import { IExecutionResult } from '../../domain/models/execution';
|
|
8
|
+
import { ExecuteRequestOutput } from '../dto/response-dtos';
|
|
9
|
+
export declare class ExecutionResultMapper {
|
|
10
|
+
/**
|
|
11
|
+
* Map domain execution result to application-layer output DTO
|
|
12
|
+
*/
|
|
13
|
+
static toOutput(result: IExecutionResult): ExecuteRequestOutput;
|
|
14
|
+
private static mapScriptResult;
|
|
15
|
+
private static mapAssertion;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application Mappers
|
|
3
|
+
*
|
|
4
|
+
* Convert between domain types and application DTOs.
|
|
5
|
+
* Mappers formalize the boundary between layers.
|
|
6
|
+
*/
|
|
7
|
+
export { RequestMapper } from './request-mapper';
|
|
8
|
+
export { CollectionMapper } from './collection-mapper';
|
|
9
|
+
export { ExecutionResultMapper } from './execution-result-mapper';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RequestMapper
|
|
3
|
+
*
|
|
4
|
+
* Maps between UnifiedRequest (domain/infrastructure type) and
|
|
5
|
+
* application-layer DTOs (RequestDetailDto, RequestSummaryDto).
|
|
6
|
+
*
|
|
7
|
+
* Preserves all metadata including enabled/disabled flags and schemas.
|
|
8
|
+
*/
|
|
9
|
+
import { UnifiedRequest } from '../../types/types';
|
|
10
|
+
import { RequestDetailDto, RequestSummaryDto } from '../dto/response-dtos';
|
|
11
|
+
export declare class RequestMapper {
|
|
12
|
+
/**
|
|
13
|
+
* Map domain request to a lightweight summary DTO
|
|
14
|
+
*/
|
|
15
|
+
static toSummary(request: UnifiedRequest): RequestSummaryDto;
|
|
16
|
+
/**
|
|
17
|
+
* Map domain request to a full detail DTO
|
|
18
|
+
* PRESERVES all metadata including enabled/disabled headers and schemas
|
|
19
|
+
*/
|
|
20
|
+
static toDetail(request: UnifiedRequest): RequestDetailDto;
|
|
21
|
+
/**
|
|
22
|
+
* Map multiple requests to summaries
|
|
23
|
+
*/
|
|
24
|
+
static toSummaryList(requests: UnifiedRequest[]): RequestSummaryDto[];
|
|
25
|
+
/**
|
|
26
|
+
* Map multiple requests to details
|
|
27
|
+
*/
|
|
28
|
+
static toDetailList(requests: UnifiedRequest[]): RequestDetailDto[];
|
|
29
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get Request Schema Query
|
|
3
|
+
*
|
|
4
|
+
* Retrieves inferred response schema for a request
|
|
5
|
+
* Merges information from: user definition, history, script hints
|
|
6
|
+
*/
|
|
7
|
+
import { IRequestRepository } from '../../ports/repositories/request-repository.interface';
|
|
8
|
+
import { IHistoryLoader } from '../../ports/storage/history-loader.interface';
|
|
9
|
+
import { ResponseSchema } from '../../domain/services/schema-inference.domain-service';
|
|
10
|
+
import { ILogger } from '../../ports/external/logger.interface';
|
|
11
|
+
/**
|
|
12
|
+
* Query: Get request response schema
|
|
13
|
+
*/
|
|
14
|
+
export declare class GetRequestSchemaQuery {
|
|
15
|
+
private requestRepository;
|
|
16
|
+
private historyLoader;
|
|
17
|
+
private logger;
|
|
18
|
+
private schemaInference;
|
|
19
|
+
constructor(requestRepository: IRequestRepository, historyLoader: IHistoryLoader, logger: ILogger);
|
|
20
|
+
/**
|
|
21
|
+
* Get combined response schema for a request
|
|
22
|
+
*/
|
|
23
|
+
execute(collectionId: string, requestId: string): Promise<ResponseSchema>;
|
|
24
|
+
/**
|
|
25
|
+
* Infer schema from historical responses
|
|
26
|
+
*/
|
|
27
|
+
private inferFromHistory;
|
|
28
|
+
/**
|
|
29
|
+
* Extract property hints from post-response script
|
|
30
|
+
*/
|
|
31
|
+
private extractScriptHints;
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create Request Use Case
|
|
3
|
+
*
|
|
4
|
+
* Creates a new HTTP request in a collection
|
|
5
|
+
* Supports full request metadata including enabled/disabled headers, schemas, etc.
|
|
6
|
+
*/
|
|
7
|
+
import { IDomainEventPublisher } from '../../domain/services/domain-events';
|
|
8
|
+
import { ILogger } from '../../ports/external/logger.interface';
|
|
9
|
+
import { ICollectionRepository } from '../../ports/repositories/collection-repository.interface';
|
|
10
|
+
import { CreateRequestInput } from '../dto/request-dtos';
|
|
11
|
+
import { CreateRequestOutput } from '../dto/response-dtos';
|
|
12
|
+
export type { CreateRequestInput } from '../dto/request-dtos';
|
|
13
|
+
/**
|
|
14
|
+
* Use Case: Create a new request in collection
|
|
15
|
+
*/
|
|
16
|
+
export declare class CreateRequestUseCase {
|
|
17
|
+
private collectionRepository;
|
|
18
|
+
private eventPublisher;
|
|
19
|
+
private logger;
|
|
20
|
+
constructor(collectionRepository: ICollectionRepository, eventPublisher: IDomainEventPublisher, logger: ILogger);
|
|
21
|
+
execute(input: CreateRequestInput): Promise<CreateRequestOutput>;
|
|
22
|
+
private generateId;
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete Request Use Case
|
|
3
|
+
*/
|
|
4
|
+
import { ICollectionRepository } from '../../ports/repositories/collection-repository.interface';
|
|
5
|
+
import { ILogger } from '../../ports/external/logger.interface';
|
|
6
|
+
import { IDomainEventPublisher } from '../../domain/services/domain-events';
|
|
7
|
+
import { DeleteRequestInput } from '../dto/request-dtos';
|
|
8
|
+
import { DeleteRequestOutput } from '../dto/response-dtos';
|
|
9
|
+
export declare class DeleteRequestUseCase {
|
|
10
|
+
private collectionRepository;
|
|
11
|
+
private eventPublisher;
|
|
12
|
+
private logger;
|
|
13
|
+
constructor(collectionRepository: ICollectionRepository, eventPublisher: IDomainEventPublisher, logger: ILogger);
|
|
14
|
+
execute(input: DeleteRequestInput): Promise<DeleteRequestOutput>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execute Request Use Case - Main business workflow
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates:
|
|
5
|
+
* 1. Load request from repository
|
|
6
|
+
* 2. Prepare execution environment
|
|
7
|
+
* 3. Call domain services for planning
|
|
8
|
+
* 4. Execute HTTP request via infrastructure
|
|
9
|
+
* 5. Handle scripts and variable updates
|
|
10
|
+
* 6. Publish events
|
|
11
|
+
*/
|
|
12
|
+
import { IRequestRepository } from '../../ports/repositories/request-repository.interface';
|
|
13
|
+
import { IEnvironmentRepository } from '../../ports/repositories/environment-repository.interface';
|
|
14
|
+
import { IHttpExecutor } from '../../ports/executors/http-executor.interface';
|
|
15
|
+
import { IScriptExecutor } from '../../ports/executors/script-executor.interface';
|
|
16
|
+
import { IDomainEventPublisher } from '../../domain/services/domain-events';
|
|
17
|
+
import { ILogger } from '../../ports/external/logger.interface';
|
|
18
|
+
import { ExecuteRequestInput } from '../dto/request-dtos';
|
|
19
|
+
import { ExecuteRequestOutput } from '../dto/response-dtos';
|
|
20
|
+
/**
|
|
21
|
+
* Options for request execution (backward compat alias)
|
|
22
|
+
*/
|
|
23
|
+
export type ExecuteRequestOptions = ExecuteRequestInput;
|
|
24
|
+
/**
|
|
25
|
+
* Use Case: Execute a request
|
|
26
|
+
*
|
|
27
|
+
* This is the main business workflow
|
|
28
|
+
*/
|
|
29
|
+
export declare class ExecuteRequestUseCase {
|
|
30
|
+
private requestRepository;
|
|
31
|
+
private environmentRepository;
|
|
32
|
+
private httpExecutor;
|
|
33
|
+
private scriptExecutor;
|
|
34
|
+
private eventPublisher;
|
|
35
|
+
private logger;
|
|
36
|
+
private planner;
|
|
37
|
+
constructor(requestRepository: IRequestRepository, environmentRepository: IEnvironmentRepository, httpExecutor: IHttpExecutor, scriptExecutor: IScriptExecutor, eventPublisher: IDomainEventPublisher, logger: ILogger);
|
|
38
|
+
/**
|
|
39
|
+
* Execute a request from a collection
|
|
40
|
+
*/
|
|
41
|
+
execute(options: ExecuteRequestInput): Promise<ExecuteRequestOutput>;
|
|
42
|
+
/**
|
|
43
|
+
* Determine overall execution status
|
|
44
|
+
*/
|
|
45
|
+
private determineStatus;
|
|
46
|
+
}
|