@kubb/plugin-zod 3.0.0-alpha.3 → 3.0.0-alpha.5
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/{chunk-XCGVHLYD.js → chunk-MGSFBU7O.js} +20 -12
- package/dist/chunk-MGSFBU7O.js.map +1 -0
- package/dist/{chunk-7X3NWYUN.cjs → chunk-RISCJCJN.cjs} +20 -12
- package/dist/chunk-RISCJCJN.cjs.map +1 -0
- package/dist/components.cjs +2 -2
- package/dist/components.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +12 -12
- package/src/plugin.ts +14 -10
- package/dist/chunk-7X3NWYUN.cjs.map +0 -1
- package/dist/chunk-XCGVHLYD.js.map +0 -1
|
@@ -658,12 +658,16 @@ var pluginTs = createPlugin((options) => {
|
|
|
658
658
|
return;
|
|
659
659
|
}
|
|
660
660
|
const root = path.resolve(this.config.root, this.config.output.path);
|
|
661
|
-
await this.fileManager.
|
|
661
|
+
const files = await this.fileManager.getIndexFiles({
|
|
662
662
|
root,
|
|
663
663
|
output,
|
|
664
|
-
|
|
664
|
+
plugin: this.plugin,
|
|
665
665
|
logger: this.logger
|
|
666
666
|
});
|
|
667
|
+
await this.fileManager.processFiles({
|
|
668
|
+
logger: this.logger,
|
|
669
|
+
files
|
|
670
|
+
});
|
|
667
671
|
}
|
|
668
672
|
};
|
|
669
673
|
});
|
|
@@ -1094,13 +1098,7 @@ var pluginZod = createPlugin2((options) => {
|
|
|
1094
1098
|
});
|
|
1095
1099
|
const operationFiles = await operationGenerator.build(zodParser);
|
|
1096
1100
|
await this.addFile(...operationFiles);
|
|
1097
|
-
|
|
1098
|
-
async buildEnd() {
|
|
1099
|
-
if (this.config.output.write === false) {
|
|
1100
|
-
return;
|
|
1101
|
-
}
|
|
1102
|
-
const root = path2.resolve(this.config.root, this.config.output.path);
|
|
1103
|
-
if (group?.type === "tag") {
|
|
1101
|
+
if (this.config.output.write && group?.type === "tag") {
|
|
1104
1102
|
const rootFiles = await getGroupedByTagFiles({
|
|
1105
1103
|
logger: this.logger,
|
|
1106
1104
|
files: this.fileManager.files,
|
|
@@ -1112,12 +1110,22 @@ var pluginZod = createPlugin2((options) => {
|
|
|
1112
1110
|
});
|
|
1113
1111
|
await this.addFile(...rootFiles);
|
|
1114
1112
|
}
|
|
1115
|
-
|
|
1113
|
+
},
|
|
1114
|
+
async buildEnd() {
|
|
1115
|
+
if (this.config.output.write === false) {
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
const root = path2.resolve(this.config.root, this.config.output.path);
|
|
1119
|
+
const files = await this.fileManager.getIndexFiles({
|
|
1116
1120
|
root,
|
|
1117
1121
|
output,
|
|
1118
|
-
|
|
1122
|
+
plugin: this.plugin,
|
|
1119
1123
|
logger: this.logger
|
|
1120
1124
|
});
|
|
1125
|
+
await this.fileManager.processFiles({
|
|
1126
|
+
logger: this.logger,
|
|
1127
|
+
files
|
|
1128
|
+
});
|
|
1121
1129
|
}
|
|
1122
1130
|
};
|
|
1123
1131
|
});
|
|
@@ -1239,4 +1247,4 @@ export {
|
|
|
1239
1247
|
pluginZodName,
|
|
1240
1248
|
pluginZod
|
|
1241
1249
|
};
|
|
1242
|
-
//# sourceMappingURL=chunk-
|
|
1250
|
+
//# sourceMappingURL=chunk-MGSFBU7O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Operations.tsx","../src/components/Schema.tsx","../../plugin-ts/src/plugin.ts","../../plugin-ts/src/OperationGenerator.tsx","../../plugin-ts/src/components/OasType.tsx","../../plugin-ts/src/components/OperationSchema.tsx","../../plugin-ts/src/SchemaGenerator.tsx","../../plugin-ts/src/components/Schema.tsx","../../plugin-ts/src/parser/index.ts","../src/parser/index.ts","../src/plugin.ts","../src/SchemaGenerator.tsx","../src/components/OperationSchema.tsx"],"sourcesContent":["import { useOperationManager, useOperations } from '@kubb/plugin-oas/hooks'\nimport { Const, File, Parser, useApp } from '@kubb/react'\n\nimport transformers from '@kubb/core/transformers'\nimport type { HttpMethod, Operation } from '@kubb/oas'\nimport type { KubbNode } from '@kubb/react'\nimport type { ComponentProps, ComponentType } from 'react'\nimport type { FileMeta, PluginZod } from '../types.ts'\n\ntype TemplateProps = {\n /**\n * Name of the function\n */\n operationsName: string\n /**\n * Name of the function\n */\n pathsName: string\n operations: Operation[]\n}\n\nfunction Template({ operationsName, pathsName, operations }: TemplateProps): KubbNode {\n const { groupSchemasByName } = useOperationManager()\n const transformedOperations = operations.map((operation) => ({ operation, data: groupSchemasByName(operation, { type: 'function' }) }))\n\n const operationsJSON = transformedOperations.reduce(\n (prev, acc) => {\n prev[`\"${acc.operation.getOperationId()}\"`] = acc.data\n\n return prev\n },\n {} as Record<string, unknown>,\n )\n\n const pathsJSON = transformedOperations.reduce(\n (prev, acc) => {\n prev[`\"${acc.operation.path}\"`] = {\n ...(prev[`\"${acc.operation.path}\"`] || ({} as Record<HttpMethod, string>)),\n [acc.operation.method]: `operations[\"${acc.operation.getOperationId()}\"]`,\n }\n\n return prev\n },\n {} as Record<string, Record<HttpMethod, string>>,\n )\n\n return (\n <>\n <Const export name={operationsName} asConst>\n {`{${transformers.stringifyObject(operationsJSON)}}`}\n </Const>\n <Const export name={pathsName} asConst>\n {`{${transformers.stringifyObject(pathsJSON)}}`}\n </Const>\n </>\n )\n}\n\ntype RootTemplateProps = {\n children?: React.ReactNode\n}\n\nfunction RootTemplate({ children }: RootTemplateProps) {\n const {\n mode,\n pluginManager,\n plugin: {\n key: pluginKey,\n options: { extName },\n },\n } = useApp<PluginZod>()\n const { getFile } = useOperationManager()\n const operations = useOperations()\n const { groupSchemasByName } = useOperationManager()\n const transformedOperations = operations.map((operation) => ({ operation, data: groupSchemasByName(operation, { type: 'function' }) }))\n\n const file = pluginManager.getFile({ name: 'operations', extName: '.ts', pluginKey })\n const imports = Object.entries(transformedOperations)\n .map(([_key, { data, operation }], index) => {\n const names = [data.request, ...Object.values(data.responses), ...Object.values(data.parameters)].filter(Boolean)\n\n return <File.Import key={index} extName={extName} name={names} root={file.path} path={getFile(operation).path} />\n })\n .filter(Boolean)\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta} exportable={false}>\n {mode === 'split' && imports}\n <File.Source>{children}</File.Source>\n </File>\n </Parser>\n )\n}\n\nconst defaultTemplates = { default: Template, root: RootTemplate } as const\n\ntype Templates = Partial<typeof defaultTemplates>\n\ntype Props = {\n /**\n * This will make it possible to override the default behaviour.\n */\n Template?: ComponentType<ComponentProps<typeof Template>>\n}\n\nexport function Operations({ Template = defaultTemplates.default }: Props): KubbNode {\n const operations = useOperations()\n\n return <Template operationsName=\"operations\" pathsName=\"paths\" operations={operations} />\n}\n\ntype FileProps = {\n /**\n * This will make it possible to override the default behaviour.\n */\n templates?: Templates\n}\n\nOperations.File = function (props: FileProps): KubbNode {\n const templates = { ...defaultTemplates, ...props.templates }\n\n const Template = templates.default\n const RootTemplate = templates.root\n\n return (\n <RootTemplate>\n <Operations Template={Template} />\n </RootTemplate>\n )\n}\n\nOperations.templates = defaultTemplates\n","import { Oas } from '@kubb/plugin-oas/components'\nimport { Const, File, Type, useApp, useFile } from '@kubb/react'\nimport { pluginTsName } from '@kubb/plugin-ts'\n\nimport transformers from '@kubb/core/transformers'\nimport { isKeyword, schemaKeywords } from '@kubb/plugin-oas'\nimport { useSchema } from '@kubb/plugin-oas/hooks'\nimport type { ReactNode } from 'react'\nimport * as parserZod from '../parser/index.ts'\nimport { pluginZodName } from '../plugin.ts'\nimport type { PluginZod } from '../types.ts'\n\ntype Props = {\n description?: string\n withTypeAnnotation?: boolean\n keysToOmit?: string[]\n}\n\nexport function Schema(props: Props): ReactNode {\n const { keysToOmit, withTypeAnnotation, description } = props\n const { tree, name } = useSchema()\n const {\n pluginManager,\n plugin: {\n options: { mapper, typedSchema, coercion },\n },\n } = useApp<PluginZod>()\n\n // all checks are also inside this.schema(React)\n const resolvedName = pluginManager.resolveName({\n name,\n pluginKey: [pluginZodName],\n type: 'function',\n })\n const resolvedTypeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginZodName],\n type: 'type',\n })\n\n const typeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n if (!tree.length) {\n return (\n <Const\n name={resolvedName}\n export\n JSDoc={{\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }}\n >\n undefined\n </Const>\n )\n }\n\n const hasTuple = tree.some((item) => isKeyword(item, schemaKeywords.tuple))\n\n const output = parserZod\n .sort(tree)\n .filter((item) => {\n if (hasTuple && (isKeyword(item, schemaKeywords.min) || isKeyword(item, schemaKeywords.max))) {\n return false\n }\n\n return true\n })\n .map((item) => parserZod.parse(undefined, item, { name, typeName, description, mapper, coercion, keysToOmit }))\n .filter(Boolean)\n .join('')\n\n const suffix = output.endsWith('.nullable()') ? '.unwrap().and' : '.and'\n\n return (\n <>\n <Const\n export\n name={resolvedName}\n JSDoc={{\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }}\n >\n {[\n output,\n keysToOmit?.length ? `${suffix}(z.object({ ${keysToOmit.map((key) => `${key}: z.never()`).join(',')} }))` : undefined,\n withTypeAnnotation && typeName ? ` as z.ZodType<${typeName}>` : '',\n ]\n .filter(Boolean)\n .join('') || ''}\n </Const>\n {typedSchema && (\n <Type export name={resolvedTypeName}>\n {`z.infer<typeof ${resolvedName}>`}\n </Type>\n )}\n </>\n )\n}\n\ntype FileProps = {}\n\nSchema.File = function ({}: FileProps): ReactNode {\n const {\n pluginManager,\n plugin: {\n options: { typed },\n },\n } = useApp<PluginZod>()\n const { schema } = useSchema()\n\n const withTypeAnnotation = !!typed\n\n return (\n <Oas.Schema.File output={pluginManager.config.output.path}>\n <Schema.Imports />\n <File.Source>\n <Schema withTypeAnnotation={withTypeAnnotation} description={schema?.description} />\n </File.Source>\n </Oas.Schema.File>\n )\n}\nSchema.Imports = (): ReactNode => {\n const {\n pluginManager,\n plugin: {\n options: { typed, importPath },\n },\n } = useApp<PluginZod>()\n const { path: root } = useFile()\n const { name, tree, schema } = useSchema()\n\n // used for this.options.typed\n const typeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n const typeFileName = pluginManager.resolveName({\n name: name,\n pluginKey: [pluginTsName],\n type: 'file',\n })\n\n const typePath = pluginManager.resolvePath({\n baseName: typeFileName,\n pluginKey: [pluginTsName],\n })\n\n const withTypeAnnotation = !!typed\n\n return (\n <>\n <File.Import name={['z']} path={importPath} />\n {withTypeAnnotation && typeName && typePath && <File.Import isTypeOnly root={root} path={typePath} name={[typeName]} />}\n </>\n )\n}\n","import path from 'node:path'\n\nimport { FileManager, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { pluginOasName } from '@kubb/plugin-oas'\n\nimport { OperationGenerator } from './OperationGenerator.tsx'\nimport { SchemaGenerator } from './SchemaGenerator.tsx'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport type { PluginTs } from './types.ts'\n\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\nexport const pluginTs = createPlugin<PluginTs>((options) => {\n const {\n output = { path: 'types' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumSuffix = '',\n dateType = 'string',\n unknownType = 'any',\n optionalType = 'questionToken',\n transformers = {},\n oasType = false,\n mapper = {},\n } = options\n const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`\n\n return {\n name: pluginTsName,\n options: {\n extName: output.extName,\n transformers,\n dateType,\n optionalType,\n oasType,\n enumType,\n enumSuffix,\n // keep the used enumnames between SchemaGenerator and OperationGenerator per plugin(pluginKey)\n usedEnumNames: {},\n unknownType,\n override,\n mapper,\n },\n pre: [pluginOasName],\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (options?.tag && group?.type === 'tag') {\n const tag = camelCase(options.tag)\n\n return path.resolve(root, renderTemplate(template, { tag }), baseName)\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n const resolvedName = pascalCase(name, { isFile: type === 'file' })\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n\n const schemaGenerator = new SchemaGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build()\n await this.addFile(...schemaFiles)\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const operationFiles = await operationGenerator.build()\n await this.addFile(...operationFiles)\n },\n async buildEnd() {\n if (this.config.output.write === false) {\n return\n }\n\n const root = path.resolve(this.config.root, this.config.output.path)\n const files = await this.fileManager.getIndexFiles({\n root,\n output,\n plugin: this.plugin,\n logger: this.logger,\n })\n\n await this.fileManager.processFiles({\n logger: this.logger,\n files,\n })\n },\n }\n})\n","import { OperationGenerator as Generator } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { App, createRoot } from '@kubb/react'\n\nimport { OasType } from './components/OasType.tsx'\nimport { OperationSchema } from './components/OperationSchema.tsx'\n\nimport type { Operation } from '@kubb/oas'\nimport type { OperationMethodResult } from '@kubb/plugin-oas'\nimport type { FileMeta, PluginTs } from './types.ts'\n\nexport class OperationGenerator extends Generator<PluginTs['resolvedOptions'], PluginTs> {\n async all(operations: Operation[]): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n root.render(\n <App pluginManager={pluginManager} plugin={plugin} mode={mode}>\n <Oas oas={oas} operations={operations} generator={this}>\n {plugin.options.oasType && <OasType.File name=\"oas\" typeName=\"Oas\" />}\n </Oas>\n </App>,\n )\n\n return root.files\n }\n\n async operation(operation: Operation, options: PluginTs['resolvedOptions']): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n root.render(\n <App pluginManager={pluginManager} plugin={{ ...plugin, options }} mode={mode}>\n <Oas oas={oas} operations={[operation]} generator={this}>\n <Oas.Operation operation={operation}>\n <OperationSchema.File />\n </Oas.Operation>\n </Oas>\n </App>,\n )\n\n return root.files\n }\n}\n","import { Parser, File, Type, useApp } from '@kubb/react'\nimport { useOas } from '@kubb/plugin-oas/hooks'\n\nimport type { OasTypes } from '@kubb/oas'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginTs } from '../types.ts'\n\ntype TemplateProps = {\n /**\n * Name of the function\n */\n name: string\n typeName: string\n api: OasTypes.OASDocument\n}\n\nfunction Template({ name, typeName, api }: TemplateProps): ReactNode {\n return (\n <>\n {`export const ${name} = ${JSON.stringify(api, undefined, 2)} as const`}\n <br />\n <Type name={typeName} export>\n {`Infer<typeof ${name}>`}\n </Type>\n </>\n )\n}\n\nconst defaultTemplates = { default: Template } as const\n\ntype Props = {\n name: string\n typeName: string\n /**\n * This will make it possible to override the default behaviour.\n */\n Template?: React.ComponentType<React.ComponentProps<typeof Template>>\n}\n\nexport function OasType({ name, typeName, Template = defaultTemplates.default }: Props): ReactNode {\n const oas = useOas()\n\n return <Template name={name} typeName={typeName} api={oas.api} />\n}\n\ntype FileProps = {\n name: string\n typeName: string\n /**\n * This will make it possible to override the default behaviour.\n */\n templates?: typeof defaultTemplates\n}\n\nOasType.File = function ({ name, typeName, templates = defaultTemplates }: FileProps): ReactNode {\n const {\n pluginManager,\n plugin: { key: pluginKey },\n } = useApp<PluginTs>()\n const file = pluginManager.getFile({ name, extName: '.ts', pluginKey })\n\n const Template = templates.default\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n <File.Import name={['Infer']} path=\"@kubb/oas\" isTypeOnly />\n <File.Source>\n <OasType Template={Template} name={name} typeName={typeName} />\n </File.Source>\n </File>\n </Parser>\n )\n}\n\nOasType.templates = defaultTemplates\n","import transformers from '@kubb/core/transformers'\nimport { print } from '@kubb/parser-ts'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperation, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { File, Parser, useApp } from '@kubb/react'\n\nimport { SchemaGenerator } from '../SchemaGenerator.tsx'\n\nimport type { PluginManager } from '@kubb/core'\nimport type { Operation } from '@kubb/oas'\nimport type { ts } from '@kubb/parser-ts'\nimport type { OperationSchema as OperationSchemaType } from '@kubb/plugin-oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginTs } from '../types.ts'\nimport { Schema } from './Schema.tsx'\n\nfunction printCombinedSchema({\n name,\n operation,\n schemas,\n pluginManager,\n}: { name: string; operation: Operation; schemas: OperationSchemas; pluginManager: PluginManager }): string {\n const properties: Record<string, ts.TypeNode> = {}\n\n if (schemas.response) {\n const identifier = pluginManager.resolveName({\n name: schemas.response.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['response'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.request) {\n const identifier = pluginManager.resolveName({\n name: schemas.request.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['request'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.pathParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.pathParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['pathParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.queryParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.queryParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['queryParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.headerParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.headerParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['headerParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.errors) {\n properties['errors'] = factory.createUnionDeclaration({\n nodes: schemas.errors.map((error) => {\n const identifier = pluginManager.resolveName({\n name: error.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }),\n })!\n }\n\n const namespaceNode = factory.createTypeAliasDeclaration({\n name: operation.method === 'get' ? `${name}Query` : `${name}Mutation`,\n type: factory.createTypeLiteralNode(\n Object.keys(properties)\n .map((key) => {\n const type = properties[key]\n if (!type) {\n return undefined\n }\n\n return factory.createPropertySignature({\n name: transformers.pascalCase(key),\n type,\n })\n })\n .filter(Boolean),\n ),\n modifiers: [factory.modifiers.export],\n })\n\n return print(namespaceNode)\n}\n\ntype Props = {\n description?: string\n keysToOmit?: string[]\n}\n\nexport function OperationSchema({ keysToOmit, description }: Props): ReactNode {\n return <Schema keysToOmit={keysToOmit} description={description} />\n}\n\ntype FileProps = {}\n\nOperationSchema.File = function ({}: FileProps): ReactNode {\n const { pluginManager, plugin, mode, fileManager } = useApp<PluginTs>()\n const oas = useOas()\n const { getSchemas, getFile, getName } = useOperationManager()\n const operation = useOperation()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const factoryName = getName(operation, { type: 'type' })\n const generator = new SchemaGenerator(plugin.options, {\n oas,\n plugin,\n pluginManager,\n mode,\n override: plugin.options.override,\n })\n const items = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response].flat().filter(Boolean)\n\n const mapItem = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n const tree = generator.parse({ schema, name })\n\n return (\n <Oas.Schema key={i} name={name} value={schema} tree={tree}>\n {mode === 'split' && <Oas.Schema.Imports extName={plugin.options.extName} isTypeOnly />}\n <File.Source>\n <OperationSchema description={description} keysToOmit={keysToOmit} />\n </File.Source>\n </Oas.Schema>\n )\n }\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n {items.map(mapItem)}\n\n <File.Source>{printCombinedSchema({ name: factoryName, operation, schemas, pluginManager })}</File.Source>\n </File>\n </Parser>\n )\n}\n","import type { SchemaObject } from '@kubb/oas'\nimport { SchemaGenerator as Generator } from '@kubb/plugin-oas'\nimport type { SchemaMethodResult } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { App, createRoot } from '@kubb/react'\nimport { Schema } from './components/Schema.tsx'\nimport type { FileMeta, PluginTs } from './types.ts'\n\nexport class SchemaGenerator extends Generator<PluginTs['resolvedOptions'], PluginTs> {\n async schema(name: string, schema: SchemaObject, options: PluginTs['resolvedOptions']): SchemaMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode, output } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n const tree = this.parse({ schema, name })\n\n root.render(\n <App pluginManager={pluginManager} plugin={{ ...plugin, options }} mode={mode}>\n <Oas oas={oas}>\n <Oas.Schema name={name} value={schema} tree={tree}>\n <Schema.File />\n </Oas.Schema>\n </Oas>\n </App>,\n )\n\n return root.files\n }\n}\n","import { Oas } from '@kubb/plugin-oas/components'\nimport { File, useApp } from '@kubb/react'\n\nimport transformers from '@kubb/core/transformers'\nimport { print, type ts } from '@kubb/parser-ts'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { useSchema } from '@kubb/plugin-oas/hooks'\nimport type { ReactNode } from 'react'\nimport { parse, typeKeywordMapper } from '../parser/index.ts'\nimport { pluginTsName } from '../plugin.ts'\nimport type { PluginTs } from '../types.ts'\n\ntype Props = {\n description?: string\n keysToOmit?: string[]\n}\n\nexport function Schema(props: Props): ReactNode {\n const { keysToOmit, description } = props\n const { tree, name } = useSchema()\n const {\n pluginManager,\n plugin: {\n options: { mapper, enumType, optionalType },\n },\n } = useApp<PluginTs>()\n\n // all checks are also inside this.schema(React)\n const resolvedName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n const typeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n const nodes: ts.Node[] = []\n const extraNodes: ts.Node[] = []\n\n if (!tree.length) {\n return ''\n }\n\n const isNullish = tree.some((item) => item.keyword === schemaKeywords.nullish)\n const isNullable = tree.some((item) => item.keyword === schemaKeywords.nullable)\n const isOptional = tree.some((item) => item.keyword === schemaKeywords.optional)\n\n let type =\n (tree\n .map((schema) => parse(undefined, schema, { name: resolvedName, typeName, description, keysToOmit, optionalType, enumType, mapper }))\n .filter(Boolean)\n .at(0) as ts.TypeNode) || typeKeywordMapper.undefined()\n\n if (isNullable) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.null],\n }) as ts.TypeNode\n }\n\n if (isNullish && ['undefined', 'questionTokenAndUndefined'].includes(optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n if (isOptional && ['undefined', 'questionTokenAndUndefined'].includes(optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n const node = factory.createTypeAliasDeclaration({\n modifiers: [factory.modifiers.export],\n name: resolvedName,\n type: keysToOmit?.length\n ? factory.createOmitDeclaration({\n keys: keysToOmit,\n type,\n nonNullable: true,\n })\n : type,\n })\n\n const enumSchemas = SchemaGenerator.deepSearch(tree, schemaKeywords.enum)\n if (enumSchemas) {\n enumSchemas.forEach((enumSchema) => {\n extraNodes.push(\n ...factory.createEnumDeclaration({\n name: transformers.camelCase(enumSchema.args.name),\n typeName: enumSchema.args.typeName,\n enums: enumSchema.args.items\n .map((item) => (item.value === undefined ? undefined : [transformers.trimQuotes(item.name?.toString()), item.value]))\n .filter(Boolean) as unknown as [string, string][],\n type: enumType,\n }),\n )\n })\n }\n\n nodes.push(\n factory.appendJSDocToNode({\n node,\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }),\n )\n\n const filterdNodes = nodes.filter(\n (node: ts.Node) =>\n !extraNodes.some(\n (extraNode: ts.Node) => (extraNode as ts.TypeAliasDeclaration)?.name?.escapedText === (node as ts.TypeAliasDeclaration)?.name?.escapedText,\n ),\n )\n\n return print([...extraNodes, ...filterdNodes])\n}\n\ntype FileProps = {}\n\nSchema.File = function ({}: FileProps): ReactNode {\n const { pluginManager } = useApp<PluginTs>()\n const { schema } = useSchema()\n\n return (\n <Oas.Schema.File output={pluginManager.config.output.path}>\n <File.Source>\n <Schema description={schema?.description} />\n </File.Source>\n </Oas.Schema.File>\n )\n}\n","import transformers from '@kubb/core/transformers'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { isKeyword, schemaKeywords } from '@kubb/plugin-oas'\n\nimport type { ts } from '@kubb/parser-ts'\nimport type { Schema, SchemaKeywordMapper, SchemaMapper } from '@kubb/plugin-oas'\n\nexport const typeKeywordMapper = {\n any: () => factory.keywordTypeNodes.any,\n unknown: () => factory.keywordTypeNodes.unknown,\n number: () => factory.keywordTypeNodes.number,\n integer: () => factory.keywordTypeNodes.number,\n object: (nodes?: ts.TypeElement[]) => {\n if (!nodes || !nodes.length) {\n return factory.keywordTypeNodes.object\n }\n\n return factory.createTypeLiteralNode(nodes)\n },\n string: () => factory.keywordTypeNodes.string,\n boolean: () => factory.keywordTypeNodes.boolean,\n undefined: () => factory.keywordTypeNodes.undefined,\n nullable: undefined,\n null: () => factory.keywordTypeNodes.null,\n nullish: undefined,\n array: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createArrayDeclaration({ nodes })\n },\n tuple: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createTupleTypeNode(nodes)\n },\n enum: (name?: string) => {\n if (!name) {\n return undefined\n }\n\n return factory.createTypeReferenceNode(name, undefined)\n },\n union: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createUnionDeclaration({\n withParentheses: true,\n nodes,\n })\n },\n const: (name?: string | number, format?: 'string' | 'number') => {\n if (!name) {\n return undefined\n }\n\n if (format === 'number') {\n return factory.createLiteralTypeNode(factory.createNumericLiteral(name))\n }\n\n return factory.createLiteralTypeNode(factory.createStringLiteral(name.toString()))\n },\n datetime: () => factory.keywordTypeNodes.string,\n date: (type: 'date' | 'string' = 'string') =>\n type === 'string' ? factory.keywordTypeNodes.string : factory.createTypeReferenceNode(factory.createIdentifier('Date')),\n time: (type: 'date' | 'string' = 'string') =>\n type === 'string' ? factory.keywordTypeNodes.string : factory.createTypeReferenceNode(factory.createIdentifier('Date')),\n uuid: undefined,\n url: undefined,\n strict: undefined,\n default: undefined,\n and: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createIntersectionDeclaration({\n withParentheses: true,\n nodes,\n })\n },\n describe: undefined,\n min: undefined,\n max: undefined,\n optional: undefined,\n matches: undefined,\n email: undefined,\n firstName: undefined,\n lastName: undefined,\n password: undefined,\n phone: undefined,\n readOnly: undefined,\n ref: (propertyName?: string) => {\n if (!propertyName) {\n return undefined\n }\n\n return factory.createTypeReferenceNode(propertyName, undefined)\n },\n blob: () => factory.createTypeReferenceNode('Blob', []),\n deprecated: undefined,\n example: undefined,\n schema: undefined,\n catchall: undefined,\n name: undefined,\n} satisfies SchemaMapper<ts.Node | null | undefined>\n\ntype ParserOptions = {\n name: string\n typeName?: string\n description?: string\n /**\n * @default `'questionToken'`\n */\n optionalType: 'questionToken' | 'undefined' | 'questionTokenAndUndefined'\n /**\n * @default `'asConst'`\n */\n enumType: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal'\n keysToOmit?: string[]\n mapper?: Record<string, ts.PropertySignature>\n}\n\nexport function parse(parent: Schema | undefined, current: Schema, options: ParserOptions): ts.Node | null | undefined {\n const value = typeKeywordMapper[current.keyword as keyof typeof typeKeywordMapper]\n\n if (!value) {\n return undefined\n }\n\n if (isKeyword(current, schemaKeywords.union)) {\n return typeKeywordMapper.union(current.args.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.and)) {\n return typeKeywordMapper.and(current.args.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.array)) {\n return typeKeywordMapper.array(current.args.items.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.enum)) {\n return typeKeywordMapper.enum(current.args.typeName)\n }\n\n if (isKeyword(current, schemaKeywords.ref)) {\n return typeKeywordMapper.ref(current.args.name)\n }\n\n if (isKeyword(current, schemaKeywords.blob)) {\n return value()\n }\n\n if (isKeyword(current, schemaKeywords.tuple)) {\n return typeKeywordMapper.tuple(current.args.items.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.const)) {\n return typeKeywordMapper.const(current.args.name, current.args.format)\n }\n\n if (isKeyword(current, schemaKeywords.object)) {\n const properties = Object.entries(current.args?.properties || {})\n .filter((item) => {\n const schemas = item[1]\n return schemas && typeof schemas.map === 'function'\n })\n .map(([name, schemas]) => {\n const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']\n const mappedName = nameSchema?.args || name\n\n // custom mapper(pluginOptions)\n if (options.mapper?.[mappedName]) {\n return options.mapper?.[mappedName]\n }\n\n const isNullish = schemas.some((schema) => schema.keyword === schemaKeywords.nullish)\n const isNullable = schemas.some((schema) => schema.keyword === schemaKeywords.nullable)\n const isOptional = schemas.some((schema) => schema.keyword === schemaKeywords.optional)\n const isReadonly = schemas.some((schema) => schema.keyword === schemaKeywords.readOnly)\n const describeSchema = schemas.find((schema) => schema.keyword === schemaKeywords.describe) as SchemaKeywordMapper['describe'] | undefined\n const deprecatedSchema = schemas.find((schema) => schema.keyword === schemaKeywords.deprecated) as SchemaKeywordMapper['deprecated'] | undefined\n const defaultSchema = schemas.find((schema) => schema.keyword === schemaKeywords.default) as SchemaKeywordMapper['default'] | undefined\n const exampleSchema = schemas.find((schema) => schema.keyword === schemaKeywords.example) as SchemaKeywordMapper['example'] | undefined\n const schemaSchema = schemas.find((schema) => schema.keyword === schemaKeywords.schema) as SchemaKeywordMapper['schema'] | undefined\n\n let type = schemas.map((schema) => parse(current, schema, options)).filter(Boolean)[0] as ts.TypeNode\n\n if (isNullable) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.null],\n }) as ts.TypeNode\n }\n\n if (isNullish && ['undefined', 'questionTokenAndUndefined'].includes(options.optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n if (isOptional && ['undefined', 'questionTokenAndUndefined'].includes(options.optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n const propertySignature = factory.createPropertySignature({\n questionToken: isOptional || isNullish ? ['questionToken', 'questionTokenAndUndefined'].includes(options.optionalType as string) : false,\n name: mappedName,\n type,\n readOnly: isReadonly,\n })\n\n return factory.appendJSDocToNode({\n node: propertySignature,\n comments: [\n describeSchema ? `@description ${transformers.jsStringEscape(describeSchema.args)}` : undefined,\n deprecatedSchema ? '@deprecated' : undefined,\n defaultSchema ? `@default ${defaultSchema.args}` : undefined,\n exampleSchema ? `@example ${exampleSchema.args}` : undefined,\n schemaSchema?.args?.type || schemaSchema?.args?.format\n ? [`@type ${schemaSchema?.args?.type || 'unknown'}${!isOptional ? '' : ' | undefined'}`, schemaSchema?.args?.format].filter(Boolean).join(', ')\n : undefined,\n ].filter(Boolean),\n })\n })\n\n const additionalProperties = current.args?.additionalProperties?.length\n ? factory.createIndexSignature(\n current.args.additionalProperties\n .map((schema) => parse(current, schema, options))\n .filter(Boolean)\n .at(0) as ts.TypeNode,\n )\n : undefined\n\n return typeKeywordMapper.object([...properties, additionalProperties].filter(Boolean))\n }\n\n if (isKeyword(current, schemaKeywords.datetime)) {\n return typeKeywordMapper.datetime()\n }\n\n if (isKeyword(current, schemaKeywords.date)) {\n return typeKeywordMapper.date(current.args.type)\n }\n\n if (isKeyword(current, schemaKeywords.time)) {\n return typeKeywordMapper.time(current.args.type)\n }\n\n if (current.keyword in typeKeywordMapper) {\n return value()\n }\n\n return undefined\n}\n","import transformers, { createJSDocBlockText } from '@kubb/core/transformers'\nimport { type SchemaKeywordMapper, isKeyword, schemaKeywords } from '@kubb/plugin-oas'\n\nimport type { Schema, SchemaKeywordBase, SchemaMapper } from '@kubb/plugin-oas'\n\nexport const zodKeywordMapper = {\n any: () => 'z.any()',\n unknown: () => 'z.unknown()',\n number: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.number()' : 'z.number()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n integer: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.number()' : 'z.number()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n object: (value?: string) => `z.object({${value}})`,\n string: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.string()' : 'z.string()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n boolean: () => 'z.boolean()',\n undefined: () => 'z.undefined()',\n nullable: () => '.nullable()',\n null: () => 'z.null()',\n nullish: () => '.nullish()',\n array: (items: string[] = [], min?: number, max?: number) => {\n return [`z.array(${items?.join('')})`, min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n tuple: (items: string[] = []) => `z.tuple([${items?.join(', ')}])`,\n enum: (items: string[] = []) => `z.enum([${items?.join(', ')}])`,\n union: (items: string[] = []) => `z.union([${items?.join(', ')}])`,\n const: (value?: string | number) => `z.literal(${value ?? ''})`,\n /**\n * ISO 8601\n */\n datetime: (offset = false, local = false) => {\n if (offset) {\n return `z.string().datetime({ offset: ${offset} })`\n }\n\n if (local) {\n return `z.string().datetime({ local: ${local} })`\n }\n\n return 'z.string().datetime()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO date format (YYYY-MM-DD)\n * @default ISO date format (YYYY-MM-DD)\n */\n date: (type: 'date' | 'string' = 'string', coercion?: boolean) => {\n if (type === 'string') {\n return 'z.string().date()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO time format (HH:mm:ss[.SSSSSS])\n * @default ISO time format (HH:mm:ss[.SSSSSS])\n */\n time: (type: 'date' | 'string' = 'string', coercion?: boolean) => {\n if (type === 'string') {\n return 'z.string().time()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n uuid: () => '.uuid()',\n url: () => '.url()',\n strict: () => '.strict()',\n default: (value?: string | number | true) => `.default(${value ?? ''})`,\n and: (items: string[] = []) => items?.map((item) => `.and(${item})`).join(''),\n describe: (value = '') => `.describe(${value})`,\n min: (value?: number) => `.min(${value ?? ''})`,\n max: (value?: number) => `.max(${value ?? ''})`,\n optional: () => '.optional()',\n matches: (value = '') => `.regex(${value})`,\n email: () => '.email()',\n firstName: undefined,\n lastName: undefined,\n password: undefined,\n phone: undefined,\n readOnly: undefined,\n ref: (value?: string) => (value ? `z.lazy(() => ${value})` : undefined),\n blob: () => 'z.string()',\n deprecated: undefined,\n example: undefined,\n schema: undefined,\n catchall: (value?: string) => (value ? `.catchall(${value})` : undefined),\n name: undefined,\n} satisfies SchemaMapper<string | null | undefined>\n\n/**\n * @link based on https://github.com/cellular/oazapfts/blob/7ba226ebb15374e8483cc53e7532f1663179a22c/src/codegen/generate.ts#L398\n */\n\nexport function sort(items?: Schema[]): Schema[] {\n const order: string[] = [\n schemaKeywords.string,\n schemaKeywords.datetime,\n schemaKeywords.date,\n schemaKeywords.time,\n schemaKeywords.tuple,\n schemaKeywords.number,\n schemaKeywords.object,\n schemaKeywords.enum,\n schemaKeywords.url,\n schemaKeywords.email,\n schemaKeywords.firstName,\n schemaKeywords.lastName,\n schemaKeywords.password,\n schemaKeywords.matches,\n schemaKeywords.uuid,\n schemaKeywords.min,\n schemaKeywords.max,\n schemaKeywords.default,\n schemaKeywords.describe,\n schemaKeywords.optional,\n schemaKeywords.nullable,\n schemaKeywords.nullish,\n schemaKeywords.null,\n ]\n\n if (!items) {\n return []\n }\n\n return transformers.orderBy(items, [(v) => order.indexOf(v.keyword)], ['asc'])\n}\n\ntype ParserOptions = {\n name: string\n typeName?: string\n description?: string\n\n keysToOmit?: string[]\n mapper?: Record<string, string>\n coercion?: boolean\n}\n\nexport function parse(parent: Schema | undefined, current: Schema, options: ParserOptions): string | undefined {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper]\n\n if (!value) {\n return undefined\n }\n\n if (isKeyword(current, schemaKeywords.union)) {\n // zod union type needs at least 2 items\n if (Array.isArray(current.args) && current.args.length === 1) {\n return parse(parent, current.args[0] as Schema, options)\n }\n if (Array.isArray(current.args) && !current.args.length) {\n return ''\n }\n\n return zodKeywordMapper.union(\n sort(current.args)\n .map((schema) => parse(current, schema, options))\n .filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.and)) {\n const items = sort(current.args)\n .filter((schema: Schema) => {\n return ![schemaKeywords.optional, schemaKeywords.describe].includes(schema.keyword as typeof schemaKeywords.describe)\n })\n .map((schema: Schema) => parse(current, schema, options))\n .filter(Boolean)\n\n return `${items.slice(0, 1)}${zodKeywordMapper.and(items.slice(1))}`\n }\n\n if (isKeyword(current, schemaKeywords.array)) {\n return zodKeywordMapper.array(\n sort(current.args.items)\n .map((schemas) => parse(current, schemas, options))\n .filter(Boolean),\n current.args.min,\n current.args.max,\n )\n }\n\n if (isKeyword(current, schemaKeywords.enum)) {\n if (current.args.asConst) {\n return zodKeywordMapper.union(\n current.args.items\n .map((schema) => {\n return parse(\n current,\n {\n keyword: schemaKeywords.const,\n args: schema,\n },\n options,\n )\n })\n .filter(Boolean),\n )\n }\n\n return zodKeywordMapper.enum(\n current.args.items.map((schema) => {\n if (schema.format === 'number') {\n return transformers.stringify(schema.value)\n }\n return transformers.stringify(schema.value)\n }),\n )\n }\n\n if (isKeyword(current, schemaKeywords.ref)) {\n return zodKeywordMapper.ref(current.args?.name)\n }\n\n if (isKeyword(current, schemaKeywords.object)) {\n const properties = Object.entries(current.args?.properties || {})\n .filter((item) => {\n const schema = item[1]\n return schema && typeof schema.map === 'function'\n })\n .map(([name, schemas]) => {\n const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']\n const mappedName = nameSchema?.args || name\n\n // custom mapper(pluginOptions)\n if (options.mapper?.[mappedName]) {\n return `\"${name}\": ${options.mapper?.[mappedName]}`\n }\n\n return `\"${name}\": ${sort(schemas)\n .map((schema, array) => {\n return parse(current, schema, options)\n })\n .filter(Boolean)\n .join('')}`\n })\n .join(',')\n\n const additionalProperties = current.args?.additionalProperties?.length\n ? current.args.additionalProperties\n .map((schema) => parse(current, schema, options))\n .filter(Boolean)\n .at(0)\n : undefined\n\n const text = [\n zodKeywordMapper.object(properties),\n current.args?.strict ? zodKeywordMapper.strict() : undefined,\n additionalProperties ? zodKeywordMapper.catchall(additionalProperties) : undefined,\n ].filter(Boolean)\n\n return text.join('')\n }\n\n if (isKeyword(current, schemaKeywords.tuple)) {\n return zodKeywordMapper.tuple(\n sort(current.args.items)\n .map((schema) => parse(current, schema, options))\n .filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.const)) {\n if (current.args.format === 'number' && current.args.value !== undefined) {\n return zodKeywordMapper.const(Number.parseInt(current.args.value?.toString()))\n }\n return zodKeywordMapper.const(transformers.stringify(current.args.value))\n }\n\n if (isKeyword(current, schemaKeywords.matches)) {\n if (current.args) {\n return zodKeywordMapper.matches(transformers.toRegExpString(current.args))\n }\n }\n\n if (isKeyword(current, schemaKeywords.default)) {\n if (current.args) {\n return zodKeywordMapper.default(current.args)\n }\n }\n\n if (isKeyword(current, schemaKeywords.describe)) {\n if (current.args) {\n return zodKeywordMapper.describe(transformers.stringify(current.args.toString()))\n }\n }\n\n if (isKeyword(current, schemaKeywords.string)) {\n return zodKeywordMapper.string(options.coercion)\n }\n\n if (isKeyword(current, schemaKeywords.number) || isKeyword(current, schemaKeywords.integer)) {\n return zodKeywordMapper.number(options.coercion)\n }\n\n if (isKeyword(current, schemaKeywords.min)) {\n return zodKeywordMapper.min(current.args)\n }\n if (isKeyword(current, schemaKeywords.max)) {\n return zodKeywordMapper.max(current.args)\n }\n\n if (isKeyword(current, schemaKeywords.datetime)) {\n return zodKeywordMapper.datetime(current.args.offset, current.args.local)\n }\n\n if (isKeyword(current, schemaKeywords.date)) {\n return zodKeywordMapper.date(current.args.type, options.coercion)\n }\n\n if (isKeyword(current, schemaKeywords.time)) {\n return zodKeywordMapper.time(current.args.type, options.coercion)\n }\n\n if (current.keyword in zodKeywordMapper && 'args' in current) {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper] as (typeof zodKeywordMapper)['const']\n\n return value((current as SchemaKeywordBase<unknown>).args as any)\n }\n\n if (current.keyword in zodKeywordMapper) {\n return value()\n }\n\n return undefined\n}\n","import path from 'node:path'\n\nimport { FileManager, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { OperationGenerator, pluginOasName, SchemaGenerator } from '@kubb/plugin-oas'\nimport { getGroupedByTagFiles } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { Operations } from './components/Operations.tsx'\nimport type { PluginZod } from './types.ts'\nimport { zodParser } from './SchemaGenerator.tsx'\n\nexport const pluginZodName = 'plugin-zod' satisfies PluginZod['name']\n\nexport const pluginZod = createPlugin<PluginZod>((options) => {\n const {\n output = { path: 'zod' },\n group,\n exclude = [],\n include,\n override = [],\n transformers = {},\n dateType = 'string',\n unknownType = 'any',\n typed = false,\n typedSchema = false,\n mapper = {},\n templates,\n importPath = 'zod',\n coercion = false,\n } = options\n const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`\n\n return {\n name: pluginZodName,\n options: {\n extName: output.extName,\n transformers,\n include,\n exclude,\n override,\n typed,\n typedSchema,\n dateType,\n unknownType,\n mapper,\n importPath,\n coercion,\n templates: {\n operations: Operations.templates,\n ...templates,\n },\n },\n pre: [pluginOasName, typed ? pluginTsName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (options?.tag && group?.type === 'tag') {\n const tag = camelCase(options.tag)\n\n return path.resolve(root, renderTemplate(template, { tag }), baseName)\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n let resolvedName = camelCase(name, {\n suffix: type ? 'schema' : undefined,\n isFile: type === 'file',\n })\n\n if (type === 'type') {\n resolvedName = pascalCase(resolvedName)\n }\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n\n const schemaGenerator = new SchemaGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build(zodParser)\n await this.addFile(...schemaFiles)\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const operationFiles = await operationGenerator.build(zodParser)\n await this.addFile(...operationFiles)\n\n if (this.config.output.write && group?.type === 'tag') {\n const rootFiles = await getGroupedByTagFiles({\n logger: this.logger,\n files: this.fileManager.files,\n plugin: this.plugin,\n template,\n exportAs: group.exportAs || '{{tag}}Schemas',\n root,\n output,\n })\n\n await this.addFile(...rootFiles)\n }\n },\n async buildEnd() {\n if (this.config.output.write === false) {\n return\n }\n\n const root = path.resolve(this.config.root, this.config.output.path)\n const files = await this.fileManager.getIndexFiles({\n root,\n output,\n plugin: this.plugin,\n logger: this.logger,\n })\n\n await this.fileManager.processFiles({\n logger: this.logger,\n files,\n })\n },\n }\n})\n","import { createReactParser } from '@kubb/plugin-oas'\nimport { Schema } from './components/Schema.tsx'\nimport type { PluginZod } from './types.ts'\nimport { Operations } from './components/Operations.tsx'\nimport { OperationSchema } from './components/OperationSchema.tsx'\n\nexport const zodParser = createReactParser<PluginZod>({\n name: 'plugin-zod',\n Operations({ options }) {\n if (!options.templates.operations) {\n return null\n }\n\n return <Operations.File templates={options.templates.operations} />\n },\n Operation() {\n return <OperationSchema.File />\n },\n Schema({ schema, name }) {\n return <Schema.File />\n },\n})\n","import { SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperation, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { File, Parser, useApp } from '@kubb/react'\n\nimport type { OperationSchema as OperationSchemaType } from '@kubb/plugin-oas'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginZod } from '../types.ts'\nimport { Schema } from './Schema.tsx'\n\ntype Props = {\n description?: string\n keysToOmit?: string[]\n}\n\nexport function OperationSchema({ description, keysToOmit }: Props): ReactNode {\n return <Schema keysToOmit={keysToOmit} withTypeAnnotation={false} description={description} />\n}\n\ntype FileProps = {}\n\nOperationSchema.File = function ({}: FileProps): ReactNode {\n const { pluginManager, plugin, mode } = useApp<PluginZod>()\n const { getSchemas, getFile } = useOperationManager()\n const oas = useOas()\n const operation = useOperation()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const generator = new SchemaGenerator(plugin.options, {\n oas,\n plugin,\n pluginManager,\n mode,\n override: plugin.options.override,\n })\n\n const items = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response].flat().filter(Boolean)\n\n const mapItem = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n // hack so Params can be optional when needed\n const required = Array.isArray(schema?.required) ? !!schema.required.length : !!schema?.required\n const optional = !required && !!name.includes('Params')\n const tree = generator.parse({ schema, name })\n\n return (\n <Oas.Schema key={i} name={name} value={schema} tree={[...tree, optional ? { keyword: schemaKeywords.optional } : undefined].filter(Boolean)}>\n {mode === 'split' && <Oas.Schema.Imports extName={plugin.options.extName} />}\n <File.Source>\n <OperationSchema description={description} keysToOmit={keysToOmit} />\n </File.Source>\n </Oas.Schema>\n )\n }\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n <File.Import name={['z']} path={plugin.options.importPath} />\n {items.map(mapItem)}\n </File>\n </Parser>\n )\n}\n"],"mappings":";AAAA,SAAS,qBAAqB,qBAAqB;AACnD,SAAS,OAAO,MAAM,QAAQ,cAAc;AAE5C,OAAO,kBAAkB;AA4CrB,mBACE,KADF;AA1BJ,SAAS,SAAS,EAAE,gBAAgB,WAAW,WAAW,GAA4B;AACpF,QAAM,EAAE,mBAAmB,IAAI,oBAAoB;AACnD,QAAM,wBAAwB,WAAW,IAAI,CAAC,eAAe,EAAE,WAAW,MAAM,mBAAmB,WAAW,EAAE,MAAM,WAAW,CAAC,EAAE,EAAE;AAEtI,QAAM,iBAAiB,sBAAsB;AAAA,IAC3C,CAAC,MAAM,QAAQ;AACb,WAAK,IAAI,IAAI,UAAU,eAAe,CAAC,GAAG,IAAI,IAAI;AAElD,aAAO;AAAA,IACT;AAAA,IACA,CAAC;AAAA,EACH;AAEA,QAAM,YAAY,sBAAsB;AAAA,IACtC,CAAC,MAAM,QAAQ;AACb,WAAK,IAAI,IAAI,UAAU,IAAI,GAAG,IAAI;AAAA,QAChC,GAAI,KAAK,IAAI,IAAI,UAAU,IAAI,GAAG,KAAM,CAAC;AAAA,QACzC,CAAC,IAAI,UAAU,MAAM,GAAG,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M;AAAA,IACJ;AAAA,IACA,QAAQ;AAAA,MACN,SAAS,EAAE,OAAO,WAAW;AAAA,IAC/B;AAAA,EACF,IAAIE,QAAkB;AACtB,QAAM,EAAE,MAAM,KAAK,IAAI,QAAQ;AAC/B,QAAM,EAAE,MAAM,MAAM,OAAO,IAAID,WAAU;AAGzC,QAAM,WAAW,cAAc,YAAY;AAAA,IACzC;AAAA,IACA,WAAW,CAAC,YAAY;AAAA,IACxB,MAAM;AAAA,EACR,CAAC;AAED,QAAM,eAAe,cAAc,YAAY;AAAA,IAC7C;AAAA,IACA,WAAW,CAAC,YAAY;AAAA,IACxB,MAAM;AAAA,EACR,CAAC;AAED,QAAM,WAAW,cAAc,YAAY;AAAA,IACzC,UAAU;AAAA,IACV,WAAW,CAAC,YAAY;AAAA,EAC1B,CAAC;AAED,QAAM,qBAAqB,CAAC,CAAC;AAE7B,SACE,gBAAAF,MAAAF,WAAA,EACE;AAAA,oBAAAC,KAACY,MAAK,QAAL,EAAY,MAAM,CAAC,GAAG,GAAG,MAAM,YAAY;AAAA,IAC3C,sBAAsB,YAAY,YAAY,gBAAAZ,KAACY,MAAK,QAAL,EAAY,YAAU,MAAC,MAAY,MAAM,UAAU,MAAM,CAAC,QAAQ,GAAG;AAAA,KACvH;AAEJ;","names":["Template","RootTemplate","Oas","Const","File","Type","useApp","Generator","Oas","App","createRoot","Parser","File","useApp","Fragment","jsx","jsxs","Template","defaultTemplates","transformers","print","factory","Oas","useOas","useOperationManager","File","Parser","useApp","Oas","File","useApp","transformers","factory","schemaKeywords","transformers","jsx","useApp","schemaKeywords","transformers","node","File","jsx","SchemaGenerator","Oas","jsx","jsxs","transformers","print","useApp","useOas","useOperationManager","SchemaGenerator","Oas","File","Parser","jsx","Generator","createRoot","App","Oas","transformers","options","SchemaGenerator","transformers","isKeyword","schemaKeywords","useSchema","transformers","isKeyword","schemaKeywords","parse","value","path","FileManager","PluginManager","createPlugin","camelCase","pascalCase","renderTemplate","OperationGenerator","pluginOasName","SchemaGenerator","SchemaGenerator","schemaKeywords","Oas","useOas","useOperation","useOperationManager","File","Parser","useApp","jsx","jsxs","OperationSchema","Schema","useApp","useOperationManager","useOas","useOperation","SchemaGenerator","Oas","schemaKeywords","File","Parser","jsx","OperationSchema","Schema","createPlugin","transformers","pluginOasName","options","path","FileManager","camelCase","renderTemplate","pascalCase","PluginManager","SchemaGenerator","OperationGenerator","Fragment","jsx","jsxs","Schema","useSchema","useApp","Const","transformers","isKeyword","schemaKeywords","parse","Type","Oas","File"]}
|
|
@@ -658,12 +658,16 @@ var pluginTs = _core.createPlugin.call(void 0, (options) => {
|
|
|
658
658
|
return;
|
|
659
659
|
}
|
|
660
660
|
const root = _path2.default.resolve(this.config.root, this.config.output.path);
|
|
661
|
-
await this.fileManager.
|
|
661
|
+
const files = await this.fileManager.getIndexFiles({
|
|
662
662
|
root,
|
|
663
663
|
output,
|
|
664
|
-
|
|
664
|
+
plugin: this.plugin,
|
|
665
665
|
logger: this.logger
|
|
666
666
|
});
|
|
667
|
+
await this.fileManager.processFiles({
|
|
668
|
+
logger: this.logger,
|
|
669
|
+
files
|
|
670
|
+
});
|
|
667
671
|
}
|
|
668
672
|
};
|
|
669
673
|
});
|
|
@@ -1094,13 +1098,7 @@ var pluginZod = _core.createPlugin.call(void 0, (options) => {
|
|
|
1094
1098
|
});
|
|
1095
1099
|
const operationFiles = await operationGenerator.build(zodParser);
|
|
1096
1100
|
await this.addFile(...operationFiles);
|
|
1097
|
-
|
|
1098
|
-
async buildEnd() {
|
|
1099
|
-
if (this.config.output.write === false) {
|
|
1100
|
-
return;
|
|
1101
|
-
}
|
|
1102
|
-
const root = _path2.default.resolve(this.config.root, this.config.output.path);
|
|
1103
|
-
if (_optionalChain([group, 'optionalAccess', _70 => _70.type]) === "tag") {
|
|
1101
|
+
if (this.config.output.write && _optionalChain([group, 'optionalAccess', _70 => _70.type]) === "tag") {
|
|
1104
1102
|
const rootFiles = await _utils3.getGroupedByTagFiles.call(void 0, {
|
|
1105
1103
|
logger: this.logger,
|
|
1106
1104
|
files: this.fileManager.files,
|
|
@@ -1112,12 +1110,22 @@ var pluginZod = _core.createPlugin.call(void 0, (options) => {
|
|
|
1112
1110
|
});
|
|
1113
1111
|
await this.addFile(...rootFiles);
|
|
1114
1112
|
}
|
|
1115
|
-
|
|
1113
|
+
},
|
|
1114
|
+
async buildEnd() {
|
|
1115
|
+
if (this.config.output.write === false) {
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
const root = _path2.default.resolve(this.config.root, this.config.output.path);
|
|
1119
|
+
const files = await this.fileManager.getIndexFiles({
|
|
1116
1120
|
root,
|
|
1117
1121
|
output,
|
|
1118
|
-
|
|
1122
|
+
plugin: this.plugin,
|
|
1119
1123
|
logger: this.logger
|
|
1120
1124
|
});
|
|
1125
|
+
await this.fileManager.processFiles({
|
|
1126
|
+
logger: this.logger,
|
|
1127
|
+
files
|
|
1128
|
+
});
|
|
1121
1129
|
}
|
|
1122
1130
|
};
|
|
1123
1131
|
});
|
|
@@ -1239,4 +1247,4 @@ Schema2.Imports = () => {
|
|
|
1239
1247
|
|
|
1240
1248
|
|
|
1241
1249
|
exports.Operations = Operations; exports.Schema = Schema2; exports.OperationSchema = OperationSchema2; exports.pluginZodName = pluginZodName; exports.pluginZod = pluginZod;
|
|
1242
|
-
//# sourceMappingURL=chunk-
|
|
1250
|
+
//# sourceMappingURL=chunk-RISCJCJN.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/kubb/kubb/packages/plugin-zod/dist/chunk-RISCJCJN.cjs","../src/components/Operations.tsx","../src/components/Schema.tsx","../../plugin-ts/src/plugin.ts","../../plugin-ts/src/OperationGenerator.tsx","../../plugin-ts/src/components/OasType.tsx","../../plugin-ts/src/components/OperationSchema.tsx","../../plugin-ts/src/SchemaGenerator.tsx","../../plugin-ts/src/components/Schema.tsx","../../plugin-ts/src/parser/index.ts","../src/parser/index.ts","../src/plugin.ts","../src/SchemaGenerator.tsx","../src/components/OperationSchema.tsx"],"names":["Template","RootTemplate","jsxs","Fragment","jsx","defaultTemplates","useApp","Parser","File","transformers","parse","createPlugin","useOperationManager","Const","schemaKeywords"],"mappings":"AAAA;ACAA,+CAAmD;AACnD,oCAA4C;AAE5C,mHAAyB;AA4CrB,qDAAA;AA1BJ,SAAS,QAAA,CAAS,EAAE,cAAA,EAAgB,SAAA,EAAW,WAAW,CAAA,EAA4B;AACpF,EAAA,MAAM,EAAE,mBAAmB,EAAA,EAAI,wCAAA,CAAoB;AACnD,EAAA,MAAM,sBAAA,EAAwB,UAAA,CAAW,GAAA,CAAI,CAAC,SAAA,EAAA,GAAA,CAAe,EAAE,SAAA,EAAW,IAAA,EAAM,kBAAA,CAAmB,SAAA,EAAW,EAAE,IAAA,EAAM,WAAW,CAAC,EAAE,CAAA,CAAE,CAAA;AAEtI,EAAA,MAAM,eAAA,EAAiB,qBAAA,CAAsB,MAAA;AAAA,IAC3C,CAAC,IAAA,EAAM,GAAA,EAAA,GAAQ;AACb,MAAA,IAAA,CAAK,CAAA,CAAA,EAAI,GAAA,CAAI,SAAA,CAAU,cAAA,CAAe,CAAC,CAAA,CAAA,CAAG,EAAA,EAAI,GAAA,CAAI,IAAA;AAElD,MAAA,OAAO,IAAA;AAAA,IACT,CAAA;AAAA,IACA,CAAC;AAAA,EACH,CAAA;AAEA,EAAA,MAAM,UAAA,EAAY,qBAAA,CAAsB,MAAA;AAAA,IACtC,CAAC,IAAA,EAAM,GAAA,EAAA,GAAQ;AACb,MAAA,IAAA,CAAK,CAAA,CAAA,EAAI,GAAA,CAAI,SAAA,CAAU,IAAI,CAAA,CAAA,CAAG,EAAA,EAAI;AAAA,QAChC,GAAI,IAAA,CAAK,CAAA,CAAA,EAAI,GAAA,CAAI,SAAA,CAAU,IAAI,CAAA,CAAA,CAAG,EAAA,GAAM,CAAC,CAAA;AAAA,QACzC,CAAC,GAAA,CAAI,SAAA,CAAU,MAAM,CAAA,EAAG,CAAA,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dL,IAAAA;AAACS,MAAAA;AAAA,MAAA;AACO,QAAA;AACA,QAAA;AACC,QAAA;AAC4E,UAAA;AACnF,QAAA;AACD,QAAA;AAAA,MAAA;AAED,IAAA;AAEJ,EAAA;AAE0E,EAAA;AAItD,EAAA;AACwDC,IAAAA;AAC/D,MAAA;AACT,IAAA;AAEO,IAAA;AAEwF,EAAA;AAIjC,EAAA;AAI9D,EAAA;AAAAV,oBAAAA;AAACS,MAAAA;AAAA,MAAA;AACO,QAAA;AACA,QAAA;AACC,QAAA;AAC4E,UAAA;AACnF,QAAA;AAEC,QAAA;AACC,UAAA;AAC2E,0BAAA;AACX,UAAA;AAGnD,QAAA;AAAA,MAAA;AACjB,IAAA;AAGK,IAAA;AAGP,EAAA;AAEJ;AAIkD;AAC1C,EAAA;AACJ,IAAA;AACQ,IAAA;AACW,MAAA;AACnB,IAAA;AACoB,EAAA;AACO,EAAA;AAEA,EAAA;AAIzB,EAAA;AAAgB,oBAAA;AAEN,oBAAA;AAEZ,EAAA;AAEJ;AACkC;AAC1B,EAAA;AACJ,IAAA;AACQ,IAAA;AACuB,MAAA;AAC/B,IAAA;AACoB,EAAA;AACS,EAAA;AACU,EAAA;AAGE,EAAA;AACzC,IAAA;AACwB,IAAA;AAClB,IAAA;AACP,EAAA;AAE8C,EAAA;AAC7C,IAAA;AACwB,IAAA;AAClB,IAAA;AACP,EAAA;AAE0C,EAAA;AAC/B,IAAA;AACc,IAAA;AACzB,EAAA;AAE4B,EAAA;AAIzB,EAAA;AAA4C,oBAAA;AACgB,IAAA;AAC9D,EAAA;AAEJ;AFwjC6F;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/kubb/kubb/packages/plugin-zod/dist/chunk-RISCJCJN.cjs","sourcesContent":[null,"import { useOperationManager, useOperations } from '@kubb/plugin-oas/hooks'\nimport { Const, File, Parser, useApp } from '@kubb/react'\n\nimport transformers from '@kubb/core/transformers'\nimport type { HttpMethod, Operation } from '@kubb/oas'\nimport type { KubbNode } from '@kubb/react'\nimport type { ComponentProps, ComponentType } from 'react'\nimport type { FileMeta, PluginZod } from '../types.ts'\n\ntype TemplateProps = {\n /**\n * Name of the function\n */\n operationsName: string\n /**\n * Name of the function\n */\n pathsName: string\n operations: Operation[]\n}\n\nfunction Template({ operationsName, pathsName, operations }: TemplateProps): KubbNode {\n const { groupSchemasByName } = useOperationManager()\n const transformedOperations = operations.map((operation) => ({ operation, data: groupSchemasByName(operation, { type: 'function' }) }))\n\n const operationsJSON = transformedOperations.reduce(\n (prev, acc) => {\n prev[`\"${acc.operation.getOperationId()}\"`] = acc.data\n\n return prev\n },\n {} as Record<string, unknown>,\n )\n\n const pathsJSON = transformedOperations.reduce(\n (prev, acc) => {\n prev[`\"${acc.operation.path}\"`] = {\n ...(prev[`\"${acc.operation.path}\"`] || ({} as Record<HttpMethod, string>)),\n [acc.operation.method]: `operations[\"${acc.operation.getOperationId()}\"]`,\n }\n\n return prev\n },\n {} as Record<string, Record<HttpMethod, string>>,\n )\n\n return (\n <>\n <Const export name={operationsName} asConst>\n {`{${transformers.stringifyObject(operationsJSON)}}`}\n </Const>\n <Const export name={pathsName} asConst>\n {`{${transformers.stringifyObject(pathsJSON)}}`}\n </Const>\n </>\n )\n}\n\ntype RootTemplateProps = {\n children?: React.ReactNode\n}\n\nfunction RootTemplate({ children }: RootTemplateProps) {\n const {\n mode,\n pluginManager,\n plugin: {\n key: pluginKey,\n options: { extName },\n },\n } = useApp<PluginZod>()\n const { getFile } = useOperationManager()\n const operations = useOperations()\n const { groupSchemasByName } = useOperationManager()\n const transformedOperations = operations.map((operation) => ({ operation, data: groupSchemasByName(operation, { type: 'function' }) }))\n\n const file = pluginManager.getFile({ name: 'operations', extName: '.ts', pluginKey })\n const imports = Object.entries(transformedOperations)\n .map(([_key, { data, operation }], index) => {\n const names = [data.request, ...Object.values(data.responses), ...Object.values(data.parameters)].filter(Boolean)\n\n return <File.Import key={index} extName={extName} name={names} root={file.path} path={getFile(operation).path} />\n })\n .filter(Boolean)\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta} exportable={false}>\n {mode === 'split' && imports}\n <File.Source>{children}</File.Source>\n </File>\n </Parser>\n )\n}\n\nconst defaultTemplates = { default: Template, root: RootTemplate } as const\n\ntype Templates = Partial<typeof defaultTemplates>\n\ntype Props = {\n /**\n * This will make it possible to override the default behaviour.\n */\n Template?: ComponentType<ComponentProps<typeof Template>>\n}\n\nexport function Operations({ Template = defaultTemplates.default }: Props): KubbNode {\n const operations = useOperations()\n\n return <Template operationsName=\"operations\" pathsName=\"paths\" operations={operations} />\n}\n\ntype FileProps = {\n /**\n * This will make it possible to override the default behaviour.\n */\n templates?: Templates\n}\n\nOperations.File = function (props: FileProps): KubbNode {\n const templates = { ...defaultTemplates, ...props.templates }\n\n const Template = templates.default\n const RootTemplate = templates.root\n\n return (\n <RootTemplate>\n <Operations Template={Template} />\n </RootTemplate>\n )\n}\n\nOperations.templates = defaultTemplates\n","import { Oas } from '@kubb/plugin-oas/components'\nimport { Const, File, Type, useApp, useFile } from '@kubb/react'\nimport { pluginTsName } from '@kubb/plugin-ts'\n\nimport transformers from '@kubb/core/transformers'\nimport { isKeyword, schemaKeywords } from '@kubb/plugin-oas'\nimport { useSchema } from '@kubb/plugin-oas/hooks'\nimport type { ReactNode } from 'react'\nimport * as parserZod from '../parser/index.ts'\nimport { pluginZodName } from '../plugin.ts'\nimport type { PluginZod } from '../types.ts'\n\ntype Props = {\n description?: string\n withTypeAnnotation?: boolean\n keysToOmit?: string[]\n}\n\nexport function Schema(props: Props): ReactNode {\n const { keysToOmit, withTypeAnnotation, description } = props\n const { tree, name } = useSchema()\n const {\n pluginManager,\n plugin: {\n options: { mapper, typedSchema, coercion },\n },\n } = useApp<PluginZod>()\n\n // all checks are also inside this.schema(React)\n const resolvedName = pluginManager.resolveName({\n name,\n pluginKey: [pluginZodName],\n type: 'function',\n })\n const resolvedTypeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginZodName],\n type: 'type',\n })\n\n const typeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n if (!tree.length) {\n return (\n <Const\n name={resolvedName}\n export\n JSDoc={{\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }}\n >\n undefined\n </Const>\n )\n }\n\n const hasTuple = tree.some((item) => isKeyword(item, schemaKeywords.tuple))\n\n const output = parserZod\n .sort(tree)\n .filter((item) => {\n if (hasTuple && (isKeyword(item, schemaKeywords.min) || isKeyword(item, schemaKeywords.max))) {\n return false\n }\n\n return true\n })\n .map((item) => parserZod.parse(undefined, item, { name, typeName, description, mapper, coercion, keysToOmit }))\n .filter(Boolean)\n .join('')\n\n const suffix = output.endsWith('.nullable()') ? '.unwrap().and' : '.and'\n\n return (\n <>\n <Const\n export\n name={resolvedName}\n JSDoc={{\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }}\n >\n {[\n output,\n keysToOmit?.length ? `${suffix}(z.object({ ${keysToOmit.map((key) => `${key}: z.never()`).join(',')} }))` : undefined,\n withTypeAnnotation && typeName ? ` as z.ZodType<${typeName}>` : '',\n ]\n .filter(Boolean)\n .join('') || ''}\n </Const>\n {typedSchema && (\n <Type export name={resolvedTypeName}>\n {`z.infer<typeof ${resolvedName}>`}\n </Type>\n )}\n </>\n )\n}\n\ntype FileProps = {}\n\nSchema.File = function ({}: FileProps): ReactNode {\n const {\n pluginManager,\n plugin: {\n options: { typed },\n },\n } = useApp<PluginZod>()\n const { schema } = useSchema()\n\n const withTypeAnnotation = !!typed\n\n return (\n <Oas.Schema.File output={pluginManager.config.output.path}>\n <Schema.Imports />\n <File.Source>\n <Schema withTypeAnnotation={withTypeAnnotation} description={schema?.description} />\n </File.Source>\n </Oas.Schema.File>\n )\n}\nSchema.Imports = (): ReactNode => {\n const {\n pluginManager,\n plugin: {\n options: { typed, importPath },\n },\n } = useApp<PluginZod>()\n const { path: root } = useFile()\n const { name, tree, schema } = useSchema()\n\n // used for this.options.typed\n const typeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n const typeFileName = pluginManager.resolveName({\n name: name,\n pluginKey: [pluginTsName],\n type: 'file',\n })\n\n const typePath = pluginManager.resolvePath({\n baseName: typeFileName,\n pluginKey: [pluginTsName],\n })\n\n const withTypeAnnotation = !!typed\n\n return (\n <>\n <File.Import name={['z']} path={importPath} />\n {withTypeAnnotation && typeName && typePath && <File.Import isTypeOnly root={root} path={typePath} name={[typeName]} />}\n </>\n )\n}\n","import path from 'node:path'\n\nimport { FileManager, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { pluginOasName } from '@kubb/plugin-oas'\n\nimport { OperationGenerator } from './OperationGenerator.tsx'\nimport { SchemaGenerator } from './SchemaGenerator.tsx'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport type { PluginTs } from './types.ts'\n\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\nexport const pluginTs = createPlugin<PluginTs>((options) => {\n const {\n output = { path: 'types' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumSuffix = '',\n dateType = 'string',\n unknownType = 'any',\n optionalType = 'questionToken',\n transformers = {},\n oasType = false,\n mapper = {},\n } = options\n const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`\n\n return {\n name: pluginTsName,\n options: {\n extName: output.extName,\n transformers,\n dateType,\n optionalType,\n oasType,\n enumType,\n enumSuffix,\n // keep the used enumnames between SchemaGenerator and OperationGenerator per plugin(pluginKey)\n usedEnumNames: {},\n unknownType,\n override,\n mapper,\n },\n pre: [pluginOasName],\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (options?.tag && group?.type === 'tag') {\n const tag = camelCase(options.tag)\n\n return path.resolve(root, renderTemplate(template, { tag }), baseName)\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n const resolvedName = pascalCase(name, { isFile: type === 'file' })\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n\n const schemaGenerator = new SchemaGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build()\n await this.addFile(...schemaFiles)\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const operationFiles = await operationGenerator.build()\n await this.addFile(...operationFiles)\n },\n async buildEnd() {\n if (this.config.output.write === false) {\n return\n }\n\n const root = path.resolve(this.config.root, this.config.output.path)\n const files = await this.fileManager.getIndexFiles({\n root,\n output,\n plugin: this.plugin,\n logger: this.logger,\n })\n\n await this.fileManager.processFiles({\n logger: this.logger,\n files,\n })\n },\n }\n})\n","import { OperationGenerator as Generator } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { App, createRoot } from '@kubb/react'\n\nimport { OasType } from './components/OasType.tsx'\nimport { OperationSchema } from './components/OperationSchema.tsx'\n\nimport type { Operation } from '@kubb/oas'\nimport type { OperationMethodResult } from '@kubb/plugin-oas'\nimport type { FileMeta, PluginTs } from './types.ts'\n\nexport class OperationGenerator extends Generator<PluginTs['resolvedOptions'], PluginTs> {\n async all(operations: Operation[]): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n root.render(\n <App pluginManager={pluginManager} plugin={plugin} mode={mode}>\n <Oas oas={oas} operations={operations} generator={this}>\n {plugin.options.oasType && <OasType.File name=\"oas\" typeName=\"Oas\" />}\n </Oas>\n </App>,\n )\n\n return root.files\n }\n\n async operation(operation: Operation, options: PluginTs['resolvedOptions']): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n root.render(\n <App pluginManager={pluginManager} plugin={{ ...plugin, options }} mode={mode}>\n <Oas oas={oas} operations={[operation]} generator={this}>\n <Oas.Operation operation={operation}>\n <OperationSchema.File />\n </Oas.Operation>\n </Oas>\n </App>,\n )\n\n return root.files\n }\n}\n","import { Parser, File, Type, useApp } from '@kubb/react'\nimport { useOas } from '@kubb/plugin-oas/hooks'\n\nimport type { OasTypes } from '@kubb/oas'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginTs } from '../types.ts'\n\ntype TemplateProps = {\n /**\n * Name of the function\n */\n name: string\n typeName: string\n api: OasTypes.OASDocument\n}\n\nfunction Template({ name, typeName, api }: TemplateProps): ReactNode {\n return (\n <>\n {`export const ${name} = ${JSON.stringify(api, undefined, 2)} as const`}\n <br />\n <Type name={typeName} export>\n {`Infer<typeof ${name}>`}\n </Type>\n </>\n )\n}\n\nconst defaultTemplates = { default: Template } as const\n\ntype Props = {\n name: string\n typeName: string\n /**\n * This will make it possible to override the default behaviour.\n */\n Template?: React.ComponentType<React.ComponentProps<typeof Template>>\n}\n\nexport function OasType({ name, typeName, Template = defaultTemplates.default }: Props): ReactNode {\n const oas = useOas()\n\n return <Template name={name} typeName={typeName} api={oas.api} />\n}\n\ntype FileProps = {\n name: string\n typeName: string\n /**\n * This will make it possible to override the default behaviour.\n */\n templates?: typeof defaultTemplates\n}\n\nOasType.File = function ({ name, typeName, templates = defaultTemplates }: FileProps): ReactNode {\n const {\n pluginManager,\n plugin: { key: pluginKey },\n } = useApp<PluginTs>()\n const file = pluginManager.getFile({ name, extName: '.ts', pluginKey })\n\n const Template = templates.default\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n <File.Import name={['Infer']} path=\"@kubb/oas\" isTypeOnly />\n <File.Source>\n <OasType Template={Template} name={name} typeName={typeName} />\n </File.Source>\n </File>\n </Parser>\n )\n}\n\nOasType.templates = defaultTemplates\n","import transformers from '@kubb/core/transformers'\nimport { print } from '@kubb/parser-ts'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperation, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { File, Parser, useApp } from '@kubb/react'\n\nimport { SchemaGenerator } from '../SchemaGenerator.tsx'\n\nimport type { PluginManager } from '@kubb/core'\nimport type { Operation } from '@kubb/oas'\nimport type { ts } from '@kubb/parser-ts'\nimport type { OperationSchema as OperationSchemaType } from '@kubb/plugin-oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginTs } from '../types.ts'\nimport { Schema } from './Schema.tsx'\n\nfunction printCombinedSchema({\n name,\n operation,\n schemas,\n pluginManager,\n}: { name: string; operation: Operation; schemas: OperationSchemas; pluginManager: PluginManager }): string {\n const properties: Record<string, ts.TypeNode> = {}\n\n if (schemas.response) {\n const identifier = pluginManager.resolveName({\n name: schemas.response.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['response'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.request) {\n const identifier = pluginManager.resolveName({\n name: schemas.request.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['request'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.pathParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.pathParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['pathParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.queryParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.queryParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['queryParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.headerParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.headerParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['headerParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.errors) {\n properties['errors'] = factory.createUnionDeclaration({\n nodes: schemas.errors.map((error) => {\n const identifier = pluginManager.resolveName({\n name: error.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }),\n })!\n }\n\n const namespaceNode = factory.createTypeAliasDeclaration({\n name: operation.method === 'get' ? `${name}Query` : `${name}Mutation`,\n type: factory.createTypeLiteralNode(\n Object.keys(properties)\n .map((key) => {\n const type = properties[key]\n if (!type) {\n return undefined\n }\n\n return factory.createPropertySignature({\n name: transformers.pascalCase(key),\n type,\n })\n })\n .filter(Boolean),\n ),\n modifiers: [factory.modifiers.export],\n })\n\n return print(namespaceNode)\n}\n\ntype Props = {\n description?: string\n keysToOmit?: string[]\n}\n\nexport function OperationSchema({ keysToOmit, description }: Props): ReactNode {\n return <Schema keysToOmit={keysToOmit} description={description} />\n}\n\ntype FileProps = {}\n\nOperationSchema.File = function ({}: FileProps): ReactNode {\n const { pluginManager, plugin, mode, fileManager } = useApp<PluginTs>()\n const oas = useOas()\n const { getSchemas, getFile, getName } = useOperationManager()\n const operation = useOperation()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const factoryName = getName(operation, { type: 'type' })\n const generator = new SchemaGenerator(plugin.options, {\n oas,\n plugin,\n pluginManager,\n mode,\n override: plugin.options.override,\n })\n const items = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response].flat().filter(Boolean)\n\n const mapItem = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n const tree = generator.parse({ schema, name })\n\n return (\n <Oas.Schema key={i} name={name} value={schema} tree={tree}>\n {mode === 'split' && <Oas.Schema.Imports extName={plugin.options.extName} isTypeOnly />}\n <File.Source>\n <OperationSchema description={description} keysToOmit={keysToOmit} />\n </File.Source>\n </Oas.Schema>\n )\n }\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n {items.map(mapItem)}\n\n <File.Source>{printCombinedSchema({ name: factoryName, operation, schemas, pluginManager })}</File.Source>\n </File>\n </Parser>\n )\n}\n","import type { SchemaObject } from '@kubb/oas'\nimport { SchemaGenerator as Generator } from '@kubb/plugin-oas'\nimport type { SchemaMethodResult } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { App, createRoot } from '@kubb/react'\nimport { Schema } from './components/Schema.tsx'\nimport type { FileMeta, PluginTs } from './types.ts'\n\nexport class SchemaGenerator extends Generator<PluginTs['resolvedOptions'], PluginTs> {\n async schema(name: string, schema: SchemaObject, options: PluginTs['resolvedOptions']): SchemaMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode, output } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n const tree = this.parse({ schema, name })\n\n root.render(\n <App pluginManager={pluginManager} plugin={{ ...plugin, options }} mode={mode}>\n <Oas oas={oas}>\n <Oas.Schema name={name} value={schema} tree={tree}>\n <Schema.File />\n </Oas.Schema>\n </Oas>\n </App>,\n )\n\n return root.files\n }\n}\n","import { Oas } from '@kubb/plugin-oas/components'\nimport { File, useApp } from '@kubb/react'\n\nimport transformers from '@kubb/core/transformers'\nimport { print, type ts } from '@kubb/parser-ts'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { useSchema } from '@kubb/plugin-oas/hooks'\nimport type { ReactNode } from 'react'\nimport { parse, typeKeywordMapper } from '../parser/index.ts'\nimport { pluginTsName } from '../plugin.ts'\nimport type { PluginTs } from '../types.ts'\n\ntype Props = {\n description?: string\n keysToOmit?: string[]\n}\n\nexport function Schema(props: Props): ReactNode {\n const { keysToOmit, description } = props\n const { tree, name } = useSchema()\n const {\n pluginManager,\n plugin: {\n options: { mapper, enumType, optionalType },\n },\n } = useApp<PluginTs>()\n\n // all checks are also inside this.schema(React)\n const resolvedName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n const typeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n const nodes: ts.Node[] = []\n const extraNodes: ts.Node[] = []\n\n if (!tree.length) {\n return ''\n }\n\n const isNullish = tree.some((item) => item.keyword === schemaKeywords.nullish)\n const isNullable = tree.some((item) => item.keyword === schemaKeywords.nullable)\n const isOptional = tree.some((item) => item.keyword === schemaKeywords.optional)\n\n let type =\n (tree\n .map((schema) => parse(undefined, schema, { name: resolvedName, typeName, description, keysToOmit, optionalType, enumType, mapper }))\n .filter(Boolean)\n .at(0) as ts.TypeNode) || typeKeywordMapper.undefined()\n\n if (isNullable) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.null],\n }) as ts.TypeNode\n }\n\n if (isNullish && ['undefined', 'questionTokenAndUndefined'].includes(optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n if (isOptional && ['undefined', 'questionTokenAndUndefined'].includes(optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n const node = factory.createTypeAliasDeclaration({\n modifiers: [factory.modifiers.export],\n name: resolvedName,\n type: keysToOmit?.length\n ? factory.createOmitDeclaration({\n keys: keysToOmit,\n type,\n nonNullable: true,\n })\n : type,\n })\n\n const enumSchemas = SchemaGenerator.deepSearch(tree, schemaKeywords.enum)\n if (enumSchemas) {\n enumSchemas.forEach((enumSchema) => {\n extraNodes.push(\n ...factory.createEnumDeclaration({\n name: transformers.camelCase(enumSchema.args.name),\n typeName: enumSchema.args.typeName,\n enums: enumSchema.args.items\n .map((item) => (item.value === undefined ? undefined : [transformers.trimQuotes(item.name?.toString()), item.value]))\n .filter(Boolean) as unknown as [string, string][],\n type: enumType,\n }),\n )\n })\n }\n\n nodes.push(\n factory.appendJSDocToNode({\n node,\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }),\n )\n\n const filterdNodes = nodes.filter(\n (node: ts.Node) =>\n !extraNodes.some(\n (extraNode: ts.Node) => (extraNode as ts.TypeAliasDeclaration)?.name?.escapedText === (node as ts.TypeAliasDeclaration)?.name?.escapedText,\n ),\n )\n\n return print([...extraNodes, ...filterdNodes])\n}\n\ntype FileProps = {}\n\nSchema.File = function ({}: FileProps): ReactNode {\n const { pluginManager } = useApp<PluginTs>()\n const { schema } = useSchema()\n\n return (\n <Oas.Schema.File output={pluginManager.config.output.path}>\n <File.Source>\n <Schema description={schema?.description} />\n </File.Source>\n </Oas.Schema.File>\n )\n}\n","import transformers from '@kubb/core/transformers'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { isKeyword, schemaKeywords } from '@kubb/plugin-oas'\n\nimport type { ts } from '@kubb/parser-ts'\nimport type { Schema, SchemaKeywordMapper, SchemaMapper } from '@kubb/plugin-oas'\n\nexport const typeKeywordMapper = {\n any: () => factory.keywordTypeNodes.any,\n unknown: () => factory.keywordTypeNodes.unknown,\n number: () => factory.keywordTypeNodes.number,\n integer: () => factory.keywordTypeNodes.number,\n object: (nodes?: ts.TypeElement[]) => {\n if (!nodes || !nodes.length) {\n return factory.keywordTypeNodes.object\n }\n\n return factory.createTypeLiteralNode(nodes)\n },\n string: () => factory.keywordTypeNodes.string,\n boolean: () => factory.keywordTypeNodes.boolean,\n undefined: () => factory.keywordTypeNodes.undefined,\n nullable: undefined,\n null: () => factory.keywordTypeNodes.null,\n nullish: undefined,\n array: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createArrayDeclaration({ nodes })\n },\n tuple: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createTupleTypeNode(nodes)\n },\n enum: (name?: string) => {\n if (!name) {\n return undefined\n }\n\n return factory.createTypeReferenceNode(name, undefined)\n },\n union: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createUnionDeclaration({\n withParentheses: true,\n nodes,\n })\n },\n const: (name?: string | number, format?: 'string' | 'number') => {\n if (!name) {\n return undefined\n }\n\n if (format === 'number') {\n return factory.createLiteralTypeNode(factory.createNumericLiteral(name))\n }\n\n return factory.createLiteralTypeNode(factory.createStringLiteral(name.toString()))\n },\n datetime: () => factory.keywordTypeNodes.string,\n date: (type: 'date' | 'string' = 'string') =>\n type === 'string' ? factory.keywordTypeNodes.string : factory.createTypeReferenceNode(factory.createIdentifier('Date')),\n time: (type: 'date' | 'string' = 'string') =>\n type === 'string' ? factory.keywordTypeNodes.string : factory.createTypeReferenceNode(factory.createIdentifier('Date')),\n uuid: undefined,\n url: undefined,\n strict: undefined,\n default: undefined,\n and: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createIntersectionDeclaration({\n withParentheses: true,\n nodes,\n })\n },\n describe: undefined,\n min: undefined,\n max: undefined,\n optional: undefined,\n matches: undefined,\n email: undefined,\n firstName: undefined,\n lastName: undefined,\n password: undefined,\n phone: undefined,\n readOnly: undefined,\n ref: (propertyName?: string) => {\n if (!propertyName) {\n return undefined\n }\n\n return factory.createTypeReferenceNode(propertyName, undefined)\n },\n blob: () => factory.createTypeReferenceNode('Blob', []),\n deprecated: undefined,\n example: undefined,\n schema: undefined,\n catchall: undefined,\n name: undefined,\n} satisfies SchemaMapper<ts.Node | null | undefined>\n\ntype ParserOptions = {\n name: string\n typeName?: string\n description?: string\n /**\n * @default `'questionToken'`\n */\n optionalType: 'questionToken' | 'undefined' | 'questionTokenAndUndefined'\n /**\n * @default `'asConst'`\n */\n enumType: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal'\n keysToOmit?: string[]\n mapper?: Record<string, ts.PropertySignature>\n}\n\nexport function parse(parent: Schema | undefined, current: Schema, options: ParserOptions): ts.Node | null | undefined {\n const value = typeKeywordMapper[current.keyword as keyof typeof typeKeywordMapper]\n\n if (!value) {\n return undefined\n }\n\n if (isKeyword(current, schemaKeywords.union)) {\n return typeKeywordMapper.union(current.args.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.and)) {\n return typeKeywordMapper.and(current.args.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.array)) {\n return typeKeywordMapper.array(current.args.items.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.enum)) {\n return typeKeywordMapper.enum(current.args.typeName)\n }\n\n if (isKeyword(current, schemaKeywords.ref)) {\n return typeKeywordMapper.ref(current.args.name)\n }\n\n if (isKeyword(current, schemaKeywords.blob)) {\n return value()\n }\n\n if (isKeyword(current, schemaKeywords.tuple)) {\n return typeKeywordMapper.tuple(current.args.items.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.const)) {\n return typeKeywordMapper.const(current.args.name, current.args.format)\n }\n\n if (isKeyword(current, schemaKeywords.object)) {\n const properties = Object.entries(current.args?.properties || {})\n .filter((item) => {\n const schemas = item[1]\n return schemas && typeof schemas.map === 'function'\n })\n .map(([name, schemas]) => {\n const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']\n const mappedName = nameSchema?.args || name\n\n // custom mapper(pluginOptions)\n if (options.mapper?.[mappedName]) {\n return options.mapper?.[mappedName]\n }\n\n const isNullish = schemas.some((schema) => schema.keyword === schemaKeywords.nullish)\n const isNullable = schemas.some((schema) => schema.keyword === schemaKeywords.nullable)\n const isOptional = schemas.some((schema) => schema.keyword === schemaKeywords.optional)\n const isReadonly = schemas.some((schema) => schema.keyword === schemaKeywords.readOnly)\n const describeSchema = schemas.find((schema) => schema.keyword === schemaKeywords.describe) as SchemaKeywordMapper['describe'] | undefined\n const deprecatedSchema = schemas.find((schema) => schema.keyword === schemaKeywords.deprecated) as SchemaKeywordMapper['deprecated'] | undefined\n const defaultSchema = schemas.find((schema) => schema.keyword === schemaKeywords.default) as SchemaKeywordMapper['default'] | undefined\n const exampleSchema = schemas.find((schema) => schema.keyword === schemaKeywords.example) as SchemaKeywordMapper['example'] | undefined\n const schemaSchema = schemas.find((schema) => schema.keyword === schemaKeywords.schema) as SchemaKeywordMapper['schema'] | undefined\n\n let type = schemas.map((schema) => parse(current, schema, options)).filter(Boolean)[0] as ts.TypeNode\n\n if (isNullable) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.null],\n }) as ts.TypeNode\n }\n\n if (isNullish && ['undefined', 'questionTokenAndUndefined'].includes(options.optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n if (isOptional && ['undefined', 'questionTokenAndUndefined'].includes(options.optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n const propertySignature = factory.createPropertySignature({\n questionToken: isOptional || isNullish ? ['questionToken', 'questionTokenAndUndefined'].includes(options.optionalType as string) : false,\n name: mappedName,\n type,\n readOnly: isReadonly,\n })\n\n return factory.appendJSDocToNode({\n node: propertySignature,\n comments: [\n describeSchema ? `@description ${transformers.jsStringEscape(describeSchema.args)}` : undefined,\n deprecatedSchema ? '@deprecated' : undefined,\n defaultSchema ? `@default ${defaultSchema.args}` : undefined,\n exampleSchema ? `@example ${exampleSchema.args}` : undefined,\n schemaSchema?.args?.type || schemaSchema?.args?.format\n ? [`@type ${schemaSchema?.args?.type || 'unknown'}${!isOptional ? '' : ' | undefined'}`, schemaSchema?.args?.format].filter(Boolean).join(', ')\n : undefined,\n ].filter(Boolean),\n })\n })\n\n const additionalProperties = current.args?.additionalProperties?.length\n ? factory.createIndexSignature(\n current.args.additionalProperties\n .map((schema) => parse(current, schema, options))\n .filter(Boolean)\n .at(0) as ts.TypeNode,\n )\n : undefined\n\n return typeKeywordMapper.object([...properties, additionalProperties].filter(Boolean))\n }\n\n if (isKeyword(current, schemaKeywords.datetime)) {\n return typeKeywordMapper.datetime()\n }\n\n if (isKeyword(current, schemaKeywords.date)) {\n return typeKeywordMapper.date(current.args.type)\n }\n\n if (isKeyword(current, schemaKeywords.time)) {\n return typeKeywordMapper.time(current.args.type)\n }\n\n if (current.keyword in typeKeywordMapper) {\n return value()\n }\n\n return undefined\n}\n","import transformers, { createJSDocBlockText } from '@kubb/core/transformers'\nimport { type SchemaKeywordMapper, isKeyword, schemaKeywords } from '@kubb/plugin-oas'\n\nimport type { Schema, SchemaKeywordBase, SchemaMapper } from '@kubb/plugin-oas'\n\nexport const zodKeywordMapper = {\n any: () => 'z.any()',\n unknown: () => 'z.unknown()',\n number: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.number()' : 'z.number()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n integer: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.number()' : 'z.number()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n object: (value?: string) => `z.object({${value}})`,\n string: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.string()' : 'z.string()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n boolean: () => 'z.boolean()',\n undefined: () => 'z.undefined()',\n nullable: () => '.nullable()',\n null: () => 'z.null()',\n nullish: () => '.nullish()',\n array: (items: string[] = [], min?: number, max?: number) => {\n return [`z.array(${items?.join('')})`, min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n tuple: (items: string[] = []) => `z.tuple([${items?.join(', ')}])`,\n enum: (items: string[] = []) => `z.enum([${items?.join(', ')}])`,\n union: (items: string[] = []) => `z.union([${items?.join(', ')}])`,\n const: (value?: string | number) => `z.literal(${value ?? ''})`,\n /**\n * ISO 8601\n */\n datetime: (offset = false, local = false) => {\n if (offset) {\n return `z.string().datetime({ offset: ${offset} })`\n }\n\n if (local) {\n return `z.string().datetime({ local: ${local} })`\n }\n\n return 'z.string().datetime()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO date format (YYYY-MM-DD)\n * @default ISO date format (YYYY-MM-DD)\n */\n date: (type: 'date' | 'string' = 'string', coercion?: boolean) => {\n if (type === 'string') {\n return 'z.string().date()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO time format (HH:mm:ss[.SSSSSS])\n * @default ISO time format (HH:mm:ss[.SSSSSS])\n */\n time: (type: 'date' | 'string' = 'string', coercion?: boolean) => {\n if (type === 'string') {\n return 'z.string().time()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n uuid: () => '.uuid()',\n url: () => '.url()',\n strict: () => '.strict()',\n default: (value?: string | number | true) => `.default(${value ?? ''})`,\n and: (items: string[] = []) => items?.map((item) => `.and(${item})`).join(''),\n describe: (value = '') => `.describe(${value})`,\n min: (value?: number) => `.min(${value ?? ''})`,\n max: (value?: number) => `.max(${value ?? ''})`,\n optional: () => '.optional()',\n matches: (value = '') => `.regex(${value})`,\n email: () => '.email()',\n firstName: undefined,\n lastName: undefined,\n password: undefined,\n phone: undefined,\n readOnly: undefined,\n ref: (value?: string) => (value ? `z.lazy(() => ${value})` : undefined),\n blob: () => 'z.string()',\n deprecated: undefined,\n example: undefined,\n schema: undefined,\n catchall: (value?: string) => (value ? `.catchall(${value})` : undefined),\n name: undefined,\n} satisfies SchemaMapper<string | null | undefined>\n\n/**\n * @link based on https://github.com/cellular/oazapfts/blob/7ba226ebb15374e8483cc53e7532f1663179a22c/src/codegen/generate.ts#L398\n */\n\nexport function sort(items?: Schema[]): Schema[] {\n const order: string[] = [\n schemaKeywords.string,\n schemaKeywords.datetime,\n schemaKeywords.date,\n schemaKeywords.time,\n schemaKeywords.tuple,\n schemaKeywords.number,\n schemaKeywords.object,\n schemaKeywords.enum,\n schemaKeywords.url,\n schemaKeywords.email,\n schemaKeywords.firstName,\n schemaKeywords.lastName,\n schemaKeywords.password,\n schemaKeywords.matches,\n schemaKeywords.uuid,\n schemaKeywords.min,\n schemaKeywords.max,\n schemaKeywords.default,\n schemaKeywords.describe,\n schemaKeywords.optional,\n schemaKeywords.nullable,\n schemaKeywords.nullish,\n schemaKeywords.null,\n ]\n\n if (!items) {\n return []\n }\n\n return transformers.orderBy(items, [(v) => order.indexOf(v.keyword)], ['asc'])\n}\n\ntype ParserOptions = {\n name: string\n typeName?: string\n description?: string\n\n keysToOmit?: string[]\n mapper?: Record<string, string>\n coercion?: boolean\n}\n\nexport function parse(parent: Schema | undefined, current: Schema, options: ParserOptions): string | undefined {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper]\n\n if (!value) {\n return undefined\n }\n\n if (isKeyword(current, schemaKeywords.union)) {\n // zod union type needs at least 2 items\n if (Array.isArray(current.args) && current.args.length === 1) {\n return parse(parent, current.args[0] as Schema, options)\n }\n if (Array.isArray(current.args) && !current.args.length) {\n return ''\n }\n\n return zodKeywordMapper.union(\n sort(current.args)\n .map((schema) => parse(current, schema, options))\n .filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.and)) {\n const items = sort(current.args)\n .filter((schema: Schema) => {\n return ![schemaKeywords.optional, schemaKeywords.describe].includes(schema.keyword as typeof schemaKeywords.describe)\n })\n .map((schema: Schema) => parse(current, schema, options))\n .filter(Boolean)\n\n return `${items.slice(0, 1)}${zodKeywordMapper.and(items.slice(1))}`\n }\n\n if (isKeyword(current, schemaKeywords.array)) {\n return zodKeywordMapper.array(\n sort(current.args.items)\n .map((schemas) => parse(current, schemas, options))\n .filter(Boolean),\n current.args.min,\n current.args.max,\n )\n }\n\n if (isKeyword(current, schemaKeywords.enum)) {\n if (current.args.asConst) {\n return zodKeywordMapper.union(\n current.args.items\n .map((schema) => {\n return parse(\n current,\n {\n keyword: schemaKeywords.const,\n args: schema,\n },\n options,\n )\n })\n .filter(Boolean),\n )\n }\n\n return zodKeywordMapper.enum(\n current.args.items.map((schema) => {\n if (schema.format === 'number') {\n return transformers.stringify(schema.value)\n }\n return transformers.stringify(schema.value)\n }),\n )\n }\n\n if (isKeyword(current, schemaKeywords.ref)) {\n return zodKeywordMapper.ref(current.args?.name)\n }\n\n if (isKeyword(current, schemaKeywords.object)) {\n const properties = Object.entries(current.args?.properties || {})\n .filter((item) => {\n const schema = item[1]\n return schema && typeof schema.map === 'function'\n })\n .map(([name, schemas]) => {\n const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']\n const mappedName = nameSchema?.args || name\n\n // custom mapper(pluginOptions)\n if (options.mapper?.[mappedName]) {\n return `\"${name}\": ${options.mapper?.[mappedName]}`\n }\n\n return `\"${name}\": ${sort(schemas)\n .map((schema, array) => {\n return parse(current, schema, options)\n })\n .filter(Boolean)\n .join('')}`\n })\n .join(',')\n\n const additionalProperties = current.args?.additionalProperties?.length\n ? current.args.additionalProperties\n .map((schema) => parse(current, schema, options))\n .filter(Boolean)\n .at(0)\n : undefined\n\n const text = [\n zodKeywordMapper.object(properties),\n current.args?.strict ? zodKeywordMapper.strict() : undefined,\n additionalProperties ? zodKeywordMapper.catchall(additionalProperties) : undefined,\n ].filter(Boolean)\n\n return text.join('')\n }\n\n if (isKeyword(current, schemaKeywords.tuple)) {\n return zodKeywordMapper.tuple(\n sort(current.args.items)\n .map((schema) => parse(current, schema, options))\n .filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.const)) {\n if (current.args.format === 'number' && current.args.value !== undefined) {\n return zodKeywordMapper.const(Number.parseInt(current.args.value?.toString()))\n }\n return zodKeywordMapper.const(transformers.stringify(current.args.value))\n }\n\n if (isKeyword(current, schemaKeywords.matches)) {\n if (current.args) {\n return zodKeywordMapper.matches(transformers.toRegExpString(current.args))\n }\n }\n\n if (isKeyword(current, schemaKeywords.default)) {\n if (current.args) {\n return zodKeywordMapper.default(current.args)\n }\n }\n\n if (isKeyword(current, schemaKeywords.describe)) {\n if (current.args) {\n return zodKeywordMapper.describe(transformers.stringify(current.args.toString()))\n }\n }\n\n if (isKeyword(current, schemaKeywords.string)) {\n return zodKeywordMapper.string(options.coercion)\n }\n\n if (isKeyword(current, schemaKeywords.number) || isKeyword(current, schemaKeywords.integer)) {\n return zodKeywordMapper.number(options.coercion)\n }\n\n if (isKeyword(current, schemaKeywords.min)) {\n return zodKeywordMapper.min(current.args)\n }\n if (isKeyword(current, schemaKeywords.max)) {\n return zodKeywordMapper.max(current.args)\n }\n\n if (isKeyword(current, schemaKeywords.datetime)) {\n return zodKeywordMapper.datetime(current.args.offset, current.args.local)\n }\n\n if (isKeyword(current, schemaKeywords.date)) {\n return zodKeywordMapper.date(current.args.type, options.coercion)\n }\n\n if (isKeyword(current, schemaKeywords.time)) {\n return zodKeywordMapper.time(current.args.type, options.coercion)\n }\n\n if (current.keyword in zodKeywordMapper && 'args' in current) {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper] as (typeof zodKeywordMapper)['const']\n\n return value((current as SchemaKeywordBase<unknown>).args as any)\n }\n\n if (current.keyword in zodKeywordMapper) {\n return value()\n }\n\n return undefined\n}\n","import path from 'node:path'\n\nimport { FileManager, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { OperationGenerator, pluginOasName, SchemaGenerator } from '@kubb/plugin-oas'\nimport { getGroupedByTagFiles } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { Operations } from './components/Operations.tsx'\nimport type { PluginZod } from './types.ts'\nimport { zodParser } from './SchemaGenerator.tsx'\n\nexport const pluginZodName = 'plugin-zod' satisfies PluginZod['name']\n\nexport const pluginZod = createPlugin<PluginZod>((options) => {\n const {\n output = { path: 'zod' },\n group,\n exclude = [],\n include,\n override = [],\n transformers = {},\n dateType = 'string',\n unknownType = 'any',\n typed = false,\n typedSchema = false,\n mapper = {},\n templates,\n importPath = 'zod',\n coercion = false,\n } = options\n const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`\n\n return {\n name: pluginZodName,\n options: {\n extName: output.extName,\n transformers,\n include,\n exclude,\n override,\n typed,\n typedSchema,\n dateType,\n unknownType,\n mapper,\n importPath,\n coercion,\n templates: {\n operations: Operations.templates,\n ...templates,\n },\n },\n pre: [pluginOasName, typed ? pluginTsName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (options?.tag && group?.type === 'tag') {\n const tag = camelCase(options.tag)\n\n return path.resolve(root, renderTemplate(template, { tag }), baseName)\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n let resolvedName = camelCase(name, {\n suffix: type ? 'schema' : undefined,\n isFile: type === 'file',\n })\n\n if (type === 'type') {\n resolvedName = pascalCase(resolvedName)\n }\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n\n const schemaGenerator = new SchemaGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build(zodParser)\n await this.addFile(...schemaFiles)\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const operationFiles = await operationGenerator.build(zodParser)\n await this.addFile(...operationFiles)\n\n if (this.config.output.write && group?.type === 'tag') {\n const rootFiles = await getGroupedByTagFiles({\n logger: this.logger,\n files: this.fileManager.files,\n plugin: this.plugin,\n template,\n exportAs: group.exportAs || '{{tag}}Schemas',\n root,\n output,\n })\n\n await this.addFile(...rootFiles)\n }\n },\n async buildEnd() {\n if (this.config.output.write === false) {\n return\n }\n\n const root = path.resolve(this.config.root, this.config.output.path)\n const files = await this.fileManager.getIndexFiles({\n root,\n output,\n plugin: this.plugin,\n logger: this.logger,\n })\n\n await this.fileManager.processFiles({\n logger: this.logger,\n files,\n })\n },\n }\n})\n","import { createReactParser } from '@kubb/plugin-oas'\nimport { Schema } from './components/Schema.tsx'\nimport type { PluginZod } from './types.ts'\nimport { Operations } from './components/Operations.tsx'\nimport { OperationSchema } from './components/OperationSchema.tsx'\n\nexport const zodParser = createReactParser<PluginZod>({\n name: 'plugin-zod',\n Operations({ options }) {\n if (!options.templates.operations) {\n return null\n }\n\n return <Operations.File templates={options.templates.operations} />\n },\n Operation() {\n return <OperationSchema.File />\n },\n Schema({ schema, name }) {\n return <Schema.File />\n },\n})\n","import { SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperation, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { File, Parser, useApp } from '@kubb/react'\n\nimport type { OperationSchema as OperationSchemaType } from '@kubb/plugin-oas'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginZod } from '../types.ts'\nimport { Schema } from './Schema.tsx'\n\ntype Props = {\n description?: string\n keysToOmit?: string[]\n}\n\nexport function OperationSchema({ description, keysToOmit }: Props): ReactNode {\n return <Schema keysToOmit={keysToOmit} withTypeAnnotation={false} description={description} />\n}\n\ntype FileProps = {}\n\nOperationSchema.File = function ({}: FileProps): ReactNode {\n const { pluginManager, plugin, mode } = useApp<PluginZod>()\n const { getSchemas, getFile } = useOperationManager()\n const oas = useOas()\n const operation = useOperation()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const generator = new SchemaGenerator(plugin.options, {\n oas,\n plugin,\n pluginManager,\n mode,\n override: plugin.options.override,\n })\n\n const items = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response].flat().filter(Boolean)\n\n const mapItem = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n // hack so Params can be optional when needed\n const required = Array.isArray(schema?.required) ? !!schema.required.length : !!schema?.required\n const optional = !required && !!name.includes('Params')\n const tree = generator.parse({ schema, name })\n\n return (\n <Oas.Schema key={i} name={name} value={schema} tree={[...tree, optional ? { keyword: schemaKeywords.optional } : undefined].filter(Boolean)}>\n {mode === 'split' && <Oas.Schema.Imports extName={plugin.options.extName} />}\n <File.Source>\n <OperationSchema description={description} keysToOmit={keysToOmit} />\n </File.Source>\n </Oas.Schema>\n )\n }\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n <File.Import name={['z']} path={plugin.options.importPath} />\n {items.map(mapItem)}\n </File>\n </Parser>\n )\n}\n"]}
|
package/dist/components.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkRISCJCJNcjs = require('./chunk-RISCJCJN.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.OperationSchema =
|
|
10
|
+
exports.OperationSchema = _chunkRISCJCJNcjs.OperationSchema; exports.Operations = _chunkRISCJCJNcjs.Operations; exports.Schema = _chunkRISCJCJNcjs.Schema;
|
|
11
11
|
//# sourceMappingURL=components.cjs.map
|
package/dist/components.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkRISCJCJNcjs = require('./chunk-RISCJCJN.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.pluginZod =
|
|
8
|
+
exports.pluginZod = _chunkRISCJCJNcjs.pluginZod; exports.pluginZodName = _chunkRISCJCJNcjs.pluginZodName;
|
|
9
9
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-zod",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.5",
|
|
4
4
|
"description": "Generator plugin-zod",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -56,25 +56,25 @@
|
|
|
56
56
|
"!/**/__tests__/**"
|
|
57
57
|
],
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@kubb/core": "3.0.0-alpha.
|
|
60
|
-
"@kubb/fs": "3.0.0-alpha.
|
|
61
|
-
"@kubb/oas": "3.0.0-alpha.
|
|
62
|
-
"@kubb/parser-ts": "3.0.0-alpha.
|
|
63
|
-
"@kubb/plugin-oas": "3.0.0-alpha.
|
|
64
|
-
"@kubb/react": "3.0.0-alpha.
|
|
65
|
-
"@kubb/types": "3.0.0-alpha.
|
|
59
|
+
"@kubb/core": "3.0.0-alpha.5",
|
|
60
|
+
"@kubb/fs": "3.0.0-alpha.5",
|
|
61
|
+
"@kubb/oas": "3.0.0-alpha.5",
|
|
62
|
+
"@kubb/parser-ts": "3.0.0-alpha.5",
|
|
63
|
+
"@kubb/plugin-oas": "3.0.0-alpha.5",
|
|
64
|
+
"@kubb/react": "3.0.0-alpha.5",
|
|
65
|
+
"@kubb/types": "3.0.0-alpha.5"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/react": "^18.3.4",
|
|
69
69
|
"prettier": "^3.3.3",
|
|
70
70
|
"react": "^18.3.1",
|
|
71
71
|
"tsup": "^8.2.4",
|
|
72
|
-
"@kubb/config-biome": "3.0.0-alpha.
|
|
73
|
-
"@kubb/config-ts": "3.0.0-alpha.
|
|
74
|
-
"@kubb/config-tsup": "3.0.0-alpha.
|
|
72
|
+
"@kubb/config-biome": "3.0.0-alpha.5",
|
|
73
|
+
"@kubb/config-ts": "3.0.0-alpha.5",
|
|
74
|
+
"@kubb/config-tsup": "3.0.0-alpha.5"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@kubb/react": "3.0.0-alpha.
|
|
77
|
+
"@kubb/react": "3.0.0-alpha.5"
|
|
78
78
|
},
|
|
79
79
|
"engines": {
|
|
80
80
|
"node": ">=20"
|
package/src/plugin.ts
CHANGED
|
@@ -125,15 +125,8 @@ export const pluginZod = createPlugin<PluginZod>((options) => {
|
|
|
125
125
|
|
|
126
126
|
const operationFiles = await operationGenerator.build(zodParser)
|
|
127
127
|
await this.addFile(...operationFiles)
|
|
128
|
-
},
|
|
129
|
-
async buildEnd() {
|
|
130
|
-
if (this.config.output.write === false) {
|
|
131
|
-
return
|
|
132
|
-
}
|
|
133
128
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if (group?.type === 'tag') {
|
|
129
|
+
if (this.config.output.write && group?.type === 'tag') {
|
|
137
130
|
const rootFiles = await getGroupedByTagFiles({
|
|
138
131
|
logger: this.logger,
|
|
139
132
|
files: this.fileManager.files,
|
|
@@ -146,12 +139,23 @@ export const pluginZod = createPlugin<PluginZod>((options) => {
|
|
|
146
139
|
|
|
147
140
|
await this.addFile(...rootFiles)
|
|
148
141
|
}
|
|
142
|
+
},
|
|
143
|
+
async buildEnd() {
|
|
144
|
+
if (this.config.output.write === false) {
|
|
145
|
+
return
|
|
146
|
+
}
|
|
149
147
|
|
|
150
|
-
|
|
148
|
+
const root = path.resolve(this.config.root, this.config.output.path)
|
|
149
|
+
const files = await this.fileManager.getIndexFiles({
|
|
151
150
|
root,
|
|
152
151
|
output,
|
|
153
|
-
|
|
152
|
+
plugin: this.plugin,
|
|
153
|
+
logger: this.logger,
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
await this.fileManager.processFiles({
|
|
154
157
|
logger: this.logger,
|
|
158
|
+
files,
|
|
155
159
|
})
|
|
156
160
|
},
|
|
157
161
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/kubb/kubb/packages/plugin-zod/dist/chunk-7X3NWYUN.cjs","../src/components/Operations.tsx","../src/components/Schema.tsx","../../plugin-ts/src/plugin.ts","../../plugin-ts/src/OperationGenerator.tsx","../../plugin-ts/src/components/OasType.tsx","../../plugin-ts/src/components/OperationSchema.tsx","../../plugin-ts/src/SchemaGenerator.tsx","../../plugin-ts/src/components/Schema.tsx","../../plugin-ts/src/parser/index.ts","../src/parser/index.ts","../src/plugin.ts","../src/SchemaGenerator.tsx","../src/components/OperationSchema.tsx"],"names":["Template","RootTemplate","jsxs","Fragment","jsx","defaultTemplates","useApp","Parser","File","transformers","parse","createPlugin","useOperationManager","Const","schemaKeywords"],"mappings":"AAAA;ACAA,+CAAmD;AACnD,oCAA4C;AAE5C,mHAAyB;AA4CrB,qDAAA;AA1BJ,SAAS,QAAA,CAAS,EAAE,cAAA,EAAgB,SAAA,EAAW,WAAW,CAAA,EAA4B;AACpF,EAAA,MAAM,EAAE,mBAAmB,EAAA,EAAI,wCAAA,CAAoB;AACnD,EAAA,MAAM,sBAAA,EAAwB,UAAA,CAAW,GAAA,CAAI,CAAC,SAAA,EAAA,GAAA,CAAe,EAAE,SAAA,EAAW,IAAA,EAAM,kBAAA,CAAmB,SAAA,EAAW,EAAE,IAAA,EAAM,WAAW,CAAC,EAAE,CAAA,CAAE,CAAA;AAEtI,EAAA,MAAM,eAAA,EAAiB,qBAAA,CAAsB,MAAA;AAAA,IAC3C,CAAC,IAAA,EAAM,GAAA,EAAA,GAAQ;AACb,MAAA,IAAA,CAAK,CAAA,CAAA,EAAI,GAAA,CAAI,SAAA,CAAU,cAAA,CAAe,CAAC,CAAA,CAAA,CAAG,EAAA,EAAI,GAAA,CAAI,IAAA;AAElD,MAAA,OAAO,IAAA;AAAA,IACT,CAAA;AAAA,IACA,CAAC;AAAA,EACH,CAAA;AAEA,EAAA,MAAM,UAAA,EAAY,qBAAA,CAAsB,MAAA;AAAA,IACtC,CAAC,IAAA,EAAM,GAAA,EAAA,GAAQ;AACb,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runner/work/kubb/kubb/packages/plugin-zod/dist/chunk-7X3NWYUN.cjs","sourcesContent":[null,"import { useOperationManager, useOperations } from '@kubb/plugin-oas/hooks'\nimport { Const, File, Parser, useApp } from '@kubb/react'\n\nimport transformers from '@kubb/core/transformers'\nimport type { HttpMethod, Operation } from '@kubb/oas'\nimport type { KubbNode } from '@kubb/react'\nimport type { ComponentProps, ComponentType } from 'react'\nimport type { FileMeta, PluginZod } from '../types.ts'\n\ntype TemplateProps = {\n /**\n * Name of the function\n */\n operationsName: string\n /**\n * Name of the function\n */\n pathsName: string\n operations: Operation[]\n}\n\nfunction Template({ operationsName, pathsName, operations }: TemplateProps): KubbNode {\n const { groupSchemasByName } = useOperationManager()\n const transformedOperations = operations.map((operation) => ({ operation, data: groupSchemasByName(operation, { type: 'function' }) }))\n\n const operationsJSON = transformedOperations.reduce(\n (prev, acc) => {\n prev[`\"${acc.operation.getOperationId()}\"`] = acc.data\n\n return prev\n },\n {} as Record<string, unknown>,\n )\n\n const pathsJSON = transformedOperations.reduce(\n (prev, acc) => {\n prev[`\"${acc.operation.path}\"`] = {\n ...(prev[`\"${acc.operation.path}\"`] || ({} as Record<HttpMethod, string>)),\n [acc.operation.method]: `operations[\"${acc.operation.getOperationId()}\"]`,\n }\n\n return prev\n },\n {} as Record<string, Record<HttpMethod, string>>,\n )\n\n return (\n <>\n <Const export name={operationsName} asConst>\n {`{${transformers.stringifyObject(operationsJSON)}}`}\n </Const>\n <Const export name={pathsName} asConst>\n {`{${transformers.stringifyObject(pathsJSON)}}`}\n </Const>\n </>\n )\n}\n\ntype RootTemplateProps = {\n children?: React.ReactNode\n}\n\nfunction RootTemplate({ children }: RootTemplateProps) {\n const {\n mode,\n pluginManager,\n plugin: {\n key: pluginKey,\n options: { extName },\n },\n } = useApp<PluginZod>()\n const { getFile } = useOperationManager()\n const operations = useOperations()\n const { groupSchemasByName } = useOperationManager()\n const transformedOperations = operations.map((operation) => ({ operation, data: groupSchemasByName(operation, { type: 'function' }) }))\n\n const file = pluginManager.getFile({ name: 'operations', extName: '.ts', pluginKey })\n const imports = Object.entries(transformedOperations)\n .map(([_key, { data, operation }], index) => {\n const names = [data.request, ...Object.values(data.responses), ...Object.values(data.parameters)].filter(Boolean)\n\n return <File.Import key={index} extName={extName} name={names} root={file.path} path={getFile(operation).path} />\n })\n .filter(Boolean)\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta} exportable={false}>\n {mode === 'split' && imports}\n <File.Source>{children}</File.Source>\n </File>\n </Parser>\n )\n}\n\nconst defaultTemplates = { default: Template, root: RootTemplate } as const\n\ntype Templates = Partial<typeof defaultTemplates>\n\ntype Props = {\n /**\n * This will make it possible to override the default behaviour.\n */\n Template?: ComponentType<ComponentProps<typeof Template>>\n}\n\nexport function Operations({ Template = defaultTemplates.default }: Props): KubbNode {\n const operations = useOperations()\n\n return <Template operationsName=\"operations\" pathsName=\"paths\" operations={operations} />\n}\n\ntype FileProps = {\n /**\n * This will make it possible to override the default behaviour.\n */\n templates?: Templates\n}\n\nOperations.File = function (props: FileProps): KubbNode {\n const templates = { ...defaultTemplates, ...props.templates }\n\n const Template = templates.default\n const RootTemplate = templates.root\n\n return (\n <RootTemplate>\n <Operations Template={Template} />\n </RootTemplate>\n )\n}\n\nOperations.templates = defaultTemplates\n","import { Oas } from '@kubb/plugin-oas/components'\nimport { Const, File, Type, useApp, useFile } from '@kubb/react'\nimport { pluginTsName } from '@kubb/plugin-ts'\n\nimport transformers from '@kubb/core/transformers'\nimport { isKeyword, schemaKeywords } from '@kubb/plugin-oas'\nimport { useSchema } from '@kubb/plugin-oas/hooks'\nimport type { ReactNode } from 'react'\nimport * as parserZod from '../parser/index.ts'\nimport { pluginZodName } from '../plugin.ts'\nimport type { PluginZod } from '../types.ts'\n\ntype Props = {\n description?: string\n withTypeAnnotation?: boolean\n keysToOmit?: string[]\n}\n\nexport function Schema(props: Props): ReactNode {\n const { keysToOmit, withTypeAnnotation, description } = props\n const { tree, name } = useSchema()\n const {\n pluginManager,\n plugin: {\n options: { mapper, typedSchema, coercion },\n },\n } = useApp<PluginZod>()\n\n // all checks are also inside this.schema(React)\n const resolvedName = pluginManager.resolveName({\n name,\n pluginKey: [pluginZodName],\n type: 'function',\n })\n const resolvedTypeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginZodName],\n type: 'type',\n })\n\n const typeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n if (!tree.length) {\n return (\n <Const\n name={resolvedName}\n export\n JSDoc={{\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }}\n >\n undefined\n </Const>\n )\n }\n\n const hasTuple = tree.some((item) => isKeyword(item, schemaKeywords.tuple))\n\n const output = parserZod\n .sort(tree)\n .filter((item) => {\n if (hasTuple && (isKeyword(item, schemaKeywords.min) || isKeyword(item, schemaKeywords.max))) {\n return false\n }\n\n return true\n })\n .map((item) => parserZod.parse(undefined, item, { name, typeName, description, mapper, coercion, keysToOmit }))\n .filter(Boolean)\n .join('')\n\n const suffix = output.endsWith('.nullable()') ? '.unwrap().and' : '.and'\n\n return (\n <>\n <Const\n export\n name={resolvedName}\n JSDoc={{\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }}\n >\n {[\n output,\n keysToOmit?.length ? `${suffix}(z.object({ ${keysToOmit.map((key) => `${key}: z.never()`).join(',')} }))` : undefined,\n withTypeAnnotation && typeName ? ` as z.ZodType<${typeName}>` : '',\n ]\n .filter(Boolean)\n .join('') || ''}\n </Const>\n {typedSchema && (\n <Type export name={resolvedTypeName}>\n {`z.infer<typeof ${resolvedName}>`}\n </Type>\n )}\n </>\n )\n}\n\ntype FileProps = {}\n\nSchema.File = function ({}: FileProps): ReactNode {\n const {\n pluginManager,\n plugin: {\n options: { typed },\n },\n } = useApp<PluginZod>()\n const { schema } = useSchema()\n\n const withTypeAnnotation = !!typed\n\n return (\n <Oas.Schema.File output={pluginManager.config.output.path}>\n <Schema.Imports />\n <File.Source>\n <Schema withTypeAnnotation={withTypeAnnotation} description={schema?.description} />\n </File.Source>\n </Oas.Schema.File>\n )\n}\nSchema.Imports = (): ReactNode => {\n const {\n pluginManager,\n plugin: {\n options: { typed, importPath },\n },\n } = useApp<PluginZod>()\n const { path: root } = useFile()\n const { name, tree, schema } = useSchema()\n\n // used for this.options.typed\n const typeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n const typeFileName = pluginManager.resolveName({\n name: name,\n pluginKey: [pluginTsName],\n type: 'file',\n })\n\n const typePath = pluginManager.resolvePath({\n baseName: typeFileName,\n pluginKey: [pluginTsName],\n })\n\n const withTypeAnnotation = !!typed\n\n return (\n <>\n <File.Import name={['z']} path={importPath} />\n {withTypeAnnotation && typeName && typePath && <File.Import isTypeOnly root={root} path={typePath} name={[typeName]} />}\n </>\n )\n}\n","import path from 'node:path'\n\nimport { FileManager, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { pluginOasName } from '@kubb/plugin-oas'\n\nimport { OperationGenerator } from './OperationGenerator.tsx'\nimport { SchemaGenerator } from './SchemaGenerator.tsx'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport type { PluginTs } from './types.ts'\n\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\nexport const pluginTs = createPlugin<PluginTs>((options) => {\n const {\n output = { path: 'types' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumSuffix = '',\n dateType = 'string',\n unknownType = 'any',\n optionalType = 'questionToken',\n transformers = {},\n oasType = false,\n mapper = {},\n } = options\n const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`\n\n return {\n name: pluginTsName,\n options: {\n extName: output.extName,\n transformers,\n dateType,\n optionalType,\n oasType,\n enumType,\n enumSuffix,\n // keep the used enumnames between SchemaGenerator and OperationGenerator per plugin(pluginKey)\n usedEnumNames: {},\n unknownType,\n override,\n mapper,\n },\n pre: [pluginOasName],\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (options?.tag && group?.type === 'tag') {\n const tag = camelCase(options.tag)\n\n return path.resolve(root, renderTemplate(template, { tag }), baseName)\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n const resolvedName = pascalCase(name, { isFile: type === 'file' })\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n\n const schemaGenerator = new SchemaGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build()\n await this.addFile(...schemaFiles)\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const operationFiles = await operationGenerator.build()\n await this.addFile(...operationFiles)\n },\n async buildEnd() {\n if (this.config.output.write === false) {\n return\n }\n\n const root = path.resolve(this.config.root, this.config.output.path)\n\n await this.fileManager.addIndexes({\n root,\n output,\n meta: { pluginKey: this.plugin.key },\n logger: this.logger,\n })\n },\n }\n})\n","import { OperationGenerator as Generator } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { App, createRoot } from '@kubb/react'\n\nimport { OasType } from './components/OasType.tsx'\nimport { OperationSchema } from './components/OperationSchema.tsx'\n\nimport type { Operation } from '@kubb/oas'\nimport type { OperationMethodResult } from '@kubb/plugin-oas'\nimport type { FileMeta, PluginTs } from './types.ts'\n\nexport class OperationGenerator extends Generator<PluginTs['resolvedOptions'], PluginTs> {\n async all(operations: Operation[]): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n root.render(\n <App pluginManager={pluginManager} plugin={plugin} mode={mode}>\n <Oas oas={oas} operations={operations} generator={this}>\n {plugin.options.oasType && <OasType.File name=\"oas\" typeName=\"Oas\" />}\n </Oas>\n </App>,\n )\n\n return root.files\n }\n\n async operation(operation: Operation, options: PluginTs['resolvedOptions']): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n root.render(\n <App pluginManager={pluginManager} plugin={{ ...plugin, options }} mode={mode}>\n <Oas oas={oas} operations={[operation]} generator={this}>\n <Oas.Operation operation={operation}>\n <OperationSchema.File />\n </Oas.Operation>\n </Oas>\n </App>,\n )\n\n return root.files\n }\n}\n","import { Parser, File, Type, useApp } from '@kubb/react'\nimport { useOas } from '@kubb/plugin-oas/hooks'\n\nimport type { OasTypes } from '@kubb/oas'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginTs } from '../types.ts'\n\ntype TemplateProps = {\n /**\n * Name of the function\n */\n name: string\n typeName: string\n api: OasTypes.OASDocument\n}\n\nfunction Template({ name, typeName, api }: TemplateProps): ReactNode {\n return (\n <>\n {`export const ${name} = ${JSON.stringify(api, undefined, 2)} as const`}\n <br />\n <Type name={typeName} export>\n {`Infer<typeof ${name}>`}\n </Type>\n </>\n )\n}\n\nconst defaultTemplates = { default: Template } as const\n\ntype Props = {\n name: string\n typeName: string\n /**\n * This will make it possible to override the default behaviour.\n */\n Template?: React.ComponentType<React.ComponentProps<typeof Template>>\n}\n\nexport function OasType({ name, typeName, Template = defaultTemplates.default }: Props): ReactNode {\n const oas = useOas()\n\n return <Template name={name} typeName={typeName} api={oas.api} />\n}\n\ntype FileProps = {\n name: string\n typeName: string\n /**\n * This will make it possible to override the default behaviour.\n */\n templates?: typeof defaultTemplates\n}\n\nOasType.File = function ({ name, typeName, templates = defaultTemplates }: FileProps): ReactNode {\n const {\n pluginManager,\n plugin: { key: pluginKey },\n } = useApp<PluginTs>()\n const file = pluginManager.getFile({ name, extName: '.ts', pluginKey })\n\n const Template = templates.default\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n <File.Import name={['Infer']} path=\"@kubb/oas\" isTypeOnly />\n <File.Source>\n <OasType Template={Template} name={name} typeName={typeName} />\n </File.Source>\n </File>\n </Parser>\n )\n}\n\nOasType.templates = defaultTemplates\n","import transformers from '@kubb/core/transformers'\nimport { print } from '@kubb/parser-ts'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperation, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { File, Parser, useApp } from '@kubb/react'\n\nimport { SchemaGenerator } from '../SchemaGenerator.tsx'\n\nimport type { PluginManager } from '@kubb/core'\nimport type { Operation } from '@kubb/oas'\nimport type { ts } from '@kubb/parser-ts'\nimport type { OperationSchema as OperationSchemaType } from '@kubb/plugin-oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginTs } from '../types.ts'\nimport { Schema } from './Schema.tsx'\n\nfunction printCombinedSchema({\n name,\n operation,\n schemas,\n pluginManager,\n}: { name: string; operation: Operation; schemas: OperationSchemas; pluginManager: PluginManager }): string {\n const properties: Record<string, ts.TypeNode> = {}\n\n if (schemas.response) {\n const identifier = pluginManager.resolveName({\n name: schemas.response.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['response'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.request) {\n const identifier = pluginManager.resolveName({\n name: schemas.request.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['request'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.pathParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.pathParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['pathParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.queryParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.queryParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['queryParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.headerParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.headerParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['headerParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.errors) {\n properties['errors'] = factory.createUnionDeclaration({\n nodes: schemas.errors.map((error) => {\n const identifier = pluginManager.resolveName({\n name: error.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }),\n })!\n }\n\n const namespaceNode = factory.createTypeAliasDeclaration({\n name: operation.method === 'get' ? `${name}Query` : `${name}Mutation`,\n type: factory.createTypeLiteralNode(\n Object.keys(properties)\n .map((key) => {\n const type = properties[key]\n if (!type) {\n return undefined\n }\n\n return factory.createPropertySignature({\n name: transformers.pascalCase(key),\n type,\n })\n })\n .filter(Boolean),\n ),\n modifiers: [factory.modifiers.export],\n })\n\n return print(namespaceNode)\n}\n\ntype Props = {\n description?: string\n keysToOmit?: string[]\n}\n\nexport function OperationSchema({ keysToOmit, description }: Props): ReactNode {\n return <Schema keysToOmit={keysToOmit} description={description} />\n}\n\ntype FileProps = {}\n\nOperationSchema.File = function ({}: FileProps): ReactNode {\n const { pluginManager, plugin, mode, fileManager } = useApp<PluginTs>()\n const oas = useOas()\n const { getSchemas, getFile, getName } = useOperationManager()\n const operation = useOperation()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const factoryName = getName(operation, { type: 'type' })\n const generator = new SchemaGenerator(plugin.options, {\n oas,\n plugin,\n pluginManager,\n mode,\n override: plugin.options.override,\n })\n const items = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response].flat().filter(Boolean)\n\n const mapItem = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n const tree = generator.parse({ schema, name })\n\n return (\n <Oas.Schema key={i} name={name} value={schema} tree={tree}>\n {mode === 'split' && <Oas.Schema.Imports extName={plugin.options.extName} isTypeOnly />}\n <File.Source>\n <OperationSchema description={description} keysToOmit={keysToOmit} />\n </File.Source>\n </Oas.Schema>\n )\n }\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n {items.map(mapItem)}\n\n <File.Source>{printCombinedSchema({ name: factoryName, operation, schemas, pluginManager })}</File.Source>\n </File>\n </Parser>\n )\n}\n","import type { SchemaObject } from '@kubb/oas'\nimport { SchemaGenerator as Generator } from '@kubb/plugin-oas'\nimport type { SchemaMethodResult } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { App, createRoot } from '@kubb/react'\nimport { Schema } from './components/Schema.tsx'\nimport type { FileMeta, PluginTs } from './types.ts'\n\nexport class SchemaGenerator extends Generator<PluginTs['resolvedOptions'], PluginTs> {\n async schema(name: string, schema: SchemaObject, options: PluginTs['resolvedOptions']): SchemaMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode, output } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n const tree = this.parse({ schema, name })\n\n root.render(\n <App pluginManager={pluginManager} plugin={{ ...plugin, options }} mode={mode}>\n <Oas oas={oas}>\n <Oas.Schema name={name} value={schema} tree={tree}>\n <Schema.File />\n </Oas.Schema>\n </Oas>\n </App>,\n )\n\n return root.files\n }\n}\n","import { Oas } from '@kubb/plugin-oas/components'\nimport { File, useApp } from '@kubb/react'\n\nimport transformers from '@kubb/core/transformers'\nimport { print, type ts } from '@kubb/parser-ts'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { useSchema } from '@kubb/plugin-oas/hooks'\nimport type { ReactNode } from 'react'\nimport { parse, typeKeywordMapper } from '../parser/index.ts'\nimport { pluginTsName } from '../plugin.ts'\nimport type { PluginTs } from '../types.ts'\n\ntype Props = {\n description?: string\n keysToOmit?: string[]\n}\n\nexport function Schema(props: Props): ReactNode {\n const { keysToOmit, description } = props\n const { tree, name } = useSchema()\n const {\n pluginManager,\n plugin: {\n options: { mapper, enumType, optionalType },\n },\n } = useApp<PluginTs>()\n\n // all checks are also inside this.schema(React)\n const resolvedName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n const typeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n const nodes: ts.Node[] = []\n const extraNodes: ts.Node[] = []\n\n if (!tree.length) {\n return ''\n }\n\n const isNullish = tree.some((item) => item.keyword === schemaKeywords.nullish)\n const isNullable = tree.some((item) => item.keyword === schemaKeywords.nullable)\n const isOptional = tree.some((item) => item.keyword === schemaKeywords.optional)\n\n let type =\n (tree\n .map((schema) => parse(undefined, schema, { name: resolvedName, typeName, description, keysToOmit, optionalType, enumType, mapper }))\n .filter(Boolean)\n .at(0) as ts.TypeNode) || typeKeywordMapper.undefined()\n\n if (isNullable) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.null],\n }) as ts.TypeNode\n }\n\n if (isNullish && ['undefined', 'questionTokenAndUndefined'].includes(optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n if (isOptional && ['undefined', 'questionTokenAndUndefined'].includes(optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n const node = factory.createTypeAliasDeclaration({\n modifiers: [factory.modifiers.export],\n name: resolvedName,\n type: keysToOmit?.length\n ? factory.createOmitDeclaration({\n keys: keysToOmit,\n type,\n nonNullable: true,\n })\n : type,\n })\n\n const enumSchemas = SchemaGenerator.deepSearch(tree, schemaKeywords.enum)\n if (enumSchemas) {\n enumSchemas.forEach((enumSchema) => {\n extraNodes.push(\n ...factory.createEnumDeclaration({\n name: transformers.camelCase(enumSchema.args.name),\n typeName: enumSchema.args.typeName,\n enums: enumSchema.args.items\n .map((item) => (item.value === undefined ? undefined : [transformers.trimQuotes(item.name?.toString()), item.value]))\n .filter(Boolean) as unknown as [string, string][],\n type: enumType,\n }),\n )\n })\n }\n\n nodes.push(\n factory.appendJSDocToNode({\n node,\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }),\n )\n\n const filterdNodes = nodes.filter(\n (node: ts.Node) =>\n !extraNodes.some(\n (extraNode: ts.Node) => (extraNode as ts.TypeAliasDeclaration)?.name?.escapedText === (node as ts.TypeAliasDeclaration)?.name?.escapedText,\n ),\n )\n\n return print([...extraNodes, ...filterdNodes])\n}\n\ntype FileProps = {}\n\nSchema.File = function ({}: FileProps): ReactNode {\n const { pluginManager } = useApp<PluginTs>()\n const { schema } = useSchema()\n\n return (\n <Oas.Schema.File output={pluginManager.config.output.path}>\n <File.Source>\n <Schema description={schema?.description} />\n </File.Source>\n </Oas.Schema.File>\n )\n}\n","import transformers from '@kubb/core/transformers'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { isKeyword, schemaKeywords } from '@kubb/plugin-oas'\n\nimport type { ts } from '@kubb/parser-ts'\nimport type { Schema, SchemaKeywordMapper, SchemaMapper } from '@kubb/plugin-oas'\n\nexport const typeKeywordMapper = {\n any: () => factory.keywordTypeNodes.any,\n unknown: () => factory.keywordTypeNodes.unknown,\n number: () => factory.keywordTypeNodes.number,\n integer: () => factory.keywordTypeNodes.number,\n object: (nodes?: ts.TypeElement[]) => {\n if (!nodes || !nodes.length) {\n return factory.keywordTypeNodes.object\n }\n\n return factory.createTypeLiteralNode(nodes)\n },\n string: () => factory.keywordTypeNodes.string,\n boolean: () => factory.keywordTypeNodes.boolean,\n undefined: () => factory.keywordTypeNodes.undefined,\n nullable: undefined,\n null: () => factory.keywordTypeNodes.null,\n nullish: undefined,\n array: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createArrayDeclaration({ nodes })\n },\n tuple: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createTupleTypeNode(nodes)\n },\n enum: (name?: string) => {\n if (!name) {\n return undefined\n }\n\n return factory.createTypeReferenceNode(name, undefined)\n },\n union: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createUnionDeclaration({\n withParentheses: true,\n nodes,\n })\n },\n const: (name?: string | number, format?: 'string' | 'number') => {\n if (!name) {\n return undefined\n }\n\n if (format === 'number') {\n return factory.createLiteralTypeNode(factory.createNumericLiteral(name))\n }\n\n return factory.createLiteralTypeNode(factory.createStringLiteral(name.toString()))\n },\n datetime: () => factory.keywordTypeNodes.string,\n date: (type: 'date' | 'string' = 'string') =>\n type === 'string' ? factory.keywordTypeNodes.string : factory.createTypeReferenceNode(factory.createIdentifier('Date')),\n time: (type: 'date' | 'string' = 'string') =>\n type === 'string' ? factory.keywordTypeNodes.string : factory.createTypeReferenceNode(factory.createIdentifier('Date')),\n uuid: undefined,\n url: undefined,\n strict: undefined,\n default: undefined,\n and: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createIntersectionDeclaration({\n withParentheses: true,\n nodes,\n })\n },\n describe: undefined,\n min: undefined,\n max: undefined,\n optional: undefined,\n matches: undefined,\n email: undefined,\n firstName: undefined,\n lastName: undefined,\n password: undefined,\n phone: undefined,\n readOnly: undefined,\n ref: (propertyName?: string) => {\n if (!propertyName) {\n return undefined\n }\n\n return factory.createTypeReferenceNode(propertyName, undefined)\n },\n blob: () => factory.createTypeReferenceNode('Blob', []),\n deprecated: undefined,\n example: undefined,\n schema: undefined,\n catchall: undefined,\n name: undefined,\n} satisfies SchemaMapper<ts.Node | null | undefined>\n\ntype ParserOptions = {\n name: string\n typeName?: string\n description?: string\n /**\n * @default `'questionToken'`\n */\n optionalType: 'questionToken' | 'undefined' | 'questionTokenAndUndefined'\n /**\n * @default `'asConst'`\n */\n enumType: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal'\n keysToOmit?: string[]\n mapper?: Record<string, ts.PropertySignature>\n}\n\nexport function parse(parent: Schema | undefined, current: Schema, options: ParserOptions): ts.Node | null | undefined {\n const value = typeKeywordMapper[current.keyword as keyof typeof typeKeywordMapper]\n\n if (!value) {\n return undefined\n }\n\n if (isKeyword(current, schemaKeywords.union)) {\n return typeKeywordMapper.union(current.args.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.and)) {\n return typeKeywordMapper.and(current.args.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.array)) {\n return typeKeywordMapper.array(current.args.items.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.enum)) {\n return typeKeywordMapper.enum(current.args.typeName)\n }\n\n if (isKeyword(current, schemaKeywords.ref)) {\n return typeKeywordMapper.ref(current.args.name)\n }\n\n if (isKeyword(current, schemaKeywords.blob)) {\n return value()\n }\n\n if (isKeyword(current, schemaKeywords.tuple)) {\n return typeKeywordMapper.tuple(current.args.items.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.const)) {\n return typeKeywordMapper.const(current.args.name, current.args.format)\n }\n\n if (isKeyword(current, schemaKeywords.object)) {\n const properties = Object.entries(current.args?.properties || {})\n .filter((item) => {\n const schemas = item[1]\n return schemas && typeof schemas.map === 'function'\n })\n .map(([name, schemas]) => {\n const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']\n const mappedName = nameSchema?.args || name\n\n // custom mapper(pluginOptions)\n if (options.mapper?.[mappedName]) {\n return options.mapper?.[mappedName]\n }\n\n const isNullish = schemas.some((schema) => schema.keyword === schemaKeywords.nullish)\n const isNullable = schemas.some((schema) => schema.keyword === schemaKeywords.nullable)\n const isOptional = schemas.some((schema) => schema.keyword === schemaKeywords.optional)\n const isReadonly = schemas.some((schema) => schema.keyword === schemaKeywords.readOnly)\n const describeSchema = schemas.find((schema) => schema.keyword === schemaKeywords.describe) as SchemaKeywordMapper['describe'] | undefined\n const deprecatedSchema = schemas.find((schema) => schema.keyword === schemaKeywords.deprecated) as SchemaKeywordMapper['deprecated'] | undefined\n const defaultSchema = schemas.find((schema) => schema.keyword === schemaKeywords.default) as SchemaKeywordMapper['default'] | undefined\n const exampleSchema = schemas.find((schema) => schema.keyword === schemaKeywords.example) as SchemaKeywordMapper['example'] | undefined\n const schemaSchema = schemas.find((schema) => schema.keyword === schemaKeywords.schema) as SchemaKeywordMapper['schema'] | undefined\n\n let type = schemas.map((schema) => parse(current, schema, options)).filter(Boolean)[0] as ts.TypeNode\n\n if (isNullable) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.null],\n }) as ts.TypeNode\n }\n\n if (isNullish && ['undefined', 'questionTokenAndUndefined'].includes(options.optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n if (isOptional && ['undefined', 'questionTokenAndUndefined'].includes(options.optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n const propertySignature = factory.createPropertySignature({\n questionToken: isOptional || isNullish ? ['questionToken', 'questionTokenAndUndefined'].includes(options.optionalType as string) : false,\n name: mappedName,\n type,\n readOnly: isReadonly,\n })\n\n return factory.appendJSDocToNode({\n node: propertySignature,\n comments: [\n describeSchema ? `@description ${transformers.jsStringEscape(describeSchema.args)}` : undefined,\n deprecatedSchema ? '@deprecated' : undefined,\n defaultSchema ? `@default ${defaultSchema.args}` : undefined,\n exampleSchema ? `@example ${exampleSchema.args}` : undefined,\n schemaSchema?.args?.type || schemaSchema?.args?.format\n ? [`@type ${schemaSchema?.args?.type || 'unknown'}${!isOptional ? '' : ' | undefined'}`, schemaSchema?.args?.format].filter(Boolean).join(', ')\n : undefined,\n ].filter(Boolean),\n })\n })\n\n const additionalProperties = current.args?.additionalProperties?.length\n ? factory.createIndexSignature(\n current.args.additionalProperties\n .map((schema) => parse(current, schema, options))\n .filter(Boolean)\n .at(0) as ts.TypeNode,\n )\n : undefined\n\n return typeKeywordMapper.object([...properties, additionalProperties].filter(Boolean))\n }\n\n if (isKeyword(current, schemaKeywords.datetime)) {\n return typeKeywordMapper.datetime()\n }\n\n if (isKeyword(current, schemaKeywords.date)) {\n return typeKeywordMapper.date(current.args.type)\n }\n\n if (isKeyword(current, schemaKeywords.time)) {\n return typeKeywordMapper.time(current.args.type)\n }\n\n if (current.keyword in typeKeywordMapper) {\n return value()\n }\n\n return undefined\n}\n","import transformers, { createJSDocBlockText } from '@kubb/core/transformers'\nimport { type SchemaKeywordMapper, isKeyword, schemaKeywords } from '@kubb/plugin-oas'\n\nimport type { Schema, SchemaKeywordBase, SchemaMapper } from '@kubb/plugin-oas'\n\nexport const zodKeywordMapper = {\n any: () => 'z.any()',\n unknown: () => 'z.unknown()',\n number: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.number()' : 'z.number()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n integer: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.number()' : 'z.number()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n object: (value?: string) => `z.object({${value}})`,\n string: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.string()' : 'z.string()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n boolean: () => 'z.boolean()',\n undefined: () => 'z.undefined()',\n nullable: () => '.nullable()',\n null: () => 'z.null()',\n nullish: () => '.nullish()',\n array: (items: string[] = [], min?: number, max?: number) => {\n return [`z.array(${items?.join('')})`, min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n tuple: (items: string[] = []) => `z.tuple([${items?.join(', ')}])`,\n enum: (items: string[] = []) => `z.enum([${items?.join(', ')}])`,\n union: (items: string[] = []) => `z.union([${items?.join(', ')}])`,\n const: (value?: string | number) => `z.literal(${value ?? ''})`,\n /**\n * ISO 8601\n */\n datetime: (offset = false, local = false) => {\n if (offset) {\n return `z.string().datetime({ offset: ${offset} })`\n }\n\n if (local) {\n return `z.string().datetime({ local: ${local} })`\n }\n\n return 'z.string().datetime()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO date format (YYYY-MM-DD)\n * @default ISO date format (YYYY-MM-DD)\n */\n date: (type: 'date' | 'string' = 'string', coercion?: boolean) => {\n if (type === 'string') {\n return 'z.string().date()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO time format (HH:mm:ss[.SSSSSS])\n * @default ISO time format (HH:mm:ss[.SSSSSS])\n */\n time: (type: 'date' | 'string' = 'string', coercion?: boolean) => {\n if (type === 'string') {\n return 'z.string().time()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n uuid: () => '.uuid()',\n url: () => '.url()',\n strict: () => '.strict()',\n default: (value?: string | number | true) => `.default(${value ?? ''})`,\n and: (items: string[] = []) => items?.map((item) => `.and(${item})`).join(''),\n describe: (value = '') => `.describe(${value})`,\n min: (value?: number) => `.min(${value ?? ''})`,\n max: (value?: number) => `.max(${value ?? ''})`,\n optional: () => '.optional()',\n matches: (value = '') => `.regex(${value})`,\n email: () => '.email()',\n firstName: undefined,\n lastName: undefined,\n password: undefined,\n phone: undefined,\n readOnly: undefined,\n ref: (value?: string) => (value ? `z.lazy(() => ${value})` : undefined),\n blob: () => 'z.string()',\n deprecated: undefined,\n example: undefined,\n schema: undefined,\n catchall: (value?: string) => (value ? `.catchall(${value})` : undefined),\n name: undefined,\n} satisfies SchemaMapper<string | null | undefined>\n\n/**\n * @link based on https://github.com/cellular/oazapfts/blob/7ba226ebb15374e8483cc53e7532f1663179a22c/src/codegen/generate.ts#L398\n */\n\nexport function sort(items?: Schema[]): Schema[] {\n const order: string[] = [\n schemaKeywords.string,\n schemaKeywords.datetime,\n schemaKeywords.date,\n schemaKeywords.time,\n schemaKeywords.tuple,\n schemaKeywords.number,\n schemaKeywords.object,\n schemaKeywords.enum,\n schemaKeywords.url,\n schemaKeywords.email,\n schemaKeywords.firstName,\n schemaKeywords.lastName,\n schemaKeywords.password,\n schemaKeywords.matches,\n schemaKeywords.uuid,\n schemaKeywords.min,\n schemaKeywords.max,\n schemaKeywords.default,\n schemaKeywords.describe,\n schemaKeywords.optional,\n schemaKeywords.nullable,\n schemaKeywords.nullish,\n schemaKeywords.null,\n ]\n\n if (!items) {\n return []\n }\n\n return transformers.orderBy(items, [(v) => order.indexOf(v.keyword)], ['asc'])\n}\n\ntype ParserOptions = {\n name: string\n typeName?: string\n description?: string\n\n keysToOmit?: string[]\n mapper?: Record<string, string>\n coercion?: boolean\n}\n\nexport function parse(parent: Schema | undefined, current: Schema, options: ParserOptions): string | undefined {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper]\n\n if (!value) {\n return undefined\n }\n\n if (isKeyword(current, schemaKeywords.union)) {\n // zod union type needs at least 2 items\n if (Array.isArray(current.args) && current.args.length === 1) {\n return parse(parent, current.args[0] as Schema, options)\n }\n if (Array.isArray(current.args) && !current.args.length) {\n return ''\n }\n\n return zodKeywordMapper.union(\n sort(current.args)\n .map((schema) => parse(current, schema, options))\n .filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.and)) {\n const items = sort(current.args)\n .filter((schema: Schema) => {\n return ![schemaKeywords.optional, schemaKeywords.describe].includes(schema.keyword as typeof schemaKeywords.describe)\n })\n .map((schema: Schema) => parse(current, schema, options))\n .filter(Boolean)\n\n return `${items.slice(0, 1)}${zodKeywordMapper.and(items.slice(1))}`\n }\n\n if (isKeyword(current, schemaKeywords.array)) {\n return zodKeywordMapper.array(\n sort(current.args.items)\n .map((schemas) => parse(current, schemas, options))\n .filter(Boolean),\n current.args.min,\n current.args.max,\n )\n }\n\n if (isKeyword(current, schemaKeywords.enum)) {\n if (current.args.asConst) {\n return zodKeywordMapper.union(\n current.args.items\n .map((schema) => {\n return parse(\n current,\n {\n keyword: schemaKeywords.const,\n args: schema,\n },\n options,\n )\n })\n .filter(Boolean),\n )\n }\n\n return zodKeywordMapper.enum(\n current.args.items.map((schema) => {\n if (schema.format === 'number') {\n return transformers.stringify(schema.value)\n }\n return transformers.stringify(schema.value)\n }),\n )\n }\n\n if (isKeyword(current, schemaKeywords.ref)) {\n return zodKeywordMapper.ref(current.args?.name)\n }\n\n if (isKeyword(current, schemaKeywords.object)) {\n const properties = Object.entries(current.args?.properties || {})\n .filter((item) => {\n const schema = item[1]\n return schema && typeof schema.map === 'function'\n })\n .map(([name, schemas]) => {\n const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']\n const mappedName = nameSchema?.args || name\n\n // custom mapper(pluginOptions)\n if (options.mapper?.[mappedName]) {\n return `\"${name}\": ${options.mapper?.[mappedName]}`\n }\n\n return `\"${name}\": ${sort(schemas)\n .map((schema, array) => {\n return parse(current, schema, options)\n })\n .filter(Boolean)\n .join('')}`\n })\n .join(',')\n\n const additionalProperties = current.args?.additionalProperties?.length\n ? current.args.additionalProperties\n .map((schema) => parse(current, schema, options))\n .filter(Boolean)\n .at(0)\n : undefined\n\n const text = [\n zodKeywordMapper.object(properties),\n current.args?.strict ? zodKeywordMapper.strict() : undefined,\n additionalProperties ? zodKeywordMapper.catchall(additionalProperties) : undefined,\n ].filter(Boolean)\n\n return text.join('')\n }\n\n if (isKeyword(current, schemaKeywords.tuple)) {\n return zodKeywordMapper.tuple(\n sort(current.args.items)\n .map((schema) => parse(current, schema, options))\n .filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.const)) {\n if (current.args.format === 'number' && current.args.value !== undefined) {\n return zodKeywordMapper.const(Number.parseInt(current.args.value?.toString()))\n }\n return zodKeywordMapper.const(transformers.stringify(current.args.value))\n }\n\n if (isKeyword(current, schemaKeywords.matches)) {\n if (current.args) {\n return zodKeywordMapper.matches(transformers.toRegExpString(current.args))\n }\n }\n\n if (isKeyword(current, schemaKeywords.default)) {\n if (current.args) {\n return zodKeywordMapper.default(current.args)\n }\n }\n\n if (isKeyword(current, schemaKeywords.describe)) {\n if (current.args) {\n return zodKeywordMapper.describe(transformers.stringify(current.args.toString()))\n }\n }\n\n if (isKeyword(current, schemaKeywords.string)) {\n return zodKeywordMapper.string(options.coercion)\n }\n\n if (isKeyword(current, schemaKeywords.number) || isKeyword(current, schemaKeywords.integer)) {\n return zodKeywordMapper.number(options.coercion)\n }\n\n if (isKeyword(current, schemaKeywords.min)) {\n return zodKeywordMapper.min(current.args)\n }\n if (isKeyword(current, schemaKeywords.max)) {\n return zodKeywordMapper.max(current.args)\n }\n\n if (isKeyword(current, schemaKeywords.datetime)) {\n return zodKeywordMapper.datetime(current.args.offset, current.args.local)\n }\n\n if (isKeyword(current, schemaKeywords.date)) {\n return zodKeywordMapper.date(current.args.type, options.coercion)\n }\n\n if (isKeyword(current, schemaKeywords.time)) {\n return zodKeywordMapper.time(current.args.type, options.coercion)\n }\n\n if (current.keyword in zodKeywordMapper && 'args' in current) {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper] as (typeof zodKeywordMapper)['const']\n\n return value((current as SchemaKeywordBase<unknown>).args as any)\n }\n\n if (current.keyword in zodKeywordMapper) {\n return value()\n }\n\n return undefined\n}\n","import path from 'node:path'\n\nimport { FileManager, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { OperationGenerator, pluginOasName, SchemaGenerator } from '@kubb/plugin-oas'\nimport { getGroupedByTagFiles } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { Operations } from './components/Operations.tsx'\nimport type { PluginZod } from './types.ts'\nimport { zodParser } from './SchemaGenerator.tsx'\n\nexport const pluginZodName = 'plugin-zod' satisfies PluginZod['name']\n\nexport const pluginZod = createPlugin<PluginZod>((options) => {\n const {\n output = { path: 'zod' },\n group,\n exclude = [],\n include,\n override = [],\n transformers = {},\n dateType = 'string',\n unknownType = 'any',\n typed = false,\n typedSchema = false,\n mapper = {},\n templates,\n importPath = 'zod',\n coercion = false,\n } = options\n const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`\n\n return {\n name: pluginZodName,\n options: {\n extName: output.extName,\n transformers,\n include,\n exclude,\n override,\n typed,\n typedSchema,\n dateType,\n unknownType,\n mapper,\n importPath,\n coercion,\n templates: {\n operations: Operations.templates,\n ...templates,\n },\n },\n pre: [pluginOasName, typed ? pluginTsName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (options?.tag && group?.type === 'tag') {\n const tag = camelCase(options.tag)\n\n return path.resolve(root, renderTemplate(template, { tag }), baseName)\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n let resolvedName = camelCase(name, {\n suffix: type ? 'schema' : undefined,\n isFile: type === 'file',\n })\n\n if (type === 'type') {\n resolvedName = pascalCase(resolvedName)\n }\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n\n const schemaGenerator = new SchemaGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build(zodParser)\n await this.addFile(...schemaFiles)\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const operationFiles = await operationGenerator.build(zodParser)\n await this.addFile(...operationFiles)\n },\n async buildEnd() {\n if (this.config.output.write === false) {\n return\n }\n\n const root = path.resolve(this.config.root, this.config.output.path)\n\n if (group?.type === 'tag') {\n const rootFiles = await getGroupedByTagFiles({\n logger: this.logger,\n files: this.fileManager.files,\n plugin: this.plugin,\n template,\n exportAs: group.exportAs || '{{tag}}Schemas',\n root,\n output,\n })\n\n await this.addFile(...rootFiles)\n }\n\n await this.fileManager.addIndexes({\n root,\n output,\n meta: { pluginKey: this.plugin.key },\n logger: this.logger,\n })\n },\n }\n})\n","import { createReactParser } from '@kubb/plugin-oas'\nimport { Schema } from './components/Schema.tsx'\nimport type { PluginZod } from './types.ts'\nimport { Operations } from './components/Operations.tsx'\nimport { OperationSchema } from './components/OperationSchema.tsx'\n\nexport const zodParser = createReactParser<PluginZod>({\n name: 'plugin-zod',\n Operations({ options }) {\n if (!options.templates.operations) {\n return null\n }\n\n return <Operations.File templates={options.templates.operations} />\n },\n Operation() {\n return <OperationSchema.File />\n },\n Schema({ schema, name }) {\n return <Schema.File />\n },\n})\n","import { SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperation, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { File, Parser, useApp } from '@kubb/react'\n\nimport type { OperationSchema as OperationSchemaType } from '@kubb/plugin-oas'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginZod } from '../types.ts'\nimport { Schema } from './Schema.tsx'\n\ntype Props = {\n description?: string\n keysToOmit?: string[]\n}\n\nexport function OperationSchema({ description, keysToOmit }: Props): ReactNode {\n return <Schema keysToOmit={keysToOmit} withTypeAnnotation={false} description={description} />\n}\n\ntype FileProps = {}\n\nOperationSchema.File = function ({}: FileProps): ReactNode {\n const { pluginManager, plugin, mode } = useApp<PluginZod>()\n const { getSchemas, getFile } = useOperationManager()\n const oas = useOas()\n const operation = useOperation()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const generator = new SchemaGenerator(plugin.options, {\n oas,\n plugin,\n pluginManager,\n mode,\n override: plugin.options.override,\n })\n\n const items = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response].flat().filter(Boolean)\n\n const mapItem = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n // hack so Params can be optional when needed\n const required = Array.isArray(schema?.required) ? !!schema.required.length : !!schema?.required\n const optional = !required && !!name.includes('Params')\n const tree = generator.parse({ schema, name })\n\n return (\n <Oas.Schema key={i} name={name} value={schema} tree={[...tree, optional ? { keyword: schemaKeywords.optional } : undefined].filter(Boolean)}>\n {mode === 'split' && <Oas.Schema.Imports extName={plugin.options.extName} />}\n <File.Source>\n <OperationSchema description={description} keysToOmit={keysToOmit} />\n </File.Source>\n </Oas.Schema>\n )\n }\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n <File.Import name={['z']} path={plugin.options.importPath} />\n {items.map(mapItem)}\n </File>\n </Parser>\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Operations.tsx","../src/components/Schema.tsx","../../plugin-ts/src/plugin.ts","../../plugin-ts/src/OperationGenerator.tsx","../../plugin-ts/src/components/OasType.tsx","../../plugin-ts/src/components/OperationSchema.tsx","../../plugin-ts/src/SchemaGenerator.tsx","../../plugin-ts/src/components/Schema.tsx","../../plugin-ts/src/parser/index.ts","../src/parser/index.ts","../src/plugin.ts","../src/SchemaGenerator.tsx","../src/components/OperationSchema.tsx"],"sourcesContent":["import { useOperationManager, useOperations } from '@kubb/plugin-oas/hooks'\nimport { Const, File, Parser, useApp } from '@kubb/react'\n\nimport transformers from '@kubb/core/transformers'\nimport type { HttpMethod, Operation } from '@kubb/oas'\nimport type { KubbNode } from '@kubb/react'\nimport type { ComponentProps, ComponentType } from 'react'\nimport type { FileMeta, PluginZod } from '../types.ts'\n\ntype TemplateProps = {\n /**\n * Name of the function\n */\n operationsName: string\n /**\n * Name of the function\n */\n pathsName: string\n operations: Operation[]\n}\n\nfunction Template({ operationsName, pathsName, operations }: TemplateProps): KubbNode {\n const { groupSchemasByName } = useOperationManager()\n const transformedOperations = operations.map((operation) => ({ operation, data: groupSchemasByName(operation, { type: 'function' }) }))\n\n const operationsJSON = transformedOperations.reduce(\n (prev, acc) => {\n prev[`\"${acc.operation.getOperationId()}\"`] = acc.data\n\n return prev\n },\n {} as Record<string, unknown>,\n )\n\n const pathsJSON = transformedOperations.reduce(\n (prev, acc) => {\n prev[`\"${acc.operation.path}\"`] = {\n ...(prev[`\"${acc.operation.path}\"`] || ({} as Record<HttpMethod, string>)),\n [acc.operation.method]: `operations[\"${acc.operation.getOperationId()}\"]`,\n }\n\n return prev\n },\n {} as Record<string, Record<HttpMethod, string>>,\n )\n\n return (\n <>\n <Const export name={operationsName} asConst>\n {`{${transformers.stringifyObject(operationsJSON)}}`}\n </Const>\n <Const export name={pathsName} asConst>\n {`{${transformers.stringifyObject(pathsJSON)}}`}\n </Const>\n </>\n )\n}\n\ntype RootTemplateProps = {\n children?: React.ReactNode\n}\n\nfunction RootTemplate({ children }: RootTemplateProps) {\n const {\n mode,\n pluginManager,\n plugin: {\n key: pluginKey,\n options: { extName },\n },\n } = useApp<PluginZod>()\n const { getFile } = useOperationManager()\n const operations = useOperations()\n const { groupSchemasByName } = useOperationManager()\n const transformedOperations = operations.map((operation) => ({ operation, data: groupSchemasByName(operation, { type: 'function' }) }))\n\n const file = pluginManager.getFile({ name: 'operations', extName: '.ts', pluginKey })\n const imports = Object.entries(transformedOperations)\n .map(([_key, { data, operation }], index) => {\n const names = [data.request, ...Object.values(data.responses), ...Object.values(data.parameters)].filter(Boolean)\n\n return <File.Import key={index} extName={extName} name={names} root={file.path} path={getFile(operation).path} />\n })\n .filter(Boolean)\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta} exportable={false}>\n {mode === 'split' && imports}\n <File.Source>{children}</File.Source>\n </File>\n </Parser>\n )\n}\n\nconst defaultTemplates = { default: Template, root: RootTemplate } as const\n\ntype Templates = Partial<typeof defaultTemplates>\n\ntype Props = {\n /**\n * This will make it possible to override the default behaviour.\n */\n Template?: ComponentType<ComponentProps<typeof Template>>\n}\n\nexport function Operations({ Template = defaultTemplates.default }: Props): KubbNode {\n const operations = useOperations()\n\n return <Template operationsName=\"operations\" pathsName=\"paths\" operations={operations} />\n}\n\ntype FileProps = {\n /**\n * This will make it possible to override the default behaviour.\n */\n templates?: Templates\n}\n\nOperations.File = function (props: FileProps): KubbNode {\n const templates = { ...defaultTemplates, ...props.templates }\n\n const Template = templates.default\n const RootTemplate = templates.root\n\n return (\n <RootTemplate>\n <Operations Template={Template} />\n </RootTemplate>\n )\n}\n\nOperations.templates = defaultTemplates\n","import { Oas } from '@kubb/plugin-oas/components'\nimport { Const, File, Type, useApp, useFile } from '@kubb/react'\nimport { pluginTsName } from '@kubb/plugin-ts'\n\nimport transformers from '@kubb/core/transformers'\nimport { isKeyword, schemaKeywords } from '@kubb/plugin-oas'\nimport { useSchema } from '@kubb/plugin-oas/hooks'\nimport type { ReactNode } from 'react'\nimport * as parserZod from '../parser/index.ts'\nimport { pluginZodName } from '../plugin.ts'\nimport type { PluginZod } from '../types.ts'\n\ntype Props = {\n description?: string\n withTypeAnnotation?: boolean\n keysToOmit?: string[]\n}\n\nexport function Schema(props: Props): ReactNode {\n const { keysToOmit, withTypeAnnotation, description } = props\n const { tree, name } = useSchema()\n const {\n pluginManager,\n plugin: {\n options: { mapper, typedSchema, coercion },\n },\n } = useApp<PluginZod>()\n\n // all checks are also inside this.schema(React)\n const resolvedName = pluginManager.resolveName({\n name,\n pluginKey: [pluginZodName],\n type: 'function',\n })\n const resolvedTypeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginZodName],\n type: 'type',\n })\n\n const typeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n if (!tree.length) {\n return (\n <Const\n name={resolvedName}\n export\n JSDoc={{\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }}\n >\n undefined\n </Const>\n )\n }\n\n const hasTuple = tree.some((item) => isKeyword(item, schemaKeywords.tuple))\n\n const output = parserZod\n .sort(tree)\n .filter((item) => {\n if (hasTuple && (isKeyword(item, schemaKeywords.min) || isKeyword(item, schemaKeywords.max))) {\n return false\n }\n\n return true\n })\n .map((item) => parserZod.parse(undefined, item, { name, typeName, description, mapper, coercion, keysToOmit }))\n .filter(Boolean)\n .join('')\n\n const suffix = output.endsWith('.nullable()') ? '.unwrap().and' : '.and'\n\n return (\n <>\n <Const\n export\n name={resolvedName}\n JSDoc={{\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }}\n >\n {[\n output,\n keysToOmit?.length ? `${suffix}(z.object({ ${keysToOmit.map((key) => `${key}: z.never()`).join(',')} }))` : undefined,\n withTypeAnnotation && typeName ? ` as z.ZodType<${typeName}>` : '',\n ]\n .filter(Boolean)\n .join('') || ''}\n </Const>\n {typedSchema && (\n <Type export name={resolvedTypeName}>\n {`z.infer<typeof ${resolvedName}>`}\n </Type>\n )}\n </>\n )\n}\n\ntype FileProps = {}\n\nSchema.File = function ({}: FileProps): ReactNode {\n const {\n pluginManager,\n plugin: {\n options: { typed },\n },\n } = useApp<PluginZod>()\n const { schema } = useSchema()\n\n const withTypeAnnotation = !!typed\n\n return (\n <Oas.Schema.File output={pluginManager.config.output.path}>\n <Schema.Imports />\n <File.Source>\n <Schema withTypeAnnotation={withTypeAnnotation} description={schema?.description} />\n </File.Source>\n </Oas.Schema.File>\n )\n}\nSchema.Imports = (): ReactNode => {\n const {\n pluginManager,\n plugin: {\n options: { typed, importPath },\n },\n } = useApp<PluginZod>()\n const { path: root } = useFile()\n const { name, tree, schema } = useSchema()\n\n // used for this.options.typed\n const typeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n const typeFileName = pluginManager.resolveName({\n name: name,\n pluginKey: [pluginTsName],\n type: 'file',\n })\n\n const typePath = pluginManager.resolvePath({\n baseName: typeFileName,\n pluginKey: [pluginTsName],\n })\n\n const withTypeAnnotation = !!typed\n\n return (\n <>\n <File.Import name={['z']} path={importPath} />\n {withTypeAnnotation && typeName && typePath && <File.Import isTypeOnly root={root} path={typePath} name={[typeName]} />}\n </>\n )\n}\n","import path from 'node:path'\n\nimport { FileManager, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { pluginOasName } from '@kubb/plugin-oas'\n\nimport { OperationGenerator } from './OperationGenerator.tsx'\nimport { SchemaGenerator } from './SchemaGenerator.tsx'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport type { PluginTs } from './types.ts'\n\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\nexport const pluginTs = createPlugin<PluginTs>((options) => {\n const {\n output = { path: 'types' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumSuffix = '',\n dateType = 'string',\n unknownType = 'any',\n optionalType = 'questionToken',\n transformers = {},\n oasType = false,\n mapper = {},\n } = options\n const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`\n\n return {\n name: pluginTsName,\n options: {\n extName: output.extName,\n transformers,\n dateType,\n optionalType,\n oasType,\n enumType,\n enumSuffix,\n // keep the used enumnames between SchemaGenerator and OperationGenerator per plugin(pluginKey)\n usedEnumNames: {},\n unknownType,\n override,\n mapper,\n },\n pre: [pluginOasName],\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (options?.tag && group?.type === 'tag') {\n const tag = camelCase(options.tag)\n\n return path.resolve(root, renderTemplate(template, { tag }), baseName)\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n const resolvedName = pascalCase(name, { isFile: type === 'file' })\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n\n const schemaGenerator = new SchemaGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build()\n await this.addFile(...schemaFiles)\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const operationFiles = await operationGenerator.build()\n await this.addFile(...operationFiles)\n },\n async buildEnd() {\n if (this.config.output.write === false) {\n return\n }\n\n const root = path.resolve(this.config.root, this.config.output.path)\n\n await this.fileManager.addIndexes({\n root,\n output,\n meta: { pluginKey: this.plugin.key },\n logger: this.logger,\n })\n },\n }\n})\n","import { OperationGenerator as Generator } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { App, createRoot } from '@kubb/react'\n\nimport { OasType } from './components/OasType.tsx'\nimport { OperationSchema } from './components/OperationSchema.tsx'\n\nimport type { Operation } from '@kubb/oas'\nimport type { OperationMethodResult } from '@kubb/plugin-oas'\nimport type { FileMeta, PluginTs } from './types.ts'\n\nexport class OperationGenerator extends Generator<PluginTs['resolvedOptions'], PluginTs> {\n async all(operations: Operation[]): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n root.render(\n <App pluginManager={pluginManager} plugin={plugin} mode={mode}>\n <Oas oas={oas} operations={operations} generator={this}>\n {plugin.options.oasType && <OasType.File name=\"oas\" typeName=\"Oas\" />}\n </Oas>\n </App>,\n )\n\n return root.files\n }\n\n async operation(operation: Operation, options: PluginTs['resolvedOptions']): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n root.render(\n <App pluginManager={pluginManager} plugin={{ ...plugin, options }} mode={mode}>\n <Oas oas={oas} operations={[operation]} generator={this}>\n <Oas.Operation operation={operation}>\n <OperationSchema.File />\n </Oas.Operation>\n </Oas>\n </App>,\n )\n\n return root.files\n }\n}\n","import { Parser, File, Type, useApp } from '@kubb/react'\nimport { useOas } from '@kubb/plugin-oas/hooks'\n\nimport type { OasTypes } from '@kubb/oas'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginTs } from '../types.ts'\n\ntype TemplateProps = {\n /**\n * Name of the function\n */\n name: string\n typeName: string\n api: OasTypes.OASDocument\n}\n\nfunction Template({ name, typeName, api }: TemplateProps): ReactNode {\n return (\n <>\n {`export const ${name} = ${JSON.stringify(api, undefined, 2)} as const`}\n <br />\n <Type name={typeName} export>\n {`Infer<typeof ${name}>`}\n </Type>\n </>\n )\n}\n\nconst defaultTemplates = { default: Template } as const\n\ntype Props = {\n name: string\n typeName: string\n /**\n * This will make it possible to override the default behaviour.\n */\n Template?: React.ComponentType<React.ComponentProps<typeof Template>>\n}\n\nexport function OasType({ name, typeName, Template = defaultTemplates.default }: Props): ReactNode {\n const oas = useOas()\n\n return <Template name={name} typeName={typeName} api={oas.api} />\n}\n\ntype FileProps = {\n name: string\n typeName: string\n /**\n * This will make it possible to override the default behaviour.\n */\n templates?: typeof defaultTemplates\n}\n\nOasType.File = function ({ name, typeName, templates = defaultTemplates }: FileProps): ReactNode {\n const {\n pluginManager,\n plugin: { key: pluginKey },\n } = useApp<PluginTs>()\n const file = pluginManager.getFile({ name, extName: '.ts', pluginKey })\n\n const Template = templates.default\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n <File.Import name={['Infer']} path=\"@kubb/oas\" isTypeOnly />\n <File.Source>\n <OasType Template={Template} name={name} typeName={typeName} />\n </File.Source>\n </File>\n </Parser>\n )\n}\n\nOasType.templates = defaultTemplates\n","import transformers from '@kubb/core/transformers'\nimport { print } from '@kubb/parser-ts'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperation, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { File, Parser, useApp } from '@kubb/react'\n\nimport { SchemaGenerator } from '../SchemaGenerator.tsx'\n\nimport type { PluginManager } from '@kubb/core'\nimport type { Operation } from '@kubb/oas'\nimport type { ts } from '@kubb/parser-ts'\nimport type { OperationSchema as OperationSchemaType } from '@kubb/plugin-oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginTs } from '../types.ts'\nimport { Schema } from './Schema.tsx'\n\nfunction printCombinedSchema({\n name,\n operation,\n schemas,\n pluginManager,\n}: { name: string; operation: Operation; schemas: OperationSchemas; pluginManager: PluginManager }): string {\n const properties: Record<string, ts.TypeNode> = {}\n\n if (schemas.response) {\n const identifier = pluginManager.resolveName({\n name: schemas.response.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['response'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.request) {\n const identifier = pluginManager.resolveName({\n name: schemas.request.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['request'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.pathParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.pathParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['pathParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.queryParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.queryParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['queryParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.headerParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.headerParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['headerParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.errors) {\n properties['errors'] = factory.createUnionDeclaration({\n nodes: schemas.errors.map((error) => {\n const identifier = pluginManager.resolveName({\n name: error.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }),\n })!\n }\n\n const namespaceNode = factory.createTypeAliasDeclaration({\n name: operation.method === 'get' ? `${name}Query` : `${name}Mutation`,\n type: factory.createTypeLiteralNode(\n Object.keys(properties)\n .map((key) => {\n const type = properties[key]\n if (!type) {\n return undefined\n }\n\n return factory.createPropertySignature({\n name: transformers.pascalCase(key),\n type,\n })\n })\n .filter(Boolean),\n ),\n modifiers: [factory.modifiers.export],\n })\n\n return print(namespaceNode)\n}\n\ntype Props = {\n description?: string\n keysToOmit?: string[]\n}\n\nexport function OperationSchema({ keysToOmit, description }: Props): ReactNode {\n return <Schema keysToOmit={keysToOmit} description={description} />\n}\n\ntype FileProps = {}\n\nOperationSchema.File = function ({}: FileProps): ReactNode {\n const { pluginManager, plugin, mode, fileManager } = useApp<PluginTs>()\n const oas = useOas()\n const { getSchemas, getFile, getName } = useOperationManager()\n const operation = useOperation()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const factoryName = getName(operation, { type: 'type' })\n const generator = new SchemaGenerator(plugin.options, {\n oas,\n plugin,\n pluginManager,\n mode,\n override: plugin.options.override,\n })\n const items = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response].flat().filter(Boolean)\n\n const mapItem = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n const tree = generator.parse({ schema, name })\n\n return (\n <Oas.Schema key={i} name={name} value={schema} tree={tree}>\n {mode === 'split' && <Oas.Schema.Imports extName={plugin.options.extName} isTypeOnly />}\n <File.Source>\n <OperationSchema description={description} keysToOmit={keysToOmit} />\n </File.Source>\n </Oas.Schema>\n )\n }\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n {items.map(mapItem)}\n\n <File.Source>{printCombinedSchema({ name: factoryName, operation, schemas, pluginManager })}</File.Source>\n </File>\n </Parser>\n )\n}\n","import type { SchemaObject } from '@kubb/oas'\nimport { SchemaGenerator as Generator } from '@kubb/plugin-oas'\nimport type { SchemaMethodResult } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { App, createRoot } from '@kubb/react'\nimport { Schema } from './components/Schema.tsx'\nimport type { FileMeta, PluginTs } from './types.ts'\n\nexport class SchemaGenerator extends Generator<PluginTs['resolvedOptions'], PluginTs> {\n async schema(name: string, schema: SchemaObject, options: PluginTs['resolvedOptions']): SchemaMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode, output } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n const tree = this.parse({ schema, name })\n\n root.render(\n <App pluginManager={pluginManager} plugin={{ ...plugin, options }} mode={mode}>\n <Oas oas={oas}>\n <Oas.Schema name={name} value={schema} tree={tree}>\n <Schema.File />\n </Oas.Schema>\n </Oas>\n </App>,\n )\n\n return root.files\n }\n}\n","import { Oas } from '@kubb/plugin-oas/components'\nimport { File, useApp } from '@kubb/react'\n\nimport transformers from '@kubb/core/transformers'\nimport { print, type ts } from '@kubb/parser-ts'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { useSchema } from '@kubb/plugin-oas/hooks'\nimport type { ReactNode } from 'react'\nimport { parse, typeKeywordMapper } from '../parser/index.ts'\nimport { pluginTsName } from '../plugin.ts'\nimport type { PluginTs } from '../types.ts'\n\ntype Props = {\n description?: string\n keysToOmit?: string[]\n}\n\nexport function Schema(props: Props): ReactNode {\n const { keysToOmit, description } = props\n const { tree, name } = useSchema()\n const {\n pluginManager,\n plugin: {\n options: { mapper, enumType, optionalType },\n },\n } = useApp<PluginTs>()\n\n // all checks are also inside this.schema(React)\n const resolvedName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n const typeName = pluginManager.resolveName({\n name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n const nodes: ts.Node[] = []\n const extraNodes: ts.Node[] = []\n\n if (!tree.length) {\n return ''\n }\n\n const isNullish = tree.some((item) => item.keyword === schemaKeywords.nullish)\n const isNullable = tree.some((item) => item.keyword === schemaKeywords.nullable)\n const isOptional = tree.some((item) => item.keyword === schemaKeywords.optional)\n\n let type =\n (tree\n .map((schema) => parse(undefined, schema, { name: resolvedName, typeName, description, keysToOmit, optionalType, enumType, mapper }))\n .filter(Boolean)\n .at(0) as ts.TypeNode) || typeKeywordMapper.undefined()\n\n if (isNullable) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.null],\n }) as ts.TypeNode\n }\n\n if (isNullish && ['undefined', 'questionTokenAndUndefined'].includes(optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n if (isOptional && ['undefined', 'questionTokenAndUndefined'].includes(optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n const node = factory.createTypeAliasDeclaration({\n modifiers: [factory.modifiers.export],\n name: resolvedName,\n type: keysToOmit?.length\n ? factory.createOmitDeclaration({\n keys: keysToOmit,\n type,\n nonNullable: true,\n })\n : type,\n })\n\n const enumSchemas = SchemaGenerator.deepSearch(tree, schemaKeywords.enum)\n if (enumSchemas) {\n enumSchemas.forEach((enumSchema) => {\n extraNodes.push(\n ...factory.createEnumDeclaration({\n name: transformers.camelCase(enumSchema.args.name),\n typeName: enumSchema.args.typeName,\n enums: enumSchema.args.items\n .map((item) => (item.value === undefined ? undefined : [transformers.trimQuotes(item.name?.toString()), item.value]))\n .filter(Boolean) as unknown as [string, string][],\n type: enumType,\n }),\n )\n })\n }\n\n nodes.push(\n factory.appendJSDocToNode({\n node,\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }),\n )\n\n const filterdNodes = nodes.filter(\n (node: ts.Node) =>\n !extraNodes.some(\n (extraNode: ts.Node) => (extraNode as ts.TypeAliasDeclaration)?.name?.escapedText === (node as ts.TypeAliasDeclaration)?.name?.escapedText,\n ),\n )\n\n return print([...extraNodes, ...filterdNodes])\n}\n\ntype FileProps = {}\n\nSchema.File = function ({}: FileProps): ReactNode {\n const { pluginManager } = useApp<PluginTs>()\n const { schema } = useSchema()\n\n return (\n <Oas.Schema.File output={pluginManager.config.output.path}>\n <File.Source>\n <Schema description={schema?.description} />\n </File.Source>\n </Oas.Schema.File>\n )\n}\n","import transformers from '@kubb/core/transformers'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { isKeyword, schemaKeywords } from '@kubb/plugin-oas'\n\nimport type { ts } from '@kubb/parser-ts'\nimport type { Schema, SchemaKeywordMapper, SchemaMapper } from '@kubb/plugin-oas'\n\nexport const typeKeywordMapper = {\n any: () => factory.keywordTypeNodes.any,\n unknown: () => factory.keywordTypeNodes.unknown,\n number: () => factory.keywordTypeNodes.number,\n integer: () => factory.keywordTypeNodes.number,\n object: (nodes?: ts.TypeElement[]) => {\n if (!nodes || !nodes.length) {\n return factory.keywordTypeNodes.object\n }\n\n return factory.createTypeLiteralNode(nodes)\n },\n string: () => factory.keywordTypeNodes.string,\n boolean: () => factory.keywordTypeNodes.boolean,\n undefined: () => factory.keywordTypeNodes.undefined,\n nullable: undefined,\n null: () => factory.keywordTypeNodes.null,\n nullish: undefined,\n array: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createArrayDeclaration({ nodes })\n },\n tuple: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createTupleTypeNode(nodes)\n },\n enum: (name?: string) => {\n if (!name) {\n return undefined\n }\n\n return factory.createTypeReferenceNode(name, undefined)\n },\n union: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createUnionDeclaration({\n withParentheses: true,\n nodes,\n })\n },\n const: (name?: string | number, format?: 'string' | 'number') => {\n if (!name) {\n return undefined\n }\n\n if (format === 'number') {\n return factory.createLiteralTypeNode(factory.createNumericLiteral(name))\n }\n\n return factory.createLiteralTypeNode(factory.createStringLiteral(name.toString()))\n },\n datetime: () => factory.keywordTypeNodes.string,\n date: (type: 'date' | 'string' = 'string') =>\n type === 'string' ? factory.keywordTypeNodes.string : factory.createTypeReferenceNode(factory.createIdentifier('Date')),\n time: (type: 'date' | 'string' = 'string') =>\n type === 'string' ? factory.keywordTypeNodes.string : factory.createTypeReferenceNode(factory.createIdentifier('Date')),\n uuid: undefined,\n url: undefined,\n strict: undefined,\n default: undefined,\n and: (nodes?: ts.TypeNode[]) => {\n if (!nodes) {\n return undefined\n }\n\n return factory.createIntersectionDeclaration({\n withParentheses: true,\n nodes,\n })\n },\n describe: undefined,\n min: undefined,\n max: undefined,\n optional: undefined,\n matches: undefined,\n email: undefined,\n firstName: undefined,\n lastName: undefined,\n password: undefined,\n phone: undefined,\n readOnly: undefined,\n ref: (propertyName?: string) => {\n if (!propertyName) {\n return undefined\n }\n\n return factory.createTypeReferenceNode(propertyName, undefined)\n },\n blob: () => factory.createTypeReferenceNode('Blob', []),\n deprecated: undefined,\n example: undefined,\n schema: undefined,\n catchall: undefined,\n name: undefined,\n} satisfies SchemaMapper<ts.Node | null | undefined>\n\ntype ParserOptions = {\n name: string\n typeName?: string\n description?: string\n /**\n * @default `'questionToken'`\n */\n optionalType: 'questionToken' | 'undefined' | 'questionTokenAndUndefined'\n /**\n * @default `'asConst'`\n */\n enumType: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal'\n keysToOmit?: string[]\n mapper?: Record<string, ts.PropertySignature>\n}\n\nexport function parse(parent: Schema | undefined, current: Schema, options: ParserOptions): ts.Node | null | undefined {\n const value = typeKeywordMapper[current.keyword as keyof typeof typeKeywordMapper]\n\n if (!value) {\n return undefined\n }\n\n if (isKeyword(current, schemaKeywords.union)) {\n return typeKeywordMapper.union(current.args.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.and)) {\n return typeKeywordMapper.and(current.args.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.array)) {\n return typeKeywordMapper.array(current.args.items.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.enum)) {\n return typeKeywordMapper.enum(current.args.typeName)\n }\n\n if (isKeyword(current, schemaKeywords.ref)) {\n return typeKeywordMapper.ref(current.args.name)\n }\n\n if (isKeyword(current, schemaKeywords.blob)) {\n return value()\n }\n\n if (isKeyword(current, schemaKeywords.tuple)) {\n return typeKeywordMapper.tuple(current.args.items.map((schema) => parse(current, schema, options)).filter(Boolean) as ts.TypeNode[])\n }\n\n if (isKeyword(current, schemaKeywords.const)) {\n return typeKeywordMapper.const(current.args.name, current.args.format)\n }\n\n if (isKeyword(current, schemaKeywords.object)) {\n const properties = Object.entries(current.args?.properties || {})\n .filter((item) => {\n const schemas = item[1]\n return schemas && typeof schemas.map === 'function'\n })\n .map(([name, schemas]) => {\n const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']\n const mappedName = nameSchema?.args || name\n\n // custom mapper(pluginOptions)\n if (options.mapper?.[mappedName]) {\n return options.mapper?.[mappedName]\n }\n\n const isNullish = schemas.some((schema) => schema.keyword === schemaKeywords.nullish)\n const isNullable = schemas.some((schema) => schema.keyword === schemaKeywords.nullable)\n const isOptional = schemas.some((schema) => schema.keyword === schemaKeywords.optional)\n const isReadonly = schemas.some((schema) => schema.keyword === schemaKeywords.readOnly)\n const describeSchema = schemas.find((schema) => schema.keyword === schemaKeywords.describe) as SchemaKeywordMapper['describe'] | undefined\n const deprecatedSchema = schemas.find((schema) => schema.keyword === schemaKeywords.deprecated) as SchemaKeywordMapper['deprecated'] | undefined\n const defaultSchema = schemas.find((schema) => schema.keyword === schemaKeywords.default) as SchemaKeywordMapper['default'] | undefined\n const exampleSchema = schemas.find((schema) => schema.keyword === schemaKeywords.example) as SchemaKeywordMapper['example'] | undefined\n const schemaSchema = schemas.find((schema) => schema.keyword === schemaKeywords.schema) as SchemaKeywordMapper['schema'] | undefined\n\n let type = schemas.map((schema) => parse(current, schema, options)).filter(Boolean)[0] as ts.TypeNode\n\n if (isNullable) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.null],\n }) as ts.TypeNode\n }\n\n if (isNullish && ['undefined', 'questionTokenAndUndefined'].includes(options.optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n if (isOptional && ['undefined', 'questionTokenAndUndefined'].includes(options.optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n const propertySignature = factory.createPropertySignature({\n questionToken: isOptional || isNullish ? ['questionToken', 'questionTokenAndUndefined'].includes(options.optionalType as string) : false,\n name: mappedName,\n type,\n readOnly: isReadonly,\n })\n\n return factory.appendJSDocToNode({\n node: propertySignature,\n comments: [\n describeSchema ? `@description ${transformers.jsStringEscape(describeSchema.args)}` : undefined,\n deprecatedSchema ? '@deprecated' : undefined,\n defaultSchema ? `@default ${defaultSchema.args}` : undefined,\n exampleSchema ? `@example ${exampleSchema.args}` : undefined,\n schemaSchema?.args?.type || schemaSchema?.args?.format\n ? [`@type ${schemaSchema?.args?.type || 'unknown'}${!isOptional ? '' : ' | undefined'}`, schemaSchema?.args?.format].filter(Boolean).join(', ')\n : undefined,\n ].filter(Boolean),\n })\n })\n\n const additionalProperties = current.args?.additionalProperties?.length\n ? factory.createIndexSignature(\n current.args.additionalProperties\n .map((schema) => parse(current, schema, options))\n .filter(Boolean)\n .at(0) as ts.TypeNode,\n )\n : undefined\n\n return typeKeywordMapper.object([...properties, additionalProperties].filter(Boolean))\n }\n\n if (isKeyword(current, schemaKeywords.datetime)) {\n return typeKeywordMapper.datetime()\n }\n\n if (isKeyword(current, schemaKeywords.date)) {\n return typeKeywordMapper.date(current.args.type)\n }\n\n if (isKeyword(current, schemaKeywords.time)) {\n return typeKeywordMapper.time(current.args.type)\n }\n\n if (current.keyword in typeKeywordMapper) {\n return value()\n }\n\n return undefined\n}\n","import transformers, { createJSDocBlockText } from '@kubb/core/transformers'\nimport { type SchemaKeywordMapper, isKeyword, schemaKeywords } from '@kubb/plugin-oas'\n\nimport type { Schema, SchemaKeywordBase, SchemaMapper } from '@kubb/plugin-oas'\n\nexport const zodKeywordMapper = {\n any: () => 'z.any()',\n unknown: () => 'z.unknown()',\n number: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.number()' : 'z.number()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n integer: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.number()' : 'z.number()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n object: (value?: string) => `z.object({${value}})`,\n string: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.string()' : 'z.string()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n boolean: () => 'z.boolean()',\n undefined: () => 'z.undefined()',\n nullable: () => '.nullable()',\n null: () => 'z.null()',\n nullish: () => '.nullish()',\n array: (items: string[] = [], min?: number, max?: number) => {\n return [`z.array(${items?.join('')})`, min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n tuple: (items: string[] = []) => `z.tuple([${items?.join(', ')}])`,\n enum: (items: string[] = []) => `z.enum([${items?.join(', ')}])`,\n union: (items: string[] = []) => `z.union([${items?.join(', ')}])`,\n const: (value?: string | number) => `z.literal(${value ?? ''})`,\n /**\n * ISO 8601\n */\n datetime: (offset = false, local = false) => {\n if (offset) {\n return `z.string().datetime({ offset: ${offset} })`\n }\n\n if (local) {\n return `z.string().datetime({ local: ${local} })`\n }\n\n return 'z.string().datetime()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO date format (YYYY-MM-DD)\n * @default ISO date format (YYYY-MM-DD)\n */\n date: (type: 'date' | 'string' = 'string', coercion?: boolean) => {\n if (type === 'string') {\n return 'z.string().date()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO time format (HH:mm:ss[.SSSSSS])\n * @default ISO time format (HH:mm:ss[.SSSSSS])\n */\n time: (type: 'date' | 'string' = 'string', coercion?: boolean) => {\n if (type === 'string') {\n return 'z.string().time()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n uuid: () => '.uuid()',\n url: () => '.url()',\n strict: () => '.strict()',\n default: (value?: string | number | true) => `.default(${value ?? ''})`,\n and: (items: string[] = []) => items?.map((item) => `.and(${item})`).join(''),\n describe: (value = '') => `.describe(${value})`,\n min: (value?: number) => `.min(${value ?? ''})`,\n max: (value?: number) => `.max(${value ?? ''})`,\n optional: () => '.optional()',\n matches: (value = '') => `.regex(${value})`,\n email: () => '.email()',\n firstName: undefined,\n lastName: undefined,\n password: undefined,\n phone: undefined,\n readOnly: undefined,\n ref: (value?: string) => (value ? `z.lazy(() => ${value})` : undefined),\n blob: () => 'z.string()',\n deprecated: undefined,\n example: undefined,\n schema: undefined,\n catchall: (value?: string) => (value ? `.catchall(${value})` : undefined),\n name: undefined,\n} satisfies SchemaMapper<string | null | undefined>\n\n/**\n * @link based on https://github.com/cellular/oazapfts/blob/7ba226ebb15374e8483cc53e7532f1663179a22c/src/codegen/generate.ts#L398\n */\n\nexport function sort(items?: Schema[]): Schema[] {\n const order: string[] = [\n schemaKeywords.string,\n schemaKeywords.datetime,\n schemaKeywords.date,\n schemaKeywords.time,\n schemaKeywords.tuple,\n schemaKeywords.number,\n schemaKeywords.object,\n schemaKeywords.enum,\n schemaKeywords.url,\n schemaKeywords.email,\n schemaKeywords.firstName,\n schemaKeywords.lastName,\n schemaKeywords.password,\n schemaKeywords.matches,\n schemaKeywords.uuid,\n schemaKeywords.min,\n schemaKeywords.max,\n schemaKeywords.default,\n schemaKeywords.describe,\n schemaKeywords.optional,\n schemaKeywords.nullable,\n schemaKeywords.nullish,\n schemaKeywords.null,\n ]\n\n if (!items) {\n return []\n }\n\n return transformers.orderBy(items, [(v) => order.indexOf(v.keyword)], ['asc'])\n}\n\ntype ParserOptions = {\n name: string\n typeName?: string\n description?: string\n\n keysToOmit?: string[]\n mapper?: Record<string, string>\n coercion?: boolean\n}\n\nexport function parse(parent: Schema | undefined, current: Schema, options: ParserOptions): string | undefined {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper]\n\n if (!value) {\n return undefined\n }\n\n if (isKeyword(current, schemaKeywords.union)) {\n // zod union type needs at least 2 items\n if (Array.isArray(current.args) && current.args.length === 1) {\n return parse(parent, current.args[0] as Schema, options)\n }\n if (Array.isArray(current.args) && !current.args.length) {\n return ''\n }\n\n return zodKeywordMapper.union(\n sort(current.args)\n .map((schema) => parse(current, schema, options))\n .filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.and)) {\n const items = sort(current.args)\n .filter((schema: Schema) => {\n return ![schemaKeywords.optional, schemaKeywords.describe].includes(schema.keyword as typeof schemaKeywords.describe)\n })\n .map((schema: Schema) => parse(current, schema, options))\n .filter(Boolean)\n\n return `${items.slice(0, 1)}${zodKeywordMapper.and(items.slice(1))}`\n }\n\n if (isKeyword(current, schemaKeywords.array)) {\n return zodKeywordMapper.array(\n sort(current.args.items)\n .map((schemas) => parse(current, schemas, options))\n .filter(Boolean),\n current.args.min,\n current.args.max,\n )\n }\n\n if (isKeyword(current, schemaKeywords.enum)) {\n if (current.args.asConst) {\n return zodKeywordMapper.union(\n current.args.items\n .map((schema) => {\n return parse(\n current,\n {\n keyword: schemaKeywords.const,\n args: schema,\n },\n options,\n )\n })\n .filter(Boolean),\n )\n }\n\n return zodKeywordMapper.enum(\n current.args.items.map((schema) => {\n if (schema.format === 'number') {\n return transformers.stringify(schema.value)\n }\n return transformers.stringify(schema.value)\n }),\n )\n }\n\n if (isKeyword(current, schemaKeywords.ref)) {\n return zodKeywordMapper.ref(current.args?.name)\n }\n\n if (isKeyword(current, schemaKeywords.object)) {\n const properties = Object.entries(current.args?.properties || {})\n .filter((item) => {\n const schema = item[1]\n return schema && typeof schema.map === 'function'\n })\n .map(([name, schemas]) => {\n const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']\n const mappedName = nameSchema?.args || name\n\n // custom mapper(pluginOptions)\n if (options.mapper?.[mappedName]) {\n return `\"${name}\": ${options.mapper?.[mappedName]}`\n }\n\n return `\"${name}\": ${sort(schemas)\n .map((schema, array) => {\n return parse(current, schema, options)\n })\n .filter(Boolean)\n .join('')}`\n })\n .join(',')\n\n const additionalProperties = current.args?.additionalProperties?.length\n ? current.args.additionalProperties\n .map((schema) => parse(current, schema, options))\n .filter(Boolean)\n .at(0)\n : undefined\n\n const text = [\n zodKeywordMapper.object(properties),\n current.args?.strict ? zodKeywordMapper.strict() : undefined,\n additionalProperties ? zodKeywordMapper.catchall(additionalProperties) : undefined,\n ].filter(Boolean)\n\n return text.join('')\n }\n\n if (isKeyword(current, schemaKeywords.tuple)) {\n return zodKeywordMapper.tuple(\n sort(current.args.items)\n .map((schema) => parse(current, schema, options))\n .filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.const)) {\n if (current.args.format === 'number' && current.args.value !== undefined) {\n return zodKeywordMapper.const(Number.parseInt(current.args.value?.toString()))\n }\n return zodKeywordMapper.const(transformers.stringify(current.args.value))\n }\n\n if (isKeyword(current, schemaKeywords.matches)) {\n if (current.args) {\n return zodKeywordMapper.matches(transformers.toRegExpString(current.args))\n }\n }\n\n if (isKeyword(current, schemaKeywords.default)) {\n if (current.args) {\n return zodKeywordMapper.default(current.args)\n }\n }\n\n if (isKeyword(current, schemaKeywords.describe)) {\n if (current.args) {\n return zodKeywordMapper.describe(transformers.stringify(current.args.toString()))\n }\n }\n\n if (isKeyword(current, schemaKeywords.string)) {\n return zodKeywordMapper.string(options.coercion)\n }\n\n if (isKeyword(current, schemaKeywords.number) || isKeyword(current, schemaKeywords.integer)) {\n return zodKeywordMapper.number(options.coercion)\n }\n\n if (isKeyword(current, schemaKeywords.min)) {\n return zodKeywordMapper.min(current.args)\n }\n if (isKeyword(current, schemaKeywords.max)) {\n return zodKeywordMapper.max(current.args)\n }\n\n if (isKeyword(current, schemaKeywords.datetime)) {\n return zodKeywordMapper.datetime(current.args.offset, current.args.local)\n }\n\n if (isKeyword(current, schemaKeywords.date)) {\n return zodKeywordMapper.date(current.args.type, options.coercion)\n }\n\n if (isKeyword(current, schemaKeywords.time)) {\n return zodKeywordMapper.time(current.args.type, options.coercion)\n }\n\n if (current.keyword in zodKeywordMapper && 'args' in current) {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper] as (typeof zodKeywordMapper)['const']\n\n return value((current as SchemaKeywordBase<unknown>).args as any)\n }\n\n if (current.keyword in zodKeywordMapper) {\n return value()\n }\n\n return undefined\n}\n","import path from 'node:path'\n\nimport { FileManager, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { OperationGenerator, pluginOasName, SchemaGenerator } from '@kubb/plugin-oas'\nimport { getGroupedByTagFiles } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { Operations } from './components/Operations.tsx'\nimport type { PluginZod } from './types.ts'\nimport { zodParser } from './SchemaGenerator.tsx'\n\nexport const pluginZodName = 'plugin-zod' satisfies PluginZod['name']\n\nexport const pluginZod = createPlugin<PluginZod>((options) => {\n const {\n output = { path: 'zod' },\n group,\n exclude = [],\n include,\n override = [],\n transformers = {},\n dateType = 'string',\n unknownType = 'any',\n typed = false,\n typedSchema = false,\n mapper = {},\n templates,\n importPath = 'zod',\n coercion = false,\n } = options\n const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`\n\n return {\n name: pluginZodName,\n options: {\n extName: output.extName,\n transformers,\n include,\n exclude,\n override,\n typed,\n typedSchema,\n dateType,\n unknownType,\n mapper,\n importPath,\n coercion,\n templates: {\n operations: Operations.templates,\n ...templates,\n },\n },\n pre: [pluginOasName, typed ? pluginTsName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (options?.tag && group?.type === 'tag') {\n const tag = camelCase(options.tag)\n\n return path.resolve(root, renderTemplate(template, { tag }), baseName)\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n let resolvedName = camelCase(name, {\n suffix: type ? 'schema' : undefined,\n isFile: type === 'file',\n })\n\n if (type === 'type') {\n resolvedName = pascalCase(resolvedName)\n }\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n\n const schemaGenerator = new SchemaGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build(zodParser)\n await this.addFile(...schemaFiles)\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const operationFiles = await operationGenerator.build(zodParser)\n await this.addFile(...operationFiles)\n },\n async buildEnd() {\n if (this.config.output.write === false) {\n return\n }\n\n const root = path.resolve(this.config.root, this.config.output.path)\n\n if (group?.type === 'tag') {\n const rootFiles = await getGroupedByTagFiles({\n logger: this.logger,\n files: this.fileManager.files,\n plugin: this.plugin,\n template,\n exportAs: group.exportAs || '{{tag}}Schemas',\n root,\n output,\n })\n\n await this.addFile(...rootFiles)\n }\n\n await this.fileManager.addIndexes({\n root,\n output,\n meta: { pluginKey: this.plugin.key },\n logger: this.logger,\n })\n },\n }\n})\n","import { createReactParser } from '@kubb/plugin-oas'\nimport { Schema } from './components/Schema.tsx'\nimport type { PluginZod } from './types.ts'\nimport { Operations } from './components/Operations.tsx'\nimport { OperationSchema } from './components/OperationSchema.tsx'\n\nexport const zodParser = createReactParser<PluginZod>({\n name: 'plugin-zod',\n Operations({ options }) {\n if (!options.templates.operations) {\n return null\n }\n\n return <Operations.File templates={options.templates.operations} />\n },\n Operation() {\n return <OperationSchema.File />\n },\n Schema({ schema, name }) {\n return <Schema.File />\n },\n})\n","import { SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperation, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { File, Parser, useApp } from '@kubb/react'\n\nimport type { OperationSchema as OperationSchemaType } from '@kubb/plugin-oas'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginZod } from '../types.ts'\nimport { Schema } from './Schema.tsx'\n\ntype Props = {\n description?: string\n keysToOmit?: string[]\n}\n\nexport function OperationSchema({ description, keysToOmit }: Props): ReactNode {\n return <Schema keysToOmit={keysToOmit} withTypeAnnotation={false} description={description} />\n}\n\ntype FileProps = {}\n\nOperationSchema.File = function ({}: FileProps): ReactNode {\n const { pluginManager, plugin, mode } = useApp<PluginZod>()\n const { getSchemas, getFile } = useOperationManager()\n const oas = useOas()\n const operation = useOperation()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const generator = new SchemaGenerator(plugin.options, {\n oas,\n plugin,\n pluginManager,\n mode,\n override: plugin.options.override,\n })\n\n const items = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response].flat().filter(Boolean)\n\n const mapItem = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n // hack so Params can be optional when needed\n const required = Array.isArray(schema?.required) ? !!schema.required.length : !!schema?.required\n const optional = !required && !!name.includes('Params')\n const tree = generator.parse({ schema, name })\n\n return (\n <Oas.Schema key={i} name={name} value={schema} tree={[...tree, optional ? { keyword: schemaKeywords.optional } : undefined].filter(Boolean)}>\n {mode === 'split' && <Oas.Schema.Imports extName={plugin.options.extName} />}\n <File.Source>\n <OperationSchema description={description} keysToOmit={keysToOmit} />\n </File.Source>\n </Oas.Schema>\n )\n }\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n <File.Import name={['z']} path={plugin.options.importPath} />\n {items.map(mapItem)}\n </File>\n </Parser>\n )\n}\n"],"mappings":";AAAA,SAAS,qBAAqB,qBAAqB;AACnD,SAAS,OAAO,MAAM,QAAQ,cAAc;AAE5C,OAAO,kBAAkB;AA4CrB,mBACE,KADF;AA1BJ,SAAS,SAAS,EAAE,gBAAgB,WAAW,WAAW,GAA4B;AACpF,QAAM,EAAE,mBAAmB,IAAI,oBAAoB;AACnD,QAAM,wBAAwB,WAAW,IAAI,CAAC,eAAe,EAAE,WAAW,MAAM,mBAAmB,WAAW,EAAE,MAAM,WAAW,CAAC,EAAE,EAAE;AAEtI,QAAM,iBAAiB,sBAAsB;AAAA,IAC3C,CAAC,MAAM,QAAQ;AACb,WAAK,IAAI,IAAI,UAAU,eAAe,CAAC,GAAG,IAAI,IAAI;AAElD,aAAO;AAAA,IACT;AAAA,IACA,CAAC;AAAA,EACH;AAEA,QAAM,YAAY,sBAAsB;AAAA,IACtC,CAAC,MAAM,QAAQ;AACb,WAAK,IAAI,IAAI,UAAU,IAAI,GAAG,IAAI;AAAA,QAChC,GAAI,KAAK,IAAI,IAAI,UAAU,IAAI,GAAG,KAAM,CAAC;AAAA,QACzC,CAAC,IAAI,UAAU,MAAM,GAAG,eAAe,IAAI,UAAU,eAAe,CAAC;AAAA,MACvE;AAEA,aAAO;AAAA,IACT;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SACE,iCACE;AAAA,wBAAC,SAAM,QAAM,MAAC,MAAM,gBAAgB,SAAO,MACxC,cAAI,aAAa,gBAAgB,cAAc,CAAC,KACnD;AAAA,IACA,oBAAC,SAAM,QAAM,MAAC,MAAM,WAAW,SAAO,MACnC,cAAI,aAAa,gBAAgB,SAAS,CAAC,KAC9C;AAAA,KACF;AAEJ;AAMA,SAAS,aAAa,EAAE,SAAS,GAAsB;AACrD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AC,CAAC;AAE7B,SACE,gBAAAF,MAAAF,WAAA,EACE;AAAA,oBAAAC,KAACY,MAAK,QAAL,EAAY,MAAM,CAAC,GAAG,GAAG,MAAM,YAAY;AAAA,IAC3C,sBAAsB,YAAY,YAAY,gBAAAZ,KAACY,MAAK,QAAL,EAAY,YAAU,MAAC,MAAY,MAAM,UAAU,MAAM,CAAC,QAAQ,GAAG;AAAA,KACvH;AAEJ;","names":["Template","RootTemplate","Oas","Const","File","Type","useApp","Generator","Oas","App","createRoot","Parser","File","useApp","Fragment","jsx","jsxs","Template","defaultTemplates","transformers","print","factory","Oas","useOas","useOperationManager","File","Parser","useApp","Oas","File","useApp","transformers","factory","schemaKeywords","transformers","jsx","useApp","schemaKeywords","transformers","node","File","jsx","SchemaGenerator","Oas","jsx","jsxs","transformers","print","useApp","useOas","useOperationManager","SchemaGenerator","Oas","File","Parser","jsx","Generator","createRoot","App","Oas","transformers","options","SchemaGenerator","transformers","isKeyword","schemaKeywords","useSchema","transformers","isKeyword","schemaKeywords","parse","value","path","FileManager","PluginManager","createPlugin","camelCase","pascalCase","renderTemplate","OperationGenerator","pluginOasName","SchemaGenerator","SchemaGenerator","schemaKeywords","Oas","useOas","useOperation","useOperationManager","File","Parser","useApp","jsx","jsxs","OperationSchema","Schema","useApp","useOperationManager","useOas","useOperation","SchemaGenerator","Oas","schemaKeywords","File","Parser","jsx","OperationSchema","Schema","createPlugin","transformers","pluginOasName","options","path","FileManager","camelCase","renderTemplate","pascalCase","PluginManager","SchemaGenerator","OperationGenerator","Fragment","jsx","jsxs","Schema","useSchema","useApp","Const","transformers","isKeyword","schemaKeywords","parse","Type","Oas","File"]}
|