@kubb/plugin-ts 3.6.0 → 3.6.2
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-4SOGPJKA.cjs → chunk-HODPITUW.cjs} +21 -21
- package/dist/{chunk-4SOGPJKA.cjs.map → chunk-HODPITUW.cjs.map} +1 -1
- package/dist/{chunk-BORNH5HV.cjs → chunk-ISG4ADLH.cjs} +93 -99
- package/dist/chunk-ISG4ADLH.cjs.map +1 -0
- package/dist/{chunk-6TOW4T6P.js → chunk-PM4CWXK4.js} +18 -18
- package/dist/{chunk-6TOW4T6P.js.map → chunk-PM4CWXK4.js.map} +1 -1
- package/dist/{chunk-ULWNGDG4.js → chunk-WBVEQ3D4.js} +93 -99
- package/dist/chunk-WBVEQ3D4.js.map +1 -0
- package/dist/components.cjs +3 -3
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/generators.cjs +4 -4
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{types-BJ5UjIUu.d.cts → types-DOx63BPA.d.cts} +3 -3
- package/dist/{types-BJ5UjIUu.d.ts → types-DOx63BPA.d.ts} +3 -3
- package/package.json +11 -11
- package/src/generators/__snapshots__/createPet.ts +7 -2
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +7 -2
- package/src/generators/__snapshots__/createPetWithUnknownTypeVoid.ts +38 -0
- package/src/generators/__snapshots__/enumArray.ts +2 -14
- package/src/generators/__snapshots__/enumArray20.ts +15 -0
- package/src/parser.ts +1 -0
- package/src/types.ts +1 -1
- package/dist/chunk-BORNH5HV.cjs.map +0 -1
- package/dist/chunk-ULWNGDG4.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/generators/index.ts","../src/generators/typeGenerator.tsx","../src/index.ts","../src/plugin.ts","../src/generators/oasGenerator.tsx"],"names":["transformers","options","SchemaGenerator","type","createReactGenerator","useApp","useOas","jsxs","File","getBanner","getFooter","jsx"],"mappings":";;;;;;;;;;;;;;AAAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAWO,IAAM,YAAe,GAAA;AAEf,IAAA,QAAA,GAAW,YAAuB,CAAA,CAAC,OAAY,KAAA;AAC1D,EAAM,MAAA;AAAA,IACJ,MAAS,GAAA,EAAE,IAAM,EAAA,OAAA,EAAS,YAAY,OAAQ,EAAA;AAAA,IAC9C,KAAA;AAAA,IACA,UAAU,EAAC;AAAA,IACX,OAAA;AAAA,IACA,WAAW,EAAC;AAAA,IACZ,QAAW,GAAA,SAAA;AAAA,IACX,UAAa,GAAA,MAAA;AAAA,IACb,QAAW,GAAA,QAAA;AAAA,IACX,WAAc,GAAA,KAAA;AAAA,IACd,YAAe,GAAA,eAAA;AAAA,IACf,UAAa,GAAA,MAAA;AAAA,IACb,YAAA,EAAAA,gBAAe,EAAC;AAAA,IAChB,OAAU,GAAA,KAAA;AAAA,IACV,SAAS,EAAC;AAAA,IACV,UAAA,GAAa,CAAC,aAAe,EAAA,OAAA,KAAY,UAAU,YAAe,GAAA,SAAS,CAAE,CAAA,MAAA,CAAO,OAAO,CAAA;AAAA,IAC3F;AAAA,GACE,GAAA,OAAA;AAEJ,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,YAAA;AAAA,IACN,OAAS,EAAA;AAAA,MACP,MAAA;AAAA,MACA,YAAAA,EAAAA,aAAAA;AAAA,MACA,QAAA;AAAA,MACA,YAAA;AAAA,MACA,OAAA;AAAA,MACA,QAAA;AAAA,MACA,UAAA;AAAA;AAAA,MAEA,eAAe,EAAC;AAAA,MAChB,WAAA;AAAA,MACA,UAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MAC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O,QAAU,EAAA,KAAA,EAAO,GAAK,EAAA,GAAA,CAAI,GAAK,EAAA;AAAA,KACvD,EAAA,CAAA;AAAA;AAGN,CAAC","file":"chunk-6TOW4T6P.js","sourcesContent":["export { typeGenerator } from './typeGenerator.tsx'\nexport { oasGenerator } from './oasGenerator.tsx'\n","import type { PluginManager } from '@kubb/core'\nimport transformers from '@kubb/core/transformers'\nimport { print } from '@kubb/parser-ts'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { type OperationSchema as OperationSchemaType, type OperationSchemas, SchemaGenerator, createReactGenerator } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperationManager, useSchemaManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, useApp } from '@kubb/react'\nimport type ts from 'typescript'\nimport { Type } from '../components'\nimport type { PluginTs } from '../types'\n\nfunction printCombinedSchema({ name, schemas, pluginManager }: { name: string; schemas: OperationSchemas; pluginManager: PluginManager }): string {\n const properties: Record<string, ts.TypeNode> = {}\n\n if (schemas.response) {\n properties['response'] = factory.createUnionDeclaration({\n nodes: schemas.responses.map((res) => {\n const identifier = pluginManager.resolveName({\n name: res.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }),\n })!\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,\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\nexport const typeGenerator = createReactGenerator<PluginTs>({\n name: 'typescript',\n Operation({ operation, options }) {\n const { mapper, enumType, syntaxType, optionalType } = options\n\n const { plugin, pluginManager, mode } = useApp<PluginTs>()\n const oas = useOas()\n const { getSchemas, getFile, getName, getGroup } = useOperationManager()\n const schemaManager = useSchemaManager()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const type = getName(operation, { type: 'function', pluginKey: [pluginTsName] })\n const combinedSchemaName = operation.method === 'get' ? `${type}Query` : `${type}Mutation`\n const schemaGenerator = new SchemaGenerator(options, {\n oas,\n plugin,\n pluginManager,\n mode,\n override: options.override,\n })\n\n const operationSchemas = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response]\n .flat()\n .filter(Boolean)\n\n const mapOperationSchema = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n const tree = schemaGenerator.parse({ schema, name })\n const imports = schemaManager.getImports(tree)\n const group = options.operation ? getGroup(options.operation) : undefined\n\n const type = {\n name: schemaManager.getName(name, { type: 'type' }),\n typedName: schemaManager.getName(name, { type: 'type' }),\n file: schemaManager.getFile(options.operationName || name, { group }),\n }\n\n return (\n <Oas.Schema key={i} name={name} value={schema} tree={tree}>\n {mode === 'split' && imports.map((imp, index) => <File.Import key={index} root={file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={type.name}\n typedName={type.typedName}\n description={description}\n tree={tree}\n schema={schema}\n mapper={mapper}\n enumType={enumType}\n optionalType={optionalType}\n keysToOmit={keysToOmit}\n syntaxType={syntaxType}\n />\n </Oas.Schema>\n )\n }\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: plugin.options.output })}\n footer={getFooter({ oas, output: plugin.options.output })}\n >\n {operationSchemas.map(mapOperationSchema)}\n\n <File.Source name={combinedSchemaName} isExportable isIndexable isTypeOnly>\n {printCombinedSchema({ name: combinedSchemaName, schemas, pluginManager })}\n </File.Source>\n </File>\n )\n },\n Schema({ schema, options }) {\n const { mapper, enumType, syntaxType, optionalType } = options\n const {\n mode,\n plugin: {\n options: { output },\n },\n } = useApp<PluginTs>()\n const oas = useOas()\n\n const { getName, getImports, getFile } = useSchemaManager()\n const imports = getImports(schema.tree)\n\n if (enumType === 'asPascalConst') {\n console.warn(`enumType '${enumType}' is deprecated`)\n }\n\n const type = {\n name: getName(schema.name, { type: 'function' }),\n typedName: getName(schema.name, { type: 'type' }),\n file: getFile(schema.name),\n }\n\n return (\n <File baseName={type.file.baseName} path={type.file.path} meta={type.file.meta} banner={getBanner({ oas, output })} footer={getFooter({ oas, output })}>\n {mode === 'split' && imports.map((imp, index) => <File.Import key={index} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={type.name}\n typedName={type.typedName}\n description={schema.value.description}\n tree={schema.tree}\n schema={schema.value}\n mapper={mapper}\n enumType={enumType}\n optionalType={optionalType}\n syntaxType={syntaxType}\n />\n </File>\n )\n },\n})\n","export { pluginTs, pluginTsName } from './plugin.ts'\nexport type { PluginTs } from './types.ts'\n","import path from 'node:path'\n\nimport { FileManager, type Group, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { OperationGenerator, SchemaGenerator, pluginOasName } from '@kubb/plugin-oas'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { oasGenerator, typeGenerator } from './generators'\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', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumSuffix = 'enum',\n dateType = 'string',\n unknownType = 'any',\n optionalType = 'questionToken',\n syntaxType = 'type',\n transformers = {},\n oasType = false,\n mapper = {},\n generators = [typeGenerator, oasType === 'infer' ? oasGenerator : undefined].filter(Boolean),\n contentType,\n } = options\n\n return {\n name: pluginTsName,\n options: {\n output,\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 syntaxType,\n group,\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 (group && (options?.group?.path || options?.group?.tag)) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n }\n\n return path.resolve(\n root,\n output.path,\n groupName({\n group: group.type === 'path' ? options.group.path! : options.group.tag!,\n }),\n baseName,\n )\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,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build(...generators)\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,\n exclude,\n include,\n override,\n mode,\n })\n\n const operationFiles = await operationGenerator.build(...generators)\n await this.addFile(...operationFiles)\n\n const barrelFiles = await this.fileManager.getBarrelFiles({\n type: output.barrelType ?? 'named',\n root,\n output,\n files: this.fileManager.files,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n },\n }\n})\n","import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, useApp } from '@kubb/react'\nimport { OasType } from '../components'\nimport type { PluginTs } from '../types.ts'\n\nexport const oasGenerator = createReactGenerator<PluginTs>({\n name: 'oas',\n Operations() {\n const {\n pluginManager,\n plugin: {\n options: { output },\n key: pluginKey,\n },\n } = useApp<PluginTs>()\n const oas = useOas()\n\n const file = pluginManager.getFile({ name: 'oas', extname: '.ts', pluginKey })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta} banner={getBanner({ oas, output })} footer={getFooter({ oas, output })}>\n <File.Import name={['Infer']} path=\"@kubb/oas\" isTypeOnly />\n\n <OasType name={'oas'} typeName={'Oas'} api={oas.api} />\n </File>\n )\n },\n})\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/generators/index.ts","../src/generators/typeGenerator.tsx","../src/index.ts","../src/plugin.ts","../src/generators/oasGenerator.tsx"],"names":["transformers","options","SchemaGenerator","type","createReactGenerator","useApp","useOas","jsxs","File","getBanner","getFooter","jsx"],"mappings":";;;;;;;;;;;;;;AAAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAWO,IAAM,YAAe,GAAA;AAEf,IAAA,QAAA,GAAW,YAAuB,CAAA,CAAC,OAAY,KAAA;AAC1D,EAAM,MAAA;AAAA,IACJ,MAAS,GAAA,EAAE,IAAM,EAAA,OAAA,EAAS,YAAY,OAAQ,EAAA;AAAA,IAC9C,KAAA;AAAA,IACA,UAAU,EAAC;AAAA,IACX,OAAA;AAAA,IACA,WAAW,EAAC;AAAA,IACZ,QAAW,GAAA,SAAA;AAAA,IACX,UAAa,GAAA,MAAA;AAAA,IACb,QAAW,GAAA,QAAA;AAAA,IACX,WAAc,GAAA,KAAA;AAAA,IACd,YAAe,GAAA,eAAA;AAAA,IACf,UAAa,GAAA,MAAA;AAAA,IACb,YAAA,EAAAA,gBAAe,EAAC;AAAA,IAChB,OAAU,GAAA,KAAA;AAAA,IACV,SAAS,EAAC;AAAA,IACV,UAAA,GAAa,CAAC,aAAe,EAAA,OAAA,KAAY,UAAU,YAAe,GAAA,MAAS,CAAE,CAAA,MAAA,CAAO,OAAO,CAAA;AAAA,IAC3F;AAAA,GACE,GAAA,OAAA;AAEJ,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,YAAA;AAAA,IAC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E,GAAA,EAAK,MAAO,EAAC,CACpI,EAAA,QAAA,EAAA;AAAA,sBAAAC,GAAAA,CAACH,IAAK,CAAA,MAAA,EAAL,EAAY,IAAA,EAAM,CAAC,OAAO,CAAG,EAAA,IAAA,EAAK,WAAY,EAAA,UAAA,EAAU,IAAC,EAAA,CAAA;AAAA,sBAE1DG,IAAC,OAAQ,EAAA,EAAA,IAAA,EAAM,OAAO,QAAU,EAAA,KAAA,EAAO,GAAK,EAAA,GAAA,CAAI,GAAK,EAAA;AAAA,KACvD,EAAA,CAAA;AAAA;AAGN,CAAC","file":"chunk-PM4CWXK4.js","sourcesContent":["export { typeGenerator } from './typeGenerator.tsx'\nexport { oasGenerator } from './oasGenerator.tsx'\n","import type { PluginManager } from '@kubb/core'\nimport transformers from '@kubb/core/transformers'\nimport { print } from '@kubb/parser-ts'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { type OperationSchema as OperationSchemaType, type OperationSchemas, SchemaGenerator, createReactGenerator } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperationManager, useSchemaManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, useApp } from '@kubb/react'\nimport type ts from 'typescript'\nimport { Type } from '../components'\nimport type { PluginTs } from '../types'\n\nfunction printCombinedSchema({ name, schemas, pluginManager }: { name: string; schemas: OperationSchemas; pluginManager: PluginManager }): string {\n const properties: Record<string, ts.TypeNode> = {}\n\n if (schemas.response) {\n properties['response'] = factory.createUnionDeclaration({\n nodes: schemas.responses.map((res) => {\n const identifier = pluginManager.resolveName({\n name: res.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }),\n })!\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,\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\nexport const typeGenerator = createReactGenerator<PluginTs>({\n name: 'typescript',\n Operation({ operation, options }) {\n const { mapper, enumType, syntaxType, optionalType } = options\n\n const { plugin, pluginManager, mode } = useApp<PluginTs>()\n const oas = useOas()\n const { getSchemas, getFile, getName, getGroup } = useOperationManager()\n const schemaManager = useSchemaManager()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const type = getName(operation, { type: 'function', pluginKey: [pluginTsName] })\n const combinedSchemaName = operation.method === 'get' ? `${type}Query` : `${type}Mutation`\n const schemaGenerator = new SchemaGenerator(options, {\n oas,\n plugin,\n pluginManager,\n mode,\n override: options.override,\n })\n\n const operationSchemas = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response]\n .flat()\n .filter(Boolean)\n\n const mapOperationSchema = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n const tree = schemaGenerator.parse({ schema, name })\n const imports = schemaManager.getImports(tree)\n const group = options.operation ? getGroup(options.operation) : undefined\n\n const type = {\n name: schemaManager.getName(name, { type: 'type' }),\n typedName: schemaManager.getName(name, { type: 'type' }),\n file: schemaManager.getFile(options.operationName || name, { group }),\n }\n\n return (\n <Oas.Schema key={i} name={name} value={schema} tree={tree}>\n {mode === 'split' && imports.map((imp, index) => <File.Import key={index} root={file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={type.name}\n typedName={type.typedName}\n description={description}\n tree={tree}\n schema={schema}\n mapper={mapper}\n enumType={enumType}\n optionalType={optionalType}\n keysToOmit={keysToOmit}\n syntaxType={syntaxType}\n />\n </Oas.Schema>\n )\n }\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: plugin.options.output })}\n footer={getFooter({ oas, output: plugin.options.output })}\n >\n {operationSchemas.map(mapOperationSchema)}\n\n <File.Source name={combinedSchemaName} isExportable isIndexable isTypeOnly>\n {printCombinedSchema({ name: combinedSchemaName, schemas, pluginManager })}\n </File.Source>\n </File>\n )\n },\n Schema({ schema, options }) {\n const { mapper, enumType, syntaxType, optionalType } = options\n const {\n mode,\n plugin: {\n options: { output },\n },\n } = useApp<PluginTs>()\n const oas = useOas()\n\n const { getName, getImports, getFile } = useSchemaManager()\n const imports = getImports(schema.tree)\n\n if (enumType === 'asPascalConst') {\n console.warn(`enumType '${enumType}' is deprecated`)\n }\n\n const type = {\n name: getName(schema.name, { type: 'function' }),\n typedName: getName(schema.name, { type: 'type' }),\n file: getFile(schema.name),\n }\n\n return (\n <File baseName={type.file.baseName} path={type.file.path} meta={type.file.meta} banner={getBanner({ oas, output })} footer={getFooter({ oas, output })}>\n {mode === 'split' && imports.map((imp, index) => <File.Import key={index} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={type.name}\n typedName={type.typedName}\n description={schema.value.description}\n tree={schema.tree}\n schema={schema.value}\n mapper={mapper}\n enumType={enumType}\n optionalType={optionalType}\n syntaxType={syntaxType}\n />\n </File>\n )\n },\n})\n","export { pluginTs, pluginTsName } from './plugin.ts'\nexport type { PluginTs } from './types.ts'\n","import path from 'node:path'\n\nimport { FileManager, type Group, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { OperationGenerator, SchemaGenerator, pluginOasName } from '@kubb/plugin-oas'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { oasGenerator, typeGenerator } from './generators'\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', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumSuffix = 'enum',\n dateType = 'string',\n unknownType = 'any',\n optionalType = 'questionToken',\n syntaxType = 'type',\n transformers = {},\n oasType = false,\n mapper = {},\n generators = [typeGenerator, oasType === 'infer' ? oasGenerator : undefined].filter(Boolean),\n contentType,\n } = options\n\n return {\n name: pluginTsName,\n options: {\n output,\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 syntaxType,\n group,\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 (group && (options?.group?.path || options?.group?.tag)) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n }\n\n return path.resolve(\n root,\n output.path,\n groupName({\n group: group.type === 'path' ? options.group.path! : options.group.tag!,\n }),\n baseName,\n )\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,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build(...generators)\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,\n exclude,\n include,\n override,\n mode,\n })\n\n const operationFiles = await operationGenerator.build(...generators)\n await this.addFile(...operationFiles)\n\n const barrelFiles = await this.fileManager.getBarrelFiles({\n type: output.barrelType ?? 'named',\n root,\n output,\n files: this.fileManager.files,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n },\n }\n})\n","import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, useApp } from '@kubb/react'\nimport { OasType } from '../components'\nimport type { PluginTs } from '../types.ts'\n\nexport const oasGenerator = createReactGenerator<PluginTs>({\n name: 'oas',\n Operations() {\n const {\n pluginManager,\n plugin: {\n options: { output },\n key: pluginKey,\n },\n } = useApp<PluginTs>()\n const oas = useOas()\n\n const file = pluginManager.getFile({ name: 'oas', extname: '.ts', pluginKey })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta} banner={getBanner({ oas, output })} footer={getFooter({ oas, output })}>\n <File.Import name={['Infer']} path=\"@kubb/oas\" isTypeOnly />\n\n <OasType name={'oas'} typeName={'Oas'} api={oas.api} />\n </File>\n )\n },\n})\n"]}
|
|
@@ -35,9 +35,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
35
35
|
mod
|
|
36
36
|
));
|
|
37
37
|
|
|
38
|
-
// ../../node_modules/.pnpm/tsup@8.
|
|
38
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@20.17.24__jiti@2.4.2_postcss@8.5.3_typescript@5.8.2_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
|
|
39
39
|
var init_esm_shims = __esm({
|
|
40
|
-
"../../node_modules/.pnpm/tsup@8.
|
|
40
|
+
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@20.17.24__jiti@2.4.2_postcss@8.5.3_typescript@5.8.2_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js"() {
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -103,14 +103,14 @@ var require_react_production_min = __commonJS({
|
|
|
103
103
|
var L = { key: true, ref: true, __self: true, __source: true };
|
|
104
104
|
function M(a, b, e) {
|
|
105
105
|
var d, c = {}, k = null, h = null;
|
|
106
|
-
if (null != b) for (d in
|
|
106
|
+
if (null != b) for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b) J.call(b, d) && !L.hasOwnProperty(d) && (c[d] = b[d]);
|
|
107
107
|
var g = arguments.length - 2;
|
|
108
108
|
if (1 === g) c.children = e;
|
|
109
109
|
else if (1 < g) {
|
|
110
110
|
for (var f = Array(g), m = 0; m < g; m++) f[m] = arguments[m + 2];
|
|
111
111
|
c.children = f;
|
|
112
112
|
}
|
|
113
|
-
if (a && a.defaultProps) for (d in g = a.defaultProps, g)
|
|
113
|
+
if (a && a.defaultProps) for (d in g = a.defaultProps, g) void 0 === c[d] && (c[d] = g[d]);
|
|
114
114
|
return { $$typeof: l, type: a, key: k, ref: h, props: c, _owner: K.current };
|
|
115
115
|
}
|
|
116
116
|
function N(a, b) {
|
|
@@ -215,13 +215,13 @@ var require_react_production_min = __commonJS({
|
|
|
215
215
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W;
|
|
216
216
|
exports.act = X;
|
|
217
217
|
exports.cloneElement = function(a, b, e) {
|
|
218
|
-
if (null === a ||
|
|
218
|
+
if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + ".");
|
|
219
219
|
var d = C({}, a.props), c = a.key, k = a.ref, h = a._owner;
|
|
220
220
|
if (null != b) {
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
void 0 !== b.ref && (k = b.ref, h = K.current);
|
|
222
|
+
void 0 !== b.key && (c = "" + b.key);
|
|
223
223
|
if (a.type && a.type.defaultProps) var g = a.type.defaultProps;
|
|
224
|
-
for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] =
|
|
224
|
+
for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]);
|
|
225
225
|
}
|
|
226
226
|
var f = arguments.length - 2;
|
|
227
227
|
if (1 === f) d.children = e;
|
|
@@ -254,7 +254,7 @@ var require_react_production_min = __commonJS({
|
|
|
254
254
|
return { $$typeof: y, _payload: { _status: -1, _result: a }, _init: T };
|
|
255
255
|
};
|
|
256
256
|
exports.memo = function(a, b) {
|
|
257
|
-
return { $$typeof: x, type: a, compare:
|
|
257
|
+
return { $$typeof: x, type: a, compare: void 0 === b ? null : b };
|
|
258
258
|
};
|
|
259
259
|
exports.startTransition = function(a) {
|
|
260
260
|
var b = V.transition;
|
|
@@ -551,7 +551,7 @@ var require_react_development = __commonJS({
|
|
|
551
551
|
Object.defineProperty(Component.prototype, methodName, {
|
|
552
552
|
get: function() {
|
|
553
553
|
warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
|
|
554
|
-
return
|
|
554
|
+
return void 0;
|
|
555
555
|
}
|
|
556
556
|
});
|
|
557
557
|
};
|
|
@@ -705,7 +705,7 @@ var require_react_development = __commonJS({
|
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
return config.ref !==
|
|
708
|
+
return config.ref !== void 0;
|
|
709
709
|
}
|
|
710
710
|
function hasValidKey(config) {
|
|
711
711
|
{
|
|
@@ -716,7 +716,7 @@ var require_react_development = __commonJS({
|
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
|
-
return config.key !==
|
|
719
|
+
return config.key !== void 0;
|
|
720
720
|
}
|
|
721
721
|
function defineKeyPropWarningGetter(props, displayName) {
|
|
722
722
|
var warnAboutAccessingKey = function() {
|
|
@@ -818,8 +818,8 @@ var require_react_development = __commonJS({
|
|
|
818
818
|
}
|
|
819
819
|
key = "" + config.key;
|
|
820
820
|
}
|
|
821
|
-
self = config.__self ===
|
|
822
|
-
source = config.__source ===
|
|
821
|
+
self = config.__self === void 0 ? null : config.__self;
|
|
822
|
+
source = config.__source === void 0 ? null : config.__source;
|
|
823
823
|
for (propName in config) {
|
|
824
824
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
825
825
|
props[propName] = config[propName];
|
|
@@ -844,7 +844,7 @@ var require_react_development = __commonJS({
|
|
|
844
844
|
if (type && type.defaultProps) {
|
|
845
845
|
var defaultProps = type.defaultProps;
|
|
846
846
|
for (propName in defaultProps) {
|
|
847
|
-
if (props[propName] ===
|
|
847
|
+
if (props[propName] === void 0) {
|
|
848
848
|
props[propName] = defaultProps[propName];
|
|
849
849
|
}
|
|
850
850
|
}
|
|
@@ -867,7 +867,7 @@ var require_react_development = __commonJS({
|
|
|
867
867
|
return newElement;
|
|
868
868
|
}
|
|
869
869
|
function cloneElement(element, config, children) {
|
|
870
|
-
if (element === null || element ===
|
|
870
|
+
if (element === null || element === void 0) {
|
|
871
871
|
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
|
872
872
|
}
|
|
873
873
|
var propName;
|
|
@@ -894,7 +894,7 @@ var require_react_development = __commonJS({
|
|
|
894
894
|
}
|
|
895
895
|
for (propName in config) {
|
|
896
896
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
897
|
-
if (config[propName] ===
|
|
897
|
+
if (config[propName] === void 0 && defaultProps !== void 0) {
|
|
898
898
|
props[propName] = defaultProps[propName];
|
|
899
899
|
} else {
|
|
900
900
|
props[propName] = config[propName];
|
|
@@ -1200,7 +1200,7 @@ var require_react_development = __commonJS({
|
|
|
1200
1200
|
if (payload._status === Resolved) {
|
|
1201
1201
|
var moduleObject = payload._result;
|
|
1202
1202
|
{
|
|
1203
|
-
if (moduleObject ===
|
|
1203
|
+
if (moduleObject === void 0) {
|
|
1204
1204
|
error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject);
|
|
1205
1205
|
}
|
|
1206
1206
|
}
|
|
@@ -1314,7 +1314,7 @@ var require_react_development = __commonJS({
|
|
|
1314
1314
|
// types supported by any Flight configuration anywhere since
|
|
1315
1315
|
// we don't know which Flight build this will end up being used
|
|
1316
1316
|
// with.
|
|
1317
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !==
|
|
1317
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
1318
1318
|
return true;
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
@@ -1329,7 +1329,7 @@ var require_react_development = __commonJS({
|
|
|
1329
1329
|
var elementType = {
|
|
1330
1330
|
$$typeof: REACT_MEMO_TYPE,
|
|
1331
1331
|
type,
|
|
1332
|
-
compare: compare ===
|
|
1332
|
+
compare: compare === void 0 ? null : compare
|
|
1333
1333
|
};
|
|
1334
1334
|
{
|
|
1335
1335
|
var ownName;
|
|
@@ -1361,7 +1361,7 @@ var require_react_development = __commonJS({
|
|
|
1361
1361
|
function useContext(Context) {
|
|
1362
1362
|
var dispatcher = resolveDispatcher();
|
|
1363
1363
|
{
|
|
1364
|
-
if (Context._context !==
|
|
1364
|
+
if (Context._context !== void 0) {
|
|
1365
1365
|
var realContext = Context._context;
|
|
1366
1366
|
if (realContext.Consumer === Context) {
|
|
1367
1367
|
error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
|
|
@@ -1512,7 +1512,7 @@ var require_react_development = __commonJS({
|
|
|
1512
1512
|
var prefix;
|
|
1513
1513
|
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1514
1514
|
{
|
|
1515
|
-
if (prefix ===
|
|
1515
|
+
if (prefix === void 0) {
|
|
1516
1516
|
try {
|
|
1517
1517
|
throw Error();
|
|
1518
1518
|
} catch (x) {
|
|
@@ -1535,14 +1535,14 @@ var require_react_development = __commonJS({
|
|
|
1535
1535
|
}
|
|
1536
1536
|
{
|
|
1537
1537
|
var frame = componentFrameCache.get(fn);
|
|
1538
|
-
if (frame !==
|
|
1538
|
+
if (frame !== void 0) {
|
|
1539
1539
|
return frame;
|
|
1540
1540
|
}
|
|
1541
1541
|
}
|
|
1542
1542
|
var control;
|
|
1543
1543
|
reentry = true;
|
|
1544
1544
|
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
1545
|
-
Error.prepareStackTrace =
|
|
1545
|
+
Error.prepareStackTrace = void 0;
|
|
1546
1546
|
var previousDispatcher;
|
|
1547
1547
|
{
|
|
1548
1548
|
previousDispatcher = ReactCurrentDispatcher$1.current;
|
|
@@ -1696,7 +1696,7 @@ var require_react_development = __commonJS({
|
|
|
1696
1696
|
var has = Function.call.bind(hasOwnProperty);
|
|
1697
1697
|
for (var typeSpecName in typeSpecs) {
|
|
1698
1698
|
if (has(typeSpecs, typeSpecName)) {
|
|
1699
|
-
var error$1 =
|
|
1699
|
+
var error$1 = void 0;
|
|
1700
1700
|
try {
|
|
1701
1701
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
1702
1702
|
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
@@ -1747,7 +1747,7 @@ var require_react_development = __commonJS({
|
|
|
1747
1747
|
return "";
|
|
1748
1748
|
}
|
|
1749
1749
|
function getSourceInfoErrorAddendum(source) {
|
|
1750
|
-
if (source !==
|
|
1750
|
+
if (source !== void 0) {
|
|
1751
1751
|
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
1752
1752
|
var lineNumber = source.lineNumber;
|
|
1753
1753
|
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
@@ -1755,7 +1755,7 @@ var require_react_development = __commonJS({
|
|
|
1755
1755
|
return "";
|
|
1756
1756
|
}
|
|
1757
1757
|
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
1758
|
-
if (elementProps !== null && elementProps !==
|
|
1758
|
+
if (elementProps !== null && elementProps !== void 0) {
|
|
1759
1759
|
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
1760
1760
|
}
|
|
1761
1761
|
return "";
|
|
@@ -1824,7 +1824,7 @@ var require_react_development = __commonJS({
|
|
|
1824
1824
|
function validatePropTypes(element) {
|
|
1825
1825
|
{
|
|
1826
1826
|
var type = element.type;
|
|
1827
|
-
if (type === null || type ===
|
|
1827
|
+
if (type === null || type === void 0 || typeof type === "string") {
|
|
1828
1828
|
return;
|
|
1829
1829
|
}
|
|
1830
1830
|
var propTypes;
|
|
@@ -1840,7 +1840,7 @@ var require_react_development = __commonJS({
|
|
|
1840
1840
|
if (propTypes) {
|
|
1841
1841
|
var name = getComponentNameFromType(type);
|
|
1842
1842
|
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
1843
|
-
} else if (type.PropTypes !==
|
|
1843
|
+
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
1844
1844
|
propTypesMisspellWarningShown = true;
|
|
1845
1845
|
var _name = getComponentNameFromType(type);
|
|
1846
1846
|
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
@@ -1873,7 +1873,7 @@ var require_react_development = __commonJS({
|
|
|
1873
1873
|
var validType = isValidElementType(type);
|
|
1874
1874
|
if (!validType) {
|
|
1875
1875
|
var info = "";
|
|
1876
|
-
if (type ===
|
|
1876
|
+
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
1877
1877
|
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
1878
1878
|
}
|
|
1879
1879
|
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
@@ -1887,7 +1887,7 @@ var require_react_development = __commonJS({
|
|
|
1887
1887
|
typeString = "null";
|
|
1888
1888
|
} else if (isArray(type)) {
|
|
1889
1889
|
typeString = "array";
|
|
1890
|
-
} else if (type !==
|
|
1890
|
+
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1891
1891
|
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
1892
1892
|
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
1893
1893
|
} else {
|
|
@@ -1985,7 +1985,7 @@ var require_react_development = __commonJS({
|
|
|
1985
1985
|
}
|
|
1986
1986
|
var channel = new MessageChannel();
|
|
1987
1987
|
channel.port1.onmessage = callback;
|
|
1988
|
-
channel.port2.postMessage(
|
|
1988
|
+
channel.port2.postMessage(void 0);
|
|
1989
1989
|
};
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
@@ -2206,7 +2206,7 @@ init_esm_shims();
|
|
|
2206
2206
|
init_esm_shims();
|
|
2207
2207
|
function OasType({ name, typeName, api }) {
|
|
2208
2208
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2209
|
-
/* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: `export const ${name} = ${JSON.stringify(api,
|
|
2209
|
+
/* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: `export const ${name} = ${JSON.stringify(api, void 0, 2)} as const` }),
|
|
2210
2210
|
/* @__PURE__ */ jsx("br", {}),
|
|
2211
2211
|
/* @__PURE__ */ jsx(File.Source, { name: typeName, isExportable: true, isIndexable: true, isTypeOnly: true, children: /* @__PURE__ */ jsx(Type, { name: typeName, export: true, children: `Infer<typeof ${name}>` }) })
|
|
2212
2212
|
] });
|
|
@@ -2221,6 +2221,7 @@ init_esm_shims();
|
|
|
2221
2221
|
var typeKeywordMapper = {
|
|
2222
2222
|
any: () => factory.keywordTypeNodes.any,
|
|
2223
2223
|
unknown: () => factory.keywordTypeNodes.unknown,
|
|
2224
|
+
void: () => factory.keywordTypeNodes.void,
|
|
2224
2225
|
number: () => factory.keywordTypeNodes.number,
|
|
2225
2226
|
integer: () => factory.keywordTypeNodes.number,
|
|
2226
2227
|
object: (nodes) => {
|
|
@@ -2232,30 +2233,30 @@ var typeKeywordMapper = {
|
|
|
2232
2233
|
string: () => factory.keywordTypeNodes.string,
|
|
2233
2234
|
boolean: () => factory.keywordTypeNodes.boolean,
|
|
2234
2235
|
undefined: () => factory.keywordTypeNodes.undefined,
|
|
2235
|
-
nullable:
|
|
2236
|
+
nullable: void 0,
|
|
2236
2237
|
null: () => factory.keywordTypeNodes.null,
|
|
2237
|
-
nullish:
|
|
2238
|
+
nullish: void 0,
|
|
2238
2239
|
array: (nodes) => {
|
|
2239
2240
|
if (!nodes) {
|
|
2240
|
-
return
|
|
2241
|
+
return void 0;
|
|
2241
2242
|
}
|
|
2242
2243
|
return factory.createArrayDeclaration({ nodes });
|
|
2243
2244
|
},
|
|
2244
2245
|
tuple: (nodes) => {
|
|
2245
2246
|
if (!nodes) {
|
|
2246
|
-
return
|
|
2247
|
+
return void 0;
|
|
2247
2248
|
}
|
|
2248
2249
|
return factory.createTupleTypeNode(nodes);
|
|
2249
2250
|
},
|
|
2250
2251
|
enum: (name) => {
|
|
2251
2252
|
if (!name) {
|
|
2252
|
-
return
|
|
2253
|
+
return void 0;
|
|
2253
2254
|
}
|
|
2254
|
-
return factory.createTypeReferenceNode(name,
|
|
2255
|
+
return factory.createTypeReferenceNode(name, void 0);
|
|
2255
2256
|
},
|
|
2256
2257
|
union: (nodes) => {
|
|
2257
2258
|
if (!nodes) {
|
|
2258
|
-
return
|
|
2259
|
+
return void 0;
|
|
2259
2260
|
}
|
|
2260
2261
|
return factory.createUnionDeclaration({
|
|
2261
2262
|
withParentheses: true,
|
|
@@ -2264,7 +2265,7 @@ var typeKeywordMapper = {
|
|
|
2264
2265
|
},
|
|
2265
2266
|
const: (name, format) => {
|
|
2266
2267
|
if (!name) {
|
|
2267
|
-
return
|
|
2268
|
+
return void 0;
|
|
2268
2269
|
}
|
|
2269
2270
|
if (format === "boolean") {
|
|
2270
2271
|
if (name === true) {
|
|
@@ -2282,58 +2283,58 @@ var typeKeywordMapper = {
|
|
|
2282
2283
|
time: (type = "string") => type === "string" ? factory.keywordTypeNodes.string : factory.createTypeReferenceNode(factory.createIdentifier("Date")),
|
|
2283
2284
|
uuid: () => factory.keywordTypeNodes.string,
|
|
2284
2285
|
url: () => factory.keywordTypeNodes.string,
|
|
2285
|
-
strict:
|
|
2286
|
-
default:
|
|
2286
|
+
strict: void 0,
|
|
2287
|
+
default: void 0,
|
|
2287
2288
|
and: (nodes) => {
|
|
2288
2289
|
if (!nodes) {
|
|
2289
|
-
return
|
|
2290
|
+
return void 0;
|
|
2290
2291
|
}
|
|
2291
2292
|
return factory.createIntersectionDeclaration({
|
|
2292
2293
|
withParentheses: true,
|
|
2293
2294
|
nodes
|
|
2294
2295
|
});
|
|
2295
2296
|
},
|
|
2296
|
-
describe:
|
|
2297
|
-
min:
|
|
2298
|
-
max:
|
|
2299
|
-
optional:
|
|
2297
|
+
describe: void 0,
|
|
2298
|
+
min: void 0,
|
|
2299
|
+
max: void 0,
|
|
2300
|
+
optional: void 0,
|
|
2300
2301
|
matches: () => factory.keywordTypeNodes.string,
|
|
2301
2302
|
email: () => factory.keywordTypeNodes.string,
|
|
2302
|
-
firstName:
|
|
2303
|
-
lastName:
|
|
2304
|
-
password:
|
|
2305
|
-
phone:
|
|
2306
|
-
readOnly:
|
|
2307
|
-
writeOnly:
|
|
2303
|
+
firstName: void 0,
|
|
2304
|
+
lastName: void 0,
|
|
2305
|
+
password: void 0,
|
|
2306
|
+
phone: void 0,
|
|
2307
|
+
readOnly: void 0,
|
|
2308
|
+
writeOnly: void 0,
|
|
2308
2309
|
ref: (propertyName) => {
|
|
2309
2310
|
if (!propertyName) {
|
|
2310
|
-
return
|
|
2311
|
+
return void 0;
|
|
2311
2312
|
}
|
|
2312
|
-
return factory.createTypeReferenceNode(propertyName,
|
|
2313
|
+
return factory.createTypeReferenceNode(propertyName, void 0);
|
|
2313
2314
|
},
|
|
2314
2315
|
blob: () => factory.createTypeReferenceNode("Blob", []),
|
|
2315
|
-
deprecated:
|
|
2316
|
-
example:
|
|
2317
|
-
schema:
|
|
2318
|
-
catchall:
|
|
2319
|
-
name:
|
|
2316
|
+
deprecated: void 0,
|
|
2317
|
+
example: void 0,
|
|
2318
|
+
schema: void 0,
|
|
2319
|
+
catchall: void 0,
|
|
2320
|
+
name: void 0
|
|
2320
2321
|
};
|
|
2321
2322
|
function parse({ current, siblings }, options) {
|
|
2322
2323
|
const value = typeKeywordMapper[current.keyword];
|
|
2323
2324
|
if (!value) {
|
|
2324
|
-
return
|
|
2325
|
+
return void 0;
|
|
2325
2326
|
}
|
|
2326
2327
|
if (isKeyword(current, schemaKeywords.union)) {
|
|
2327
2328
|
return typeKeywordMapper.union(
|
|
2328
|
-
current.args.map((schema) => parse({
|
|
2329
|
+
current.args.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
|
|
2329
2330
|
);
|
|
2330
2331
|
}
|
|
2331
2332
|
if (isKeyword(current, schemaKeywords.and)) {
|
|
2332
|
-
return typeKeywordMapper.and(current.args.map((schema) => parse({
|
|
2333
|
+
return typeKeywordMapper.and(current.args.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean));
|
|
2333
2334
|
}
|
|
2334
2335
|
if (isKeyword(current, schemaKeywords.array)) {
|
|
2335
2336
|
return typeKeywordMapper.array(
|
|
2336
|
-
current.args.items.map((schema) => parse({
|
|
2337
|
+
current.args.items.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
|
|
2337
2338
|
);
|
|
2338
2339
|
}
|
|
2339
2340
|
if (isKeyword(current, schemaKeywords.enum)) {
|
|
@@ -2347,7 +2348,7 @@ function parse({ current, siblings }, options) {
|
|
|
2347
2348
|
}
|
|
2348
2349
|
if (isKeyword(current, schemaKeywords.tuple)) {
|
|
2349
2350
|
return typeKeywordMapper.tuple(
|
|
2350
|
-
current.args.items.map((schema) => parse({
|
|
2351
|
+
current.args.items.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
|
|
2351
2352
|
);
|
|
2352
2353
|
}
|
|
2353
2354
|
if (isKeyword(current, schemaKeywords.const)) {
|
|
@@ -2375,7 +2376,7 @@ function parse({ current, siblings }, options) {
|
|
|
2375
2376
|
const minSchema = schemas.find((schema) => schema.keyword === schemaKeywords.min);
|
|
2376
2377
|
const maxSchema = schemas.find((schema) => schema.keyword === schemaKeywords.max);
|
|
2377
2378
|
const matchesSchema = schemas.find((schema) => schema.keyword === schemaKeywords.matches);
|
|
2378
|
-
let type = schemas.map((schema) => parse({
|
|
2379
|
+
let type = schemas.map((schema) => parse({ current: schema, siblings: schemas }, options)).filter(Boolean)[0];
|
|
2379
2380
|
if (isNullable) {
|
|
2380
2381
|
type = factory.createUnionDeclaration({
|
|
2381
2382
|
nodes: [type, factory.keywordTypeNodes.null]
|
|
@@ -2400,20 +2401,20 @@ function parse({ current, siblings }, options) {
|
|
|
2400
2401
|
return factory.appendJSDocToNode({
|
|
2401
2402
|
node: propertySignature,
|
|
2402
2403
|
comments: [
|
|
2403
|
-
describeSchema ? `@description ${transformers2.jsStringEscape(describeSchema.args)}` :
|
|
2404
|
-
deprecatedSchema ? "@deprecated" :
|
|
2405
|
-
minSchema ? `@minLength ${minSchema.args}` :
|
|
2406
|
-
maxSchema ? `@maxLength ${maxSchema.args}` :
|
|
2407
|
-
matchesSchema ? `@pattern ${matchesSchema.args}` :
|
|
2408
|
-
defaultSchema ? `@default ${defaultSchema.args}` :
|
|
2409
|
-
exampleSchema ? `@example ${exampleSchema.args}` :
|
|
2410
|
-
schemaSchema?.args?.type || schemaSchema?.args?.format ? [`@type ${schemaSchema?.args?.type || "unknown"}${!isOptional ? "" : " | undefined"}`, schemaSchema?.args?.format].filter(Boolean).join(", ") :
|
|
2404
|
+
describeSchema ? `@description ${transformers2.jsStringEscape(describeSchema.args)}` : void 0,
|
|
2405
|
+
deprecatedSchema ? "@deprecated" : void 0,
|
|
2406
|
+
minSchema ? `@minLength ${minSchema.args}` : void 0,
|
|
2407
|
+
maxSchema ? `@maxLength ${maxSchema.args}` : void 0,
|
|
2408
|
+
matchesSchema ? `@pattern ${matchesSchema.args}` : void 0,
|
|
2409
|
+
defaultSchema ? `@default ${defaultSchema.args}` : void 0,
|
|
2410
|
+
exampleSchema ? `@example ${exampleSchema.args}` : void 0,
|
|
2411
|
+
schemaSchema?.args?.type || schemaSchema?.args?.format ? [`@type ${schemaSchema?.args?.type || "unknown"}${!isOptional ? "" : " | undefined"}`, schemaSchema?.args?.format].filter(Boolean).join(", ") : void 0
|
|
2411
2412
|
].filter(Boolean)
|
|
2412
2413
|
});
|
|
2413
2414
|
});
|
|
2414
2415
|
const additionalProperties = current.args?.additionalProperties?.length ? factory.createIndexSignature(
|
|
2415
|
-
current.args.additionalProperties.map((schema) => parse({
|
|
2416
|
-
) :
|
|
2416
|
+
current.args.additionalProperties.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean).at(0)
|
|
2417
|
+
) : void 0;
|
|
2417
2418
|
return typeKeywordMapper.object([...properties, additionalProperties].filter(Boolean));
|
|
2418
2419
|
}
|
|
2419
2420
|
if (isKeyword(current, schemaKeywords.datetime)) {
|
|
@@ -2428,7 +2429,7 @@ function parse({ current, siblings }, options) {
|
|
|
2428
2429
|
if (current.keyword in typeKeywordMapper) {
|
|
2429
2430
|
return value();
|
|
2430
2431
|
}
|
|
2431
|
-
return
|
|
2432
|
+
return void 0;
|
|
2432
2433
|
}
|
|
2433
2434
|
function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntaxType, enumType, mapper, description }) {
|
|
2434
2435
|
const typeNodes = [];
|
|
@@ -2438,17 +2439,10 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2438
2439
|
const schemaFromTree = tree.find((item) => item.keyword === schemaKeywords.schema);
|
|
2439
2440
|
let type = tree.map(
|
|
2440
2441
|
(current, _index, siblings) => parse(
|
|
2441
|
-
{
|
|
2442
|
+
{ current, siblings },
|
|
2442
2443
|
{
|
|
2443
|
-
name,
|
|
2444
|
-
typedName,
|
|
2445
|
-
description,
|
|
2446
|
-
keysToOmit,
|
|
2447
2444
|
optionalType,
|
|
2448
|
-
|
|
2449
|
-
mapper,
|
|
2450
|
-
syntaxType
|
|
2451
|
-
}
|
|
2445
|
+
mapper}
|
|
2452
2446
|
)
|
|
2453
2447
|
).filter(Boolean).at(0) || typeKeywordMapper.undefined();
|
|
2454
2448
|
if (schemaFromTree && isKeyword(schemaFromTree, schemaKeywords.schema) && schemaFromTree.args.type !== "object") {
|
|
@@ -2483,13 +2477,13 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2483
2477
|
}) : type,
|
|
2484
2478
|
syntax: useTypeGeneration ? "type" : "interface",
|
|
2485
2479
|
comments: [
|
|
2486
|
-
description ? `@description ${transformers2.jsStringEscape(description)}` :
|
|
2487
|
-
schema.deprecated ? "@deprecated" :
|
|
2488
|
-
schema.minLength ? `@minLength ${schema.minLength}` :
|
|
2489
|
-
schema.maxLength ? `@maxLength ${schema.maxLength}` :
|
|
2490
|
-
schema.pattern ? `@pattern ${schema.pattern}` :
|
|
2491
|
-
schema.default ? `@default ${schema.default}` :
|
|
2492
|
-
schema.example ? `@example ${schema.example}` :
|
|
2480
|
+
description ? `@description ${transformers2.jsStringEscape(description)}` : void 0,
|
|
2481
|
+
schema.deprecated ? "@deprecated" : void 0,
|
|
2482
|
+
schema.minLength ? `@minLength ${schema.minLength}` : void 0,
|
|
2483
|
+
schema.maxLength ? `@maxLength ${schema.maxLength}` : void 0,
|
|
2484
|
+
schema.pattern ? `@pattern ${schema.pattern}` : void 0,
|
|
2485
|
+
schema.default ? `@default ${schema.default}` : void 0,
|
|
2486
|
+
schema.example ? `@example ${schema.example}` : void 0
|
|
2493
2487
|
]
|
|
2494
2488
|
})
|
|
2495
2489
|
);
|
|
@@ -2500,7 +2494,7 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2500
2494
|
const [nameNode, typeNode] = factory.createEnumDeclaration({
|
|
2501
2495
|
name: name2,
|
|
2502
2496
|
typeName,
|
|
2503
|
-
enums: enumSchema.args.items.map((item) => item.value ===
|
|
2497
|
+
enums: enumSchema.args.items.map((item) => item.value === void 0 ? void 0 : [transformers2.trimQuotes(item.name?.toString()), item.value]).filter(Boolean),
|
|
2504
2498
|
type: enumType
|
|
2505
2499
|
});
|
|
2506
2500
|
return {
|
|
@@ -2520,8 +2514,8 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2520
2514
|
{
|
|
2521
2515
|
name: typeName,
|
|
2522
2516
|
isIndexable: true,
|
|
2523
|
-
isExportable: ["enum", "asConst", "constEnum", "literal",
|
|
2524
|
-
isTypeOnly: ["asConst", "constEnum", "literal",
|
|
2517
|
+
isExportable: ["enum", "asConst", "constEnum", "literal", void 0].includes(enumType),
|
|
2518
|
+
isTypeOnly: ["asConst", "constEnum", "literal", void 0].includes(enumType),
|
|
2525
2519
|
children: print([typeNode])
|
|
2526
2520
|
}
|
|
2527
2521
|
)
|
|
@@ -2556,5 +2550,5 @@ react/cjs/react.development.js:
|
|
|
2556
2550
|
*/
|
|
2557
2551
|
|
|
2558
2552
|
export { OasType, Type2 as Type, init_esm_shims };
|
|
2559
|
-
//# sourceMappingURL=chunk-
|
|
2560
|
-
//# sourceMappingURL=chunk-
|
|
2553
|
+
//# sourceMappingURL=chunk-WBVEQ3D4.js.map
|
|
2554
|
+
//# sourceMappingURL=chunk-WBVEQ3D4.js.map
|