@kubb/plugin-client 5.0.0-alpha.3 → 5.0.0-alpha.31

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.
Files changed (42) hide show
  1. package/dist/clients/axios.d.ts +2 -2
  2. package/dist/index.cjs +1893 -74
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.ts +480 -4
  5. package/dist/index.js +1885 -77
  6. package/dist/index.js.map +1 -1
  7. package/package.json +10 -25
  8. package/src/components/ClassClient.tsx +42 -138
  9. package/src/components/Client.tsx +85 -124
  10. package/src/components/ClientLegacy.tsx +501 -0
  11. package/src/components/Operations.tsx +8 -8
  12. package/src/components/StaticClassClient.tsx +41 -135
  13. package/src/components/Url.tsx +37 -46
  14. package/src/generators/classClientGenerator.tsx +125 -148
  15. package/src/generators/clientGenerator.tsx +93 -82
  16. package/src/generators/groupedClientGenerator.tsx +47 -50
  17. package/src/generators/operationsGenerator.tsx +9 -17
  18. package/src/generators/staticClassClientGenerator.tsx +159 -164
  19. package/src/index.ts +11 -1
  20. package/src/plugin.ts +115 -108
  21. package/src/presets.ts +25 -0
  22. package/src/resolvers/resolverClient.ts +26 -0
  23. package/src/resolvers/resolverClientLegacy.ts +26 -0
  24. package/src/types.ts +105 -40
  25. package/src/utils.ts +148 -0
  26. package/dist/StaticClassClient-By-aMAe4.cjs +0 -677
  27. package/dist/StaticClassClient-By-aMAe4.cjs.map +0 -1
  28. package/dist/StaticClassClient-CCn9g9eF.js +0 -636
  29. package/dist/StaticClassClient-CCn9g9eF.js.map +0 -1
  30. package/dist/components.cjs +0 -7
  31. package/dist/components.d.ts +0 -216
  32. package/dist/components.js +0 -2
  33. package/dist/generators-C2jT7XCH.js +0 -723
  34. package/dist/generators-C2jT7XCH.js.map +0 -1
  35. package/dist/generators-qkDW17Hf.cjs +0 -753
  36. package/dist/generators-qkDW17Hf.cjs.map +0 -1
  37. package/dist/generators.cjs +0 -7
  38. package/dist/generators.d.ts +0 -512
  39. package/dist/generators.js +0 -2
  40. package/dist/types-CdM4DK1M.d.ts +0 -169
  41. package/src/components/index.ts +0 -5
  42. package/src/generators/index.ts +0 -5
@@ -1 +0,0 @@
1
- {"version":3,"file":"generators-qkDW17Hf.cjs","names":["camelCase","File","pluginTsName","pluginZodName","camelCase","pascalCase","File","path","ClassClient","pluginTsName","pluginZodName","File","path","Url","Client","camelCase","File","Function","File","Operations","pluginTsName","pluginZodName","camelCase","pascalCase","File","path","StaticClassClient"],"sources":["../src/components/WrapperClient.tsx","../src/generators/classClientGenerator.tsx","../src/generators/clientGenerator.tsx","../src/generators/groupedClientGenerator.tsx","../src/generators/operationsGenerator.tsx","../src/generators/staticClassClientGenerator.tsx"],"sourcesContent":["import { camelCase } from '@internals/utils'\nimport { File } from '@kubb/react-fabric'\nimport type { FabricReactNode } from '@kubb/react-fabric/types'\n\ntype Props = {\n name: string\n classNames: Array<string>\n isExportable?: boolean\n isIndexable?: boolean\n}\n\nexport function WrapperClient({ name, classNames, isExportable = true, isIndexable = true }: Props): FabricReactNode {\n const properties = classNames.map((className) => ` readonly ${camelCase(className)}: ${className}`).join('\\n')\n const assignments = classNames.map((className) => ` this.${camelCase(className)} = new ${className}(config)`).join('\\n')\n\n const classCode = `export class ${name} {\n${properties}\n\n constructor(config: Partial<RequestConfig> & { client?: Client } = {}) {\n${assignments}\n }\n}`\n\n return (\n <File.Source name={name} isExportable={isExportable} isIndexable={isIndexable}>\n {classCode}\n </File.Source>\n )\n}\n","import path from 'node:path'\nimport { camelCase, pascalCase } from '@internals/utils'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { ClassClient } from '../components/ClassClient'\nimport { WrapperClient } from '../components/WrapperClient'\nimport type { PluginClient } from '../types'\n\ntype OperationData = {\n operation: Operation\n name: string\n typeSchemas: OperationSchemas\n zodSchemas: OperationSchemas | undefined\n typeFile: KubbFile.File\n zodFile: KubbFile.File\n}\n\ntype Controller = {\n name: string\n file: KubbFile.File\n operations: Array<OperationData>\n}\n\nexport const classClientGenerator = createReactGenerator<PluginClient>({\n name: 'classClient',\n Operations({ operations, generator, plugin, config }) {\n const { options, name: pluginName } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getName, getFile, getGroup, getSchemas } = useOperationManager(generator)\n\n function buildOperationData(operation: Operation): OperationData {\n const type = {\n file: getFile(operation, { pluginName: pluginTsName }),\n schemas: getSchemas(operation, { pluginName: pluginTsName, type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginName: pluginZodName }),\n schemas: getSchemas(operation, { pluginName: pluginZodName, type: 'function' }),\n }\n\n return {\n operation,\n name: getName(operation, { type: 'function' }),\n typeSchemas: type.schemas,\n zodSchemas: zod.schemas,\n typeFile: type.file,\n zodFile: zod.file,\n }\n }\n\n // Group operations by tag\n const controllers = operations.reduce(\n (acc, operation) => {\n const group = getGroup(operation)\n const groupName = group?.tag ? (options.group?.name?.({ group: camelCase(group.tag) }) ?? pascalCase(group.tag)) : 'Client'\n\n if (!group?.tag && !options.group) {\n // If no grouping, put all operations in a single class\n const name = 'ApiClient'\n const file = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginName,\n })\n\n const operationData = buildOperationData(operation)\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.operations.push(operationData)\n } else {\n acc.push({ name, file, operations: [operationData] })\n }\n } else if (group?.tag) {\n // Group by tag\n const name = groupName\n const file = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginName,\n options: { group },\n })\n\n const operationData = buildOperationData(operation)\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.operations.push(operationData)\n } else {\n acc.push({ name, file, operations: [operationData] })\n }\n }\n\n return acc\n },\n [] as Array<Controller>,\n )\n\n function collectTypeImports(ops: Array<OperationData>) {\n const typeImportsByFile = new Map<string, Set<string>>()\n const typeFilesByPath = new Map<string, KubbFile.File>()\n\n ops.forEach((op) => {\n const { typeSchemas, typeFile } = op\n\n if (!typeImportsByFile.has(typeFile.path)) {\n typeImportsByFile.set(typeFile.path, new Set())\n }\n const typeImports = typeImportsByFile.get(typeFile.path)!\n\n if (typeSchemas.request?.name) typeImports.add(typeSchemas.request.name)\n if (typeSchemas.response?.name) typeImports.add(typeSchemas.response.name)\n if (typeSchemas.pathParams?.name) typeImports.add(typeSchemas.pathParams.name)\n if (typeSchemas.queryParams?.name) typeImports.add(typeSchemas.queryParams.name)\n if (typeSchemas.headerParams?.name) typeImports.add(typeSchemas.headerParams.name)\n typeSchemas.statusCodes?.forEach((item) => {\n if (item?.name) typeImports.add(item.name)\n })\n typeFilesByPath.set(typeFile.path, typeFile)\n })\n\n return { typeImportsByFile, typeFilesByPath }\n }\n\n function collectZodImports(ops: Array<OperationData>) {\n const zodImportsByFile = new Map<string, Set<string>>()\n const zodFilesByPath = new Map<string, KubbFile.File>()\n\n ops.forEach((op) => {\n const { zodSchemas, zodFile } = op\n\n if (!zodImportsByFile.has(zodFile.path)) {\n zodImportsByFile.set(zodFile.path, new Set())\n }\n const zodImports = zodImportsByFile.get(zodFile.path)!\n\n if (zodSchemas?.response?.name) zodImports.add(zodSchemas.response.name)\n if (zodSchemas?.request?.name) zodImports.add(zodSchemas.request.name)\n zodFilesByPath.set(zodFile.path, zodFile)\n })\n\n return { zodImportsByFile, zodFilesByPath }\n }\n\n const files = controllers.map(({ name, file, operations: ops }) => {\n const { typeImportsByFile, typeFilesByPath } = collectTypeImports(ops)\n const { zodImportsByFile, zodFilesByPath } =\n options.parser === 'zod'\n ? collectZodImports(ops)\n : { zodImportsByFile: new Map<string, Set<string>>(), zodFilesByPath: new Map<string, KubbFile.File>() }\n const hasFormData = ops.some((op) => op.operation.getContentType() === 'multipart/form-data')\n\n return (\n <File\n key={file.path}\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: options.output })}\n >\n {options.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.importPath} />\n <File.Import name={['mergeConfig']} path={options.importPath} />\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={options.importPath} isTypeOnly />\n </>\n ) : (\n <>\n <File.Import name={['fetch']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import name={['mergeConfig']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n </>\n )}\n\n {hasFormData && <File.Import name={['buildFormData']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/config.ts')} />}\n\n {Array.from(typeImportsByFile.entries()).map(([filePath, imports]) => {\n const typeFile = typeFilesByPath.get(filePath)\n if (!typeFile) {\n return null\n }\n const importNames = Array.from(imports).filter(Boolean)\n if (importNames.length === 0) {\n return null\n }\n return <File.Import key={filePath} name={importNames} root={file.path} path={typeFile.path} isTypeOnly />\n })}\n\n {options.parser === 'zod' &&\n Array.from(zodImportsByFile.entries()).map(([filePath, imports]) => {\n const zodFile = zodFilesByPath.get(filePath)\n if (!zodFile) {\n return null\n }\n const importNames = Array.from(imports).filter(Boolean)\n if (importNames.length === 0) {\n return null\n }\n\n return <File.Import key={filePath} name={importNames} root={file.path} path={zodFile.path} />\n })}\n\n <ClassClient\n name={name}\n operations={ops}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n parser={options.parser}\n />\n </File>\n )\n })\n\n if (options.wrapper) {\n const wrapperFile = pluginManager.getFile({\n name: options.wrapper.className,\n extname: '.ts',\n pluginName,\n })\n\n files.push(\n <File\n key={wrapperFile.path}\n baseName={wrapperFile.baseName}\n path={wrapperFile.path}\n meta={wrapperFile.meta}\n banner={getBanner({ oas, output: options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: options.output })}\n >\n {options.importPath ? (\n <File.Import name={['Client', 'RequestConfig']} path={options.importPath} isTypeOnly />\n ) : (\n <File.Import\n name={['Client', 'RequestConfig']}\n root={wrapperFile.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n )}\n\n {controllers.map(({ name, file }) => (\n <File.Import key={name} name={[name]} root={wrapperFile.path} path={file.path} />\n ))}\n\n <WrapperClient name={options.wrapper.className} classNames={controllers.map(({ name }) => name)} />\n </File>,\n )\n }\n\n return files\n },\n})\n","import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { Client } from '../components/Client'\nimport { Url } from '../components/Url.tsx'\nimport type { PluginClient } from '../types'\n\nexport const clientGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operation({ config, plugin, operation, generator }) {\n const pluginManager = usePluginManager()\n const {\n options,\n options: { output, urlType },\n } = plugin\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const url = {\n name: getName(operation, { type: 'function', suffix: 'url', prefix: 'get' }),\n file: getFile(operation),\n }\n\n const type = {\n file: getFile(operation, { pluginName: pluginTsName }),\n schemas: getSchemas(operation, { pluginName: pluginTsName, type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginName: pluginZodName }),\n schemas: getSchemas(operation, { pluginName: pluginZodName, type: 'function' }),\n }\n\n const isFormData = operation.getContentType() === 'multipart/form-data'\n\n return (\n <File\n baseName={client.file.baseName}\n path={client.file.path}\n meta={client.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.importPath} />\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={options.importPath} isTypeOnly />\n </>\n ) : (\n <>\n <File.Import name={['fetch']} root={client.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={client.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n </>\n )}\n\n {isFormData && type.schemas.request?.name && (\n <File.Import name={['buildFormData']} root={client.file.path} path={path.resolve(config.root, config.output.path, '.kubb/config.ts')} />\n )}\n\n {options.parser === 'zod' && (\n <File.Import\n name={[zod.schemas.response.name, zod.schemas.request?.name].filter((x): x is string => Boolean(x))}\n root={client.file.path}\n path={zod.file.path}\n />\n )}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter((x): x is string => Boolean(x))}\n root={client.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <Url\n name={url.name}\n baseURL={options.baseURL}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n isIndexable={urlType === 'export'}\n isExportable={urlType === 'export'}\n />\n\n <Client\n name={client.name}\n urlName={url.name}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n parser={options.parser}\n zodSchemas={zod.schemas}\n />\n </File>\n )\n },\n})\n","import { camelCase } from '@internals/utils'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, Function } from '@kubb/react-fabric'\nimport type { PluginClient } from '../types'\n\nexport const groupedClientGenerator = createReactGenerator<PluginClient>({\n name: 'groupedClient',\n Operations({ operations, generator, plugin }) {\n const { options, name: pluginName } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getName, getFile, getGroup } = useOperationManager(generator)\n\n const controllers = operations.reduce(\n (acc, operation) => {\n if (options.group?.type === 'tag') {\n const group = getGroup(operation)\n const name = group?.tag ? options.group?.name?.({ group: camelCase(group.tag) }) : undefined\n\n if (!group?.tag || !name) {\n return acc\n }\n\n const file = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginName,\n options: { group },\n })\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.clients.push(client)\n } else {\n acc.push({ name, file, clients: [client] })\n }\n }\n\n return acc\n },\n [] as Array<{ name: string; file: KubbFile.File; clients: Array<{ name: string; file: KubbFile.File }> }>,\n )\n\n return controllers.map(({ name, file, clients }) => {\n return (\n <File\n key={file.path}\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: options.output })}\n >\n {clients.map((client) => (\n <File.Import key={client.name} name={[client.name]} root={file.path} path={client.file.path} />\n ))}\n\n <File.Source name={name} isExportable isIndexable>\n <Function export name={name}>\n {`return { ${clients.map((client) => client.name).join(', ')} }`}\n </Function>\n </File.Source>\n </File>\n )\n })\n },\n})\n","import { usePluginManager } from '@kubb/core/hooks'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File } from '@kubb/react-fabric'\nimport { Operations } from '../components/Operations'\nimport type { PluginClient } from '../types'\n\nexport const operationsGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operations({ operations, plugin }) {\n const {\n name: pluginName,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n\n const name = 'operations'\n const file = pluginManager.getFile({ name, extname: '.ts', pluginName })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <Operations name={name} operations={operations} />\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { camelCase, pascalCase } from '@internals/utils'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { StaticClassClient } from '../components/StaticClassClient'\nimport type { PluginClient } from '../types'\n\ntype OperationData = {\n operation: Operation\n name: string\n typeSchemas: OperationSchemas\n zodSchemas: OperationSchemas | undefined\n typeFile: KubbFile.File\n zodFile: KubbFile.File\n}\n\ntype Controller = {\n name: string\n file: KubbFile.File\n operations: Array<OperationData>\n}\n\nexport const staticClassClientGenerator = createReactGenerator<PluginClient>({\n name: 'staticClassClient',\n Operations({ operations, generator, plugin, config }) {\n const { options, name: pluginName } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getName, getFile, getGroup, getSchemas } = useOperationManager(generator)\n\n function buildOperationData(operation: Operation): OperationData {\n const type = {\n file: getFile(operation, { pluginName: pluginTsName }),\n schemas: getSchemas(operation, { pluginName: pluginTsName, type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginName: pluginZodName }),\n schemas: getSchemas(operation, { pluginName: pluginZodName, type: 'function' }),\n }\n\n return {\n operation,\n name: getName(operation, { type: 'function' }),\n typeSchemas: type.schemas,\n zodSchemas: zod.schemas,\n typeFile: type.file,\n zodFile: zod.file,\n }\n }\n\n // Group operations by tag\n const controllers = operations.reduce(\n (acc, operation) => {\n const group = getGroup(operation)\n const groupName = group?.tag ? (options.group?.name?.({ group: camelCase(group.tag) }) ?? pascalCase(group.tag)) : 'Client'\n\n if (!group?.tag && !options.group) {\n // If no grouping, put all operations in a single class\n const name = 'ApiClient'\n const file = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginName,\n })\n\n const operationData = buildOperationData(operation)\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.operations.push(operationData)\n } else {\n acc.push({ name, file, operations: [operationData] })\n }\n } else if (group?.tag) {\n // Group by tag\n const name = groupName\n const file = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginName,\n options: { group },\n })\n\n const operationData = buildOperationData(operation)\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.operations.push(operationData)\n } else {\n acc.push({ name, file, operations: [operationData] })\n }\n }\n\n return acc\n },\n [] as Array<Controller>,\n )\n\n function collectTypeImports(ops: Array<OperationData>) {\n const typeImportsByFile = new Map<string, Set<string>>()\n const typeFilesByPath = new Map<string, KubbFile.File>()\n\n ops.forEach((op) => {\n const { typeSchemas, typeFile } = op\n\n if (!typeImportsByFile.has(typeFile.path)) {\n typeImportsByFile.set(typeFile.path, new Set())\n }\n const typeImports = typeImportsByFile.get(typeFile.path)!\n\n if (typeSchemas.request?.name) typeImports.add(typeSchemas.request.name)\n if (typeSchemas.response?.name) typeImports.add(typeSchemas.response.name)\n if (typeSchemas.pathParams?.name) typeImports.add(typeSchemas.pathParams.name)\n if (typeSchemas.queryParams?.name) typeImports.add(typeSchemas.queryParams.name)\n if (typeSchemas.headerParams?.name) typeImports.add(typeSchemas.headerParams.name)\n typeSchemas.statusCodes?.forEach((item) => {\n if (item?.name) typeImports.add(item.name)\n })\n typeFilesByPath.set(typeFile.path, typeFile)\n })\n\n return { typeImportsByFile, typeFilesByPath }\n }\n\n function collectZodImports(ops: Array<OperationData>) {\n const zodImportsByFile = new Map<string, Set<string>>()\n const zodFilesByPath = new Map<string, KubbFile.File>()\n\n ops.forEach((op) => {\n const { zodSchemas, zodFile } = op\n\n if (!zodImportsByFile.has(zodFile.path)) {\n zodImportsByFile.set(zodFile.path, new Set())\n }\n const zodImports = zodImportsByFile.get(zodFile.path)!\n\n if (zodSchemas?.response?.name) zodImports.add(zodSchemas.response.name)\n if (zodSchemas?.request?.name) zodImports.add(zodSchemas.request.name)\n zodFilesByPath.set(zodFile.path, zodFile)\n })\n\n return { zodImportsByFile, zodFilesByPath }\n }\n\n return controllers.map(({ name, file, operations: ops }) => {\n const { typeImportsByFile, typeFilesByPath } = collectTypeImports(ops)\n const { zodImportsByFile, zodFilesByPath } =\n options.parser === 'zod'\n ? collectZodImports(ops)\n : { zodImportsByFile: new Map<string, Set<string>>(), zodFilesByPath: new Map<string, KubbFile.File>() }\n const hasFormData = ops.some((op) => op.operation.getContentType() === 'multipart/form-data')\n\n return (\n <File\n key={file.path}\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: options.output })}\n >\n {options.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.importPath} />\n <File.Import name={['mergeConfig']} path={options.importPath} />\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={options.importPath} isTypeOnly />\n </>\n ) : (\n <>\n <File.Import name={['fetch']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import name={['mergeConfig']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n </>\n )}\n\n {hasFormData && <File.Import name={['buildFormData']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/config.ts')} />}\n\n {Array.from(typeImportsByFile.entries()).map(([filePath, imports]) => {\n const typeFile = typeFilesByPath.get(filePath)\n if (!typeFile) {\n return null\n }\n const importNames = Array.from(imports).filter(Boolean)\n if (importNames.length === 0) {\n return null\n }\n return <File.Import key={filePath} name={importNames} root={file.path} path={typeFile.path} isTypeOnly />\n })}\n\n {options.parser === 'zod' &&\n Array.from(zodImportsByFile.entries()).map(([filePath, imports]) => {\n const zodFile = zodFilesByPath.get(filePath)\n if (!zodFile) {\n return null\n }\n const importNames = Array.from(imports).filter(Boolean)\n if (importNames.length === 0) {\n return null\n }\n\n return <File.Import key={filePath} name={importNames} root={file.path} path={zodFile.path} />\n })}\n\n <StaticClassClient\n name={name}\n operations={ops}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n parser={options.parser}\n />\n </File>\n )\n })\n },\n})\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,cAAc,EAAE,MAAM,YAAY,eAAe,MAAM,cAAc,QAAgC;CAInH,MAAM,YAAY,gBAAgB,KAAK;EAHpB,WAAW,KAAK,cAAc,cAAcA,0BAAAA,UAAU,UAAU,CAAC,IAAI,YAAY,CAAC,KA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ringTag, { value: "Module" });
2
- const require_generators = require("./generators-qkDW17Hf.cjs");
3
- exports.classClientGenerator = require_generators.classClientGenerator;
4
- exports.clientGenerator = require_generators.clientGenerator;
5
- exports.groupedClientGenerator = require_generators.groupedClientGenerator;
6
- exports.operationsGenerator = require_generators.operationsGenerator;
7
- exports.staticClassClientGenerator = require_generators.staticClassClientGenerator;
@@ -1,512 +0,0 @@
1
- import { t as __name } from "./chunk--u3MIqq1.js";
2
- import { r as PluginClient } from "./types-CdM4DK1M.js";
3
- import { Adapter, AsyncEventEmitter, Config, FileMetaBase, Group, KubbEvents, Output, Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from "@kubb/core";
4
- import { Fabric } from "@kubb/react-fabric";
5
- import { HttpMethod, Oas, Operation, SchemaObject, contentType } from "@kubb/oas";
6
- import { FabricReactNode } from "@kubb/react-fabric/types";
7
- import { OperationNode, SchemaNode } from "@kubb/ast/types";
8
- import { KubbFile } from "@kubb/fabric-core/types";
9
-
10
- //#region ../plugin-oas/src/types.d.ts
11
- type GetOasOptions = {
12
- validate?: boolean;
13
- };
14
- type Context$2 = {
15
- getOas(options?: GetOasOptions): Promise<Oas>;
16
- getBaseURL(): Promise<string | undefined>;
17
- };
18
- declare global {
19
- namespace Kubb {
20
- interface PluginContext extends Context$2 {}
21
- }
22
- }
23
- /**
24
- * `propertyName` is the ref name + resolved with the nameResolver
25
- * @example import { Pet } from './Pet'
26
- *
27
- * `originalName` is the original name used(in PascalCase), only used to remove duplicates
28
- *
29
- * `pluginName` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
30
- * @example import a type(plugin-ts) for a mock file(swagger-faker)
31
- */
32
- type Ref = {
33
- propertyName: string;
34
- originalName: string;
35
- path: KubbFile.Path;
36
- pluginName?: string;
37
- };
38
- type Refs = Record<string, Ref>;
39
- type OperationSchema = {
40
- /**
41
- * Converted name, contains already `PathParams`, `QueryParams`, ...
42
- */
43
- name: string;
44
- schema: SchemaObject;
45
- operation?: Operation;
46
- /**
47
- * OperationName in PascalCase, only being used in OperationGenerator
48
- */
49
- operationName: string;
50
- description?: string;
51
- statusCode?: number;
52
- keys?: string[];
53
- keysToOmit?: string[];
54
- withData?: boolean;
55
- };
56
- type OperationSchemas = {
57
- pathParams?: OperationSchema & {
58
- keysToOmit?: never;
59
- };
60
- queryParams?: OperationSchema & {
61
- keysToOmit?: never;
62
- };
63
- headerParams?: OperationSchema & {
64
- keysToOmit?: never;
65
- };
66
- request?: OperationSchema;
67
- response: OperationSchema;
68
- responses: Array<OperationSchema>;
69
- statusCodes?: Array<OperationSchema>;
70
- errors?: Array<OperationSchema>;
71
- };
72
- type ByTag = {
73
- type: 'tag';
74
- pattern: string | RegExp;
75
- };
76
- type ByOperationId = {
77
- type: 'operationId';
78
- pattern: string | RegExp;
79
- };
80
- type ByPath = {
81
- type: 'path';
82
- pattern: string | RegExp;
83
- };
84
- type ByMethod = {
85
- type: 'method';
86
- pattern: HttpMethod | RegExp;
87
- };
88
- type BySchemaName = {
89
- type: 'schemaName';
90
- pattern: string | RegExp;
91
- };
92
- type ByContentType = {
93
- type: 'contentType';
94
- pattern: string | RegExp;
95
- };
96
- type Exclude = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
97
- type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
98
- type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
99
- options: Partial<TOptions>;
100
- };
101
- //#endregion
102
- //#region ../plugin-oas/src/OperationGenerator.d.ts
103
- type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
104
- fabric: Fabric;
105
- oas: Oas;
106
- exclude: Array<Exclude> | undefined;
107
- include: Array<Include> | undefined;
108
- override: Array<Override<TOptions>> | undefined;
109
- contentType: contentType | undefined;
110
- pluginManager: PluginManager;
111
- events?: AsyncEventEmitter<KubbEvents>;
112
- /**
113
- * Current plugin
114
- */
115
- plugin: Plugin<TPluginOptions>;
116
- mode: KubbFile.Mode;
117
- UNSTABLE_NAMING?: true;
118
- };
119
- declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> {
120
- #private;
121
- constructor(options: TPluginOptions['resolvedOptions'], context: Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>);
122
- get options(): TPluginOptions['resolvedOptions'];
123
- set options(options: TPluginOptions['resolvedOptions']);
124
- get context(): Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>;
125
- getOptions(operation: Operation, method: HttpMethod): Partial<TPluginOptions['resolvedOptions']>;
126
- getSchemas(operation: Operation, {
127
- resolveName
128
- }?: {
129
- resolveName?: (name: string) => string;
130
- }): OperationSchemas;
131
- getOperations(): Promise<Array<{
132
- path: string;
133
- method: HttpMethod;
134
- operation: Operation;
135
- }>>;
136
- build(...generators: Array<Generator<TPluginOptions, Version>>): Promise<Array<KubbFile.File<TFileMeta>>>;
137
- }
138
- //#endregion
139
- //#region ../plugin-oas/src/SchemaMapper.d.ts
140
- type SchemaKeywordMapper = {
141
- object: {
142
- keyword: 'object';
143
- args: {
144
- properties: {
145
- [x: string]: Schema[];
146
- };
147
- additionalProperties: Schema[];
148
- patternProperties?: Record<string, Schema[]>;
149
- strict?: boolean;
150
- };
151
- };
152
- url: {
153
- keyword: 'url';
154
- };
155
- readOnly: {
156
- keyword: 'readOnly';
157
- };
158
- writeOnly: {
159
- keyword: 'writeOnly';
160
- };
161
- uuid: {
162
- keyword: 'uuid';
163
- };
164
- email: {
165
- keyword: 'email';
166
- };
167
- firstName: {
168
- keyword: 'firstName';
169
- };
170
- lastName: {
171
- keyword: 'lastName';
172
- };
173
- phone: {
174
- keyword: 'phone';
175
- };
176
- password: {
177
- keyword: 'password';
178
- };
179
- date: {
180
- keyword: 'date';
181
- args: {
182
- type?: 'date' | 'string';
183
- };
184
- };
185
- time: {
186
- keyword: 'time';
187
- args: {
188
- type?: 'date' | 'string';
189
- };
190
- };
191
- datetime: {
192
- keyword: 'datetime';
193
- args: {
194
- offset?: boolean;
195
- local?: boolean;
196
- };
197
- };
198
- tuple: {
199
- keyword: 'tuple';
200
- args: {
201
- items: Schema[];
202
- min?: number;
203
- max?: number;
204
- rest?: Schema;
205
- };
206
- };
207
- array: {
208
- keyword: 'array';
209
- args: {
210
- items: Schema[];
211
- min?: number;
212
- max?: number;
213
- unique?: boolean;
214
- };
215
- };
216
- enum: {
217
- keyword: 'enum';
218
- args: {
219
- name: string;
220
- typeName: string;
221
- asConst: boolean;
222
- items: Array<{
223
- name: string | number;
224
- format: 'string' | 'number' | 'boolean';
225
- value?: string | number | boolean;
226
- }>;
227
- };
228
- };
229
- and: {
230
- keyword: 'and';
231
- args: Schema[];
232
- };
233
- const: {
234
- keyword: 'const';
235
- args: {
236
- name: string | number;
237
- format: 'string' | 'number' | 'boolean';
238
- value?: string | number | boolean;
239
- };
240
- };
241
- union: {
242
- keyword: 'union';
243
- args: Schema[];
244
- };
245
- ref: {
246
- keyword: 'ref';
247
- args: {
248
- name: string;
249
- $ref: string;
250
- /**
251
- * Full qualified path.
252
- */
253
- path: KubbFile.Path;
254
- /**
255
- * When true `File.Import` is used.
256
- * When false a reference is used inside the current file.
257
- */
258
- isImportable: boolean;
259
- };
260
- };
261
- matches: {
262
- keyword: 'matches';
263
- args?: string;
264
- };
265
- boolean: {
266
- keyword: 'boolean';
267
- };
268
- default: {
269
- keyword: 'default';
270
- args: string | number | boolean;
271
- };
272
- string: {
273
- keyword: 'string';
274
- };
275
- integer: {
276
- keyword: 'integer';
277
- };
278
- bigint: {
279
- keyword: 'bigint';
280
- };
281
- number: {
282
- keyword: 'number';
283
- };
284
- max: {
285
- keyword: 'max';
286
- args: number;
287
- };
288
- min: {
289
- keyword: 'min';
290
- args: number;
291
- };
292
- exclusiveMaximum: {
293
- keyword: 'exclusiveMaximum';
294
- args: number;
295
- };
296
- exclusiveMinimum: {
297
- keyword: 'exclusiveMinimum';
298
- args: number;
299
- };
300
- describe: {
301
- keyword: 'describe';
302
- args: string;
303
- };
304
- example: {
305
- keyword: 'example';
306
- args: string;
307
- };
308
- deprecated: {
309
- keyword: 'deprecated';
310
- };
311
- optional: {
312
- keyword: 'optional';
313
- };
314
- undefined: {
315
- keyword: 'undefined';
316
- };
317
- nullish: {
318
- keyword: 'nullish';
319
- };
320
- nullable: {
321
- keyword: 'nullable';
322
- };
323
- null: {
324
- keyword: 'null';
325
- };
326
- any: {
327
- keyword: 'any';
328
- };
329
- unknown: {
330
- keyword: 'unknown';
331
- };
332
- void: {
333
- keyword: 'void';
334
- };
335
- blob: {
336
- keyword: 'blob';
337
- };
338
- schema: {
339
- keyword: 'schema';
340
- args: {
341
- type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
342
- format?: string;
343
- };
344
- };
345
- name: {
346
- keyword: 'name';
347
- args: string;
348
- };
349
- catchall: {
350
- keyword: 'catchall';
351
- };
352
- interface: {
353
- keyword: 'interface';
354
- };
355
- };
356
- type Schema = {
357
- keyword: string;
358
- } | SchemaKeywordMapper[keyof SchemaKeywordMapper];
359
- //#endregion
360
- //#region ../plugin-oas/src/SchemaGenerator.d.ts
361
- type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
362
- fabric: Fabric;
363
- oas: Oas;
364
- pluginManager: PluginManager;
365
- events?: AsyncEventEmitter<KubbEvents>;
366
- /**
367
- * Current plugin
368
- */
369
- plugin: Plugin<TPluginOptions>;
370
- mode: KubbFile.Mode;
371
- include?: Array<'schemas' | 'responses' | 'requestBodies'>;
372
- override: Array<Override<TOptions>> | undefined;
373
- contentType?: contentType;
374
- output?: string;
375
- };
376
- type SchemaGeneratorOptions = {
377
- dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date';
378
- integerType?: 'number' | 'bigint';
379
- unknownType: 'any' | 'unknown' | 'void';
380
- emptySchemaType: 'any' | 'unknown' | 'void';
381
- enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal' | 'inlineLiteral';
382
- enumSuffix?: string;
383
- /**
384
- * @deprecated Will be removed in v5. Use `collisionDetection: true` instead to prevent enum name collisions.
385
- * When `collisionDetection` is enabled, the rootName-based approach eliminates the need for numeric suffixes.
386
- * @internal
387
- */
388
- usedEnumNames?: Record<string, number>;
389
- mapper?: Record<string, string>;
390
- typed?: boolean;
391
- transformers: {
392
- /**
393
- * Customize the names based on the type that is provided by the plugin.
394
- */
395
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
396
- /**
397
- * Receive schema and name(propertyName) and return Schema array.
398
- * Return `undefined` to fall through to default schema generation.
399
- * @beta
400
- */
401
- schema?: (schemaProps: SchemaProps$1, defaultSchemas: Schema[]) => Array<Schema> | undefined;
402
- };
403
- };
404
- type SchemaProps$1 = {
405
- schema: SchemaObject | null;
406
- name: string | null;
407
- parentName: string | null;
408
- rootName?: string | null;
409
- };
410
- declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> {
411
- #private;
412
- constructor(options: TOptions, context: Context<TOptions, TPluginOptions>);
413
- get options(): TOptions;
414
- set options(options: TOptions);
415
- get context(): Context<TOptions, TPluginOptions>;
416
- refs: Refs;
417
- /**
418
- * Creates a type node from a given schema.
419
- * Delegates to getBaseTypeFromSchema internally and
420
- * optionally adds a union with null.
421
- */
422
- parse(props: SchemaProps$1): Schema[];
423
- static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
424
- static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
425
- static combineObjects(tree: Schema[] | undefined): Schema[];
426
- build(...generators: Array<Generator<TPluginOptions, Version>>): Promise<Array<KubbFile.File<TFileMeta>>>;
427
- }
428
- //#endregion
429
- //#region ../plugin-oas/src/generators/createGenerator.d.ts
430
- type CoreGenerator<TOptions extends PluginFactoryOptions, TVersion extends Version> = {
431
- name: string;
432
- type: 'core';
433
- version: TVersion;
434
- operations: (props: OperationsProps<TOptions, TVersion>) => Promise<KubbFile.File[]>;
435
- operation: (props: OperationProps<TOptions, TVersion>) => Promise<KubbFile.File[]>;
436
- schema: (props: SchemaProps<TOptions, TVersion>) => Promise<KubbFile.File[]>;
437
- };
438
- //#endregion
439
- //#region ../plugin-oas/src/generators/types.d.ts
440
- type Version = '1' | '2';
441
- type OperationsV1Props<TOptions extends PluginFactoryOptions> = {
442
- config: Config;
443
- generator: Omit<OperationGenerator<TOptions>, 'build'>;
444
- plugin: Plugin<TOptions>;
445
- operations: Array<Operation>;
446
- };
447
- type OperationsV2Props<TOptions extends PluginFactoryOptions> = {
448
- config: Config;
449
- adapter: Adapter;
450
- options: Plugin<TOptions>['options'];
451
- nodes: Array<OperationNode>;
452
- };
453
- type OperationV1Props<TOptions extends PluginFactoryOptions> = {
454
- config: Config;
455
- generator: Omit<OperationGenerator<TOptions>, 'build'>;
456
- plugin: Plugin<TOptions>;
457
- operation: Operation;
458
- };
459
- type OperationV2Props<TOptions extends PluginFactoryOptions> = {
460
- config: Config;
461
- adapter: Adapter;
462
- options: Plugin<TOptions>['options'];
463
- node: OperationNode;
464
- };
465
- type OperationsProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? OperationsV2Props<TOptions> : OperationsV1Props<TOptions>;
466
- type OperationProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? OperationV2Props<TOptions> : OperationV1Props<TOptions>;
467
- type SchemaV1Props<TOptions extends PluginFactoryOptions> = {
468
- config: Config;
469
- generator: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
470
- plugin: Plugin<TOptions>;
471
- schema: {
472
- name: string;
473
- tree: Array<Schema>;
474
- value: SchemaObject;
475
- };
476
- };
477
- type SchemaV2Props<TOptions extends PluginFactoryOptions> = {
478
- config: Config;
479
- options: Plugin<TOptions>['options'];
480
- node: SchemaNode;
481
- adapter: Adapter;
482
- };
483
- type SchemaProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? SchemaV2Props<TOptions> : SchemaV1Props<TOptions>;
484
- type Generator<TOptions extends PluginFactoryOptions, TVersion extends Version = Version> = CoreGenerator<TOptions, TVersion> | ReactGenerator<TOptions, TVersion>;
485
- //#endregion
486
- //#region ../plugin-oas/src/generators/createReactGenerator.d.ts
487
- type ReactGenerator<TOptions extends PluginFactoryOptions, TVersion extends Version> = {
488
- name: string;
489
- type: 'react';
490
- version: TVersion;
491
- Operations: (props: OperationsProps<TOptions, TVersion>) => FabricReactNode;
492
- Operation: (props: OperationProps<TOptions, TVersion>) => FabricReactNode;
493
- Schema: (props: SchemaProps<TOptions, TVersion>) => FabricReactNode;
494
- };
495
- //#endregion
496
- //#region src/generators/classClientGenerator.d.ts
497
- declare const classClientGenerator: ReactGenerator<PluginClient, "1">;
498
- //#endregion
499
- //#region src/generators/clientGenerator.d.ts
500
- declare const clientGenerator: ReactGenerator<PluginClient, "1">;
501
- //#endregion
502
- //#region src/generators/groupedClientGenerator.d.ts
503
- declare const groupedClientGenerator: ReactGenerator<PluginClient, "1">;
504
- //#endregion
505
- //#region src/generators/operationsGenerator.d.ts
506
- declare const operationsGenerator: ReactGenerator<PluginClient, "1">;
507
- //#endregion
508
- //#region src/generators/staticClassClientGenerator.d.ts
509
- declare const staticClassClientGenerator: ReactGenerator<PluginClient, "1">;
510
- //#endregion
511
- export { classClientGenerator, clientGenerator, groupedClientGenerator, operationsGenerator, staticClassClientGenerator };
512
- //# sourceMappingURL=generators.d.ts.map
@@ -1,2 +0,0 @@
1
- import { a as classClientGenerator, i as clientGenerator, n as operationsGenerator, r as groupedClientGenerator, t as staticClassClientGenerator } from "./generators-C2jT7XCH.js";
2
- export { classClientGenerator, clientGenerator, groupedClientGenerator, operationsGenerator, staticClassClientGenerator };