// This file is auto-generated by @hey-api/openapi-ts

import type { Client, Options as Options2, TDataShape } from './client';
import { client } from './client.gen';
import type { GetMcpServerCategoriesData, GetMcpServerCategoriesResponses, GetMcpServerData, GetMcpServerErrors, GetMcpServerQualityBadgeData, GetMcpServerQualityBadgeErrors, GetMcpServerQualityBadgeResponses, GetMcpServerResponses, SearchMcpServerCatalogData, SearchMcpServerCatalogResponses } from './types.gen';

export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
    /**
     * You can provide a client instance returned by `createClient()` instead of
     * individual options. This might be also useful if you want to implement a
     * custom client.
     */
    client?: Client;
    /**
     * You can pass arbitrary values through the `meta` object. This can be
     * used to access values that aren't defined as part of the SDK function.
     */
    meta?: Record<string, unknown>;
};

/**
 * Search MCP servers
 *
 * Search for MCP servers with filtering and sorting options
 */
export const searchMcpServerCatalog = <ThrowOnError extends boolean = false>(options?: Options<SearchMcpServerCatalogData, ThrowOnError>) => (options?.client ?? client).get<SearchMcpServerCatalogResponses, unknown, ThrowOnError>({ url: '/search', ...options });

/**
 * Get MCP server by name
 *
 * Retrieve detailed information about a specific MCP server by its name identifier
 */
export const getMcpServer = <ThrowOnError extends boolean = false>(options: Options<GetMcpServerData, ThrowOnError>) => (options.client ?? client).get<GetMcpServerResponses, GetMcpServerErrors, ThrowOnError>({ url: '/server/{name}', ...options });

/**
 * Get quality badge
 *
 * Get an SVG quality badge for an MCP server
 */
export const getMcpServerQualityBadge = <ThrowOnError extends boolean = false>(options: Options<GetMcpServerQualityBadgeData, ThrowOnError>) => (options.client ?? client).get<GetMcpServerQualityBadgeResponses, GetMcpServerQualityBadgeErrors, ThrowOnError>({ url: '/badge/quality/{org}/{repo}', ...options });

/**
 * Get available categories
 *
 * Get a list of all available MCP server categories
 */
export const getMcpServerCategories = <ThrowOnError extends boolean = false>(options?: Options<GetMcpServerCategoriesData, ThrowOnError>) => (options?.client ?? client).get<GetMcpServerCategoriesResponses, unknown, ThrowOnError>({ url: '/category', ...options });
