/** * manifest mock command * * Starts a local HTTP server that simulates API routes derived from compiled * Manifest IR. Uses RuntimeEngine with in-memory stores for real command * execution. Enables frontend teams to develop against a realistic API * before the backend is deployed. */ import http from 'node:http'; import { RuntimeEngine, type CommandResult } from '@angriff36/manifest'; interface MockCommandOptions { port?: string | number; host?: string; cors?: boolean; scenario?: string; } interface IR { entities: IREntity[]; commands: IRCommand[]; policies: unknown[]; events: unknown[]; stores: unknown[]; [key: string]: unknown; } interface IREntity { name: string; properties: Array<{ name: string; type?: { name?: string; } | string; defaultValue?: unknown; }>; commands?: string[]; constraints?: unknown[]; [key: string]: unknown; } interface IRCommand { name: string; entity?: string; parameters?: Array<{ name: string; type?: unknown; }>; guards?: unknown[]; actions?: unknown[]; [key: string]: unknown; } export interface Route { method: 'GET' | 'POST'; path: string; entity: string; handler: 'list' | 'get' | 'command'; command?: string; } /** * Convert camelCase or PascalCase to kebab-case. */ export declare function toKebabCase(str: string): string; /** * Derive REST routes from IR entities and commands. */ export declare function deriveRoutes(ir: IR): Route[]; /** * Map a CommandResult to an HTTP status code. */ export declare function commandResultToStatus(result: CommandResult): number; /** * Create and start the mock HTTP server. */ export declare function createMockServer(engine: RuntimeEngine, routes: Route[], options: { cors?: boolean; }): http.Server; /** * Main mock command handler. */ export declare function mockCommand(source: string, options: MockCommandOptions): Promise; export {}; //# sourceMappingURL=mock.d.ts.map