import { t as __name } from "./chunk--u3MIqq1.js"; import { Group, Output, PluginFactoryOptions, ResolveNameParams } from "@kubb/core"; import { Exclude, Include, Override, ResolvePathOptions } from "@kubb/plugin-oas"; import { Generator } from "@kubb/plugin-oas/generators"; import { Oas, contentType } from "@kubb/oas"; //#region src/types.d.ts /** * Use either a preset `client` type OR a custom `importPath`, not both. * `importPath` will override the default `client` preset when both are provided. * These options are mutually exclusive. `bundle` and `importPath` are also * mutually exclusive since `bundle` only has effect when `importPath` is not set. */ type ClientImportPath = { /** * Which client should be used to do the HTTP calls. * - 'axios' uses axios client for HTTP requests. * - 'fetch' uses native fetch API for HTTP requests. * @default 'axios' */ client?: 'axios' | 'fetch'; importPath?: never; } | { client?: never; /** * Client import path for API calls. * Used as `import client from '${importPath}'`. * Accepts relative and absolute paths; path changes are not performed. */ importPath: string; /** * `bundle` has no effect when `importPath` is set. * Use either `bundle` (with `client`) or `importPath`, not both. * @deprecated Removed in v5, where the client is always bundled. See https://kubb.dev/docs/5.x/migration-guide */ bundle?: never; }; type Options = { /** * Specify the export location for the files and define the behavior of the output * @default { path: 'clients', barrelType: 'named' } */ output?: Output; /** * Define which contentType should be used. * By default, the first JSON valid mediaType is used */ contentType?: contentType; /** * Group the clients based on the provided name. */ group?: Group; /** * Array containing exclude parameters to exclude/skip tags/operations/methods/paths. */ exclude?: Array; /** * Array containing include parameters to include tags/operations/methods/paths. */ include?: Array; /** * Array containing override parameters to override `options` based on tags/operations/methods/paths. */ override?: Array>; /** * Create `operations.ts` file with all operations grouped by methods. * @default false */ operations?: boolean; /** * Export urls that are used by operation x. * - 'export' makes them part of your barrel file. * - false does not make them exportable. * @default false * @example getGetPetByIdUrl */ urlType?: 'export' | false; /** * Allows you to set a custom base url for all generated calls. */ baseURL?: string; /** * ReturnType that is used when calling the client. * - 'data' returns ResponseConfig[data]. * - 'full' returns ResponseConfig. * @default 'data' */ dataReturnType?: 'data' | 'full'; /** * How to style your params, by default no casing is applied * - 'camelcase' uses camelCase for pathParams, queryParams and headerParams names * @note response types (data/body) are not affected by this option * @deprecated Removed in v5, where parameters always use camelCase names. Set `paramsCasing: 'camelcase'` now to match the v5 behavior. See https://kubb.dev/docs/5.x/migration-guide */ paramsCasing?: 'camelcase'; /** * How to pass your params. * - 'object' returns the params and pathParams as an object. * - 'inline' returns the params as comma separated params. * @default 'inline' * @deprecated Removed in v5, where generated functions take a single grouped options object. Set `paramsType: 'object'` now to match the v5 behavior. See https://kubb.dev/docs/5.x/migration-guide */ paramsType?: 'object' | 'inline'; /** * How to pass your pathParams. * - 'object' returns the pathParams as an object. * - 'inline' returns the pathParams as comma separated params. * @default 'inline' * @deprecated Removed in v5, where generated functions take a single grouped options object. Set `pathParamsType: 'object'` now to match the v5 behavior. See https://kubb.dev/docs/5.x/migration-guide */ pathParamsType?: 'object' | 'inline'; /** * Which parser can be used before returning the data. * - 'client' returns the data as-is from the client. * - 'zod' uses @kubb/plugin-zod to parse the data. * @default 'client' */ parser?: 'client' | 'zod'; /** * How to generate the client code. * - 'function' generates standalone functions for each operation. * - 'class' generates a class with methods for each operation. * - 'staticClass' generates a class with static methods for each operation. * @default 'function' */ clientType?: 'function' | 'class' | 'staticClass'; /** * Bundle the selected client into the generated `.kubb` directory. * When disabled the generated clients will import the shared runtime from `@kubb/plugin-client/clients/*`. * @default false * In version 5 of Kubb this is by default true * @deprecated Removed in v5, where the client is always bundled. Set `bundle: true` now (or set `importPath` to import from an external module) to match the v5 behavior. See https://kubb.dev/docs/5.x/migration-guide */ bundle?: boolean; /** * Generate a wrapper class that composes all tag-based client classes into a single entry point. */ wrapper?: { /** * Name of the wrapper class. */ className: string; }; transformers?: { /** * Customize the names based on the type that is provided by the plugin. */ name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string; }; /** * Define some generators next to the client generators * @deprecated Removed in v5. To add custom output, build your own plugin. See https://kubb.dev/docs/5.x/migration-guide */ generators?: Array>; } & ClientImportPath; type ResolvedOptions = { output: Output; group?: Options['group']; baseURL: string | undefined; client: Options['client']; clientType: NonNullable; bundle: NonNullable; parser: NonNullable; urlType: NonNullable; importPath: Options['importPath']; dataReturnType: NonNullable; pathParamsType: NonNullable; paramsType: NonNullable; paramsCasing: Options['paramsCasing']; wrapper: Options['wrapper']; }; type PluginClient = PluginFactoryOptions<'plugin-client', Options, ResolvedOptions, never, ResolvePathOptions>; //#endregion export { Options as n, PluginClient as r, ClientImportPath as t }; //# sourceMappingURL=types-Bn2ad3pn.d.ts.map