Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | import { createCodeUsageGeneratorRegistry } from 'fumadocs-openapi/requests/generators'; |
| 2 | import { registerDefault } from 'fumadocs-openapi/requests/generators/all'; |
| 3 | import { python } from 'fumadocs-openapi/requests/generators/python'; |
| 4 | import { javascript } from 'fumadocs-openapi/requests/generators/javascript'; |
| 5 | import { curl } from 'fumadocs-openapi/requests/generators/curl'; |
| 6 | |
| 7 | /** Raw HTTP equivalents, not calls to the Composio SDKs. JavaScript fetch is valid TypeScript. */ |
| 8 | export const apiCodeUsages = createCodeUsageGeneratorRegistry(); |
| 9 | apiCodeUsages.add('python', python); |
| 10 | apiCodeUsages.add('typescript', { ...javascript, label: 'TypeScript', lang: 'typescript' }); |
| 11 | apiCodeUsages.add('api', { ...curl, label: 'API' }); |
| 12 | |
| 13 | // Preserve the reference's other generated languages without duplicate JS/cURL options. |
| 14 | const defaults = registerDefault(createCodeUsageGeneratorRegistry()); |
| 15 | for (const [id, generator] of defaults.map()) { |
| 16 | if (!['python', 'js', 'curl'].includes(id)) apiCodeUsages.add(id, generator); |
| 17 | } |