@orval/mcp 8.4.2 → 8.5.0
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.mjs +1 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
package/dist/index.mjs
CHANGED
|
@@ -201,8 +201,7 @@ const mcpClientBuilder = {
|
|
|
201
201
|
extraFiles: generateExtraFiles
|
|
202
202
|
};
|
|
203
203
|
const builder = () => () => mcpClientBuilder;
|
|
204
|
-
var src_default = builder;
|
|
205
204
|
|
|
206
205
|
//#endregion
|
|
207
|
-
export { builder,
|
|
206
|
+
export { builder, builder as default, generateExtraFiles, generateMcp, generateServer, getMcpHeader };
|
|
208
207
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["getMcpHeader: ClientHeaderBuilder","generateMcp: ClientBuilder","generateExtraFiles: ClientExtraFilesBuilder","mcpClientBuilder: ClientGeneratorsBuilder"],"sources":["../src/index.ts"],"sourcesContent":["import {\n camel,\n type ClientBuilder,\n type ClientExtraFilesBuilder,\n type ClientGeneratorsBuilder,\n type ClientHeaderBuilder,\n type ContextSpec,\n generateMutatorImports,\n type GeneratorVerbOptions,\n getFileInfo,\n getFullRoute,\n isObject,\n jsDoc,\n jsStringEscape,\n type NormalizedOutputOptions,\n type OpenApiInfoObject,\n pascal,\n upath,\n} from '@orval/core';\nimport { generateClient, generateFetchHeader } from '@orval/fetch';\nimport { generateZod } from '@orval/zod';\n\nconst getHeader = (\n option: false | ((info: OpenApiInfoObject) => string | string[]),\n info: OpenApiInfoObject,\n): string => {\n if (!option) {\n return '';\n }\n\n const header = option(info);\n\n return Array.isArray(header) ? jsDoc({ description: header }) : header;\n};\n\nexport const getMcpHeader: ClientHeaderBuilder = ({ verbOptions, output }) => {\n const targetInfo = getFileInfo(output.target);\n const schemasPath = isObject(output.schemas)\n ? output.schemas.path\n : output.schemas;\n const schemaInfo = schemasPath ? getFileInfo(schemasPath) : undefined;\n\n const isZodSchemaOutput =\n isObject(output.schemas) && output.schemas.type === 'zod';\n const basePath = schemaInfo?.dirname;\n const relativeSchemaImportPath = basePath\n ? isZodSchemaOutput && output.indexFiles\n ? upath.relativeSafe(\n targetInfo.dirname,\n upath.joinSafe(basePath, 'index.zod'),\n )\n : upath.relativeSafe(targetInfo.dirname, basePath)\n : './' + targetInfo.filename + '.schemas';\n\n const importSchemaNames = new Set(\n Object.values(verbOptions).flatMap((verbOption) => {\n const imports = [];\n const pascalOperationName = pascal(verbOption.operationName);\n\n if (verbOption.queryParams) {\n imports.push(`${pascalOperationName}Params`);\n }\n\n if (verbOption.body.imports[0]?.name) {\n imports.push(verbOption.body.imports[0]?.name);\n }\n\n return imports;\n }),\n )\n .values()\n .toArray();\n\n const importSchemasImplementation = `import {\\n ${importSchemaNames.join(\n ',\\n ',\n )}\\n} from '${relativeSchemaImportPath}';\n`;\n\n const relativeFetchClientPath = './http-client';\n const importFetchClientNames = new Set(\n Object.values(verbOptions).flatMap(\n (verbOption) => verbOption.operationName,\n ),\n )\n .values()\n .toArray();\n\n const importFetchClientImplementation = `import {\\n ${importFetchClientNames.join(\n ',\\n ',\n )}\\n} from '${relativeFetchClientPath}';\n `;\n\n const content = [\n importSchemasImplementation,\n importFetchClientImplementation,\n ].join('\\n');\n\n return content + '\\n';\n};\n\nexport const generateMcp: ClientBuilder = (verbOptions) => {\n const handlerArgsTypes = [];\n const pathParamsType = verbOptions.params\n .map((param) => {\n const paramName = param.name.split(': ')[0];\n const paramType = param.implementation.split(': ')[1];\n return ` ${paramName}: ${paramType}`;\n })\n .join(',\\n');\n if (pathParamsType) {\n handlerArgsTypes.push(` pathParams: {\\n${pathParamsType}\\n };`);\n }\n if (verbOptions.queryParams) {\n handlerArgsTypes.push(\n ` queryParams: ${verbOptions.queryParams.schema.name};`,\n );\n }\n if (verbOptions.body.definition) {\n handlerArgsTypes.push(` bodyParams: ${verbOptions.body.definition};`);\n }\n\n const handlerArgsName = `${verbOptions.operationName}Args`;\n const handlerArgsImplementation =\n handlerArgsTypes.length > 0\n ? `\nexport type ${handlerArgsName} = {\n${handlerArgsTypes.join('\\n')}\n}\n`\n : '';\n\n const fetchParams = [];\n if (verbOptions.params.length > 0) {\n const pathParamsArgs = verbOptions.params\n .map((param) => {\n const paramName = param.name.split(': ')[0];\n\n return `args.pathParams.${paramName}`;\n })\n .join(', ');\n\n fetchParams.push(pathParamsArgs);\n }\n if (verbOptions.body.definition) fetchParams.push(`args.bodyParams`);\n if (verbOptions.queryParams) fetchParams.push(`args.queryParams`);\n\n const handlerName = `${verbOptions.operationName}Handler`;\n const handlerImplementation = `\nexport const ${handlerName} = async (${handlerArgsTypes.length > 0 ? `args: ${handlerArgsName}` : ''}) => {\n const res = await ${verbOptions.operationName}(${fetchParams.join(', ')});\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(res),\n },\n ],\n };\n};`;\n\n const handlersImplementation = [\n handlerArgsImplementation,\n handlerImplementation,\n ].join('');\n\n return {\n implementation: handlersImplementation ? `${handlersImplementation}\\n` : '',\n imports: [],\n };\n};\n\nexport const generateServer = (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n const info = context.spec.info;\n const { extension, dirname } = getFileInfo(output.target);\n const serverPath = upath.join(dirname, `server${extension}`);\n const header = getHeader(output.override.header, info);\n\n const toolImplementations = Object.values(verbOptions)\n .map((verbOption) => {\n const pascalOperationName = pascal(verbOption.operationName);\n const inputSchemaTypes = [];\n if (verbOption.params.length > 0)\n inputSchemaTypes.push(` pathParams: ${pascalOperationName}Params`);\n if (verbOption.queryParams)\n inputSchemaTypes.push(\n ` queryParams: ${pascalOperationName}QueryParams`,\n );\n if (verbOption.body.definition)\n inputSchemaTypes.push(` bodyParams: ${pascalOperationName}Body`);\n\n const inputSchemaImplementation =\n inputSchemaTypes.length > 0\n ? ` {\n ${inputSchemaTypes.join(',\\n ')}\n },`\n : '';\n\n const toolImplementation = `\nserver.tool(\n '${jsStringEscape(verbOption.operationName)}',\n '${jsStringEscape(verbOption.summary)}',${inputSchemaImplementation ? `\\n${inputSchemaImplementation}` : ''}\n ${jsStringEscape(verbOption.operationName)}Handler\n);`;\n\n return toolImplementation;\n })\n .join('\\n');\n\n const importToolSchemas = Object.values(verbOptions)\n .flatMap((verbOption) => {\n const imports = [];\n\n const pascalOperationName = pascal(verbOption.operationName);\n\n if (verbOption.headers) imports.push(` ${pascalOperationName}Header`);\n if (verbOption.params.length > 0)\n imports.push(` ${pascalOperationName}Params`);\n if (verbOption.queryParams)\n imports.push(` ${pascalOperationName}QueryParams`);\n if (verbOption.body.definition)\n imports.push(` ${pascalOperationName}Body`);\n\n return imports;\n })\n .join(',\\n');\n const importToolSchemasImplementation = `import {\\n${importToolSchemas}\\n} from './tool-schemas.zod';`;\n\n const importHandlers = Object.values(verbOptions)\n .filter((verbOption) =>\n toolImplementations.includes(`${verbOption.operationName}Handler`),\n )\n .map((verbOption) => ` ${verbOption.operationName}Handler`)\n .join(`,\\n`);\n const importHandlersImplementation = `import {\\n${importHandlers}\\n} from './handlers';`;\n\n const importDependenciesImplementation = `import {\n McpServer\n} from '@modelcontextprotocol/sdk/server/mcp.js';\n \nimport {\n StdioServerTransport\n} from '@modelcontextprotocol/sdk/server/stdio.js'; \n`;\n const newMcpServerImplementation = `\nconst server = new McpServer({\n name: '${camel(info.title)}Server',\n version: '1.0.0',\n});\n`;\n const serverConnectImplementation = `\nconst transport = new StdioServerTransport();\n\nserver.connect(transport).then(() => {\n console.error('MCP server running on stdio');\n}).catch(console.error);\n`;\n\n const content = [\n header,\n importDependenciesImplementation,\n importHandlersImplementation,\n importToolSchemasImplementation,\n newMcpServerImplementation,\n toolImplementations,\n serverConnectImplementation,\n ].join('\\n');\n\n return [\n {\n content,\n path: serverPath,\n },\n ];\n};\n\nconst generateZodFiles = async (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n const { extension, dirname } = getFileInfo(output.target);\n\n const header = getHeader(output.override.header, context.spec.info);\n\n const zods = await Promise.all(\n Object.values(verbOptions).map(async (verbOption) =>\n generateZod(\n verbOption,\n {\n route: verbOption.route,\n pathRoute: verbOption.pathRoute,\n override: output.override,\n context,\n mock: output.mock,\n output: output.target,\n },\n output.client,\n ),\n ),\n );\n\n const allMutators = new Map(\n zods.flatMap((z) => z.mutators ?? []).map((m) => [m.name, m]),\n )\n .values()\n .toArray();\n\n const mutatorsImports = generateMutatorImports({\n mutators: allMutators,\n });\n\n let content = `${header}import { z as zod } from 'zod';\\n${mutatorsImports}\\n`;\n\n const zodPath = upath.join(dirname, `tool-schemas.zod${extension}`);\n\n content += zods.map((zod) => zod.implementation).join('\\n');\n\n return [\n {\n content,\n path: zodPath,\n },\n ];\n};\n\nconst generateHttpClientFiles = async (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n const { extension, dirname, filename } = getFileInfo(output.target);\n\n const header = getHeader(output.override.header, context.spec.info);\n\n const clients = await Promise.all(\n Object.values(verbOptions).map(async (verbOption) => {\n const fullRoute = getFullRoute(\n verbOption.route,\n context.spec.servers,\n output.baseUrl,\n );\n\n const options = {\n route: fullRoute,\n pathRoute: verbOption.pathRoute,\n override: output.override,\n context,\n mock: output.mock,\n output: output.target,\n };\n\n return generateClient(verbOption, options, output.client, output);\n }),\n );\n\n const clientImplementation = clients\n .map((client) => client.implementation)\n .join('\\n');\n\n const isZodSchemaOutput =\n isObject(output.schemas) && output.schemas.type === 'zod';\n const schemasPath = isObject(output.schemas)\n ? output.schemas.path\n : output.schemas;\n const basePath = schemasPath ? getFileInfo(schemasPath).dirname : undefined;\n const relativeSchemasPath = basePath\n ? isZodSchemaOutput && output.indexFiles\n ? upath.relativeSafe(dirname, upath.joinSafe(basePath, 'index.zod'))\n : upath.relativeSafe(dirname, basePath)\n : './' + filename + '.schemas';\n\n const importNames = clients\n .flatMap((client) => client.imports)\n .map((imp) => imp.name);\n const uniqueImportNames = new Set(importNames).values().toArray();\n\n const importImplementation = `import { ${uniqueImportNames.join(\n ',\\n',\n )} } from '${relativeSchemasPath}';`;\n\n const fetchHeader = generateFetchHeader({\n title: '',\n isRequestOptions: false,\n isMutator: false,\n noFunction: false,\n isGlobalMutator: false,\n provideIn: false,\n hasAwaitedType: false,\n output,\n verbOptions,\n clientImplementation,\n });\n\n const content = [\n header,\n importImplementation,\n fetchHeader,\n clientImplementation,\n ].join('\\n');\n const outputPath = upath.join(dirname, `http-client${extension}`);\n\n return [\n {\n content,\n path: outputPath,\n },\n ];\n};\n\nexport const generateExtraFiles: ClientExtraFilesBuilder = async (\n verbOptions,\n output,\n context,\n) => {\n const server = generateServer(verbOptions, output, context);\n const [zods, httpClients] = await Promise.all([\n generateZodFiles(verbOptions, output, context),\n generateHttpClientFiles(verbOptions, output, context),\n ]);\n\n return [...server, ...zods, ...httpClients];\n};\n\nconst mcpClientBuilder: ClientGeneratorsBuilder = {\n client: generateMcp,\n header: getMcpHeader,\n extraFiles: generateExtraFiles,\n};\n\nexport const builder = () => () => mcpClientBuilder;\n\nexport default builder;\n"],"mappings":";;;;;AAsBA,MAAM,aACJ,QACA,SACW;AACX,KAAI,CAAC,OACH,QAAO;CAGT,MAAM,SAAS,OAAO,KAAK;AAE3B,QAAO,MAAM,QAAQ,OAAO,GAAG,MAAM,EAAE,aAAa,QAAQ,CAAC,GAAG;;AAGlE,MAAaA,gBAAqC,EAAE,aAAa,aAAa;CAC5E,MAAM,aAAa,YAAY,OAAO,OAAO;CAC7C,MAAM,cAAc,SAAS,OAAO,QAAQ,GACxC,OAAO,QAAQ,OACf,OAAO;CACX,MAAM,aAAa,cAAc,YAAY,YAAY,GAAG;CAE5D,MAAM,oBACJ,SAAS,OAAO,QAAQ,IAAI,OAAO,QAAQ,SAAS;CACtD,MAAM,WAAW,YAAY;CAC7B,MAAM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;CAEtB,MAAM,cAAc,QACjB,SAAS,WAAW,OAAO,QAAQ,CACnC,KAAK,QAAQ,IAAI,KAAK;AA4BzB,QAAO,CACL;EACE,SAVY;GACd;GAlB2B,YAFH,IAAI,IAAI,YAAY,CAAC,QAAQ,CAAC,SAAS,CAEN,KACzD,MACD,CAAC,WAAW,oBAAoB;GAEb,oBAAoB;IACtC,OAAO;IACP,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,iBAAiB;IACjB,WAAW;IACX,gBAAgB;IAChB;IACA;IACA;IACD,CAAC;GAMA;GACD,CAAC,KAAK,KAAK;EAMR,MALe,MAAM,KAAK,SAAS,cAAc,YAAY;EAM9D,CACF;;AAGH,MAAaC,qBAA8C,OACzD,aACA,QACA,YACG;CACH,MAAM,SAAS,eAAe,aAAa,QAAQ,QAAQ;CAC3D,MAAM,CAAC,MAAM,eAAe,MAAM,QAAQ,IAAI,CAC5C,iBAAiB,aAAa,QAAQ,QAAQ,EAC9C,wBAAwB,aAAa,QAAQ,QAAQ,CACtD,CAAC;AAEF,QAAO;EAAC,GAAG;EAAQ,GAAG;EAAM,GAAG;EAAY;;AAG7C,MAAMC,mBAA4C;CAChD,QAAQ;CACR,QAAQ;CACR,YAAY;CACb;AAED,MAAa,sBAAsB;AAEnC,kBAAe"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n camel,\n type ClientBuilder,\n type ClientExtraFilesBuilder,\n type ClientGeneratorsBuilder,\n type ClientHeaderBuilder,\n type ContextSpec,\n generateMutatorImports,\n type GeneratorVerbOptions,\n getFileInfo,\n getFullRoute,\n isObject,\n jsDoc,\n jsStringEscape,\n type NormalizedOutputOptions,\n type OpenApiInfoObject,\n pascal,\n upath,\n} from '@orval/core';\nimport { generateClient, generateFetchHeader } from '@orval/fetch';\nimport { generateZod } from '@orval/zod';\n\nconst getHeader = (\n option: false | ((info: OpenApiInfoObject) => string | string[]),\n info: OpenApiInfoObject,\n): string => {\n if (!option) {\n return '';\n }\n\n const header = option(info);\n\n return Array.isArray(header) ? jsDoc({ description: header }) : header;\n};\n\nexport const getMcpHeader: ClientHeaderBuilder = ({ verbOptions, output }) => {\n const targetInfo = getFileInfo(output.target);\n const schemasPath = isObject(output.schemas)\n ? output.schemas.path\n : output.schemas;\n const schemaInfo = schemasPath ? getFileInfo(schemasPath) : undefined;\n\n const isZodSchemaOutput =\n isObject(output.schemas) && output.schemas.type === 'zod';\n const basePath = schemaInfo?.dirname;\n const relativeSchemaImportPath = basePath\n ? isZodSchemaOutput && output.indexFiles\n ? upath.relativeSafe(\n targetInfo.dirname,\n upath.joinSafe(basePath, 'index.zod'),\n )\n : upath.relativeSafe(targetInfo.dirname, basePath)\n : './' + targetInfo.filename + '.schemas';\n\n const importSchemaNames = new Set(\n Object.values(verbOptions).flatMap((verbOption) => {\n const imports = [];\n const pascalOperationName = pascal(verbOption.operationName);\n\n if (verbOption.queryParams) {\n imports.push(`${pascalOperationName}Params`);\n }\n\n if (verbOption.body.imports[0]?.name) {\n imports.push(verbOption.body.imports[0]?.name);\n }\n\n return imports;\n }),\n )\n .values()\n .toArray();\n\n const importSchemasImplementation = `import {\\n ${importSchemaNames.join(\n ',\\n ',\n )}\\n} from '${relativeSchemaImportPath}';\n`;\n\n const relativeFetchClientPath = './http-client';\n const importFetchClientNames = new Set(\n Object.values(verbOptions).flatMap(\n (verbOption) => verbOption.operationName,\n ),\n )\n .values()\n .toArray();\n\n const importFetchClientImplementation = `import {\\n ${importFetchClientNames.join(\n ',\\n ',\n )}\\n} from '${relativeFetchClientPath}';\n `;\n\n const content = [\n importSchemasImplementation,\n importFetchClientImplementation,\n ].join('\\n');\n\n return content + '\\n';\n};\n\nexport const generateMcp: ClientBuilder = (verbOptions) => {\n const handlerArgsTypes = [];\n const pathParamsType = verbOptions.params\n .map((param) => {\n const paramName = param.name.split(': ')[0];\n const paramType = param.implementation.split(': ')[1];\n return ` ${paramName}: ${paramType}`;\n })\n .join(',\\n');\n if (pathParamsType) {\n handlerArgsTypes.push(` pathParams: {\\n${pathParamsType}\\n };`);\n }\n if (verbOptions.queryParams) {\n handlerArgsTypes.push(\n ` queryParams: ${verbOptions.queryParams.schema.name};`,\n );\n }\n if (verbOptions.body.definition) {\n handlerArgsTypes.push(` bodyParams: ${verbOptions.body.definition};`);\n }\n\n const handlerArgsName = `${verbOptions.operationName}Args`;\n const handlerArgsImplementation =\n handlerArgsTypes.length > 0\n ? `\nexport type ${handlerArgsName} = {\n${handlerArgsTypes.join('\\n')}\n}\n`\n : '';\n\n const fetchParams = [];\n if (verbOptions.params.length > 0) {\n const pathParamsArgs = verbOptions.params\n .map((param) => {\n const paramName = param.name.split(': ')[0];\n\n return `args.pathParams.${paramName}`;\n })\n .join(', ');\n\n fetchParams.push(pathParamsArgs);\n }\n if (verbOptions.body.definition) fetchParams.push(`args.bodyParams`);\n if (verbOptions.queryParams) fetchParams.push(`args.queryParams`);\n\n const handlerName = `${verbOptions.operationName}Handler`;\n const handlerImplementation = `\nexport const ${handlerName} = async (${handlerArgsTypes.length > 0 ? `args: ${handlerArgsName}` : ''}) => {\n const res = await ${verbOptions.operationName}(${fetchParams.join(', ')});\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(res),\n },\n ],\n };\n};`;\n\n const handlersImplementation = [\n handlerArgsImplementation,\n handlerImplementation,\n ].join('');\n\n return {\n implementation: handlersImplementation ? `${handlersImplementation}\\n` : '',\n imports: [],\n };\n};\n\nexport const generateServer = (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n const info = context.spec.info;\n const { extension, dirname } = getFileInfo(output.target);\n const serverPath = upath.join(dirname, `server${extension}`);\n const header = getHeader(output.override.header, info);\n\n const toolImplementations = Object.values(verbOptions)\n .map((verbOption) => {\n const pascalOperationName = pascal(verbOption.operationName);\n const inputSchemaTypes = [];\n if (verbOption.params.length > 0)\n inputSchemaTypes.push(` pathParams: ${pascalOperationName}Params`);\n if (verbOption.queryParams)\n inputSchemaTypes.push(\n ` queryParams: ${pascalOperationName}QueryParams`,\n );\n if (verbOption.body.definition)\n inputSchemaTypes.push(` bodyParams: ${pascalOperationName}Body`);\n\n const inputSchemaImplementation =\n inputSchemaTypes.length > 0\n ? ` {\n ${inputSchemaTypes.join(',\\n ')}\n },`\n : '';\n\n const toolImplementation = `\nserver.tool(\n '${jsStringEscape(verbOption.operationName)}',\n '${jsStringEscape(verbOption.summary)}',${inputSchemaImplementation ? `\\n${inputSchemaImplementation}` : ''}\n ${jsStringEscape(verbOption.operationName)}Handler\n);`;\n\n return toolImplementation;\n })\n .join('\\n');\n\n const importToolSchemas = Object.values(verbOptions)\n .flatMap((verbOption) => {\n const imports = [];\n\n const pascalOperationName = pascal(verbOption.operationName);\n\n if (verbOption.headers) imports.push(` ${pascalOperationName}Header`);\n if (verbOption.params.length > 0)\n imports.push(` ${pascalOperationName}Params`);\n if (verbOption.queryParams)\n imports.push(` ${pascalOperationName}QueryParams`);\n if (verbOption.body.definition)\n imports.push(` ${pascalOperationName}Body`);\n\n return imports;\n })\n .join(',\\n');\n const importToolSchemasImplementation = `import {\\n${importToolSchemas}\\n} from './tool-schemas.zod';`;\n\n const importHandlers = Object.values(verbOptions)\n .filter((verbOption) =>\n toolImplementations.includes(`${verbOption.operationName}Handler`),\n )\n .map((verbOption) => ` ${verbOption.operationName}Handler`)\n .join(`,\\n`);\n const importHandlersImplementation = `import {\\n${importHandlers}\\n} from './handlers';`;\n\n const importDependenciesImplementation = `import {\n McpServer\n} from '@modelcontextprotocol/sdk/server/mcp.js';\n \nimport {\n StdioServerTransport\n} from '@modelcontextprotocol/sdk/server/stdio.js'; \n`;\n const newMcpServerImplementation = `\nconst server = new McpServer({\n name: '${camel(info.title)}Server',\n version: '1.0.0',\n});\n`;\n const serverConnectImplementation = `\nconst transport = new StdioServerTransport();\n\nserver.connect(transport).then(() => {\n console.error('MCP server running on stdio');\n}).catch(console.error);\n`;\n\n const content = [\n header,\n importDependenciesImplementation,\n importHandlersImplementation,\n importToolSchemasImplementation,\n newMcpServerImplementation,\n toolImplementations,\n serverConnectImplementation,\n ].join('\\n');\n\n return [\n {\n content,\n path: serverPath,\n },\n ];\n};\n\nconst generateZodFiles = async (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n const { extension, dirname } = getFileInfo(output.target);\n\n const header = getHeader(output.override.header, context.spec.info);\n\n const zods = await Promise.all(\n Object.values(verbOptions).map(async (verbOption) =>\n generateZod(\n verbOption,\n {\n route: verbOption.route,\n pathRoute: verbOption.pathRoute,\n override: output.override,\n context,\n mock: output.mock,\n output: output.target,\n },\n output.client,\n ),\n ),\n );\n\n const allMutators = new Map(\n zods.flatMap((z) => z.mutators ?? []).map((m) => [m.name, m]),\n )\n .values()\n .toArray();\n\n const mutatorsImports = generateMutatorImports({\n mutators: allMutators,\n });\n\n let content = `${header}import { z as zod } from 'zod';\\n${mutatorsImports}\\n`;\n\n const zodPath = upath.join(dirname, `tool-schemas.zod${extension}`);\n\n content += zods.map((zod) => zod.implementation).join('\\n');\n\n return [\n {\n content,\n path: zodPath,\n },\n ];\n};\n\nconst generateHttpClientFiles = async (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n const { extension, dirname, filename } = getFileInfo(output.target);\n\n const header = getHeader(output.override.header, context.spec.info);\n\n const clients = await Promise.all(\n Object.values(verbOptions).map(async (verbOption) => {\n const fullRoute = getFullRoute(\n verbOption.route,\n context.spec.servers,\n output.baseUrl,\n );\n\n const options = {\n route: fullRoute,\n pathRoute: verbOption.pathRoute,\n override: output.override,\n context,\n mock: output.mock,\n output: output.target,\n };\n\n return generateClient(verbOption, options, output.client, output);\n }),\n );\n\n const clientImplementation = clients\n .map((client) => client.implementation)\n .join('\\n');\n\n const isZodSchemaOutput =\n isObject(output.schemas) && output.schemas.type === 'zod';\n const schemasPath = isObject(output.schemas)\n ? output.schemas.path\n : output.schemas;\n const basePath = schemasPath ? getFileInfo(schemasPath).dirname : undefined;\n const relativeSchemasPath = basePath\n ? isZodSchemaOutput && output.indexFiles\n ? upath.relativeSafe(dirname, upath.joinSafe(basePath, 'index.zod'))\n : upath.relativeSafe(dirname, basePath)\n : './' + filename + '.schemas';\n\n const importNames = clients\n .flatMap((client) => client.imports)\n .map((imp) => imp.name);\n const uniqueImportNames = new Set(importNames).values().toArray();\n\n const importImplementation = `import { ${uniqueImportNames.join(\n ',\\n',\n )} } from '${relativeSchemasPath}';`;\n\n const fetchHeader = generateFetchHeader({\n title: '',\n isRequestOptions: false,\n isMutator: false,\n noFunction: false,\n isGlobalMutator: false,\n provideIn: false,\n hasAwaitedType: false,\n output,\n verbOptions,\n clientImplementation,\n });\n\n const content = [\n header,\n importImplementation,\n fetchHeader,\n clientImplementation,\n ].join('\\n');\n const outputPath = upath.join(dirname, `http-client${extension}`);\n\n return [\n {\n content,\n path: outputPath,\n },\n ];\n};\n\nexport const generateExtraFiles: ClientExtraFilesBuilder = async (\n verbOptions,\n output,\n context,\n) => {\n const server = generateServer(verbOptions, output, context);\n const [zods, httpClients] = await Promise.all([\n generateZodFiles(verbOptions, output, context),\n generateHttpClientFiles(verbOptions, output, context),\n ]);\n\n return [...server, ...zods, ...httpClients];\n};\n\nconst mcpClientBuilder: ClientGeneratorsBuilder = {\n client: generateMcp,\n header: getMcpHeader,\n extraFiles: generateExtraFiles,\n};\n\nexport const builder = () => () => mcpClientBuilder;\n\nexport default builder;\n"],"mappings":";;;;;AAsBA,MAAM,aACJ,QACA,SACW;AACX,KAAI,CAAC,OACH,QAAO;CAGT,MAAM,SAAS,OAAO,KAAK;AAE3B,QAAO,MAAM,QAAQ,OAAO,GAAG,MAAM,EAAE,aAAa,QAAQ,CAAC,GAAG;;AAGlE,MAAa,gBAAqC,EAAE,aAAa,aAAa;CAC5E,MAAM,aAAa,YAAY,OAAO,OAAO;CAC7C,MAAM,cAAc,SAAS,O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AM,WAAW,cAAc,YAAY,YAAY,CAAC,UAAU;CAClE,MAAM,sBAAsB,WACxB,qBAAqB,OAAO,aAC1B,MAAM,aAAa,SAAS,MAAM,SAAS,UAAU,YAAY,CAAC,GAClE,MAAM,aAAa,SAAS,SAAS,GACvC,OAAO,WAAW;CAEtB,MAAM,cAAc,QACjB,SAAS,WAAW,OAAO,QAAQ,CACnC,KAAK,QAAQ,IAAI,KAAK;AA4BzB,QAAO,CACL;EACE,SAVY;GACd;GAlB2B,YAFH,IAAI,IAAI,YAAY,CAAC,QAAQ,CAAC,SAAS,CAEN,KACzD,MACD,CAAC,WAAW,oBAAoB;GAEb,oBAAoB;IACtC,OAAO;IACP,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,iBAAiB;IACjB,WAAW;IACX,gBAAgB;IAChB;IACA;IACA;IACD,CAAC;GAMA;GACD,CAAC,KAAK,KAAK;EAMR,MALe,MAAM,KAAK,SAAS,cAAc,YAAY;EAM9D,CACF;;AAGH,MAAa,qBAA8C,OACzD,aACA,QACA,YACG;CACH,MAAM,SAAS,eAAe,aAAa,QAAQ,QAAQ;CAC3D,MAAM,CAAC,MAAM,eAAe,MAAM,QAAQ,IAAI,CAC5C,iBAAiB,aAAa,QAAQ,QAAQ,EAC9C,wBAAwB,aAAa,QAAQ,QAAQ,CACtD,CAAC;AAEF,QAAO;EAAC,GAAG;EAAQ,GAAG;EAAM,GAAG;EAAY;;AAG7C,MAAM,mBAA4C;CAChD,QAAQ;CACR,QAAQ;CACR,YAAY;CACb;AAED,MAAa,sBAAsB"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orval/mcp",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"types": "./dist/index.d.mts",
|
|
6
7
|
"exports": {
|
|
7
8
|
".": "./dist/index.mjs",
|
|
8
9
|
"./package.json": "./package.json"
|
|
@@ -16,21 +17,20 @@
|
|
|
16
17
|
"build": "tsdown --config-loader unrun",
|
|
17
18
|
"dev": "tsdown --config-loader unrun --watch src",
|
|
18
19
|
"lint": "eslint .",
|
|
20
|
+
"test": "vitest",
|
|
19
21
|
"clean": "rimraf .turbo dist",
|
|
20
22
|
"nuke": "rimraf .turbo dist node_modules"
|
|
21
23
|
},
|
|
22
24
|
"dependencies": {
|
|
23
|
-
"@orval/core": "8.
|
|
24
|
-
"@orval/fetch": "8.
|
|
25
|
-
"@orval/zod": "8.
|
|
25
|
+
"@orval/core": "8.5.0",
|
|
26
|
+
"@orval/fetch": "8.5.0",
|
|
27
|
+
"@orval/zod": "8.5.0"
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|
|
28
30
|
"eslint": "9.39.2",
|
|
29
31
|
"rimraf": "6.1.2",
|
|
30
|
-
"tsdown": "0.
|
|
31
|
-
"typescript": "5.9.3"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"module": "./dist/index.mjs",
|
|
35
|
-
"types": "./dist/index.d.mts"
|
|
32
|
+
"tsdown": "0.20.3",
|
|
33
|
+
"typescript": "5.9.3",
|
|
34
|
+
"vitest": "4.0.18"
|
|
35
|
+
}
|
|
36
36
|
}
|