@kubb/plugin-ts 3.12.0 → 3.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/{chunk-DM7GVDDP.cjs → chunk-ET7NPWRZ.cjs} +4 -4
  2. package/dist/{chunk-DM7GVDDP.cjs.map → chunk-ET7NPWRZ.cjs.map} +1 -1
  3. package/dist/{chunk-XKUNRASY.js → chunk-FANJV56Z.js} +3 -3
  4. package/dist/{chunk-XKUNRASY.js.map → chunk-FANJV56Z.js.map} +1 -1
  5. package/dist/{chunk-F5AASAQW.js → chunk-HWPTXYQW.js} +5 -3
  6. package/dist/chunk-HWPTXYQW.js.map +1 -0
  7. package/dist/{chunk-72QLVJKT.cjs → chunk-IAF3HXKE.cjs} +12 -10
  8. package/dist/chunk-IAF3HXKE.cjs.map +1 -0
  9. package/dist/components.cjs +3 -3
  10. package/dist/components.d.cts +1 -1
  11. package/dist/components.d.ts +1 -1
  12. package/dist/components.js +1 -1
  13. package/dist/generators.cjs +4 -4
  14. package/dist/generators.d.cts +1 -1
  15. package/dist/generators.d.ts +1 -1
  16. package/dist/generators.js +2 -2
  17. package/dist/index.cjs +5 -5
  18. package/dist/index.d.cts +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +2 -2
  21. package/dist/{types-DOx63BPA.d.cts → types-DkvPgLAK.d.cts} +6 -0
  22. package/dist/{types-DOx63BPA.d.ts → types-DkvPgLAK.d.ts} +6 -0
  23. package/package.json +9 -9
  24. package/src/generators/__snapshots__/createPet.ts +1 -1
  25. package/src/generators/__snapshots__/createPetWithEmptySchemaTypeUnknown.ts +43 -0
  26. package/src/generators/__snapshots__/createPetWithEmptySchemaTypeVoid.ts +43 -0
  27. package/src/generators/__snapshots__/createPetWithUnknownTypeVoid.ts +1 -1
  28. package/src/generators/__snapshots__/deletePet.ts +1 -1
  29. package/src/generators/__snapshots__/enumArray20.ts +1 -1
  30. package/src/plugin.ts +2 -0
  31. package/src/types.ts +6 -0
  32. package/dist/chunk-72QLVJKT.cjs.map +0 -1
  33. package/dist/chunk-F5AASAQW.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { init_esm_shims, Type, OasType } from './chunk-XKUNRASY.js';
1
+ import { init_esm_shims, Type, OasType } from './chunk-FANJV56Z.js';
2
2
  import transformers, { pascalCase, camelCase } from '@kubb/core/transformers';
3
3
  import { print } from '@kubb/parser-ts';
4
4
  import * as factory from '@kubb/parser-ts/factory';
@@ -32,6 +32,7 @@ var pluginTs = createPlugin((options) => {
32
32
  dateType = "string",
33
33
  unknownType = "any",
34
34
  optionalType = "questionToken",
35
+ emptySchemaType = unknownType,
35
36
  syntaxType = "type",
36
37
  transformers: transformers2 = {},
37
38
  oasType = false,
@@ -52,6 +53,7 @@ var pluginTs = createPlugin((options) => {
52
53
  // keep the used enumnames between SchemaGenerator and OperationGenerator per plugin(pluginKey)
53
54
  usedEnumNames: {},
54
55
  unknownType,
56
+ emptySchemaType,
55
57
  syntaxType,
56
58
  group,
57
59
  override,
@@ -353,5 +355,5 @@ var oasGenerator = createReactGenerator({
353
355
  });
354
356
 
355
357
  export { oasGenerator, pluginTs, pluginTsName, typeGenerator };
356
- //# sourceMappingURL=chunk-F5AASAQW.js.map
357
- //# sourceMappingURL=chunk-F5AASAQW.js.map
358
+ //# sourceMappingURL=chunk-HWPTXYQW.js.map
359
+ //# sourceMappingURL=chunk-HWPTXYQW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/generators/index.ts","../src/generators/typeGenerator.tsx","../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;AAWO,IAAM,YAAe,GAAA;AAEf,IAAA,QAAA,GAAW,YAAuB,CAAA,CAAC,OAAY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AA,EAAK,WAAY,EAAA,UAAA,EAAU,IAAC,EAAA,CAAA;AAAA,0BAE1DG,IAAC,OAAQ,EAAA,EAAA,IAAA,EAAM,OAAO,QAAU,EAAA,KAAA,EAAO,GAAK,EAAA,GAAA,CAAI,GAAK,EAAA;AAAA;AAAA;AAAA,KACvD;AAAA;AAGN,CAAC","file":"chunk-HWPTXYQW.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 { createReactGenerator, type OperationSchemas, type OperationSchema as OperationSchemaType, SchemaGenerator } 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 { File, useApp } from '@kubb/react'\nimport type ts from 'typescript'\nimport { Type } from '../components'\nimport { pluginTsName } from '../plugin.ts'\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: schemaObject, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n const tree = schemaGenerator.parse({ schemaObject, 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} schemaObject={schemaObject} tree={tree}>\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[imp.name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={type.name}\n typedName={type.typedName}\n description={description}\n tree={tree}\n schema={schemaObject}\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, config: pluginManager.config })}\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 pluginManager,\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\n baseName={type.file.baseName}\n path={type.file.path}\n meta={type.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[imp.name, imp.path, imp.isTypeOnly].join('-')} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\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","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 emptySchemaType = unknownType,\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 emptySchemaType,\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\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkDM7GVDDP_cjs = require('./chunk-DM7GVDDP.cjs');
3
+ var chunkET7NPWRZ_cjs = require('./chunk-ET7NPWRZ.cjs');
4
4
  var transformers = require('@kubb/core/transformers');
5
5
  var parserTs = require('@kubb/parser-ts');
6
6
  var factory = require('@kubb/parser-ts/factory');
@@ -38,13 +38,13 @@ var factory__namespace = /*#__PURE__*/_interopNamespace(factory);
38
38
  var path__default = /*#__PURE__*/_interopDefault(path);
39
39
 
40
40
  // src/generators/index.ts
41
- chunkDM7GVDDP_cjs.init_cjs_shims();
41
+ chunkET7NPWRZ_cjs.init_cjs_shims();
42
42
 
43
43
  // src/generators/typeGenerator.tsx
44
- chunkDM7GVDDP_cjs.init_cjs_shims();
44
+ chunkET7NPWRZ_cjs.init_cjs_shims();
45
45
 
46
46
  // src/plugin.ts
47
- chunkDM7GVDDP_cjs.init_cjs_shims();
47
+ chunkET7NPWRZ_cjs.init_cjs_shims();
48
48
  var pluginTsName = "plugin-ts";
49
49
  var pluginTs = core.createPlugin((options) => {
50
50
  const {
@@ -58,6 +58,7 @@ var pluginTs = core.createPlugin((options) => {
58
58
  dateType = "string",
59
59
  unknownType = "any",
60
60
  optionalType = "questionToken",
61
+ emptySchemaType = unknownType,
61
62
  syntaxType = "type",
62
63
  transformers: transformers2 = {},
63
64
  oasType = false,
@@ -78,6 +79,7 @@ var pluginTs = core.createPlugin((options) => {
78
79
  // keep the used enumnames between SchemaGenerator and OperationGenerator per plugin(pluginKey)
79
80
  usedEnumNames: {},
80
81
  unknownType,
82
+ emptySchemaType,
81
83
  syntaxType,
82
84
  group,
83
85
  override,
@@ -266,7 +268,7 @@ var typeGenerator = pluginOas.createReactGenerator({
266
268
  return /* @__PURE__ */ jsxRuntime.jsxs(components.Oas.Schema, { name, schemaObject, tree, children: [
267
269
  mode === "split" && imports.map((imp) => /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { root: file.path, path: imp.path, name: imp.name, isTypeOnly: true }, [imp.name, imp.path, imp.isTypeOnly].join("-"))),
268
270
  /* @__PURE__ */ jsxRuntime.jsx(
269
- chunkDM7GVDDP_cjs.Type,
271
+ chunkET7NPWRZ_cjs.Type,
270
272
  {
271
273
  name: type2.name,
272
274
  typedName: type2.typedName,
@@ -328,7 +330,7 @@ var typeGenerator = pluginOas.createReactGenerator({
328
330
  children: [
329
331
  mode === "split" && imports.map((imp) => /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { root: type.file.path, path: imp.path, name: imp.name, isTypeOnly: true }, [imp.name, imp.path, imp.isTypeOnly].join("-"))),
330
332
  /* @__PURE__ */ jsxRuntime.jsx(
331
- chunkDM7GVDDP_cjs.Type,
333
+ chunkET7NPWRZ_cjs.Type,
332
334
  {
333
335
  name: type.name,
334
336
  typedName: type.typedName,
@@ -348,7 +350,7 @@ var typeGenerator = pluginOas.createReactGenerator({
348
350
  });
349
351
 
350
352
  // src/generators/oasGenerator.tsx
351
- chunkDM7GVDDP_cjs.init_cjs_shims();
353
+ chunkET7NPWRZ_cjs.init_cjs_shims();
352
354
  var oasGenerator = pluginOas.createReactGenerator({
353
355
  name: "oas",
354
356
  Operations() {
@@ -371,7 +373,7 @@ var oasGenerator = pluginOas.createReactGenerator({
371
373
  footer: utils.getFooter({ oas, output }),
372
374
  children: [
373
375
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["Infer"], path: "@kubb/oas", isTypeOnly: true }),
374
- /* @__PURE__ */ jsxRuntime.jsx(chunkDM7GVDDP_cjs.OasType, { name: "oas", typeName: "Oas", api: oas.api })
376
+ /* @__PURE__ */ jsxRuntime.jsx(chunkET7NPWRZ_cjs.OasType, { name: "oas", typeName: "Oas", api: oas.api })
375
377
  ]
376
378
  }
377
379
  );
@@ -382,5 +384,5 @@ exports.oasGenerator = oasGenerator;
382
384
  exports.pluginTs = pluginTs;
383
385
  exports.pluginTsName = pluginTsName;
384
386
  exports.typeGenerator = typeGenerator;
385
- //# sourceMappingURL=chunk-72QLVJKT.cjs.map
386
- //# sourceMappingURL=chunk-72QLVJKT.cjs.map
387
+ //# sourceMappingURL=chunk-IAF3HXKE.cjs.map
388
+ //# sourceMappingURL=chunk-IAF3HXKE.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/generators/index.ts","../src/generators/typeGenerator.tsx","../src/plugin.ts","../src/generators/oasGenerator.tsx"],"names":["init_cjs_shims","createPlugin","transformers","pluginOasName","options","path","FileManager","camelCase","pascalCase","PluginManager","SchemaGenerator","OperationGenerator","factory","print","createReactGenerator","useApp","useOas","useOperationManager","useSchemaManager","type","Oas","jsx","File","Type","jsxs","getBanner","getFooter","OasType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,gCAAA,EAAA;;;ACAAA,gCAAA,EAAA;;;ACAAA,gCAAA,EAAA;AAWO,IAAM,YAAe,GAAA;AAEf,IAAA,QAAA,GAAWC,iBAAuB,CAAA,CAAC,OAAY,KAAA;AAC1D,EAAM,MAAA;AAAA,IACJ,MAAS,GAAA,EAAE,IAAM,EAAA,OAAA,EAAS,YAAY,OAAQ,EAAA;AAAA,IAC9C,KAAA;AAAA,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AAY,EAAA,UAAA,EAAU,IAAC,EAAA,CAAA;AAAA,0BAE1DD,eAACM,yBAAQ,EAAA,EAAA,IAAA,EAAM,OAAO,QAAU,EAAA,KAAA,EAAO,GAAK,EAAA,GAAA,CAAI,GAAK,EAAA;AAAA;AAAA;AAAA,KACvD;AAAA;AAGN,CAAC","file":"chunk-IAF3HXKE.cjs","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 { createReactGenerator, type OperationSchemas, type OperationSchema as OperationSchemaType, SchemaGenerator } 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 { File, useApp } from '@kubb/react'\nimport type ts from 'typescript'\nimport { Type } from '../components'\nimport { pluginTsName } from '../plugin.ts'\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: schemaObject, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n const tree = schemaGenerator.parse({ schemaObject, 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} schemaObject={schemaObject} tree={tree}>\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[imp.name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={type.name}\n typedName={type.typedName}\n description={description}\n tree={tree}\n schema={schemaObject}\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, config: pluginManager.config })}\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 pluginManager,\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\n baseName={type.file.baseName}\n path={type.file.path}\n meta={type.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[imp.name, imp.path, imp.isTypeOnly].join('-')} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\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","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 emptySchemaType = unknownType,\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 emptySchemaType,\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\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <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,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunkDM7GVDDP_cjs = require('./chunk-DM7GVDDP.cjs');
3
+ var chunkET7NPWRZ_cjs = require('./chunk-ET7NPWRZ.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "OasType", {
8
8
  enumerable: true,
9
- get: function () { return chunkDM7GVDDP_cjs.OasType; }
9
+ get: function () { return chunkET7NPWRZ_cjs.OasType; }
10
10
  });
11
11
  Object.defineProperty(exports, "Type", {
12
12
  enumerable: true,
13
- get: function () { return chunkDM7GVDDP_cjs.Type; }
13
+ get: function () { return chunkET7NPWRZ_cjs.Type; }
14
14
  });
15
15
  //# sourceMappingURL=components.cjs.map
16
16
  //# sourceMappingURL=components.cjs.map
@@ -1,7 +1,7 @@
1
1
  import { OasTypes, SchemaObject } from '@kubb/oas';
2
2
  import { Schema } from '@kubb/plugin-oas';
3
3
  import { ReactNode } from 'react';
4
- import { P as PluginTs } from './types-DOx63BPA.cjs';
4
+ import { P as PluginTs } from './types-DkvPgLAK.cjs';
5
5
  import '@kubb/core';
6
6
  import 'typescript';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { OasTypes, SchemaObject } from '@kubb/oas';
2
2
  import { Schema } from '@kubb/plugin-oas';
3
3
  import { ReactNode } from 'react';
4
- import { P as PluginTs } from './types-DOx63BPA.js';
4
+ import { P as PluginTs } from './types-DkvPgLAK.js';
5
5
  import '@kubb/core';
6
6
  import 'typescript';
7
7
 
@@ -1,3 +1,3 @@
1
- export { OasType, Type } from './chunk-XKUNRASY.js';
1
+ export { OasType, Type } from './chunk-FANJV56Z.js';
2
2
  //# sourceMappingURL=components.js.map
3
3
  //# sourceMappingURL=components.js.map
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var chunk72QLVJKT_cjs = require('./chunk-72QLVJKT.cjs');
4
- require('./chunk-DM7GVDDP.cjs');
3
+ var chunkIAF3HXKE_cjs = require('./chunk-IAF3HXKE.cjs');
4
+ require('./chunk-ET7NPWRZ.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "oasGenerator", {
9
9
  enumerable: true,
10
- get: function () { return chunk72QLVJKT_cjs.oasGenerator; }
10
+ get: function () { return chunkIAF3HXKE_cjs.oasGenerator; }
11
11
  });
12
12
  Object.defineProperty(exports, "typeGenerator", {
13
13
  enumerable: true,
14
- get: function () { return chunk72QLVJKT_cjs.typeGenerator; }
14
+ get: function () { return chunkIAF3HXKE_cjs.typeGenerator; }
15
15
  });
16
16
  //# sourceMappingURL=generators.cjs.map
17
17
  //# sourceMappingURL=generators.cjs.map
@@ -1,5 +1,5 @@
1
1
  import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
- import { P as PluginTs } from './types-DOx63BPA.cjs';
2
+ import { P as PluginTs } from './types-DkvPgLAK.cjs';
3
3
  import '@kubb/core';
4
4
  import '@kubb/oas';
5
5
  import 'typescript';
@@ -1,5 +1,5 @@
1
1
  import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
- import { P as PluginTs } from './types-DOx63BPA.js';
2
+ import { P as PluginTs } from './types-DkvPgLAK.js';
3
3
  import '@kubb/core';
4
4
  import '@kubb/oas';
5
5
  import 'typescript';
@@ -1,4 +1,4 @@
1
- export { oasGenerator, typeGenerator } from './chunk-F5AASAQW.js';
2
- import './chunk-XKUNRASY.js';
1
+ export { oasGenerator, typeGenerator } from './chunk-HWPTXYQW.js';
2
+ import './chunk-FANJV56Z.js';
3
3
  //# sourceMappingURL=generators.js.map
4
4
  //# sourceMappingURL=generators.js.map
package/dist/index.cjs CHANGED
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunk72QLVJKT_cjs = require('./chunk-72QLVJKT.cjs');
4
- var chunkDM7GVDDP_cjs = require('./chunk-DM7GVDDP.cjs');
3
+ var chunkIAF3HXKE_cjs = require('./chunk-IAF3HXKE.cjs');
4
+ var chunkET7NPWRZ_cjs = require('./chunk-ET7NPWRZ.cjs');
5
5
 
6
6
  // src/index.ts
7
- chunkDM7GVDDP_cjs.init_cjs_shims();
7
+ chunkET7NPWRZ_cjs.init_cjs_shims();
8
8
 
9
9
  Object.defineProperty(exports, "pluginTs", {
10
10
  enumerable: true,
11
- get: function () { return chunk72QLVJKT_cjs.pluginTs; }
11
+ get: function () { return chunkIAF3HXKE_cjs.pluginTs; }
12
12
  });
13
13
  Object.defineProperty(exports, "pluginTsName", {
14
14
  enumerable: true,
15
- get: function () { return chunk72QLVJKT_cjs.pluginTsName; }
15
+ get: function () { return chunkIAF3HXKE_cjs.pluginTsName; }
16
16
  });
17
17
  //# sourceMappingURL=index.cjs.map
18
18
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _kubb_core from '@kubb/core';
2
- import { O as Options, P as PluginTs } from './types-DOx63BPA.cjs';
2
+ import { O as Options, P as PluginTs } from './types-DkvPgLAK.cjs';
3
3
  import '@kubb/oas';
4
4
  import '@kubb/plugin-oas';
5
5
  import 'typescript';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _kubb_core from '@kubb/core';
2
- import { O as Options, P as PluginTs } from './types-DOx63BPA.js';
2
+ import { O as Options, P as PluginTs } from './types-DkvPgLAK.js';
3
3
  import '@kubb/oas';
4
4
  import '@kubb/plugin-oas';
5
5
  import 'typescript';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { pluginTs, pluginTsName } from './chunk-F5AASAQW.js';
2
- import { init_esm_shims } from './chunk-XKUNRASY.js';
1
+ export { pluginTs, pluginTsName } from './chunk-HWPTXYQW.js';
2
+ import { init_esm_shims } from './chunk-FANJV56Z.js';
3
3
 
4
4
  // src/index.ts
5
5
  init_esm_shims();
@@ -56,6 +56,11 @@ type Options = {
56
56
  * @default 'any'
57
57
  */
58
58
  unknownType?: 'any' | 'unknown' | 'void';
59
+ /**
60
+ * Which type to use for empty schema values
61
+ * @default `unknownType`
62
+ */
63
+ emptySchemaType?: 'any' | 'unknown' | 'void';
59
64
  /**
60
65
  * Choose what to use as mode for an optional value.
61
66
  * @examples 'questionToken': type?: string
@@ -98,6 +103,7 @@ type ResolvedOptions = {
98
103
  enumSuffix: NonNullable<Options['enumSuffix']>;
99
104
  dateType: NonNullable<Options['dateType']>;
100
105
  unknownType: NonNullable<Options['unknownType']>;
106
+ emptySchemaType: NonNullable<Options['emptySchemaType']>;
101
107
  optionalType: NonNullable<Options['optionalType']>;
102
108
  transformers: NonNullable<Options['transformers']>;
103
109
  oasType: NonNullable<Options['oasType']>;
@@ -56,6 +56,11 @@ type Options = {
56
56
  * @default 'any'
57
57
  */
58
58
  unknownType?: 'any' | 'unknown' | 'void';
59
+ /**
60
+ * Which type to use for empty schema values
61
+ * @default `unknownType`
62
+ */
63
+ emptySchemaType?: 'any' | 'unknown' | 'void';
59
64
  /**
60
65
  * Choose what to use as mode for an optional value.
61
66
  * @examples 'questionToken': type?: string
@@ -98,6 +103,7 @@ type ResolvedOptions = {
98
103
  enumSuffix: NonNullable<Options['enumSuffix']>;
99
104
  dateType: NonNullable<Options['dateType']>;
100
105
  unknownType: NonNullable<Options['unknownType']>;
106
+ emptySchemaType: NonNullable<Options['emptySchemaType']>;
101
107
  optionalType: NonNullable<Options['optionalType']>;
102
108
  transformers: NonNullable<Options['transformers']>;
103
109
  oasType: NonNullable<Options['oasType']>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-ts",
3
- "version": "3.12.0",
3
+ "version": "3.13.0",
4
4
  "description": "Generator plugin-ts",
5
5
  "keywords": [
6
6
  "zod",
@@ -58,20 +58,20 @@
58
58
  "!/**/__tests__/**"
59
59
  ],
60
60
  "dependencies": {
61
- "@kubb/core": "3.12.0",
62
- "@kubb/oas": "3.12.0",
63
- "@kubb/parser-ts": "3.12.0",
64
- "@kubb/react": "3.12.0",
65
- "@kubb/plugin-oas": "3.12.0"
61
+ "@kubb/core": "3.13.0",
62
+ "@kubb/oas": "3.13.0",
63
+ "@kubb/parser-ts": "3.13.0",
64
+ "@kubb/plugin-oas": "3.13.0",
65
+ "@kubb/react": "3.13.0"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/react": "^18.3.23",
69
69
  "react": "^18.3.1",
70
70
  "tsup": "^8.5.0",
71
71
  "typescript": "^5.8.3",
72
- "@kubb/config-ts": "3.12.0",
73
- "@kubb/config-tsup": "3.12.0",
74
- "@kubb/plugin-oas": "3.12.0"
72
+ "@kubb/config-ts": "3.13.0",
73
+ "@kubb/config-tsup": "3.13.0",
74
+ "@kubb/plugin-oas": "3.13.0"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "@kubb/react": "^3.0.0"
@@ -16,7 +16,7 @@ export type CreatePets201 = error & {
16
16
  /**
17
17
  * @description Accepted response
18
18
  */
19
- export type CreatePets202 = any
19
+ export type CreatePets202 = unknown
20
20
 
21
21
  /**
22
22
  * @description unexpected error
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Generated by Kubb (https://kubb.dev/).
3
+ * Do not edit manually.
4
+ */
5
+
6
+ /**
7
+ * @description Null response
8
+ */
9
+ export type CreatePets201 = error & {
10
+ /**
11
+ * @type object | undefined
12
+ */
13
+ name?: errorCode
14
+ }
15
+
16
+ /**
17
+ * @description Accepted response
18
+ */
19
+ export type CreatePets202 = unknown
20
+
21
+ /**
22
+ * @description unexpected error
23
+ */
24
+ export type CreatePetsError = error
25
+
26
+ export type CreatePetsMutationRequest = {
27
+ /**
28
+ * @type string
29
+ */
30
+ name: string
31
+ /**
32
+ * @type string
33
+ */
34
+ tag: string
35
+ }
36
+
37
+ export type CreatePetsMutationResponse = createPets201 | createPets202
38
+
39
+ export type createPetsMutation = {
40
+ Response: createPets201 | createPets202
41
+ Request: createPetsMutationRequest
42
+ Errors: any
43
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Generated by Kubb (https://kubb.dev/).
3
+ * Do not edit manually.
4
+ */
5
+
6
+ /**
7
+ * @description Null response
8
+ */
9
+ export type CreatePets201 = error & {
10
+ /**
11
+ * @type object | undefined
12
+ */
13
+ name?: errorCode
14
+ }
15
+
16
+ /**
17
+ * @description Accepted response
18
+ */
19
+ export type CreatePets202 = void
20
+
21
+ /**
22
+ * @description unexpected error
23
+ */
24
+ export type CreatePetsError = error
25
+
26
+ export type CreatePetsMutationRequest = {
27
+ /**
28
+ * @type string
29
+ */
30
+ name: string
31
+ /**
32
+ * @type string
33
+ */
34
+ tag: string
35
+ }
36
+
37
+ export type CreatePetsMutationResponse = createPets201 | createPets202
38
+
39
+ export type createPetsMutation = {
40
+ Response: createPets201 | createPets202
41
+ Request: createPetsMutationRequest
42
+ Errors: any
43
+ }
@@ -16,7 +16,7 @@ export type CreatePets201 = error & {
16
16
  /**
17
17
  * @description Accepted response
18
18
  */
19
- export type CreatePets202 = void
19
+ export type CreatePets202 = unknown
20
20
 
21
21
  /**
22
22
  * @description unexpected error
@@ -3,7 +3,7 @@
3
3
  * Do not edit manually.
4
4
  */
5
5
 
6
- export type DeletePetsPetidMutationResponse = any
6
+ export type DeletePetsPetidMutationResponse = unknown
7
7
 
8
8
  export type deletePetsPetidMutation = {
9
9
  Response: any
@@ -16,5 +16,5 @@ export type enumArray = {
16
16
  /**
17
17
  * @type array | undefined
18
18
  */
19
- identifier?: [number, string, EnumArrayIdentifierEnum2, ...any[]]
19
+ identifier?: [number, string, EnumArrayIdentifierEnum2, ...unknown[]]
20
20
  }
package/src/plugin.ts CHANGED
@@ -23,6 +23,7 @@ export const pluginTs = createPlugin<PluginTs>((options) => {
23
23
  dateType = 'string',
24
24
  unknownType = 'any',
25
25
  optionalType = 'questionToken',
26
+ emptySchemaType = unknownType,
26
27
  syntaxType = 'type',
27
28
  transformers = {},
28
29
  oasType = false,
@@ -44,6 +45,7 @@ export const pluginTs = createPlugin<PluginTs>((options) => {
44
45
  // keep the used enumnames between SchemaGenerator and OperationGenerator per plugin(pluginKey)
45
46
  usedEnumNames: {},
46
47
  unknownType,
48
+ emptySchemaType,
47
49
  syntaxType,
48
50
  group,
49
51
  override,
package/src/types.ts CHANGED
@@ -56,6 +56,11 @@ export type Options = {
56
56
  * @default 'any'
57
57
  */
58
58
  unknownType?: 'any' | 'unknown' | 'void'
59
+ /**
60
+ * Which type to use for empty schema values
61
+ * @default `unknownType`
62
+ */
63
+ emptySchemaType?: 'any' | 'unknown' | 'void'
59
64
  /**
60
65
  * Choose what to use as mode for an optional value.
61
66
  * @examples 'questionToken': type?: string
@@ -99,6 +104,7 @@ type ResolvedOptions = {
99
104
  enumSuffix: NonNullable<Options['enumSuffix']>
100
105
  dateType: NonNullable<Options['dateType']>
101
106
  unknownType: NonNullable<Options['unknownType']>
107
+ emptySchemaType: NonNullable<Options['emptySchemaType']>
102
108
  optionalType: NonNullable<Options['optionalType']>
103
109
  transformers: NonNullable<Options['transformers']>
104
110
  oasType: NonNullable<Options['oasType']>