UNPKG

@paultaku/node-mock-server

Version:

A TypeScript-based mock server with automatic Swagger-based mock file generation

36 lines 1.03 kB
/** * Endpoint File Generator * * Generates file structure and JSON templates for mock endpoints. * Creates folder structure mirroring API paths with default response files. */ export interface EndpointFileConfig { mockRoot: string; path: string; method: string; } export interface EndpointFileResult { filesCreated: string[]; mockDirectory: string; } /** * Generate file structure and templates for a mock endpoint * * @param config - Configuration for endpoint file generation * @returns Result containing list of created files and directory path * * @example * ```ts * const result = await generateEndpointFiles({ * mockRoot: '/mock', * path: '/pet/status/{id}', * method: 'GET' * }); * // Creates: /mock/pet/status/{id}/GET/ * // - success-200.json * // - unexpected-error-default.json * // - status.json * ``` */ export declare function generateEndpointFiles(config: EndpointFileConfig): Promise<EndpointFileResult>; //# sourceMappingURL=endpoint-file-generator.d.ts.map