@http-forge/core 0.6.36-beta.1 → 0.6.36-beta.3
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/dist/index.d.ts +23 -22
- package/dist/index.js +154 -148
- package/dist/index.mjs +151 -145
- package/dist/infrastructure/api-discovery/endpoint-to-request.d.ts +43 -0
- package/dist/infrastructure/api-discovery/index.d.ts +2 -0
- package/dist/infrastructure/config/config-service.d.ts +3 -1
- package/dist/infrastructure/config/config.interface.d.ts +17 -0
- package/dist/infrastructure/config/index.d.ts +1 -1
- package/dist/infrastructure/test-suite/markdown-summary-generator.d.ts +2 -1
- package/dist/runtime/mcp-handlers/discovery.d.ts +2 -3
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discovered endpoint → HTTP Forge request adapter.
|
|
3
|
+
*
|
|
4
|
+
* Pure helpers shared by the MCP discovery tools (`create_request_from_endpoint`,
|
|
5
|
+
* `generate_test_suite`, `generate_workflow`) and the extension's Discovered
|
|
6
|
+
* APIs view actions. Keeping them here (rather than inside the MCP handler)
|
|
7
|
+
* lets every consumer reuse the exact same request-building rules.
|
|
8
|
+
*/
|
|
9
|
+
import type { CollectionRequestItem, CreateRequestOptions } from '../../types/collection';
|
|
10
|
+
import type { RequestBody } from '../../types/types';
|
|
11
|
+
import type { DiscoveredApi } from './types';
|
|
12
|
+
import type { JsonSchema } from './types';
|
|
13
|
+
/**
|
|
14
|
+
* Build a minimal JSON example from a JSON Schema (recursive).
|
|
15
|
+
*/
|
|
16
|
+
export declare function schemaToExample(schema: JsonSchema | undefined): unknown;
|
|
17
|
+
/** Derive a request name from a discovered endpoint (source symbol, else method+path). */
|
|
18
|
+
export declare function endpointToName(endpoint: DiscoveredApi): string;
|
|
19
|
+
/**
|
|
20
|
+
* Convert a discovered endpoint into the request parts (headers, query, path
|
|
21
|
+
* params, body) needed by `ICollectionService.createRequest`.
|
|
22
|
+
*
|
|
23
|
+
* - Header/query params become enabled key/value entries (sample values when
|
|
24
|
+
* `includeSampleData`).
|
|
25
|
+
* - Path params get a concrete value so the request runs against a live server
|
|
26
|
+
* (e.g. `:id` → `1`).
|
|
27
|
+
* - Bearer/JWT/basic auth becomes an `Authorization` header with a `{{TOKEN}}`
|
|
28
|
+
* / `{{BASIC_AUTH}}` placeholder.
|
|
29
|
+
* - The discovered request body schema is rendered to a raw JSON body (or form
|
|
30
|
+
* entries for form/multipart).
|
|
31
|
+
*/
|
|
32
|
+
export declare function endpointToRequestParts(endpoint: DiscoveredApi, includeSampleData: boolean): {
|
|
33
|
+
headers: unknown[];
|
|
34
|
+
query: unknown[];
|
|
35
|
+
params: Record<string, string>;
|
|
36
|
+
body: RequestBody | undefined;
|
|
37
|
+
};
|
|
38
|
+
/** Build the request description: endpoint description + provenance + framework/confidence. */
|
|
39
|
+
export declare function buildDescription(endpoint: DiscoveredApi): string;
|
|
40
|
+
/** Build a `CreateRequestOptions` from a discovered endpoint. */
|
|
41
|
+
export declare function endpointToCreateRequestOptions(endpoint: DiscoveredApi, collectionId: string, baseUrl?: string): CreateRequestOptions;
|
|
42
|
+
/** The collection request item shape produced after `createRequest`. */
|
|
43
|
+
export type { CollectionRequestItem };
|
|
@@ -19,6 +19,8 @@ export { LambdaDiscoveryProvider, parseYamlToObject } from './providers/lambda-d
|
|
|
19
19
|
export { SpringDiscoveryProvider } from './spring/spring-discovery-provider';
|
|
20
20
|
export { FastApiDiscoveryProvider } from './fastapi/fastapi-discovery-provider';
|
|
21
21
|
export * from './analyzer';
|
|
22
|
+
export { buildDescription, endpointToCreateRequestOptions, endpointToName, endpointToRequestParts, schemaToExample, } from './endpoint-to-request';
|
|
23
|
+
export type { CollectionRequestItem } from './endpoint-to-request';
|
|
22
24
|
export { generateSuiteFromEndpoints, suiteIdFromName, generateFlowFromEndpoints, } from './test-generator';
|
|
23
25
|
export type { GenerateSuiteOptions, GenerateSuiteResult, GenerateFlowOptions, } from './test-generator';
|
|
24
26
|
export { discoverWorkflows, } from './workflow-discovery';
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* instead of VS Code APIs.
|
|
9
9
|
*/
|
|
10
10
|
import { IFileWatcherFactory, INotificationService } from '../../types/platform';
|
|
11
|
-
import type { EnvironmentsConfig, HttpForgeConfig, IConfigService, McpConfig, ProxyConfig, RequestConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './config.interface';
|
|
11
|
+
import type { DiscoveryConfig, EnvironmentsConfig, HttpForgeConfig, IConfigService, McpConfig, ProxyConfig, RequestConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './config.interface';
|
|
12
12
|
/**
|
|
13
13
|
* Configuration Service Implementation
|
|
14
14
|
*
|
|
@@ -23,6 +23,7 @@ export declare class ConfigService implements IConfigService {
|
|
|
23
23
|
private configPath;
|
|
24
24
|
private fileWatchers;
|
|
25
25
|
constructor(workspacePath: string, fileWatcherFactory?: IFileWatcherFactory | undefined, notifications?: INotificationService | undefined);
|
|
26
|
+
private normalizeWorkspacePath;
|
|
26
27
|
private resolveConfigPath;
|
|
27
28
|
/**
|
|
28
29
|
* Load configuration from file, merging with defaults
|
|
@@ -53,6 +54,7 @@ export declare class ConfigService implements IConfigService {
|
|
|
53
54
|
*/
|
|
54
55
|
getRestClientMergeGlobals(): boolean;
|
|
55
56
|
getProxyConfig(): ProxyConfig | null;
|
|
57
|
+
getDiscoveryConfig(): DiscoveryConfig;
|
|
56
58
|
getMcpConfig(): McpConfig;
|
|
57
59
|
/**
|
|
58
60
|
* Resolve a path relative to workspace
|
|
@@ -119,6 +119,19 @@ export interface RestClientExportConfig {
|
|
|
119
119
|
/** When exporting environments, merge global variables into each environment file */
|
|
120
120
|
mergeGlobals?: boolean;
|
|
121
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Discovery configuration
|
|
124
|
+
*/
|
|
125
|
+
export interface DiscoveryConfig {
|
|
126
|
+
/** Absolute or workspace-relative path to a custom seed loader module. */
|
|
127
|
+
customSeedLoaderModulePath?: string;
|
|
128
|
+
/** Custom framework hints for discovery. Defaults to ['auto']. */
|
|
129
|
+
frameworks?: string[];
|
|
130
|
+
/** Custom request/response context properties to search for during component analysis. */
|
|
131
|
+
contextProperties?: string[];
|
|
132
|
+
/** When true, skip component dependency analysis during discovery. */
|
|
133
|
+
skipComponentAnalysis?: boolean;
|
|
134
|
+
}
|
|
122
135
|
/**
|
|
123
136
|
* MCP Server CORS configuration
|
|
124
137
|
*/
|
|
@@ -260,6 +273,8 @@ export interface HttpForgeConfig {
|
|
|
260
273
|
proxy?: ProxyConfig | null;
|
|
261
274
|
/** Cloud secret provider configuration (optional) */
|
|
262
275
|
secrets?: SecretsConfig;
|
|
276
|
+
/** Discovery configuration (optional) */
|
|
277
|
+
discovery?: DiscoveryConfig;
|
|
263
278
|
}
|
|
264
279
|
/**
|
|
265
280
|
* Configuration service interface
|
|
@@ -277,6 +292,8 @@ export interface IConfigService {
|
|
|
277
292
|
getRunnerConfig(): RunnerConfig;
|
|
278
293
|
/** Get environments configuration */
|
|
279
294
|
getEnvironmentsConfig(): EnvironmentsConfig;
|
|
295
|
+
/** Get discovery configuration */
|
|
296
|
+
getDiscoveryConfig(): DiscoveryConfig;
|
|
280
297
|
/** Get proxy configuration */
|
|
281
298
|
getProxyConfig(): ProxyConfig | null;
|
|
282
299
|
/** Get MCP server project-level configuration (always returns resolved defaults) */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Config Services
|
|
3
3
|
*/
|
|
4
|
-
export type { EnvironmentsConfig, HttpForgeConfig, IConfigService, McpConfig, McpCorsConfig, McpToolMode, ProxyConfig, RequestConfig, RestClientExportConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './config.interface';
|
|
4
|
+
export type { DiscoveryConfig, EnvironmentsConfig, HttpForgeConfig, IConfigService, McpConfig, McpCorsConfig, McpToolMode, ProxyConfig, RequestConfig, RestClientExportConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './config.interface';
|
|
5
5
|
export { CONFIG_FILES, DEFAULT_CONFIG, ROOT_DIRECTORIES } from './default-config';
|
|
6
6
|
export { ConfigService } from './config-service';
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export declare class MarkdownSummaryGenerator {
|
|
11
11
|
private readonly basePath;
|
|
12
|
-
|
|
12
|
+
private readonly suitesPath?;
|
|
13
|
+
constructor(basePath: string, suitesPath?: string | undefined);
|
|
13
14
|
/**
|
|
14
15
|
* Generate run-summary.md for the given run.
|
|
15
16
|
* @returns absolute path to the written file
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* endpoint becomes a working HTTP Forge request with NO OpenAPI involved and a
|
|
6
6
|
* provenance label pointing at the source location it was derived from.
|
|
7
7
|
*/
|
|
8
|
+
import { schemaToExample } from '../../infrastructure/api-discovery';
|
|
8
9
|
import type { McpToolHandler } from './types';
|
|
9
|
-
import type { JsonSchema } from '../../infrastructure/api-discovery';
|
|
10
10
|
export declare const discoveryHandlers: McpToolHandler[];
|
|
11
|
-
|
|
12
|
-
export declare function schemaToExample(schema: JsonSchema | undefined): unknown;
|
|
11
|
+
export { schemaToExample };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@http-forge/core",
|
|
3
|
-
"version": "0.6.36-beta.
|
|
3
|
+
"version": "0.6.36-beta.3",
|
|
4
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",
|