@http-forge/core 0.2.13 → 0.2.15
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 +6 -0
- package/dist/index.js +116 -116
- package/dist/index.mjs +114 -114
- package/dist/infrastructure/collection/collection-service.d.ts +3 -0
- package/dist/infrastructure/collection/collection-store.d.ts +5 -1
- package/dist/infrastructure/collection/folder-collection-store.d.ts +4 -0
- package/dist/infrastructure/collection/folder-io.d.ts +1 -0
- package/dist/infrastructure/collection/json-collection-loader.d.ts +5 -0
- package/dist/infrastructure/test-suite/interfaces.d.ts +2 -0
- package/dist/types/collection.d.ts +2 -0
- package/package.json +1 -1
- package/dist/application/dto/index.d.ts +0 -8
- package/dist/application/dto/request-dtos.d.ts +0 -105
- package/dist/application/dto/response-dtos.d.ts +0 -185
- package/dist/application/events/application-events.d.ts +0 -53
- package/dist/application/events/index.d.ts +0 -6
- package/dist/application/index.d.ts +0 -25
- package/dist/application/mappers/collection-mapper.d.ts +0 -39
- package/dist/application/mappers/execution-result-mapper.d.ts +0 -16
- package/dist/application/mappers/index.d.ts +0 -9
- package/dist/application/mappers/request-mapper.d.ts +0 -29
- package/dist/application/queries/get-request-schema.query.d.ts +0 -32
- package/dist/application/queries/index.d.ts +0 -6
- package/dist/application/use-cases/create-request.use-case.d.ts +0 -23
- package/dist/application/use-cases/delete-request.use-case.d.ts +0 -15
- package/dist/application/use-cases/execute-request.use-case.d.ts +0 -46
- package/dist/application/use-cases/export-collection.use-case.d.ts +0 -22
- package/dist/application/use-cases/get-collection.use-case.d.ts +0 -13
- package/dist/application/use-cases/index.d.ts +0 -12
- package/dist/application/use-cases/list-requests.use-case.d.ts +0 -14
- package/dist/application/use-cases/load-collection.use-case.d.ts +0 -30
- package/dist/application/use-cases/save-collection.use-case.d.ts +0 -25
- package/dist/application/use-cases/update-request.use-case.d.ts +0 -17
- package/dist/domain/errors/domain-errors.d.ts +0 -52
- package/dist/domain/errors/index.d.ts +0 -4
- package/dist/domain/index.d.ts +0 -24
- package/dist/domain/models/execution.d.ts +0 -88
- package/dist/domain/models/index.d.ts +0 -4
- package/dist/domain/services/domain-events.d.ts +0 -60
- package/dist/domain/services/execution-planner.domain-service.d.ts +0 -40
- package/dist/domain/services/index.d.ts +0 -9
- package/dist/domain/services/schema-inference.domain-service.d.ts +0 -54
- package/dist/domain/value-objects/entity-id.d.ts +0 -26
- package/dist/domain/value-objects/http-method.d.ts +0 -30
- package/dist/domain/value-objects/index.d.ts +0 -9
- package/dist/domain/value-objects/request-url.d.ts +0 -28
- package/dist/infrastructure/adapters/index.d.ts +0 -5
- package/dist/infrastructure/adapters/logger.adapter.d.ts +0 -25
- package/dist/infrastructure/adapters/node-file-system.adapter.d.ts +0 -18
- package/dist/infrastructure/di/complete-bootstrap.d.ts +0 -24
- package/dist/infrastructure/di/index.d.ts +0 -6
- package/dist/infrastructure/di/infrastructure-di-config.d.ts +0 -33
- package/dist/infrastructure/di/simple-event-publisher.d.ts +0 -17
- package/dist/infrastructure/environment/interfaces.d.ts +0 -139
- package/dist/infrastructure/http/index.d.ts +0 -4
- package/dist/infrastructure/http/node-http-executor.adapter.d.ts +0 -25
- package/dist/infrastructure/index.d.ts +0 -31
- package/dist/infrastructure/persistence/file-system-history-loader.d.ts +0 -31
- package/dist/infrastructure/persistence/index.d.ts +0 -6
- package/dist/infrastructure/repositories/file-system/fs-collection-repository.d.ts +0 -72
- package/dist/infrastructure/repositories/file-system/fs-environment-file-loader.adapter.d.ts +0 -41
- package/dist/infrastructure/repositories/file-system/fs-environment-repository.d.ts +0 -34
- package/dist/infrastructure/repositories/file-system/fs-request-repository.d.ts +0 -31
- package/dist/infrastructure/repositories/file-system/index.d.ts +0 -7
- package/dist/infrastructure/repositories/in-memory/in-memory-collection-repository.d.ts +0 -18
- package/dist/infrastructure/repositories/in-memory/in-memory-environment-repository.d.ts +0 -25
- package/dist/infrastructure/repositories/in-memory/in-memory-request-repository.d.ts +0 -25
- package/dist/infrastructure/repositories/in-memory/index.d.ts +0 -7
- package/dist/infrastructure/script/index.d.ts +0 -4
- package/dist/infrastructure/script/vm-script-executor.adapter.d.ts +0 -19
- package/dist/infrastructure/test-suite/index.d.ts +0 -10
- package/dist/ports/executors/index.d.ts +0 -5
- package/dist/ports/external/file-system.interface.d.ts +0 -44
- package/dist/ports/external/http-client.interface.d.ts +0 -25
- package/dist/ports/external/index.d.ts +0 -7
- package/dist/ports/index.d.ts +0 -17
- package/dist/ports/parsers/index.d.ts +0 -4
- package/dist/ports/repositories/collection-repository.interface.d.ts +0 -32
- package/dist/ports/repositories/environment-repository.interface.d.ts +0 -31
- package/dist/ports/repositories/index.d.ts +0 -6
- package/dist/ports/repositories/request-repository.interface.d.ts +0 -32
- package/dist/ports/storage/cache-store.interface.d.ts +0 -26
- package/dist/ports/storage/history-loader.interface.d.ts +0 -37
- package/dist/ports/storage/index.d.ts +0 -5
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Console Logger Adapter - ILogger implementation
|
|
3
|
-
*/
|
|
4
|
-
import { ILogger, LogLevel } from '../../ports/external/logger.interface';
|
|
5
|
-
/**
|
|
6
|
-
* Simple console-based logger implementation
|
|
7
|
-
*/
|
|
8
|
-
export declare class ConsoleLoggerAdapter implements ILogger {
|
|
9
|
-
private minLevel;
|
|
10
|
-
constructor(minLevel?: LogLevel);
|
|
11
|
-
debug(message: string, context?: Record<string, any>): void;
|
|
12
|
-
info(message: string, context?: Record<string, any>): void;
|
|
13
|
-
warn(message: string, context?: Record<string, any>): void;
|
|
14
|
-
error(message: string, error?: Error | Record<string, any>): void;
|
|
15
|
-
private canLog;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Silent logger - no output
|
|
19
|
-
*/
|
|
20
|
-
export declare class SilentLoggerAdapter implements ILogger {
|
|
21
|
-
debug(): void;
|
|
22
|
-
info(): void;
|
|
23
|
-
warn(): void;
|
|
24
|
-
error(): void;
|
|
25
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node File System Adapter - IFileSystem implementation for Node.js
|
|
3
|
-
*/
|
|
4
|
-
import { IFileSystem, FileStat } from '../../ports/external/file-system.interface';
|
|
5
|
-
/**
|
|
6
|
-
* Node.js implementation of IFileSystem
|
|
7
|
-
*/
|
|
8
|
-
export declare class NodeFileSystemAdapter implements IFileSystem {
|
|
9
|
-
exists(path: string): Promise<boolean>;
|
|
10
|
-
readFile(filePath: string): Promise<string>;
|
|
11
|
-
writeFile(filePath: string, content: string): Promise<void>;
|
|
12
|
-
readDir(dirPath: string): Promise<string[]>;
|
|
13
|
-
mkdir(dirPath: string, options?: {
|
|
14
|
-
recursive?: boolean;
|
|
15
|
-
}): Promise<void>;
|
|
16
|
-
delete(filePath: string): Promise<void>;
|
|
17
|
-
stat(filePath: string): Promise<FileStat>;
|
|
18
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Complete Infrastructure Bootstrap
|
|
3
|
-
*
|
|
4
|
-
* Registers all infrastructure implementations including:
|
|
5
|
-
* - File system repositories
|
|
6
|
-
* - History loaders
|
|
7
|
-
* - HTTP/Script executors
|
|
8
|
-
* - Parsers
|
|
9
|
-
* - Adapters
|
|
10
|
-
*/
|
|
11
|
-
import { PlatformAdapters } from '../../di/platform-adapters';
|
|
12
|
-
import { ServiceContainer } from '../../di/service-container';
|
|
13
|
-
export interface FullBootstrapOptions {
|
|
14
|
-
/** Use file system repositories instead of in-memory */
|
|
15
|
-
useFileSystem?: boolean;
|
|
16
|
-
/** Base path for file system operations */
|
|
17
|
-
basePath?: string;
|
|
18
|
-
/** Platform adapters (file system, logger, HTTP client, etc) */
|
|
19
|
-
adapters?: Partial<PlatformAdapters>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Complete bootstrap with all implementations
|
|
23
|
-
*/
|
|
24
|
-
export declare function bootstrapComplete(container: ServiceContainer, options?: FullBootstrapOptions): void;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Infrastructure DI Configuration
|
|
3
|
-
*
|
|
4
|
-
* Registers all infrastructure implementations and wires up the dependency graph
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* ```typescript
|
|
8
|
-
* const container = new ServiceContainer();
|
|
9
|
-
* registerInfrastructureServices(container);
|
|
10
|
-
* registerDomainServices(container);
|
|
11
|
-
* registerApplicationServices(container);
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
import { ServiceContainer } from '../../di/service-container';
|
|
15
|
-
import { PlatformAdapters } from '../../di/platform-adapters';
|
|
16
|
-
/**
|
|
17
|
-
* Register infrastructure layer services
|
|
18
|
-
*
|
|
19
|
-
* These are concrete implementations of port interfaces
|
|
20
|
-
*/
|
|
21
|
-
export declare function registerInfrastructureServices(container: ServiceContainer, adapters?: Partial<PlatformAdapters>): void;
|
|
22
|
-
/**
|
|
23
|
-
* Register domain layer services
|
|
24
|
-
*/
|
|
25
|
-
export declare function registerDomainServices(container: ServiceContainer): void;
|
|
26
|
-
/**
|
|
27
|
-
* Register application layer services (use cases)
|
|
28
|
-
*/
|
|
29
|
-
export declare function registerApplicationServices(container: ServiceContainer): void;
|
|
30
|
-
/**
|
|
31
|
-
* Bootstrap all layers
|
|
32
|
-
*/
|
|
33
|
-
export declare function bootstrapAllServices(container: ServiceContainer, adapters?: Partial<PlatformAdapters>): void;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Domain Event Publisher Implementation
|
|
3
|
-
*/
|
|
4
|
-
import { IDomainEventPublisher } from '../../domain/services/domain-events';
|
|
5
|
-
import { DomainEvent } from '../../domain/services/domain-events';
|
|
6
|
-
/**
|
|
7
|
-
* Simple in-memory event publisher
|
|
8
|
-
*/
|
|
9
|
-
export declare class SimpleEventPublisher implements IDomainEventPublisher {
|
|
10
|
-
private subscriptions;
|
|
11
|
-
publish(event: DomainEvent): Promise<void>;
|
|
12
|
-
subscribe(eventType: string, handler: (event: DomainEvent) => Promise<void>): void;
|
|
13
|
-
/**
|
|
14
|
-
* Clear all subscriptions (useful for testing)
|
|
15
|
-
*/
|
|
16
|
-
clear(): void;
|
|
17
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Environment Configuration Service Interface
|
|
3
|
-
*
|
|
4
|
-
* Interface Segregation: Separated into focused sub-interfaces
|
|
5
|
-
* Dependency Inversion: Consumers depend on this abstraction
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Environment configuration structure
|
|
9
|
-
*/
|
|
10
|
-
export interface EnvironmentConfig {
|
|
11
|
-
description?: string;
|
|
12
|
-
requiresConfirmation?: boolean;
|
|
13
|
-
variables?: Record<string, string>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Shared configuration file structure
|
|
17
|
-
*/
|
|
18
|
-
export interface SharedConfig {
|
|
19
|
-
environments: Record<string, EnvironmentConfig>;
|
|
20
|
-
globalVariables?: Record<string, string>;
|
|
21
|
-
defaultHeaders?: Record<string, string>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Local configuration file structure
|
|
25
|
-
*/
|
|
26
|
-
export interface LocalConfig {
|
|
27
|
-
credentials?: Record<string, {
|
|
28
|
-
variables?: Record<string, string>;
|
|
29
|
-
}>;
|
|
30
|
-
variables?: Record<string, string>;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Resolved environment with all inherited values
|
|
34
|
-
*/
|
|
35
|
-
export interface ResolvedEnvironment {
|
|
36
|
-
name: string;
|
|
37
|
-
description?: string;
|
|
38
|
-
requiresConfirmation?: boolean;
|
|
39
|
-
headers: Record<string, string>;
|
|
40
|
-
variables: Record<string, string>;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Representation of an imported environment (from Postman)
|
|
44
|
-
*/
|
|
45
|
-
export interface ImportedEnvironment {
|
|
46
|
-
name: string;
|
|
47
|
-
variables: Record<string, string>;
|
|
48
|
-
description?: string;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Import operations for environments
|
|
52
|
-
*/
|
|
53
|
-
export interface IEnvironmentImporter {
|
|
54
|
-
importPostmanEnvironmentFile(filePath: string): ImportedEnvironment | null;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Read operations for environment configuration
|
|
58
|
-
*/
|
|
59
|
-
export interface IEnvironmentConfigReader {
|
|
60
|
-
getWorkspaceFolder(): string;
|
|
61
|
-
getRootPath(): string;
|
|
62
|
-
getEnvironmentNames(): string[];
|
|
63
|
-
getSelectedEnvironment(): string;
|
|
64
|
-
getSharedConfig(): SharedConfig | null;
|
|
65
|
-
getSharedConfigPath(): string;
|
|
66
|
-
getLocalConfig(): LocalConfig | null;
|
|
67
|
-
getLocalConfigPath(): string;
|
|
68
|
-
getEnvironmentConfigPath(envName: string): string;
|
|
69
|
-
getEnvLocalPath(envName: string): string;
|
|
70
|
-
getResolvedEnvironment(envName: string): ResolvedEnvironment | null;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Write operations for environment configuration
|
|
74
|
-
*/
|
|
75
|
-
export interface IEnvironmentConfigWriter {
|
|
76
|
-
saveSharedConfig(config: SharedConfig): void;
|
|
77
|
-
saveLocalConfig(config: LocalConfig): void;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Environment selection operations
|
|
81
|
-
*/
|
|
82
|
-
export interface IEnvironmentSelector {
|
|
83
|
-
setSelectedEnvironment(envName: string): Promise<void>;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Variable resolution operations
|
|
87
|
-
*/
|
|
88
|
-
export interface IVariableResolver {
|
|
89
|
-
resolveVariables(text: string, envName?: string): string;
|
|
90
|
-
resolveVariablesWithExtra(text: string, extraVariables: Record<string, string>, envName?: string): string;
|
|
91
|
-
resolveVariablesInObject<T extends Record<string, any>>(obj: T, envName?: string): T;
|
|
92
|
-
resolveVariablesInObjectWithExtra<T extends Record<string, any>>(obj: T, extraVariables: Record<string, string>, envName?: string): T;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Variable management operations (for scripts)
|
|
96
|
-
*/
|
|
97
|
-
export interface IVariableManager {
|
|
98
|
-
setEnvironmentVariable(key: string, value: unknown): void;
|
|
99
|
-
deleteEnvironmentVariable(key: string): void;
|
|
100
|
-
clearEnvironmentVariables(): void;
|
|
101
|
-
getEnvironmentVariableLocals(): Record<string, string>;
|
|
102
|
-
setGlobalVariable(key: string, value: unknown): void;
|
|
103
|
-
getGlobalVariable(key: string): string | undefined;
|
|
104
|
-
deleteGlobalVariable(key: string): void;
|
|
105
|
-
clearGlobalVariables(): void;
|
|
106
|
-
setSessionVariable(key: string, value: unknown): void;
|
|
107
|
-
deleteSessionVariable(key: string): Promise<void>;
|
|
108
|
-
clearSessionVariables(): Promise<void>;
|
|
109
|
-
getSessionVariables(): Record<string, string>;
|
|
110
|
-
getGlobalVariables(): Record<string, string>;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Full environment configuration service interface
|
|
114
|
-
*/
|
|
115
|
-
export interface IEnvironmentConfigService extends IEnvironmentConfigReader, IEnvironmentConfigWriter, IEnvironmentSelector, IVariableResolver, IVariableManager {
|
|
116
|
-
loadConfigs(): void;
|
|
117
|
-
exportEnvironmentsToFolder(outDir: string, mergeGlobals?: boolean): void;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Interface for storing and retrieving environment variables.
|
|
121
|
-
*/
|
|
122
|
-
export interface IEnvironmentStore {
|
|
123
|
-
get(key: string): string | undefined;
|
|
124
|
-
set(key: string, value: string): void;
|
|
125
|
-
getAll(): Record<string, string>;
|
|
126
|
-
getActive(): string | undefined;
|
|
127
|
-
setActive(name: string): void;
|
|
128
|
-
getVariables(environmentName?: string): Record<string, string>;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Interface for interpolating variables in strings.
|
|
132
|
-
* Handles {{variable}} syntax replacement.
|
|
133
|
-
* @deprecated Use IVariableResolver for environment-aware resolution
|
|
134
|
-
*/
|
|
135
|
-
export interface IVariableInterpolator {
|
|
136
|
-
interpolate(input: string, variables: Record<string, string>): string;
|
|
137
|
-
extractVariables(input: string): string[];
|
|
138
|
-
interpolateObject<T>(obj: T, variables: Record<string, string>): T;
|
|
139
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node HTTP Executor Adapter - Implements IHttpExecutor
|
|
3
|
-
*
|
|
4
|
-
* Wraps existing InterceptorChain and CookieService to conform to port interface
|
|
5
|
-
*/
|
|
6
|
-
import { IHttpExecutor, IExecutionPlan } from '../../ports/executors/http-executor.interface';
|
|
7
|
-
import { HttpRequest, HttpResponse } from '../../types/types';
|
|
8
|
-
import type { IInterceptorChain } from './interceptor-chain';
|
|
9
|
-
import type { ICookieService } from '../cookie/interfaces';
|
|
10
|
-
/**
|
|
11
|
-
* Adapter that implements IHttpExecutor using existing infrastructure
|
|
12
|
-
*/
|
|
13
|
-
export declare class NodeHttpExecutorAdapter implements IHttpExecutor {
|
|
14
|
-
private interceptorChain;
|
|
15
|
-
private cookieJar;
|
|
16
|
-
constructor(interceptorChain: IInterceptorChain, cookieJar: ICookieService);
|
|
17
|
-
/**
|
|
18
|
-
* Prepare request for execution
|
|
19
|
-
*/
|
|
20
|
-
prepare(plan: IExecutionPlan): Promise<HttpRequest>;
|
|
21
|
-
/**
|
|
22
|
-
* Execute prepared HTTP request
|
|
23
|
-
*/
|
|
24
|
-
execute(prepared: HttpRequest): Promise<HttpResponse>;
|
|
25
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Infrastructure Layer - Implementations and Adapters
|
|
3
|
-
*
|
|
4
|
-
* Contains:
|
|
5
|
-
* - Repository implementations (file-system, in-memory, cloud)
|
|
6
|
-
* - HTTP executor implementations
|
|
7
|
-
* - Script executor implementations
|
|
8
|
-
* - Storage implementations (history, cache)
|
|
9
|
-
* - Parser implementations
|
|
10
|
-
* - External adapters (FileSystem, HTTP client, Logger)
|
|
11
|
-
* - DI configuration
|
|
12
|
-
*
|
|
13
|
-
* Constraints:
|
|
14
|
-
* - Depends on Ports and Domain layers
|
|
15
|
-
* - NO direct dependencies on Application layer
|
|
16
|
-
* - Contains all platform-specific code
|
|
17
|
-
* - All implementations must conform to port interfaces
|
|
18
|
-
*
|
|
19
|
-
* Usage:
|
|
20
|
-
* - Imported during bootstrap phase
|
|
21
|
-
* - Never imported by domain layer
|
|
22
|
-
* - Imported by application layer only through ports
|
|
23
|
-
*/
|
|
24
|
-
export * from './adapters';
|
|
25
|
-
export * from './repositories/in-memory';
|
|
26
|
-
export * from './repositories/file-system';
|
|
27
|
-
export * from './http';
|
|
28
|
-
export * from './script';
|
|
29
|
-
export * from './persistence';
|
|
30
|
-
export * from './parsers';
|
|
31
|
-
export * from './di';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File System History Loader Implementation
|
|
3
|
-
*
|
|
4
|
-
* Implements IHistoryLoader using file-based storage
|
|
5
|
-
* Compatible with existing RequestHistoryService
|
|
6
|
-
*/
|
|
7
|
-
import { IHistoryLoader, IHistoryEntry } from '../../ports/storage/history-loader.interface';
|
|
8
|
-
import { HttpResponse } from '../../types/types';
|
|
9
|
-
import { IFileSystem } from '../../ports/external/file-system.interface';
|
|
10
|
-
/**
|
|
11
|
-
* File system implementation of IHistoryLoader
|
|
12
|
-
* Stores execution history in timestamped files
|
|
13
|
-
*/
|
|
14
|
-
export declare class FileSystemHistoryLoader implements IHistoryLoader {
|
|
15
|
-
private fileSystem;
|
|
16
|
-
private basePath;
|
|
17
|
-
private readonly historyDir;
|
|
18
|
-
private readonly manifestFile;
|
|
19
|
-
private readonly responseExt;
|
|
20
|
-
constructor(fileSystem: IFileSystem, basePath: string);
|
|
21
|
-
loadHistory(collectionId: string, requestId: string, options?: {
|
|
22
|
-
limit?: number;
|
|
23
|
-
offset?: number;
|
|
24
|
-
}): Promise<IHistoryEntry[]>;
|
|
25
|
-
loadFullResponse(collectionId: string, requestId: string, entryId: string): Promise<HttpResponse | null>;
|
|
26
|
-
saveEntry(collectionId: string, requestId: string, response: HttpResponse, duration: number): Promise<IHistoryEntry>;
|
|
27
|
-
/**
|
|
28
|
-
* Generate unique entry ID
|
|
29
|
-
*/
|
|
30
|
-
private generateEntryId;
|
|
31
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File System Collection Repository
|
|
3
|
-
*
|
|
4
|
-
* Implements ICollectionRepository using the FolderCollectionStore.
|
|
5
|
-
*
|
|
6
|
-
* Delegates to FolderCollectionStore for all disk operations,
|
|
7
|
-
* converting between UnifiedCollection (repository contract) and
|
|
8
|
-
* Collection (internal format).
|
|
9
|
-
*
|
|
10
|
-
* This ensures a single source of truth for folder-based storage
|
|
11
|
-
* while supporting both the legacy CollectionService and new use-case architecture.
|
|
12
|
-
*/
|
|
13
|
-
import { ICollectionRepository } from '../../../ports/repositories/collection-repository.interface';
|
|
14
|
-
import { UnifiedCollection } from '../../../types/types';
|
|
15
|
-
/**
|
|
16
|
-
* File system collection repository implementation using FolderCollectionStore
|
|
17
|
-
*/
|
|
18
|
-
export declare class FileSystemCollectionRepository implements ICollectionRepository {
|
|
19
|
-
private store;
|
|
20
|
-
constructor(basePath: string);
|
|
21
|
-
/**
|
|
22
|
-
* Find collection by ID
|
|
23
|
-
*/
|
|
24
|
-
findById(id: string): Promise<UnifiedCollection | null>;
|
|
25
|
-
/**
|
|
26
|
-
* Find all collections
|
|
27
|
-
*/
|
|
28
|
-
findAll(): Promise<UnifiedCollection[]>;
|
|
29
|
-
/**
|
|
30
|
-
* Save or update collection
|
|
31
|
-
*/
|
|
32
|
-
save(id: string, collection: UnifiedCollection): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Delete collection
|
|
35
|
-
*/
|
|
36
|
-
delete(id: string): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Check if collection exists
|
|
39
|
-
*/
|
|
40
|
-
exists(id: string): Promise<boolean>;
|
|
41
|
-
/**
|
|
42
|
-
* Convert internal Collection to UnifiedCollection
|
|
43
|
-
*/
|
|
44
|
-
private toUnifiedCollection;
|
|
45
|
-
/**
|
|
46
|
-
* Convert UnifiedCollection to internal Collection
|
|
47
|
-
*/
|
|
48
|
-
private toCollection;
|
|
49
|
-
/**
|
|
50
|
-
* Normalize auth object to remove oauth2 type if present
|
|
51
|
-
* Converts RequestAuth to CollectionAuth by removing oauth2-specific fields
|
|
52
|
-
*/
|
|
53
|
-
private normalizeAuth;
|
|
54
|
-
/**
|
|
55
|
-
* Recursively convert items from internal format to unified
|
|
56
|
-
* PRESERVES: enabled flags, metadata on headers/query, all request fields
|
|
57
|
-
*/
|
|
58
|
-
private itemsToUnified;
|
|
59
|
-
/**
|
|
60
|
-
* Recursively convert items from unified format to internal
|
|
61
|
-
* PRESERVES: enabled flags, metadata, all request fields
|
|
62
|
-
*/
|
|
63
|
-
private itemsFromUnified;
|
|
64
|
-
/**
|
|
65
|
-
* Convert variables Record to unified format
|
|
66
|
-
*/
|
|
67
|
-
private recordToUnified;
|
|
68
|
-
/**
|
|
69
|
-
* Convert variables from unified format to Record
|
|
70
|
-
*/
|
|
71
|
-
private unifiedToRecord;
|
|
72
|
-
}
|
package/dist/infrastructure/repositories/file-system/fs-environment-file-loader.adapter.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File System Environment File Loader Adapter
|
|
3
|
-
*
|
|
4
|
-
* Loads environment configuration files from disk
|
|
5
|
-
* Wraps the legacy environment-file-loader functionality
|
|
6
|
-
*/
|
|
7
|
-
import { IFileSystem } from '../../../ports/external/file-system.interface';
|
|
8
|
-
import { ILogger } from '../../../ports/external/logger.interface';
|
|
9
|
-
export interface EnvironmentFileConfig {
|
|
10
|
-
name: string;
|
|
11
|
-
variables: Record<string, string>;
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
}
|
|
14
|
-
export interface EnvironmentLoadResult {
|
|
15
|
-
environments: Record<string, EnvironmentFileConfig>;
|
|
16
|
-
globalVariables?: Record<string, string>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Adapter: Load environment files from file system
|
|
20
|
-
*/
|
|
21
|
-
export declare class FileSystemEnvironmentFileLoaderAdapter {
|
|
22
|
-
private fileSystem;
|
|
23
|
-
private logger;
|
|
24
|
-
constructor(fileSystem: IFileSystem, logger: ILogger);
|
|
25
|
-
/**
|
|
26
|
-
* Load single environment file
|
|
27
|
-
*/
|
|
28
|
-
loadEnvironmentFile(filePath: string): Promise<EnvironmentFileConfig>;
|
|
29
|
-
/**
|
|
30
|
-
* Load all environment files from directory
|
|
31
|
-
*/
|
|
32
|
-
loadEnvironmentDirectory(dirPath: string): Promise<EnvironmentLoadResult>;
|
|
33
|
-
/**
|
|
34
|
-
* Write environment file
|
|
35
|
-
*/
|
|
36
|
-
saveEnvironmentFile(filePath: string, config: EnvironmentFileConfig): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Delete environment file
|
|
39
|
-
*/
|
|
40
|
-
deleteEnvironmentFile(filePath: string): Promise<void>;
|
|
41
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File System Environment Repository Implementation
|
|
3
|
-
*
|
|
4
|
-
* Implements IEnvironmentRepository using folder-based storage
|
|
5
|
-
* Compatible with existing EnvironmentResolver and environment-file-loader
|
|
6
|
-
*/
|
|
7
|
-
import { IEnvironmentRepository } from '../../../ports/repositories/environment-repository.interface';
|
|
8
|
-
import { Environment } from '../../environment/environment-resolver';
|
|
9
|
-
import { IFileSystem } from '../../../ports/external/file-system.interface';
|
|
10
|
-
/**
|
|
11
|
-
* File system implementation of IEnvironmentRepository
|
|
12
|
-
* Stores environments in a dedicated directory
|
|
13
|
-
*/
|
|
14
|
-
export declare class FileSystemEnvironmentRepository implements IEnvironmentRepository {
|
|
15
|
-
private fileSystem;
|
|
16
|
-
private basePath;
|
|
17
|
-
private readonly environmentsDir;
|
|
18
|
-
private readonly environmentExt;
|
|
19
|
-
private activeEnvironmentId;
|
|
20
|
-
constructor(fileSystem: IFileSystem, basePath: string);
|
|
21
|
-
findById(id: string): Promise<Environment | null>;
|
|
22
|
-
findActive(): Promise<Environment | null>;
|
|
23
|
-
findAll(): Promise<Environment[]>;
|
|
24
|
-
save(environment: Environment): Promise<void>;
|
|
25
|
-
delete(id: string): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Set environment as active
|
|
28
|
-
*/
|
|
29
|
-
setActive(id: string): void;
|
|
30
|
-
/**
|
|
31
|
-
* Build file path for environment
|
|
32
|
-
*/
|
|
33
|
-
private buildEnvironmentPath;
|
|
34
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File System Request Repository Implementation
|
|
3
|
-
*
|
|
4
|
-
* Implements IRequestRepository using folder-based storage
|
|
5
|
-
* Compatible with existing FolderCollectionStore and folder-io
|
|
6
|
-
*/
|
|
7
|
-
import { IRequestRepository } from '../../../ports/repositories/request-repository.interface';
|
|
8
|
-
import { UnifiedRequest } from '../../../types/types';
|
|
9
|
-
import { IFileSystem } from '../../../ports/external/file-system.interface';
|
|
10
|
-
/**
|
|
11
|
-
* File system implementation of IRequestRepository
|
|
12
|
-
* Stores requests as .json files in collection directories
|
|
13
|
-
*/
|
|
14
|
-
export declare class FileSystemRequestRepository implements IRequestRepository {
|
|
15
|
-
private fileSystem;
|
|
16
|
-
private collectionsBasePath;
|
|
17
|
-
private readonly requestsDir;
|
|
18
|
-
private readonly requestExt;
|
|
19
|
-
constructor(fileSystem: IFileSystem, collectionsBasePath: string);
|
|
20
|
-
findById(id: string): Promise<UnifiedRequest | null>;
|
|
21
|
-
findAll(collectionId: string): Promise<UnifiedRequest[]>;
|
|
22
|
-
save(request: UnifiedRequest): Promise<void>;
|
|
23
|
-
delete(id: string): Promise<void>;
|
|
24
|
-
exists(id: string): Promise<boolean>;
|
|
25
|
-
/**
|
|
26
|
-
* Build file path for a request
|
|
27
|
-
* Assumes request ID contains collection ID in some form
|
|
28
|
-
* or that we have configuration for this
|
|
29
|
-
*/
|
|
30
|
-
private buildRequestPath;
|
|
31
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-Memory Collection Repository
|
|
3
|
-
*
|
|
4
|
-
* Useful for testing and development
|
|
5
|
-
*/
|
|
6
|
-
import { ICollectionRepository } from '../../../ports/repositories/collection-repository.interface';
|
|
7
|
-
import { UnifiedCollection } from '../../../types/types';
|
|
8
|
-
/**
|
|
9
|
-
* In-memory collection repository implementation
|
|
10
|
-
*/
|
|
11
|
-
export declare class InMemoryCollectionRepository implements ICollectionRepository {
|
|
12
|
-
private collections;
|
|
13
|
-
findById(id: string): Promise<UnifiedCollection | null>;
|
|
14
|
-
findAll(filter?: any): Promise<UnifiedCollection[]>;
|
|
15
|
-
save(id: string, collection: UnifiedCollection): Promise<void>;
|
|
16
|
-
delete(id: string): Promise<void>;
|
|
17
|
-
exists(id: string): Promise<boolean>;
|
|
18
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-Memory Environment Repository Implementation
|
|
3
|
-
*/
|
|
4
|
-
import { Environment } from '../../environment/environment-resolver';
|
|
5
|
-
import { IEnvironmentRepository } from '../../../ports/repositories/environment-repository.interface';
|
|
6
|
-
/**
|
|
7
|
-
* In-memory implementation of IEnvironmentRepository
|
|
8
|
-
*/
|
|
9
|
-
export declare class InMemoryEnvironmentRepository implements IEnvironmentRepository {
|
|
10
|
-
private environments;
|
|
11
|
-
private activeId;
|
|
12
|
-
findById(id: string): Promise<Environment | null>;
|
|
13
|
-
findActive(): Promise<Environment | null>;
|
|
14
|
-
findAll(): Promise<Environment[]>;
|
|
15
|
-
save(environment: Environment): Promise<void>;
|
|
16
|
-
delete(id: string): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Set active environment
|
|
19
|
-
*/
|
|
20
|
-
setActive(id: string): void;
|
|
21
|
-
/**
|
|
22
|
-
* Clear all environments
|
|
23
|
-
*/
|
|
24
|
-
clear(): void;
|
|
25
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-Memory Request Repository Implementation
|
|
3
|
-
*/
|
|
4
|
-
import { UnifiedRequest } from '../../../types/types';
|
|
5
|
-
import { IRequestRepository } from '../../../ports/repositories/request-repository.interface';
|
|
6
|
-
/**
|
|
7
|
-
* In-memory implementation of IRequestRepository
|
|
8
|
-
* Useful for testing and as a fallback
|
|
9
|
-
*/
|
|
10
|
-
export declare class InMemoryRequestRepository implements IRequestRepository {
|
|
11
|
-
private requests;
|
|
12
|
-
findById(id: string): Promise<UnifiedRequest | null>;
|
|
13
|
-
findAll(collectionId: string): Promise<UnifiedRequest[]>;
|
|
14
|
-
save(request: UnifiedRequest): Promise<void>;
|
|
15
|
-
delete(id: string): Promise<void>;
|
|
16
|
-
exists(id: string): Promise<boolean>;
|
|
17
|
-
/**
|
|
18
|
-
* Clear all requests (useful for testing)
|
|
19
|
-
*/
|
|
20
|
-
clear(): void;
|
|
21
|
-
/**
|
|
22
|
-
* Pre-populate requests (useful for testing)
|
|
23
|
-
*/
|
|
24
|
-
addRequests(...requests: UnifiedRequest[]): void;
|
|
25
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* VM Script Executor Adapter - Implements IScriptExecutor (port)
|
|
3
|
-
*
|
|
4
|
-
* Wraps existing ScriptExecutor to conform to the new port interface.
|
|
5
|
-
* The legacy ScriptExecutor uses `createRequestSession()` pattern;
|
|
6
|
-
* this adapter translates to the simpler `executePreRequest` / `executePostResponse` port API.
|
|
7
|
-
*/
|
|
8
|
-
import { IScriptExecutor as IScriptExecutorPort, IScriptResult, IScriptSession } from '../../ports/executors/script-executor.interface';
|
|
9
|
-
import { HttpResponse } from '../../types/types';
|
|
10
|
-
import { ScriptExecutor } from './script-executor';
|
|
11
|
-
/**
|
|
12
|
-
* Adapter that implements ports/IScriptExecutor using the legacy ScriptExecutor
|
|
13
|
-
*/
|
|
14
|
-
export declare class VmScriptExecutorAdapter implements IScriptExecutorPort {
|
|
15
|
-
private scriptExecutor;
|
|
16
|
-
constructor(scriptExecutor: ScriptExecutor);
|
|
17
|
-
executePreRequest(session: IScriptSession, script: string): Promise<IScriptResult>;
|
|
18
|
-
executePostResponse(session: IScriptSession, script: string, response: HttpResponse): Promise<IScriptResult>;
|
|
19
|
-
}
|