@kubb/plugin-ts 3.8.0 → 3.9.1

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 (67) hide show
  1. package/dist/{chunk-OJLHIBYC.js → chunk-45GERXQD.js} +47 -26
  2. package/dist/chunk-45GERXQD.js.map +1 -0
  3. package/dist/{chunk-YCJCRZF6.js → chunk-LEN5TPHR.js} +15 -13
  4. package/dist/chunk-LEN5TPHR.js.map +1 -0
  5. package/dist/{chunk-VBEBZKJX.cjs → chunk-LWIFDYGQ.cjs} +53 -32
  6. package/dist/chunk-LWIFDYGQ.cjs.map +1 -0
  7. package/dist/{chunk-OFELQKSZ.cjs → chunk-YOHDAJ4F.cjs} +15 -13
  8. package/dist/chunk-YOHDAJ4F.cjs.map +1 -0
  9. package/dist/components.cjs +3 -3
  10. package/dist/components.js +1 -1
  11. package/dist/generators.cjs +4 -4
  12. package/dist/generators.js +2 -2
  13. package/dist/index.cjs +4 -4
  14. package/dist/index.js +2 -2
  15. package/package.json +11 -11
  16. package/src/generators/__snapshots__/bodyUploadFileApiAssetsPost.ts +5 -0
  17. package/src/generators/__snapshots__/catTypeAsConst.ts +5 -0
  18. package/src/generators/__snapshots__/createPet.ts +5 -0
  19. package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +5 -0
  20. package/src/generators/__snapshots__/createPetWithUnknownTypeVoid.ts +5 -0
  21. package/src/generators/__snapshots__/deletePet.ts +5 -0
  22. package/src/generators/__snapshots__/dogTypeAsConst.ts +5 -0
  23. package/src/generators/__snapshots__/enumAllOf.ts +5 -0
  24. package/src/generators/__snapshots__/enumArray.ts +5 -0
  25. package/src/generators/__snapshots__/enumArray20.ts +5 -0
  26. package/src/generators/__snapshots__/enumInObject.ts +5 -0
  27. package/src/generators/__snapshots__/enumItems.ts +5 -0
  28. package/src/generators/__snapshots__/enumNames.ts +5 -0
  29. package/src/generators/__snapshots__/enumNamesConst.ts +5 -0
  30. package/src/generators/__snapshots__/enumNamesLiteral.ts +5 -0
  31. package/src/generators/__snapshots__/enumNamesPascalConst.ts +5 -0
  32. package/src/generators/__snapshots__/enumNamesType.ts +5 -0
  33. package/src/generators/__snapshots__/enumNullableMember.ts +5 -0
  34. package/src/generators/__snapshots__/enumNullableType.ts +5 -0
  35. package/src/generators/__snapshots__/enumString.ts +5 -0
  36. package/src/generators/__snapshots__/enumVarNamesType.ts +5 -0
  37. package/src/generators/__snapshots__/fooBase.ts +5 -0
  38. package/src/generators/__snapshots__/fooNumber.ts +5 -0
  39. package/src/generators/__snapshots__/getPets.ts +5 -0
  40. package/src/generators/__snapshots__/mixedValueTypeConst.ts +5 -0
  41. package/src/generators/__snapshots__/nullConstNull.ts +5 -0
  42. package/src/generators/__snapshots__/numberValueConst.ts +5 -0
  43. package/src/generators/__snapshots__/petMapper.ts +5 -0
  44. package/src/generators/__snapshots__/petQuestionToken.ts +5 -0
  45. package/src/generators/__snapshots__/petQuestionTokenAndUndefined.ts +5 -0
  46. package/src/generators/__snapshots__/petUndefined.ts +5 -0
  47. package/src/generators/__snapshots__/pets.ts +5 -0
  48. package/src/generators/__snapshots__/petsInterface.ts +5 -0
  49. package/src/generators/__snapshots__/petsStoreAdvancedDiscriminator.ts +5 -0
  50. package/src/generators/__snapshots__/petsStoreDiscriminator.ts +5 -0
  51. package/src/generators/__snapshots__/petsStoreRef.ts +5 -0
  52. package/src/generators/__snapshots__/plainDateDate.ts +5 -0
  53. package/src/generators/__snapshots__/plainDateString.ts +5 -0
  54. package/src/generators/__snapshots__/plainEmail.ts +5 -0
  55. package/src/generators/__snapshots__/plainFile.ts +5 -0
  56. package/src/generators/__snapshots__/plainTimeDate.ts +5 -0
  57. package/src/generators/__snapshots__/plainUuid.ts +5 -0
  58. package/src/generators/__snapshots__/readOnly.ts +5 -0
  59. package/src/generators/__snapshots__/showPetById.ts +5 -0
  60. package/src/generators/__snapshots__/stringValueConst.ts +5 -0
  61. package/src/generators/oasGenerator.tsx +7 -1
  62. package/src/generators/typeGenerator.tsx +9 -2
  63. package/src/parser.ts +12 -8
  64. package/dist/chunk-OFELQKSZ.cjs.map +0 -1
  65. package/dist/chunk-OJLHIBYC.js.map +0 -1
  66. package/dist/chunk-VBEBZKJX.cjs.map +0 -1
  67. package/dist/chunk-YCJCRZF6.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkOFELQKSZ_cjs = require('./chunk-OFELQKSZ.cjs');
3
+ var chunkYOHDAJ4F_cjs = require('./chunk-YOHDAJ4F.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,16 +38,16 @@ var factory__namespace = /*#__PURE__*/_interopNamespace(factory);
38
38
  var path__default = /*#__PURE__*/_interopDefault(path);
39
39
 
40
40
  // src/generators/index.ts
41
- chunkOFELQKSZ_cjs.init_cjs_shims();
41
+ chunkYOHDAJ4F_cjs.init_cjs_shims();
42
42
 
43
43
  // src/generators/typeGenerator.tsx
44
- chunkOFELQKSZ_cjs.init_cjs_shims();
44
+ chunkYOHDAJ4F_cjs.init_cjs_shims();
45
45
 
46
46
  // src/index.ts
47
- chunkOFELQKSZ_cjs.init_cjs_shims();
47
+ chunkYOHDAJ4F_cjs.init_cjs_shims();
48
48
 
49
49
  // src/plugin.ts
50
- chunkOFELQKSZ_cjs.init_cjs_shims();
50
+ chunkYOHDAJ4F_cjs.init_cjs_shims();
51
51
  var pluginTsName = "plugin-ts";
52
52
  var pluginTs = core.createPlugin((options) => {
53
53
  const {
@@ -269,7 +269,7 @@ var typeGenerator = pluginOas.createReactGenerator({
269
269
  return /* @__PURE__ */ jsxRuntime.jsxs(components.Oas.Schema, { name, value: schema, tree, children: [
270
270
  mode === "split" && imports.map((imp, index) => /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { root: file.path, path: imp.path, name: imp.name, isTypeOnly: true }, index)),
271
271
  /* @__PURE__ */ jsxRuntime.jsx(
272
- chunkOFELQKSZ_cjs.Type,
272
+ chunkYOHDAJ4F_cjs.Type,
273
273
  {
274
274
  name: type2.name,
275
275
  typedName: type2.typedName,
@@ -291,7 +291,7 @@ var typeGenerator = pluginOas.createReactGenerator({
291
291
  baseName: file.baseName,
292
292
  path: file.path,
293
293
  meta: file.meta,
294
- banner: utils.getBanner({ oas, output: plugin.options.output }),
294
+ banner: utils.getBanner({ oas, output: plugin.options.output, config: pluginManager.config }),
295
295
  footer: utils.getFooter({ oas, output: plugin.options.output }),
296
296
  children: [
297
297
  operationSchemas.map(mapOperationSchema),
@@ -306,7 +306,8 @@ var typeGenerator = pluginOas.createReactGenerator({
306
306
  mode,
307
307
  plugin: {
308
308
  options: { output }
309
- }
309
+ },
310
+ pluginManager
310
311
  } = react.useApp();
311
312
  const oas = hooks.useOas();
312
313
  const { getName, getImports, getFile } = hooks.useSchemaManager();
@@ -319,28 +320,38 @@ var typeGenerator = pluginOas.createReactGenerator({
319
320
  typedName: getName(schema.name, { type: "type" }),
320
321
  file: getFile(schema.name)
321
322
  };
322
- return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: type.file.baseName, path: type.file.path, meta: type.file.meta, banner: utils.getBanner({ oas, output }), footer: utils.getFooter({ oas, output }), children: [
323
- mode === "split" && imports.map((imp, index) => /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { root: type.file.path, path: imp.path, name: imp.name, isTypeOnly: true }, index)),
324
- /* @__PURE__ */ jsxRuntime.jsx(
325
- chunkOFELQKSZ_cjs.Type,
326
- {
327
- name: type.name,
328
- typedName: type.typedName,
329
- description: schema.value.description,
330
- tree: schema.tree,
331
- schema: schema.value,
332
- mapper,
333
- enumType,
334
- optionalType,
335
- syntaxType
336
- }
337
- )
338
- ] });
323
+ return /* @__PURE__ */ jsxRuntime.jsxs(
324
+ react.File,
325
+ {
326
+ baseName: type.file.baseName,
327
+ path: type.file.path,
328
+ meta: type.file.meta,
329
+ banner: utils.getBanner({ oas, output, config: pluginManager.config }),
330
+ footer: utils.getFooter({ oas, output }),
331
+ children: [
332
+ mode === "split" && imports.map((imp, index) => /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { root: type.file.path, path: imp.path, name: imp.name, isTypeOnly: true }, index)),
333
+ /* @__PURE__ */ jsxRuntime.jsx(
334
+ chunkYOHDAJ4F_cjs.Type,
335
+ {
336
+ name: type.name,
337
+ typedName: type.typedName,
338
+ description: schema.value.description,
339
+ tree: schema.tree,
340
+ schema: schema.value,
341
+ mapper,
342
+ enumType,
343
+ optionalType,
344
+ syntaxType
345
+ }
346
+ )
347
+ ]
348
+ }
349
+ );
339
350
  }
340
351
  });
341
352
 
342
353
  // src/generators/oasGenerator.tsx
343
- chunkOFELQKSZ_cjs.init_cjs_shims();
354
+ chunkYOHDAJ4F_cjs.init_cjs_shims();
344
355
  var oasGenerator = pluginOas.createReactGenerator({
345
356
  name: "oas",
346
357
  Operations() {
@@ -353,10 +364,20 @@ var oasGenerator = pluginOas.createReactGenerator({
353
364
  } = react.useApp();
354
365
  const oas = hooks.useOas();
355
366
  const file = pluginManager.getFile({ name: "oas", extname: ".ts", pluginKey });
356
- return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: file.baseName, path: file.path, meta: file.meta, banner: utils.getBanner({ oas, output }), footer: utils.getFooter({ oas, output }), children: [
357
- /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["Infer"], path: "@kubb/oas", isTypeOnly: true }),
358
- /* @__PURE__ */ jsxRuntime.jsx(chunkOFELQKSZ_cjs.OasType, { name: "oas", typeName: "Oas", api: oas.api })
359
- ] });
367
+ return /* @__PURE__ */ jsxRuntime.jsxs(
368
+ react.File,
369
+ {
370
+ baseName: file.baseName,
371
+ path: file.path,
372
+ meta: file.meta,
373
+ banner: utils.getBanner({ oas, output, config: pluginManager.config }),
374
+ footer: utils.getFooter({ oas, output }),
375
+ children: [
376
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["Infer"], path: "@kubb/oas", isTypeOnly: true }),
377
+ /* @__PURE__ */ jsxRuntime.jsx(chunkYOHDAJ4F_cjs.OasType, { name: "oas", typeName: "Oas", api: oas.api })
378
+ ]
379
+ }
380
+ );
360
381
  }
361
382
  });
362
383
 
@@ -364,5 +385,5 @@ exports.oasGenerator = oasGenerator;
364
385
  exports.pluginTs = pluginTs;
365
386
  exports.pluginTsName = pluginTsName;
366
387
  exports.typeGenerator = typeGenerator;
367
- //# sourceMappingURL=chunk-VBEBZKJX.cjs.map
368
- //# sourceMappingURL=chunk-VBEBZKJX.cjs.map
388
+ //# sourceMappingURL=chunk-LWIFDYGQ.cjs.map
389
+ //# sourceMappingURL=chunk-LWIFDYGQ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/generators/index.ts","../src/generators/typeGenerator.tsx","../src/index.ts","../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;;;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,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,WAA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,EAAA,KAAA;AAAA,EACN,UAAa,GAAA;AACX,IAAM,MAAA;AAAA,MACJ,aAAA;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,OAAA,EAAS,EAAE,MAAO,EAAA;AAAA,QAClB,GAAK,EAAA;AAAA;AACP,QACEC,YAAiB,EAAA;AACrB,IAAA,MAAM,MAAMC,YAAO,EAAA;AAEnB,IAAM,MAAA,IAAA,GAAO,cAAc,OAAQ,CAAA,EAAE,MAAM,KAAO,EAAA,OAAA,EAAS,KAAO,EAAA,SAAA,EAAW,CAAA;AAE7E,IAAA,uBACEQ,eAAAA;AAAA,MAACF,UAAAA;AAAA,MAAA;AAAA,QACC,UAAU,IAAK,CAAA,QAAA;AAAA,QACf,MAAM,IAAK,CAAA,IAAA;AAAA,QACX,MAAM,IAAK,CAAA,IAAA;AAAA,QACX,MAAA,EAAQG,gBAAU,EAAE,GAAA,EAAK,QAAQ,MAAQ,EAAA,aAAA,CAAc,QAAQ,CAAA;AAAA,QAC/D,MAAQC,EAAAA,eAAAA,CAAU,EAAE,GAAA,EAAK,QAAQ,CAAA;AAAA,QAEjC,QAAA,EAAA;AAAA,0BAAAL,cAAAA,CAACC,UAAK,CAAA,MAAA,EAAL,EAAY,IAAA,EAAM,CAAC,OAAO,CAAG,EAAA,IAAA,EAAK,WAAY,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-LWIFDYGQ.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 { 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, 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' && 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\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"]}
@@ -2307,7 +2307,6 @@ var typeKeywordMapper = {
2307
2307
  time: (type = "string") => type === "string" ? factory__namespace.keywordTypeNodes.string : factory__namespace.createTypeReferenceNode(factory__namespace.createIdentifier("Date")),
2308
2308
  uuid: () => factory__namespace.keywordTypeNodes.string,
2309
2309
  url: () => factory__namespace.keywordTypeNodes.string,
2310
- strict: void 0,
2311
2310
  default: void 0,
2312
2311
  and: (nodes) => {
2313
2312
  if (!nodes) {
@@ -2341,24 +2340,27 @@ var typeKeywordMapper = {
2341
2340
  example: void 0,
2342
2341
  schema: void 0,
2343
2342
  catchall: void 0,
2344
- name: void 0
2343
+ name: void 0,
2344
+ interface: void 0
2345
2345
  };
2346
- function parse({ current, siblings }, options) {
2346
+ function parse({ current, siblings, name }, options) {
2347
2347
  const value = typeKeywordMapper[current.keyword];
2348
2348
  if (!value) {
2349
2349
  return void 0;
2350
2350
  }
2351
2351
  if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.union)) {
2352
2352
  return typeKeywordMapper.union(
2353
- current.args.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
2353
+ current.args.map((schema) => parse({ name, current: schema, siblings }, options)).filter(Boolean)
2354
2354
  );
2355
2355
  }
2356
2356
  if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.and)) {
2357
- return typeKeywordMapper.and(current.args.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean));
2357
+ return typeKeywordMapper.and(
2358
+ current.args.map((schema) => parse({ name, current: schema, siblings }, options)).filter(Boolean)
2359
+ );
2358
2360
  }
2359
2361
  if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.array)) {
2360
2362
  return typeKeywordMapper.array(
2361
- current.args.items.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
2363
+ current.args.items.map((schema) => parse({ name, current: schema, siblings }, options)).filter(Boolean)
2362
2364
  );
2363
2365
  }
2364
2366
  if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.enum)) {
@@ -2372,7 +2374,7 @@ function parse({ current, siblings }, options) {
2372
2374
  }
2373
2375
  if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.tuple)) {
2374
2376
  return typeKeywordMapper.tuple(
2375
- current.args.items.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
2377
+ current.args.items.map((schema) => parse({ name, current: schema, siblings }, options)).filter(Boolean)
2376
2378
  );
2377
2379
  }
2378
2380
  if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.const)) {
@@ -2382,9 +2384,9 @@ function parse({ current, siblings }, options) {
2382
2384
  const properties = Object.entries(current.args?.properties || {}).filter((item) => {
2383
2385
  const schemas = item[1];
2384
2386
  return schemas && typeof schemas.map === "function";
2385
- }).map(([name, schemas]) => {
2387
+ }).map(([name2, schemas]) => {
2386
2388
  const nameSchema = schemas.find((schema) => schema.keyword === pluginOas.schemaKeywords.name);
2387
- const mappedName = nameSchema?.args || name;
2389
+ const mappedName = nameSchema?.args || name2;
2388
2390
  if (options.mapper?.[mappedName]) {
2389
2391
  return options.mapper?.[mappedName];
2390
2392
  }
@@ -2400,7 +2402,7 @@ function parse({ current, siblings }, options) {
2400
2402
  const minSchema = schemas.find((schema) => schema.keyword === pluginOas.schemaKeywords.min);
2401
2403
  const maxSchema = schemas.find((schema) => schema.keyword === pluginOas.schemaKeywords.max);
2402
2404
  const matchesSchema = schemas.find((schema) => schema.keyword === pluginOas.schemaKeywords.matches);
2403
- let type = schemas.map((schema) => parse({ current: schema, siblings: schemas }, options)).filter(Boolean)[0];
2405
+ let type = schemas.map((schema) => parse({ name: name2, current: schema, siblings: schemas }, options)).filter(Boolean)[0];
2404
2406
  if (isNullable) {
2405
2407
  type = factory__namespace.createUnionDeclaration({
2406
2408
  nodes: [type, factory__namespace.keywordTypeNodes.null]
@@ -2437,7 +2439,7 @@ function parse({ current, siblings }, options) {
2437
2439
  });
2438
2440
  });
2439
2441
  const additionalProperties = current.args?.additionalProperties?.length ? factory__namespace.createIndexSignature(
2440
- current.args.additionalProperties.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean).at(0)
2442
+ current.args.additionalProperties.map((schema) => parse({ name, current: schema, siblings }, options)).filter(Boolean).at(0)
2441
2443
  ) : void 0;
2442
2444
  return typeKeywordMapper.object([...properties, additionalProperties].filter(Boolean));
2443
2445
  }
@@ -2576,5 +2578,5 @@ react/cjs/react.development.js:
2576
2578
  exports.OasType = OasType;
2577
2579
  exports.Type = Type2;
2578
2580
  exports.init_cjs_shims = init_cjs_shims;
2579
- //# sourceMappingURL=chunk-OFELQKSZ.cjs.map
2580
- //# sourceMappingURL=chunk-OFELQKSZ.cjs.map
2581
+ //# sourceMappingURL=chunk-YOHDAJ4F.cjs.map
2582
+ //# sourceMappingURL=chunk-YOHDAJ4F.cjs.map