openpost 1.0.4

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 (116) hide show
  1. package/README.md +359 -0
  2. package/dist/auth/authHandler.d.ts +11 -0
  3. package/dist/auth/authHandler.d.ts.map +1 -0
  4. package/dist/builtInVault.d.ts +25 -0
  5. package/dist/builtInVault.d.ts.map +1 -0
  6. package/dist/cli/commands/config.d.ts +3 -0
  7. package/dist/cli/commands/config.d.ts.map +1 -0
  8. package/dist/cli/commands/crud.d.ts +3 -0
  9. package/dist/cli/commands/crud.d.ts.map +1 -0
  10. package/dist/cli/commands/envVar.d.ts +3 -0
  11. package/dist/cli/commands/envVar.d.ts.map +1 -0
  12. package/dist/cli/commands/importExport.d.ts +3 -0
  13. package/dist/cli/commands/importExport.d.ts.map +1 -0
  14. package/dist/cli/commands/license.d.ts +3 -0
  15. package/dist/cli/commands/license.d.ts.map +1 -0
  16. package/dist/cli/commands/list.d.ts +4 -0
  17. package/dist/cli/commands/list.d.ts.map +1 -0
  18. package/dist/cli/commands/proxyCookie.d.ts +3 -0
  19. package/dist/cli/commands/proxyCookie.d.ts.map +1 -0
  20. package/dist/cli/commands/run.d.ts +3 -0
  21. package/dist/cli/commands/run.d.ts.map +1 -0
  22. package/dist/cli/commands/servers.d.ts +3 -0
  23. package/dist/cli/commands/servers.d.ts.map +1 -0
  24. package/dist/cli/commands/vault.d.ts +3 -0
  25. package/dist/cli/commands/vault.d.ts.map +1 -0
  26. package/dist/cli/config.d.ts +23 -0
  27. package/dist/cli/config.d.ts.map +1 -0
  28. package/dist/cli/mcp-collection-stdio.d.ts +13 -0
  29. package/dist/cli/mcp-collection-stdio.d.ts.map +1 -0
  30. package/dist/cli/mcp-stdio.d.ts +13 -0
  31. package/dist/cli/mcp-stdio.d.ts.map +1 -0
  32. package/dist/cli/openpost.d.ts +64 -0
  33. package/dist/cli/openpost.d.ts.map +1 -0
  34. package/dist/cli/output.d.ts +29 -0
  35. package/dist/cli/output.d.ts.map +1 -0
  36. package/dist/cli-bundle.js +263 -0
  37. package/dist/container/serviceContainer.d.ts +35 -0
  38. package/dist/container/serviceContainer.d.ts.map +1 -0
  39. package/dist/cookieJar.d.ts +18 -0
  40. package/dist/cookieJar.d.ts.map +1 -0
  41. package/dist/curlParser.d.ts +11 -0
  42. package/dist/curlParser.d.ts.map +1 -0
  43. package/dist/errors/appError.d.ts +35 -0
  44. package/dist/errors/appError.d.ts.map +1 -0
  45. package/dist/events/typedEventBus.d.ts +9 -0
  46. package/dist/events/typedEventBus.d.ts.map +1 -0
  47. package/dist/httpClient.d.ts +15 -0
  48. package/dist/httpClient.d.ts.map +1 -0
  49. package/dist/index.d.ts +50 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.min.js +212 -0
  52. package/dist/inheritance.d.ts +9 -0
  53. package/dist/inheritance.d.ts.map +1 -0
  54. package/dist/interfaces/configProvider.d.ts +10 -0
  55. package/dist/interfaces/configProvider.d.ts.map +1 -0
  56. package/dist/interfaces/eventBus.d.ts +44 -0
  57. package/dist/interfaces/eventBus.d.ts.map +1 -0
  58. package/dist/interfaces/fileStore.d.ts +66 -0
  59. package/dist/interfaces/fileStore.d.ts.map +1 -0
  60. package/dist/interfaces/logger.d.ts +9 -0
  61. package/dist/interfaces/logger.d.ts.map +1 -0
  62. package/dist/interfaces/secretStorage.d.ts +7 -0
  63. package/dist/interfaces/secretStorage.d.ts.map +1 -0
  64. package/dist/interpolation.d.ts +10 -0
  65. package/dist/interpolation.d.ts.map +1 -0
  66. package/dist/licenseValidator.d.ts +18 -0
  67. package/dist/licenseValidator.d.ts.map +1 -0
  68. package/dist/managementMcpServer.d.ts +80 -0
  69. package/dist/managementMcpServer.d.ts.map +1 -0
  70. package/dist/mcpServer.d.ts +54 -0
  71. package/dist/mcpServer.d.ts.map +1 -0
  72. package/dist/mcpToolDefs.d.ts +13 -0
  73. package/dist/mcpToolDefs.d.ts.map +1 -0
  74. package/dist/mcpToolEngine.d.ts +22 -0
  75. package/dist/mcpToolEngine.d.ts.map +1 -0
  76. package/dist/mockServer.d.ts +117 -0
  77. package/dist/mockServer.d.ts.map +1 -0
  78. package/dist/mockServerManager.d.ts +219 -0
  79. package/dist/mockServerManager.d.ts.map +1 -0
  80. package/dist/openApiGenerator.d.ts +19 -0
  81. package/dist/openApiGenerator.d.ts.map +1 -0
  82. package/dist/openApiParser.d.ts +11 -0
  83. package/dist/openApiParser.d.ts.map +1 -0
  84. package/dist/openpost.d.ts +101 -0
  85. package/dist/openpost.d.ts.map +1 -0
  86. package/dist/routeMatcher.d.ts +59 -0
  87. package/dist/routeMatcher.d.ts.map +1 -0
  88. package/dist/scripting/sandbox.d.ts +14 -0
  89. package/dist/scripting/sandbox.d.ts.map +1 -0
  90. package/dist/serverRegistry.d.ts +22 -0
  91. package/dist/serverRegistry.d.ts.map +1 -0
  92. package/dist/services/collectionRunEngine.d.ts +24 -0
  93. package/dist/services/collectionRunEngine.d.ts.map +1 -0
  94. package/dist/services/collectionService.d.ts +22 -0
  95. package/dist/services/collectionService.d.ts.map +1 -0
  96. package/dist/services/environmentService.d.ts +16 -0
  97. package/dist/services/environmentService.d.ts.map +1 -0
  98. package/dist/services/historyService.d.ts +16 -0
  99. package/dist/services/historyService.d.ts.map +1 -0
  100. package/dist/services/requestEngine.d.ts +49 -0
  101. package/dist/services/requestEngine.d.ts.map +1 -0
  102. package/dist/services/settingsService.d.ts +21 -0
  103. package/dist/services/settingsService.d.ts.map +1 -0
  104. package/dist/services/snapshotEngine.d.ts +23 -0
  105. package/dist/services/snapshotEngine.d.ts.map +1 -0
  106. package/dist/storage/standaloneFileStore.d.ts +109 -0
  107. package/dist/storage/standaloneFileStore.d.ts.map +1 -0
  108. package/dist/stripComments.d.ts +3 -0
  109. package/dist/stripComments.d.ts.map +1 -0
  110. package/dist/testRunner.d.ts +4 -0
  111. package/dist/testRunner.d.ts.map +1 -0
  112. package/dist/types.d.ts +1011 -0
  113. package/dist/types.d.ts.map +1 -0
  114. package/dist/vaultManager.d.ts +50 -0
  115. package/dist/vaultManager.d.ts.map +1 -0
  116. package/package.json +56 -0
@@ -0,0 +1,219 @@
1
+ /**
2
+ * Mock Server Manager — Orchestrates multiple MockServer instances.
3
+ *
4
+ * Owns a `Map<string, MockServer>` of running server instances and a
5
+ * `MockServerConfig[]` array that is persisted via FileStore. Enforces
6
+ * a configurable server cap, assigns default names and ports, and
7
+ * coordinates lifecycle operations (create, delete, rename, start, stop).
8
+ *
9
+ * Route management, export/import, and auto-start are added in later tasks.
10
+ */
11
+ import type { MockServerConfig, MockServerCollection, MockServerStatusData, MockLogEntry, MockRoute } from './types';
12
+ export interface MockStoreOps {
13
+ loadMockServers(): MockServerConfig[];
14
+ saveMockServers(configs: MockServerConfig[]): void;
15
+ loadMaxMockServers(): number;
16
+ saveMaxMockServers(cap: number): void;
17
+ migrateLegacyMockConfig(): void;
18
+ }
19
+ export declare class MockServerManager {
20
+ private servers;
21
+ private configs;
22
+ private store;
23
+ private serverCap;
24
+ setStore(store: MockStoreOps): void;
25
+ private workspacePath;
26
+ private currentVariables;
27
+ /** External callback fired when any managed server's status changes. */
28
+ onStatusChange: ((serverId: string, status: MockServerStatusData) => void) | null;
29
+ /** External callback fired when any managed server produces a log entry. */
30
+ onLogEntry: ((serverId: string, entry: MockLogEntry) => void) | null;
31
+ setWorkspacePath(p: string | null): void;
32
+ /**
33
+ * Create a new mock server with default settings.
34
+ *
35
+ * Assigns a UUID, a default name "Mock Server N", the next available port
36
+ * starting from 3100, an empty route list, and conservative defaults.
37
+ * Persists immediately and returns the new config.
38
+ *
39
+ * Throws if the server cap has been reached.
40
+ */
41
+ createServer(): MockServerConfig;
42
+ /**
43
+ * Delete a mock server by id.
44
+ *
45
+ * Stops the server if it is running, removes it from the config list
46
+ * and the instance map, and persists the change.
47
+ *
48
+ * Throws if no server with the given id exists.
49
+ */
50
+ deleteServer(id: string): Promise<void>;
51
+ /**
52
+ * Rename a mock server.
53
+ *
54
+ * Updates the config name and, if a MockServer instance exists,
55
+ * updates its server name as well. Persists the change.
56
+ *
57
+ * Throws if no server with the given id exists.
58
+ */
59
+ renameServer(id: string, name: string): void;
60
+ /**
61
+ * Start a mock server.
62
+ *
63
+ * Validates that the configured port is not already in use by another
64
+ * managed server. Creates a MockServer instance if one doesn't exist,
65
+ * wires status/log callbacks, and starts listening.
66
+ *
67
+ * Throws if the server is not found, or the port conflicts with another
68
+ * managed server that is currently running.
69
+ */
70
+ startServer(id: string): Promise<void>;
71
+ /**
72
+ * Stop a mock server.
73
+ *
74
+ * Throws if no server with the given id exists.
75
+ * No-op if the server is not currently running.
76
+ */
77
+ stopServer(id: string): Promise<void>;
78
+ /**
79
+ * Add a route to a mock server's routing table.
80
+ *
81
+ * Appends the route to the config, updates the running instance's
82
+ * routes (if any), and persists the change.
83
+ *
84
+ * Throws if no server with the given id exists.
85
+ */
86
+ addRoute(serverId: string, route: MockRoute): void;
87
+ /**
88
+ * Update an existing route in a mock server's routing table.
89
+ *
90
+ * Replaces the route with the matching id. Updates the running
91
+ * instance's routes (if any) and persists the change.
92
+ *
93
+ * Throws if the server or route is not found.
94
+ */
95
+ updateRoute(serverId: string, route: MockRoute): void;
96
+ /**
97
+ * Delete a route from a mock server's routing table.
98
+ *
99
+ * Removes the route with the given id. Updates the running
100
+ * instance's routes (if any) and persists the change.
101
+ *
102
+ * Throws if the server or route is not found.
103
+ */
104
+ deleteRoute(serverId: string, routeId: string): void;
105
+ /**
106
+ * Clear the log for a mock server instance.
107
+ *
108
+ * No-op if the server has no running instance.
109
+ * Throws if no server with the given id exists.
110
+ */
111
+ clearLog(serverId: string): void;
112
+ /**
113
+ * Update a setting on a mock server.
114
+ *
115
+ * Supported keys: `port`, `autoStart`, `maxLogEntries`, `swaggerEnabled`.
116
+ *
117
+ * - `port` (number): Updates the config. If the server is running, stops it
118
+ * so the user knows a restart is needed on the new port.
119
+ * - `autoStart` (boolean): Updates the config only (no runtime effect).
120
+ * - `maxLogEntries` (number): Updates the config and applies to the running
121
+ * instance immediately.
122
+ * - `swaggerEnabled` (boolean): Updates the config and applies to the running
123
+ * instance immediately.
124
+ *
125
+ * Persists the change. Returns `{ restartNeeded: true }` when a port change
126
+ * stops a running server, otherwise `{ restartNeeded: false }`.
127
+ *
128
+ * Throws if the server is not found or the key is unrecognised.
129
+ */
130
+ updateSetting(serverId: string, key: 'port' | 'autoStart' | 'maxLogEntries' | 'swaggerEnabled' | 'mcpEnabled', value: number | boolean): {
131
+ restartNeeded: boolean;
132
+ };
133
+ /**
134
+ * Export a mock server as a `MockServerCollection`.
135
+ *
136
+ * Returns the collection object with version `"1.0"` and the server's
137
+ * full config (including routes).
138
+ *
139
+ * Throws if no server with the given id exists.
140
+ */
141
+ exportServer(id: string): MockServerCollection;
142
+ /**
143
+ * Import a mock server from a `MockServerCollection`.
144
+ *
145
+ * Validates the version field, checks the server cap, assigns a new UUID,
146
+ * resolves port conflicts by picking the next available port, persists,
147
+ * and returns the new config along with an optional port-change message.
148
+ *
149
+ * Throws if the version is missing/unsupported or the server cap is reached.
150
+ */
151
+ importServer(data: MockServerCollection): {
152
+ config: MockServerConfig;
153
+ portChanged?: string;
154
+ };
155
+ /** Return a copy of all server configs. */
156
+ getConfigs(): MockServerConfig[];
157
+ /**
158
+ * Return the current status of a specific server.
159
+ *
160
+ * If the server has a running instance, returns its live status.
161
+ * Otherwise returns a default stopped status with the configured port.
162
+ */
163
+ getServerStatus(id: string): MockServerStatusData;
164
+ /** Return the current server cap. */
165
+ getServerCap(): number;
166
+ /**
167
+ * Update the server cap.
168
+ *
169
+ * Accepts values in the range 1–20 inclusive. Persists the new value.
170
+ * Existing servers beyond the new cap are retained; only new creation
171
+ * is blocked until the count drops below the cap.
172
+ *
173
+ * Throws if the value is outside the valid range.
174
+ */
175
+ setServerCap(cap: number): void;
176
+ /**
177
+ * Set the internal configs array (used by loadAndAutoStart and tests).
178
+ * Does NOT persist — caller is responsible for persistence if needed.
179
+ */
180
+ setConfigs(configs: MockServerConfig[]): void;
181
+ /**
182
+ * Set the internal server cap without persisting (used during load).
183
+ */
184
+ setServerCapInternal(cap: number): void;
185
+ /**
186
+ * Load persisted server configs and auto-start servers flagged with `autoStart: true`.
187
+ *
188
+ * 1. Runs legacy migration (`mock-server.json` → `mock-servers.json`).
189
+ * 2. Loads all configs and the server cap from FileStore.
190
+ * 3. Creates a `MockServer` instance for each config.
191
+ * 4. Starts servers with `autoStart: true` — failures are caught and
192
+ * logged so one broken server doesn't prevent the others from starting.
193
+ */
194
+ loadAndAutoStart(): Promise<void>;
195
+ /**
196
+ * Stop all running mock server instances.
197
+ *
198
+ * Called during extension deactivation. Errors are caught per-server
199
+ * so one failure doesn't prevent the others from stopping.
200
+ */
201
+ stopAll(): Promise<void>;
202
+ /**
203
+ * Update the variable map used for `{{variable}}` interpolation.
204
+ *
205
+ * Stores the map and forwards it to every running MockServer instance
206
+ * so that subsequent requests use the new values without a restart.
207
+ */
208
+ updateVariables(variables: Record<string, string>): void;
209
+ /**
210
+ * Find the smallest port >= 3100 that is not already used by any
211
+ * existing server config.
212
+ */
213
+ private nextAvailablePort;
214
+ /**
215
+ * Look up a config by id, throwing if not found.
216
+ */
217
+ private findConfig;
218
+ }
219
+ //# sourceMappingURL=mockServerManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockServerManager.d.ts","sourceRoot":"","sources":["../src/mockServerManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIrH,MAAM,WAAW,YAAY;IAC3B,eAAe,IAAI,gBAAgB,EAAE,CAAC;IACtC,eAAe,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;IACnD,kBAAkB,IAAI,MAAM,CAAC;IAC7B,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,uB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
2
+ * OpenAPI Generator — Produces an OpenAPI 3.0 JSON document from mock routes.
3
+ *
4
+ * Pure function with no side effects. Called by MockServer at request time
5
+ * when `/_openapi.json` is hit and `swaggerEnabled` is true.
6
+ *
7
+ * Full implementation in Task 2.2.
8
+ */
9
+ import type { MockRoute } from './types';
10
+ /**
11
+ * Generate an OpenAPI 3.0 JSON-serializable object from the given routes.
12
+ *
13
+ * @param routes The mock routes to document
14
+ * @param serverName The human-readable server name
15
+ * @param port The port the server is bound to
16
+ * @returns An OpenAPI 3.0 document object
17
+ */
18
+ export declare function generateOpenApiDoc(routes: MockRoute[], serverName: string, port: number): object;
19
+ //# sourceMappingURL=openApiGenerator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiGenerator.d.ts","sourceRoot":"","sources":["../src/openApiGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,EAAE,EACnB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,GACX,MAAM,CAwDR"}
@@ -0,0 +1,11 @@
1
+ import { Collection, KeyValue } from './types';
2
+ export interface OpenApiImportResult {
3
+ collection: Collection;
4
+ environment: {
5
+ name: string;
6
+ variables: KeyValue[];
7
+ };
8
+ requestCount: number;
9
+ }
10
+ export declare function parseOpenApiSpec(content: string, fileName: string): OpenApiImportResult;
11
+ //# sourceMappingURL=openApiParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiParser.d.ts","sourceRoot":"","sources":["../src/openApiParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAgC,QAAQ,EAAuC,MAAM,SAAS,CAAC;AAgElH,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,QAAQ,EAAE,CAAA;KAAE,CAAC;IACrD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CA8OvF"}
@@ -0,0 +1,101 @@
1
+ import { StandaloneFileStore } from './storage/standaloneFileStore';
2
+ import { RequestEngine } from './services/requestEngine';
3
+ import { CollectionRunEngine } from './services/collectionRunEngine';
4
+ import { CollectionService } from './services/collectionService';
5
+ import { EnvironmentService } from './services/environmentService';
6
+ import { HistoryService } from './services/historyService';
7
+ import { SettingsService } from './services/settingsService';
8
+ import { SnapshotEngine } from './services/snapshotEngine';
9
+ import { MockServerManager } from './mockServerManager';
10
+ import { VaultManager } from './vaultManager';
11
+ import { McpServer } from './mcpServer';
12
+ import { ManagementMcpServer } from './managementMcpServer';
13
+ import type { ILogger } from './interfaces/logger';
14
+ import type { IConfigProvider } from './interfaces/configProvider';
15
+ import type { IEventBus } from './interfaces/eventBus';
16
+ import type { Collection, Environment, ApiRequest, ApiResponse, CollectionRunEntry, CollectionRunResult } from './types';
17
+ export interface OpenPostOptions {
18
+ workspace?: string;
19
+ logger?: ILogger;
20
+ config?: IConfigProvider;
21
+ }
22
+ export declare class OpenPost {
23
+ readonly fileStore: StandaloneFileStore;
24
+ readonly collections: CollectionService;
25
+ readonly environments: EnvironmentService;
26
+ readonly history: HistoryService;
27
+ readonly settings: SettingsService;
28
+ readonly snapshot: SnapshotEngine;
29
+ readonly request: RequestEngine;
30
+ readonly collectionRun: CollectionRunEngine;
31
+ readonly eventBus: IEventBus;
32
+ private readonly logger;
33
+ private readonly mockManager;
34
+ private readonly vaultManager;
35
+ private readonly mcpServers;
36
+ private managementMcp;
37
+ constructor(opts?: OpenPostOptions);
38
+ activateLicense(jwt: string): {
39
+ valid: boolean;
40
+ expired: boolean;
41
+ expiry: number | null;
42
+ };
43
+ deactivateLicense(): void;
44
+ isLicensed(): boolean;
45
+ getLicenseInfo(): {
46
+ valid: boolean;
47
+ expired: boolean;
48
+ expiry: number | null;
49
+ machineId: string;
50
+ };
51
+ listCollections(scope?: 'local' | 'global'): Collection[];
52
+ createCollection(name: string, scope?: 'local' | 'global'): Collection;
53
+ deleteCollection(id: string, scope?: 'local' | 'global'): void;
54
+ findCollection(name: string, scope?: 'local' | 'global'): Collection | undefined;
55
+ findRequest(collectionName: string, requestName: string, scope?: 'local' | 'global'): {
56
+ request: ApiRequest;
57
+ collection: Collection;
58
+ scope: 'local' | 'global';
59
+ folderPath: string[];
60
+ } | undefined;
61
+ listEnvironments(scope?: 'local' | 'global'): Environment[];
62
+ findEnvironment(name: string, scope?: 'local' | 'global'): {
63
+ env: Environment;
64
+ scope: 'local' | 'global';
65
+ } | undefined;
66
+ setActiveEnvironment(name: string, scope?: 'local' | 'global'): boolean;
67
+ runRequest(collectionName: string, requestName: string, opts?: {
68
+ env?: string;
69
+ scope?: 'local' | 'global';
70
+ sslVerification?: boolean;
71
+ proxyId?: string;
72
+ }): Promise<{
73
+ response: ApiResponse;
74
+ scriptLogs: string[];
75
+ extractedVars: Record<string, string>;
76
+ testResults?: import('./types').TestResult[];
77
+ }>;
78
+ runCollection(collectionOrName: string | Collection, opts?: {
79
+ env?: string;
80
+ scope?: 'local' | 'global';
81
+ mode?: 'sequential' | 'parallel';
82
+ concurrency?: number;
83
+ onProgress?: (r: CollectionRunResult) => void;
84
+ }): Promise<CollectionRunEntry>;
85
+ importCurl(curlString: string, collectionName?: string, scope?: 'local' | 'global', requestName?: string): ApiRequest | null;
86
+ importOpenApi(specContent: string, fileName?: string, scope?: 'local' | 'global'): {
87
+ collection: Collection;
88
+ requestCount: number;
89
+ };
90
+ getMockManager(): MockServerManager;
91
+ startMockServers(): Promise<void>;
92
+ getMcpServers(): Map<string, McpServer>;
93
+ startManagementMcp(opts?: {
94
+ port?: number;
95
+ }): Promise<ManagementMcpServer>;
96
+ getVaultManager(): VaultManager;
97
+ createVault(password: string): Promise<void>;
98
+ unlockVault(password: string): Promise<boolean>;
99
+ dispose(): Promise<void>;
100
+ }
101
+ //# sourceMappingURL=openpost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openpost.d.ts","sourceRoot":"","sources":["../src/openpost.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAwB,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAqB,MAAM,uBAAuB,CAAC;AAI/E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,mBAAmB,EAAqC,MAAM,SAAS,CAAC;AAE5J,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,eAAe,CAA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AAC;QAAC,IAAI,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,mBAAmB,KAAK,IAAI,CAAA;KAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAevP,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,OAAO,GAAG,QAAkB,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAiBrI,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAoB,EAAE,KAAK,GAAE,OAAO,GAAG,QAAkB,GAAG;QAAE,UAAU,EAAE,UAAU,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE;IAgBzJ,cAAc,IAAI,iBAAiB;IAE7B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAMvC,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC;IAIjC,kBAAkB,CAAC,IAAI,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA0CpF,eAAe,IAAI,YAAY;IAEzB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAM/C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAO/B"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Route Matcher — Pure function module for matching incoming HTTP requests
3
+ * to configured mock routes.
4
+ *
5
+ * All functions are exported individually for testability.
6
+ */
7
+ import type { MockRoute } from './types';
8
+ /** Result of a successful route match. */
9
+ export interface RouteMatchResult {
10
+ route: MockRoute;
11
+ params: Record<string, string>;
12
+ }
13
+ /**
14
+ * Strip trailing slashes from a path, keeping root `/` intact.
15
+ *
16
+ * `/users/` → `/users`
17
+ * `/` → `/`
18
+ * `` → `/`
19
+ */
20
+ export declare function normalizePath(path: string): string;
21
+ /**
22
+ * Extract the path portion from a URL string, stripping protocol, host,
23
+ * port, and query parameters.
24
+ *
25
+ * `http://example.com:8080/users?q=1` → `/users`
26
+ * `/users` → `/users`
27
+ * `` or unparseable → `/`
28
+ */
29
+ export declare function extractPathFromUrl(url: string): string;
30
+ /**
31
+ * Parse a route pattern into its segments and identify parameter names.
32
+ *
33
+ * `/users/:id/posts` → { segments: ['users', ':id', 'posts'], paramNames: ['id'] }
34
+ */
35
+ export declare function parseRoutePattern(pattern: string): {
36
+ segments: string[];
37
+ paramNames: string[];
38
+ };
39
+ /**
40
+ * Count the number of literal (non-parameter) segments in a route pattern.
41
+ * Used for priority scoring — routes with more literal segments are preferred.
42
+ *
43
+ * `/users/:id` → 1 (only 'users' is literal)
44
+ * `/users/admin` → 2
45
+ */
46
+ export declare function scoreLiteralSegments(pattern: string): number;
47
+ /**
48
+ * Find the best matching enabled route for an incoming request.
49
+ *
50
+ * - Only considers enabled routes
51
+ * - Case-insensitive method comparison
52
+ * - Normalizes paths (trailing slashes)
53
+ * - Literal segments must match exactly; `:param` segments match any non-empty value
54
+ * - When multiple routes match, prefers the one with the highest literal segment score
55
+ *
56
+ * Returns `{ route, params }` or `null` if no match.
57
+ */
58
+ export declare function matchRoute(method: string, path: string, routes: MockRoute[]): RouteMatchResult | null;
59
+ //# sourceMappingURL=routeMatcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routeMatcher.d.ts","sourceRoot":"","sources":["../src/routeMatcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,0CAA0C;AAC1C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOlD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAwBtD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG;IAClD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAgBA;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,EAAE,GAClB,gBAAgB,GAAG,IAAI,CAgEzB"}
@@ -0,0 +1,14 @@
1
+ import { ApiRequest, ApiResponse } from '../types';
2
+ interface ScriptResult {
3
+ logs: string[];
4
+ error?: string;
5
+ updatedRequest?: ApiRequest;
6
+ environmentUpdates?: Record<string, string>;
7
+ }
8
+ export declare function runScript(script: string, context: {
9
+ request: ApiRequest;
10
+ response?: ApiResponse;
11
+ environment: Record<string, string>;
12
+ }): ScriptResult;
13
+ export {};
14
+ //# sourceMappingURL=sandbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/scripting/sandbox.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEnD,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C;AAED,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IACP,OAAO,EAAE,UAAU,CAAC;IACpB,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC,GACA,YAAY,CA8Bd"}
@@ -0,0 +1,22 @@
1
+ export interface RegistryEntry {
2
+ id: string;
3
+ type: 'mock' | 'mcp' | 'management-mcp';
4
+ port: number;
5
+ pid: number;
6
+ workspace: string | null;
7
+ scope: 'local' | 'global';
8
+ name: string;
9
+ startedAt: number;
10
+ }
11
+ export declare function getRegistryPath(): string;
12
+ export declare function loadRegistry(): RegistryEntry[];
13
+ export declare function saveRegistry(entries: RegistryEntry[]): void;
14
+ export declare function cleanStaleEntries(): RegistryEntry[];
15
+ export declare function registerServer(entry: Omit<RegistryEntry, 'pid' | 'startedAt'>): void;
16
+ export declare function unregisterServer(id: string, type: string): void;
17
+ export declare function unregisterByPid(pid?: number): void;
18
+ export declare function isServerRunning(id: string, type: string): RegistryEntry | null;
19
+ export declare function isPortInUse(port: number): RegistryEntry | null;
20
+ export declare function forceStopServer(id: string, type: string): boolean;
21
+ export declare function getRunningServers(): RegistryEntry[];
22
+ //# sourceMappingURL=serverRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverRegistry.d.ts","sourceRoot":"","sources":["../src/serverRegistry.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,gBAAgB,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAaD,wBAAgB,eAAe,IAAI,MAAM,CAA0B;AAEnE,wBAAgB,YAAY,IAAI,aAAa,EAAE,CAM9C;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,IAAI,CAG3D;AAED,wBAAgB,iBAAiB,IAAI,aAAa,EAAE,CAKnD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,WAAW,CAAC,GAAG,IAAI,CAIpF;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAG/D;AAED,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAoB,GAAG,IAAI,CAG/D;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAI9E;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAI9D;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAMjE;AAED,wBAAgB,iBAAiB,IAAI,aAAa,EAAE,CAEnD"}
@@ -0,0 +1,24 @@
1
+ import type { IFileStore } from '../interfaces/fileStore';
2
+ import type { IConfigProvider } from '../interfaces/configProvider';
3
+ import type { ILogger } from '../interfaces/logger';
4
+ import type { IEventBus } from '../interfaces/eventBus';
5
+ import type { Collection, CollectionRunEntry, CollectionRunResult } from '../types';
6
+ import { RequestEngine } from './requestEngine';
7
+ export interface CollectionRunOptions {
8
+ mode: 'sequential' | 'parallel';
9
+ maxConcurrency?: number;
10
+ scope: 'local' | 'global';
11
+ onProgress?: (result: CollectionRunResult) => void;
12
+ }
13
+ export declare class CollectionRunEngine {
14
+ private requestEngine;
15
+ private fileStore;
16
+ private config;
17
+ private logger;
18
+ private eventBus;
19
+ constructor(requestEngine: RequestEngine, fileStore: IFileStore, config: IConfigProvider, logger: ILogger, eventBus: IEventBus);
20
+ /** Flatten collection into ordered request list with folder paths */
21
+ private flattenRequests;
22
+ run(collection: Collection, options: CollectionRunOptions): Promise<CollectionRunEntry>;
23
+ }
24
+ //# sourceMappingURL=collectionRunEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectionRunEngine.d.ts","sourceRoot":"","sources":["../../src/services/collectionRunEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpF,OAAO,EAAE,aAAa,EAAkB,MAAM,iBAAiB,CAAC;AAEhE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACpD;AAED,qBAAa,mBAAmB;IAE5B,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,QAAQ;gBAJR,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,SAAS;IAG7B,qEAAqE;IACrE,OAAO,CAAC,eAAe;IAUjB,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAkE9F"}
@@ -0,0 +1,22 @@
1
+ import type { IFileStore } from '../interfaces/fileStore';
2
+ import type { ILogger } from '../interfaces/logger';
3
+ import type { IEventBus } from '../interfaces/eventBus';
4
+ import type { Collection, CollectionFolder, ApiRequest } from '../types';
5
+ export declare class CollectionService {
6
+ private fileStore;
7
+ private logger;
8
+ private eventBus;
9
+ constructor(fileStore: IFileStore, logger: ILogger, eventBus: IEventBus);
10
+ private loadCollections;
11
+ private saveCollections;
12
+ create(name: string, scope: 'local' | 'global'): Collection;
13
+ delete(id: string, scope: 'local' | 'global'): void;
14
+ rename(id: string, name: string, scope: 'local' | 'global'): void;
15
+ duplicate(id: string, scope: 'local' | 'global'): Collection | null;
16
+ saveMeta(id: string, scope: 'local' | 'global', meta: Partial<Pick<Collection, 'description' | 'auth' | 'preRequestScript' | 'testScript' | 'variables' | 'certificateConfig'>>): void;
17
+ createFolder(collectionId: string, scope: 'local' | 'global', name: string, parentPath: string[]): CollectionFolder | null;
18
+ deleteFolder(collectionId: string, scope: 'local' | 'global', folderId: string, parentPath: string[]): void;
19
+ saveRequest(collectionId: string, scope: 'local' | 'global', request: ApiRequest, folderPath: string[]): void;
20
+ deleteRequest(collectionId: string, scope: 'local' | 'global', requestId: string, folderPath: string[]): void;
21
+ }
22
+ //# sourceMappingURL=collectionService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectionService.d.ts","sourceRoot":"","sources":["../../src/services/collectionService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEzE,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,SAAS;IACj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CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI;CAa9G"}
@@ -0,0 +1,16 @@
1
+ import type { IFileStore } from '../interfaces/fileStore';
2
+ import type { ILogger } from '../interfaces/logger';
3
+ import type { IEventBus } from '../interfaces/eventBus';
4
+ import type { Environment } from '../types';
5
+ export declare class EnvironmentService {
6
+ private fileStore;
7
+ private logger;
8
+ private eventBus;
9
+ constructor(fileStore: IFileStore, logger: ILogger, eventBus: IEventBus);
10
+ load(scope: 'local' | 'global'): Environment[];
11
+ save(env: Environment, scope: 'local' | 'global'): void;
12
+ delete(id: string, scope: 'local' | 'global'): void;
13
+ getActiveId(scope: 'local' | 'global'): string | null;
14
+ setActiveId(id: string | null, scope: 'local' | 'global'): void;
15
+ }
16
+ //# sourceMappingURL=environmentService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environmentService.d.ts","sourceRoot":"","sources":["../../src/services/environmentService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,qBAAa,kBAAkB;IAE3B,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,QAAQ;gBAFR,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,SAAS;IAG7B,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,WAAW,EAAE;IAI9C,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI;IAQvD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI;IAMnD,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI;IAIrD,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI;CAIhE"}
@@ -0,0 +1,16 @@
1
+ import type { IFileStore } from '../interfaces/fileStore';
2
+ import type { ILogger } from '../interfaces/logger';
3
+ import type { IEventBus } from '../interfaces/eventBus';
4
+ import type { HistoryEntry } from '../types';
5
+ export declare class HistoryService {
6
+ private fileStore;
7
+ private logger;
8
+ private eventBus;
9
+ constructor(fileStore: IFileStore, logger: ILogger, eventBus: IEventBus);
10
+ load(scope: 'local' | 'global'): HistoryEntry[];
11
+ save(history: HistoryEntry[], scope: 'local' | 'global'): void;
12
+ clear(scope: 'local' | 'global'): void;
13
+ delete(id: string, scope: 'local' | 'global'): void;
14
+ append(entry: HistoryEntry, scope: 'local' | 'global', maxHistory?: number): void;
15
+ }
16
+ //# sourceMappingURL=historyService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"historyService.d.ts","sourceRoot":"","sources":["../../src/services/historyService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,qBAAa,cAAc;IAEvB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,QAAQ;gBAFR,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,SAAS;IAG7B,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,YAAY,EAAE;IAI/C,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI;IAK9D,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI;IAItC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI;IAKnD,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,GAAG,QAAQ,EAAE,UAAU,GAAE,MAAY,GAAG,IAAI;CAMvF"}
@@ -0,0 +1,49 @@
1
+ import type { IFileStore } from '../interfaces/fileStore';
2
+ import type { IConfigProvider } from '../interfaces/configProvider';
3
+ import type { ILogger } from '../interfaces/logger';
4
+ import type { IEventBus } from '../interfaces/eventBus';
5
+ import type { ApiRequest, ApiResponse, CookieEntry, CertificateConfig, CertificateEntry, Collection } from '../types';
6
+ import { TlsCerts } from '../httpClient';
7
+ export interface RequestContext {
8
+ request: ApiRequest;
9
+ sourceCollectionId?: string;
10
+ sourceScope?: 'local' | 'global';
11
+ sourceFolderPath?: string[];
12
+ sslVerification?: boolean;
13
+ proxyId?: string;
14
+ followRedirects?: boolean;
15
+ signal?: AbortSignal;
16
+ }
17
+ export interface RequestResult {
18
+ response: ApiResponse;
19
+ scriptLogs: string[];
20
+ extractedVars: Record<string, string>;
21
+ cookiesToSave?: CookieEntry[];
22
+ envUpdates?: Record<string, string>;
23
+ digestNote?: string;
24
+ certNames?: string;
25
+ }
26
+ /** Resolve {{variable}} placeholder names from a request */
27
+ export declare function extractVariableNames(request: ApiRequest): string[];
28
+ export declare function resolveInheritedCertificate(col: Collection, folderPath: string[], request: ApiRequest): CertificateConfig | null;
29
+ export declare function buildTlsCerts(config: CertificateConfig, certs: CertificateEntry[]): {
30
+ tls: TlsCerts | null;
31
+ names: string;
32
+ };
33
+ export declare class RequestEngine {
34
+ private fileStore;
35
+ private config;
36
+ private logger;
37
+ private eventBus;
38
+ private resolveSecretVariables?;
39
+ constructor(fileStore: IFileStore, config: IConfigProvider, logger: ILogger, eventBus: IEventBus, resolveSecretVariables?: ((vars: string[], existing: Record<string, string>) => Promise<Record<string, string>>) | undefined);
40
+ /** Build env vars in priority order: collection vars < global env < vault secrets < local env */
41
+ buildEnvVars(ctx: RequestContext): Promise<Record<string, string>>;
42
+ /** Resolve auth inheritance for a request */
43
+ resolveAuth(request: ApiRequest, ctx: RequestContext): ApiRequest;
44
+ /** Resolve script inheritance for a request */
45
+ resolveScripts(request: ApiRequest, ctx: RequestContext): ApiRequest;
46
+ /** Full request execution pipeline */
47
+ execute(ctx: RequestContext): Promise<RequestResult>;
48
+ }
49
+ //# sourceMappingURL=requestEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestEngine.d.ts","sourceRoot":"","sources":["../../src/services/requestEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAe,UAAU,EAAoB,MAAM,UAAU,CAAC;AACrJ,OAAO,EAAkB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,UAAU,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,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