@http-forge/core 0.6.36-beta.2 → 0.6.37

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.
@@ -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';
@@ -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
@@ -9,7 +9,8 @@
9
9
  */
10
10
  export declare class MarkdownSummaryGenerator {
11
11
  private readonly basePath;
12
- constructor(basePath: string);
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
- /** Build a minimal JSON example from a JSON Schema (recursive). */
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.2",
3
+ "version": "0.6.37",
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",