@http-forge/core 0.6.1 → 0.6.2-2.beta.1

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 (39) hide show
  1. package/README.md +223 -251
  2. package/dist/di/platform-adapters.d.ts +11 -4
  3. package/dist/index.d.ts +13 -2
  4. package/dist/index.js +497 -283
  5. package/dist/index.mjs +496 -282
  6. package/dist/infrastructure/ai/ai-provider.d.ts +16 -0
  7. package/dist/infrastructure/analysis/ai-env-suggester.d.ts +22 -0
  8. package/dist/infrastructure/analysis/collection-enhancer.d.ts +23 -0
  9. package/dist/infrastructure/analysis/env-suggester.d.ts +57 -0
  10. package/dist/infrastructure/collection/collection-store.d.ts +1 -1
  11. package/dist/infrastructure/config/config-service.d.ts +20 -1
  12. package/dist/infrastructure/config/config.interface.d.ts +26 -2
  13. package/dist/infrastructure/config/default-config.d.ts +4 -2
  14. package/dist/infrastructure/environment/environment-config-service.d.ts +2 -1
  15. package/dist/infrastructure/execution/collection-request-executor.d.ts +3 -2
  16. package/dist/infrastructure/execution/request-executor.d.ts +5 -0
  17. package/dist/infrastructure/execution/request-preparer.d.ts +1 -0
  18. package/dist/infrastructure/http/native-http-client.d.ts +6 -1
  19. package/dist/infrastructure/openapi/openapi-exporter.d.ts +5 -0
  20. package/dist/infrastructure/parsers/curl-parser.d.ts +61 -0
  21. package/dist/infrastructure/script/interfaces.d.ts +3 -0
  22. package/dist/infrastructure/script/module-loader.d.ts +1 -1
  23. package/dist/infrastructure/script/script-factories.d.ts +17 -0
  24. package/dist/infrastructure/test-suite/interfaces.d.ts +103 -6
  25. package/dist/infrastructure/test-suite/result-storage.d.ts +6 -0
  26. package/dist/infrastructure/test-suite/statistics-service.d.ts +1 -1
  27. package/dist/infrastructure/test-suite/test-suite-service.d.ts +2 -2
  28. package/dist/infrastructure/test-suite/test-suite-store.d.ts +27 -9
  29. package/dist/runtime/mcp-collection-utils.d.ts +29 -1
  30. package/dist/runtime/mcp-prompts.d.ts +39 -0
  31. package/dist/runtime/mcp-run-store.d.ts +11 -1
  32. package/dist/runtime/mcp-tool-builder.d.ts +6 -0
  33. package/dist/runtime/mcp-tool-name.d.ts +4 -5
  34. package/dist/runtime/mcp-tool-schemas.d.ts +45 -0
  35. package/dist/runtime/node-bootstrap.d.ts +9 -0
  36. package/dist/runtime/runtime-contracts.d.ts +14 -0
  37. package/dist/types/types.d.ts +67 -1
  38. package/dist/utils/typed-value.d.ts +14 -0
  39. package/package.json +20 -6
@@ -8,7 +8,7 @@
8
8
  * Single Responsibility: Maintain suite state and resolve requests
9
9
  * Dependency Inversion: Depends on ICollectionService abstraction
10
10
  */
11
- import { CollectionRequest, ICollectionService, RequestScripts } from '../../types/collection';
11
+ import { CollectionRequest, ICollectionService, RequestAuth, RequestScripts } from '../../types/collection';
12
12
  import { SuiteRequest, TestSuite } from './interfaces';
13
13
  /**
14
14
  * Cached request entry with full context
@@ -20,8 +20,12 @@ export interface SuiteRequestEntry {
20
20
  suiteRequest: SuiteRequest;
21
21
  /** Collection scripts */
22
22
  collectionScripts?: RequestScripts;
23
+ /** Collection auth */
24
+ collectionAuth?: RequestAuth;
23
25
  /** Folder scripts chain */
24
26
  folderScriptsChain: RequestScripts[];
27
+ /** Folder auth chain */
28
+ folderAuthChain: RequestAuth[];
25
29
  }
26
30
  /**
27
31
  * Interface for TestSuiteStore
@@ -51,6 +55,11 @@ export interface ITestSuiteStore {
51
55
  * Get all suite requests with their resolved data
52
56
  */
53
57
  getAllSuiteRequests(): SuiteRequestEntry[];
58
+ /**
59
+ * Resolve a SuiteRequest to a full entry with collection context.
60
+ * Works for any SuiteRequest object regardless of whether it's in suite.requests.
61
+ */
62
+ resolveRequestEntry(suiteRequest: SuiteRequest): SuiteRequestEntry | undefined;
54
63
  /**
55
64
  * Get resolved requests for webview display
56
65
  */
@@ -66,6 +75,7 @@ export interface ITestSuiteStore {
66
75
  enabled: boolean;
67
76
  hasEmbeddedRequest: boolean;
68
77
  slug?: string;
78
+ description?: string;
69
79
  }>;
70
80
  /**
71
81
  * Get suite requests by selection state
@@ -103,6 +113,7 @@ export declare class TestSuiteStore implements ITestSuiteStore {
103
113
  constructor(collectionService: ICollectionService);
104
114
  /**
105
115
  * Set the suite
116
+ * Converts legacy requests to request nodes for unified nodes-only architecture
106
117
  */
107
118
  setSuite(suite: TestSuite): void;
108
119
  /**
@@ -120,7 +131,7 @@ export declare class TestSuiteStore implements ITestSuiteStore {
120
131
  private loadSuiteRequest;
121
132
  /**
122
133
  * Save a suite request to its folder.
123
- * Writes request.json + scripts/pre-request.js + scripts/post-response.js
134
+ * Writes request.json + scripts/pre-request.js + scripts/post-response.js atomically.
124
135
  */
125
136
  private saveSuiteRequest;
126
137
  /**
@@ -131,7 +142,7 @@ export declare class TestSuiteStore implements ITestSuiteStore {
131
142
  * Resolve a suite request to its full request data.
132
143
  * Priority: suite folder → collection (fallback for legacy suites)
133
144
  */
134
- private resolveRequest;
145
+ resolveRequestEntry(suiteRequest: SuiteRequest): SuiteRequestEntry | undefined;
135
146
  /**
136
147
  * Find a request in a collection, including folder scripts
137
148
  */
@@ -161,8 +172,8 @@ export declare class TestSuiteStore implements ITestSuiteStore {
161
172
  */
162
173
  getAllSuiteRequests(): SuiteRequestEntry[];
163
174
  /**
164
- * Get resolved requests for webview display
165
- * Returns simplified format with display-relevant properties
175
+ * Get resolved requests for webview display.
176
+ * Returns simplified format with display-relevant properties, ordered by nodes.
166
177
  */
167
178
  getResolvedRequests(): Array<{
168
179
  id: string;
@@ -176,6 +187,7 @@ export declare class TestSuiteStore implements ITestSuiteStore {
176
187
  enabled: boolean;
177
188
  hasEmbeddedRequest: boolean;
178
189
  slug?: string;
190
+ description?: string;
179
191
  }>;
180
192
  /**
181
193
  * Get selected requests in order
@@ -183,8 +195,9 @@ export declare class TestSuiteStore implements ITestSuiteStore {
183
195
  */
184
196
  getSelectedRequests(selectedIds: string[]): SuiteRequestEntry[];
185
197
  /**
186
- * Add a request to the suite.
187
- * If fullRequest is provided and suiteDir is set, creates a folder with request.json + scripts.
198
+ * Add a request to the suite as a flow node.
199
+ * Copy-on-write: do NOT create an embedded request folder at add time.
200
+ * A folder snapshot is created only when the request is edited/reset in-suite.
188
201
  */
189
202
  addRequest(request: SuiteRequest, fullRequest?: CollectionRequest): void;
190
203
  /**
@@ -192,11 +205,11 @@ export declare class TestSuiteStore implements ITestSuiteStore {
192
205
  */
193
206
  private resolveUniqueSlug;
194
207
  /**
195
- * Remove a request from the suite
208
+ * Remove a request from the suite (removes its node)
196
209
  */
197
210
  removeRequest(requestId: string): void;
198
211
  /**
199
- * Reorder requests by request IDs (format: "collectionId:requestId")
212
+ * Reorder request nodes by "collectionId:requestId" keys
200
213
  */
201
214
  reorderRequests(orderedKeys: string[]): void;
202
215
  /**
@@ -209,4 +222,9 @@ export declare class TestSuiteStore implements ITestSuiteStore {
209
222
  * Overwrites the request folder content.
210
223
  */
211
224
  resyncFromCollection(slug: string): CollectionRequest | undefined;
225
+ /**
226
+ * Extract all SuiteRequest objects from top-level request nodes.
227
+ * Nodes is the sole source of truth — no suite.requests access.
228
+ */
229
+ private _getRequestNodes;
212
230
  }
@@ -11,10 +11,38 @@ export interface FlatRequest {
11
11
  request: CollectionRequestItem;
12
12
  folderPath: string;
13
13
  }
14
+ /**
15
+ * Encode a single folder name segment so that '/' within the name is
16
+ * unambiguous from the '/' path separator used in folderPath strings.
17
+ * Only '/' is encoded; all other characters are left as-is.
18
+ */
19
+ export declare function encodeFolderName(name: string): string;
20
+ /**
21
+ * Decode a single folder name segment back to its display form.
22
+ */
23
+ export declare function decodeFolderName(name: string): string;
24
+ /**
25
+ * Convert an internal folderPath (segments joined by '/', with '/' inside
26
+ * names encoded as '%2F') to a human-readable display string.
27
+ * E.g. "agl-page-composition/TRAY%2FEPG/AVS5-5303 - TRAY%2FEPG"
28
+ * → "agl-page-composition / TRAY/EPG / AVS5-5303 - TRAY/EPG"
29
+ */
30
+ export declare function decodeFolderPath(folderPath: string): string;
31
+ /**
32
+ * Convert a user-supplied folder input to an internal folderPath.
33
+ * Accepts both the display form ("A / B/C / D" with ' / ' separators)
34
+ * and the raw form ("A/B/C"). In the raw form, each slash that matches a
35
+ * known separator boundary is kept; slashes within a segment are encoded.
36
+ * The simplest reliable approach: if ' / ' is present, treat it as the
37
+ * separator; otherwise encode all '/' as '%2F' (treating the whole input
38
+ * as a single folder name or leaf to match by inclusion).
39
+ */
40
+ export declare function normalizeFolderInput(input: string): string;
14
41
  /** Flatten all requests in a collection into a list with their folder paths. */
15
42
  export declare function flattenRequests(collection: Collection, items?: CollectionItem[], folderPath?: string): FlatRequest[];
16
- /** Enumerate every folder path in a collection along with its recursive request count. */
43
+ /** Enumerate every folder path in a collection along with its id and recursive request count. */
17
44
  export declare function enumerateFolders(collection: Collection, items?: CollectionItem[], prefix?: string): Array<{
45
+ folderId: string;
18
46
  folderPath: string;
19
47
  requestCount: number;
20
48
  }>;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * MCP Prompts — pre-defined analysis prompts that leverage the calling LLM.
3
+ *
4
+ * When an MCP client (Copilot, Claude Code, etc.) invokes a prompt, the server
5
+ * fetches workspace data, assembles a rich structured message, and returns it
6
+ * to the client. The client feeds this message to its already-connected LLM,
7
+ * which produces AI-quality analysis without any extra configuration.
8
+ *
9
+ * Available prompts:
10
+ * analyze-test-failure — diagnose failures from a completed run
11
+ * suggest-assertions — write pm.test() scripts for a request
12
+ * review-collection — structural review of a collection
13
+ */
14
+ import type { ICollectionService } from '../types/collection';
15
+ import type { McpRunStore } from './mcp-run-store';
16
+ export interface McpPromptArg {
17
+ name: string;
18
+ description: string;
19
+ required: boolean;
20
+ }
21
+ export interface McpPromptDef {
22
+ name: string;
23
+ description: string;
24
+ arguments: McpPromptArg[];
25
+ }
26
+ export declare const MCP_PROMPTS: McpPromptDef[];
27
+ interface PromptMessage {
28
+ role: 'user' | 'assistant';
29
+ content: {
30
+ type: 'text';
31
+ text: string;
32
+ };
33
+ }
34
+ export interface PromptResult {
35
+ description: string;
36
+ messages: PromptMessage[];
37
+ }
38
+ export declare function buildPromptResult(name: string, args: Record<string, string>, collectionService: ICollectionService, runStore: McpRunStore): Promise<PromptResult>;
39
+ export {};
@@ -8,7 +8,7 @@
8
8
  */
9
9
  export interface McpRunRecord {
10
10
  id: string;
11
- status: 'running' | 'completed' | 'failed';
11
+ status: 'running' | 'completed' | 'failed' | 'cancelled';
12
12
  suiteName: string;
13
13
  startedAt: number;
14
14
  completedAt?: number;
@@ -26,6 +26,8 @@ export interface McpRunRecord {
26
26
  allResults: object[];
27
27
  reportPath: string | null;
28
28
  error?: string;
29
+ /** Request names (unique) that ran without any pm.test() assertion */
30
+ noAssertionExamples?: string[];
29
31
  }
30
32
  export declare class McpRunStore {
31
33
  private readonly store;
@@ -42,4 +44,12 @@ export declare class McpRunStore {
42
44
  prune(): void;
43
45
  /** Iterate all stored run records (non-expired). */
44
46
  values(): IterableIterator<McpRunRecord>;
47
+ /**
48
+ * Best-effort cancellation: mark a running run as 'cancelled' so that the
49
+ * execution loop can detect it and skip remaining requests.
50
+ *
51
+ * Returns `true` when the status was changed; `false` if the run doesn't
52
+ * exist, has already finished, or is in an unmodifiable state.
53
+ */
54
+ cancel(id: string): boolean;
45
55
  }
@@ -13,6 +13,12 @@ export interface McpTool {
13
13
  name: string;
14
14
  description: string;
15
15
  inputSchema: object;
16
+ annotations?: {
17
+ readOnlyHint?: boolean;
18
+ destructiveHint?: boolean;
19
+ idempotentHint?: boolean;
20
+ openWorldHint?: boolean;
21
+ };
16
22
  }
17
23
  /** Remove tools that share an identical name, keeping the first occurrence. */
18
24
  export declare function dedupeToolsByName(tools: McpTool[]): McpTool[];
@@ -21,12 +21,11 @@
21
21
  * human-readable names), so the exact tool name does not affect tool choice.
22
22
  */
23
23
  /**
24
- * Deterministic short token for an ID or folder path (12 hex chars).
25
- * @param value The value to be hashed.
26
- * @param maxLen The maximum length of the raw segment before appending the hash.
27
- * @returns A string combining the truncated value and its hash.
24
+ * Deterministic readable token for an ID or folder path.
25
+ *
26
+ * Shape: `<slug>_<hash12>`
28
27
  */
29
- export declare function mcpToolToken(value: string, maxLen?: number): string;
28
+ export declare function mcpToolToken(value: string): string;
30
29
  /**
31
30
  * Return `value` verbatim when it is a safe, short raw segment (discoverable),
32
31
  * otherwise its deterministic hash token. Either way the result never contains
@@ -67,6 +67,10 @@ export declare const COLLECTION_INPUT_SCHEMA: {
67
67
  readonly type: "number";
68
68
  readonly description: "Number of iterations (default: 1)";
69
69
  };
70
+ readonly concurrency: {
71
+ readonly type: "number";
72
+ readonly description: "Number of parallel virtual users (1–50, default: 1). Each VU runs the full request sequence independently, preserving inter-request dependencies.";
73
+ };
70
74
  readonly stopOnError: {
71
75
  readonly type: "boolean";
72
76
  readonly description: "Stop on first failure";
@@ -107,6 +111,10 @@ export declare const FOLDER_INPUT_SCHEMA: {
107
111
  readonly type: "number";
108
112
  readonly description: "Number of iterations (default: 1)";
109
113
  };
114
+ readonly concurrency: {
115
+ readonly type: "number";
116
+ readonly description: "Number of parallel virtual users (1–50, default: 1). Each VU runs the full request sequence independently.";
117
+ };
110
118
  readonly stopOnError: {
111
119
  readonly type: "boolean";
112
120
  readonly description: "Stop on first failure";
@@ -144,6 +152,10 @@ export declare const SUITE_INPUT_SCHEMA: {
144
152
  readonly type: "number";
145
153
  readonly description: "Number of iterations (overrides suite default)";
146
154
  };
155
+ readonly concurrency: {
156
+ readonly type: "number";
157
+ readonly description: "Number of parallel virtual users (1–50, default: 1). Each VU runs the full request sequence independently.";
158
+ };
147
159
  readonly stopOnError: {
148
160
  readonly type: "boolean";
149
161
  readonly description: "Stop on first failure";
@@ -195,6 +207,7 @@ export declare const GENERIC_TOOL_NAMES: {
195
207
  readonly getRunSummary: "get_run_summary";
196
208
  readonly getFailedRequests: "get_failed_requests";
197
209
  readonly getRequestResult: "get_request_result";
210
+ readonly cancelRun: "cancel_run";
198
211
  readonly setVariable: "set_variable";
199
212
  readonly createCollection: "create_collection";
200
213
  readonly renameCollection: "rename_collection";
@@ -202,6 +215,7 @@ export declare const GENERIC_TOOL_NAMES: {
202
215
  readonly duplicateCollection: "duplicate_collection";
203
216
  readonly createFolder: "create_folder";
204
217
  readonly deleteFolder: "delete_folder";
218
+ readonly getRequest: "get_request";
205
219
  readonly createRequest: "create_request";
206
220
  readonly updateRequest: "update_request";
207
221
  readonly deleteRequest: "delete_request";
@@ -212,6 +226,12 @@ export declare const GENERIC_TOOL_NAMES: {
212
226
  readonly getSuite: "get_suite";
213
227
  readonly createSuite: "create_suite";
214
228
  readonly updateSuiteConfig: "update_suite_config";
229
+ readonly getSuiteNode: "get_suite_node";
230
+ readonly listSuiteNodePaths: "list_suite_node_paths";
231
+ readonly addSuiteNode: "add_suite_node";
232
+ readonly updateSuiteNode: "update_suite_node";
233
+ readonly removeSuiteNode: "remove_suite_node";
234
+ readonly moveSuiteNode: "move_suite_node";
215
235
  readonly addSuiteRequests: "add_suite_requests";
216
236
  readonly removeSuiteRequest: "remove_suite_request";
217
237
  readonly reorderSuiteRequests: "reorder_suite_requests";
@@ -229,12 +249,37 @@ export declare const GENERIC_TOOL_NAMES: {
229
249
  readonly scaffoldCollectionFromOpenApi: "scaffold_collection_from_openapi";
230
250
  readonly suggestAssertions: "suggest_assertions";
231
251
  readonly explainFailure: "explain_failure";
252
+ readonly suggestEnvVars: "suggest_env_vars";
253
+ readonly applyEnvVars: "apply_env_vars";
254
+ readonly getRequestsForEnhancement: "get_requests_for_enhancement";
255
+ readonly applyRequestEnhancements: "apply_request_enhancements";
256
+ readonly aiSuggestEnvVars: "ai_suggest_env_vars";
257
+ readonly aiEnhanceCollection: "ai_enhance_collection";
258
+ readonly analyzeCoverage: "analyze_coverage";
259
+ readonly aiAnalyzeCoverage: "ai_analyze_coverage";
260
+ readonly generateRequestFromIntent: "generate_request_from_intent";
261
+ readonly validateAgainstSpec: "validate_against_spec";
262
+ readonly generateScenarios: "generate_scenarios";
263
+ readonly healAssertions: "heal_assertions";
264
+ readonly generateIterationData: "generate_iteration_data";
232
265
  };
233
266
  export type GenericToolName = (typeof GENERIC_TOOL_NAMES)[keyof typeof GENERIC_TOOL_NAMES];
267
+ /** MCP 2025-11 tool annotations — surface hints to AI clients about safety and idempotency. */
268
+ interface ToolAnnotations {
269
+ /** true = no side-effects (safe to call freely) */
270
+ readOnlyHint?: boolean;
271
+ /** true = irreversible side-effect (client should confirm before calling) */
272
+ destructiveHint?: boolean;
273
+ /** true = safe to retry without unintended side-effects */
274
+ idempotentHint?: boolean;
275
+ /** true = may interact with external systems; false = workspace-local only */
276
+ openWorldHint?: boolean;
277
+ }
234
278
  interface GenericToolDef {
235
279
  name: string;
236
280
  description: string;
237
281
  inputSchema: Record<string, unknown>;
282
+ annotations?: ToolAnnotations;
238
283
  }
239
284
  /**
240
285
  * Build the generic drill-down tool definitions. `collectionLabels` and
@@ -13,6 +13,11 @@ export interface NodeBootstrapOptions {
13
13
  name: string;
14
14
  version: string;
15
15
  };
16
+ /**
17
+ * Optional global store file path.
18
+ * If relative, it is resolved against the workspace folder.
19
+ */
20
+ globalStorePath?: string;
16
21
  }
17
22
  /**
18
23
  * Bootstrap HTTP Forge core services for Node.js environment.
@@ -27,3 +32,7 @@ export declare function bootstrapNodeRuntime(options: NodeBootstrapOptions): Ser
27
32
  * This is a convenience wrapper that combines bootstrap and returns the container.
28
33
  */
29
34
  export declare function createNodeContainer(workspaceFolder: string): ServiceContainer;
35
+ /**
36
+ * Create and initialize service container with optional Node bootstrap overrides.
37
+ */
38
+ export declare function createNodeContainerWithOptions(workspaceFolder: string, options: Omit<NodeBootstrapOptions, 'workspaceFolder'>): ServiceContainer;
@@ -118,6 +118,15 @@ export interface RunCollectionOptions {
118
118
  include?: string[];
119
119
  /** Additional machine-readable reports to generate, e.g. ['junit'] */
120
120
  reporters?: string[];
121
+ /**
122
+ * Maximum number of iterations to execute in parallel (default: 1 = sequential).
123
+ * Each iteration runs the full request sequence in order so that inter-request
124
+ * dependencies (e.g. login → use token → call protected endpoint) are always
125
+ * preserved within an iteration. Concurrency means N independent virtual users
126
+ * running the same flow simultaneously, not requests within one flow running in
127
+ * parallel. Max: 50.
128
+ */
129
+ concurrency?: number;
121
130
  /**
122
131
  * Restrict execution to requests under this folder path (slash-separated
123
132
  * folder names, e.g. "Auth/Login"). When omitted, the whole collection runs.
@@ -153,6 +162,11 @@ export interface RunSuiteOptions {
153
162
  include?: string[];
154
163
  /** Additional machine-readable reports to generate, e.g. ['junit'] */
155
164
  reporters?: string[];
165
+ /**
166
+ * Maximum number of iterations to execute in parallel (default: 1 = sequential).
167
+ * Each iteration runs the full request sequence in order. Max: 50.
168
+ */
169
+ concurrency?: number;
156
170
  }
157
171
  /**
158
172
  * Execute a single request directly without MCP server.
@@ -39,6 +39,24 @@ export interface UnifiedFolder {
39
39
  scripts?: CollectionScripts;
40
40
  items: (UnifiedFolder | UnifiedRequest)[];
41
41
  }
42
+ /**
43
+ * Operation example (for OpenAPI generation)
44
+ */
45
+ export interface OperationExample {
46
+ name: string;
47
+ description?: string;
48
+ value: any;
49
+ }
50
+ /**
51
+ * Operation response definition (for OpenAPI generation)
52
+ */
53
+ export interface OperationResponse {
54
+ description: string;
55
+ contentType?: string;
56
+ schema?: JSONSchema7;
57
+ examples?: Record<string, any>;
58
+ headers?: Record<string, KeyValueEntry>;
59
+ }
42
60
  /**
43
61
  * Unified Request - normalized request format
44
62
  * Supports full feature set from CollectionRequest with metadata preservation
@@ -71,6 +89,18 @@ export interface UnifiedRequest {
71
89
  responseSchema?: ResponseSchemaDefinition;
72
90
  /** Body schema for validation */
73
91
  bodySchema?: BodySchemaDefinition;
92
+ /** Explicit OpenAPI operationId (e.g., from @Operation, @RequestMapping) */
93
+ operationId?: string;
94
+ /** Explicit OpenAPI summary, separate from name */
95
+ summary?: string;
96
+ /** Explicit OpenAPI tags (e.g., from @Tag, controller class) */
97
+ tags?: string[];
98
+ /** Request/response examples for OpenAPI */
99
+ examples?: OperationExample[];
100
+ /** Per-status-code response definitions */
101
+ responses?: Record<string, OperationResponse>;
102
+ /** Operation-level security requirements */
103
+ security?: Record<string, string[]>[];
74
104
  }
75
105
  /**
76
106
  * Collection-level scripts
@@ -161,6 +191,36 @@ export interface RequestSettings {
161
191
  strictSSL?: boolean;
162
192
  decompress?: boolean;
163
193
  includeCookies?: boolean;
194
+ tls?: TlsSettings;
195
+ certificates?: TlsCertificateMapping[];
196
+ }
197
+ /**
198
+ * TLS options for HTTPS requests
199
+ */
200
+ export interface TlsSettings {
201
+ /** Path to CA certificate bundle (PEM) */
202
+ caPath?: string;
203
+ /** Path to client certificate (PEM) */
204
+ certPath?: string;
205
+ /** Path to client private key (PEM) */
206
+ keyPath?: string;
207
+ /** Path to client certificate/key bundle (PFX/P12) */
208
+ pfxPath?: string;
209
+ /** Passphrase for key/pfx if required */
210
+ passphrase?: string;
211
+ /** Optional TLS servername (SNI override) */
212
+ servername?: string;
213
+ }
214
+ /**
215
+ * Host-based TLS certificate mapping (Postman-style global certificate settings)
216
+ */
217
+ export interface TlsCertificateMapping extends TlsSettings {
218
+ /** Host matcher: exact host (api.example.com), wildcard (*.example.com), or '*' */
219
+ host: string;
220
+ /** Optional port filter */
221
+ port?: number;
222
+ /** Enable/disable mapping */
223
+ enabled?: boolean;
164
224
  }
165
225
  /**
166
226
  * HTTP request ready for execution
@@ -578,11 +638,17 @@ export interface CollectionRequest {
578
638
  deprecated?: boolean;
579
639
  responseSchema?: ResponseSchemaDefinition;
580
640
  bodySchema?: BodySchemaDefinition;
641
+ operationId?: string;
642
+ summary?: string;
643
+ tags?: string[];
644
+ examples?: OperationExample[];
645
+ responses?: Record<string, OperationResponse>;
646
+ security?: Record<string, string[]>[];
581
647
  }
582
648
  /**
583
649
  * Encoded request body ready for HTTP transmission
584
650
  */
585
- export type RequestBodyEncoded = string | Buffer | null;
651
+ export type RequestBodyEncoded = string | Buffer | FormData | URLSearchParams | null;
586
652
  /**
587
653
  * Resolved body ready for HTTP transmission
588
654
  */
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Serialize a value for storage in variable scopes.
3
+ * Strings are stored as-is; other values are JSON payloads with U+001E marker.
4
+ */
5
+ export declare function serializeTypedValue(raw: unknown): string;
6
+ /**
7
+ * Deserialize a value stored by script variable scopes.
8
+ * Values prefixed with U+001E are JSON payloads and are parsed back.
9
+ */
10
+ export declare function deserializeTypedValue(raw: unknown): unknown;
11
+ /**
12
+ * Deserialize every value in a variable map.
13
+ */
14
+ export declare function deserializeTypedRecord(record: Record<string, unknown> | undefined): Record<string, unknown>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@http-forge/core",
3
- "version": "0.6.1",
4
- "description": "Headless HTTP testing engine with Postman collection support, dynamic variables, and script-based automation.",
3
+ "version": "0.6.22.beta.1",
4
+ "description": "Headless Postman-compatible API testing engine for Node.js, CI/CD, OpenAPI workflows, and HTTP Forge automation",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -27,18 +27,32 @@
27
27
  "clean": "rimraf dist"
28
28
  },
29
29
  "keywords": [
30
+ "http-forge",
31
+ "http forge",
30
32
  "http",
31
33
  "api",
32
34
  "testing",
33
- "automation",
35
+ "api testing",
34
36
  "postman",
37
+ "postman alternative",
38
+ "postman runtime",
39
+ "openapi",
40
+ "graphql",
41
+ "automation",
42
+ "ci",
43
+ "cd",
44
+ "ci-cd",
45
+ "api engine",
35
46
  "collection",
47
+ "headless",
48
+ "headless api testing",
49
+ "nodejs",
50
+ "mcp",
51
+ "mcp server",
36
52
  "scripting",
37
53
  "variables",
38
54
  "cookies",
39
- "ci-cd",
40
- "headless",
41
- "http-forge"
55
+ "runtime"
42
56
  ],
43
57
  "author": "Henry Huang",
44
58
  "license": "MIT",