@kubb/plugin-ts 5.0.0-alpha.13 → 5.0.0-alpha.15

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.
@@ -1,4 +1,4 @@
1
- import { applyParamsCasing } from '@kubb/ast'
1
+ import { applyParamsCasing, composeTransformers, transform } from '@kubb/ast'
2
2
  import type { SchemaNode } from '@kubb/ast/types'
3
3
  import { defineGenerator } from '@kubb/core'
4
4
  import { useKubb } from '@kubb/core/hooks'
@@ -21,7 +21,7 @@ export const typeGenerator = defineGenerator<PluginTs>({
21
21
  name: 'typescript',
22
22
  type: 'react',
23
23
  Operation({ node, adapter, options }) {
24
- const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, resolver, baseResolver, legacy } = options
24
+ const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, resolver, baseResolver, legacy, transformers = [] } = options
25
25
  const { mode, getFile, resolveBanner, resolveFooter } = useKubb<PluginTs>()
26
26
 
27
27
  const file = getFile({
@@ -51,7 +51,9 @@ export const typeGenerator = defineGenerator<PluginTs>({
51
51
  return null
52
52
  }
53
53
 
54
- const imports = adapter.getImports(schemaNode, (schemaName) => ({
54
+ const transformedNode = transform(schemaNode, composeTransformers(...transformers))
55
+
56
+ const imports = adapter.getImports(transformedNode, (schemaName) => ({
55
57
  name: resolver.default(schemaName, 'type'),
56
58
  path: getFile({ name: schemaName, extname: '.ts', mode }).path,
57
59
  }))
@@ -63,7 +65,7 @@ export const typeGenerator = defineGenerator<PluginTs>({
63
65
  <Type
64
66
  name={name}
65
67
  typedName={typedName}
66
- node={schemaNode}
68
+ node={transformedNode}
67
69
  description={description}
68
70
  enumType={enumType}
69
71
  enumKeyCasing={enumKeyCasing}
@@ -81,7 +83,7 @@ export const typeGenerator = defineGenerator<PluginTs>({
81
83
  const responseTypes = legacy
82
84
  ? node.responses.map((res) => {
83
85
  const responseName = resolver.resolveResponseStatusName(node, res.statusCode)
84
- const baseResponseName = (baseResolver ?? resolver).resolveResponseStatusName(node, res.statusCode)
86
+ const baseResponseName = baseResolver.resolveResponseStatusName(node, res.statusCode)
85
87
 
86
88
  return renderSchemaType({
87
89
  node: res.schema ? nameUnnamedEnums(res.schema, baseResponseName) : res.schema,
@@ -103,7 +105,7 @@ export const typeGenerator = defineGenerator<PluginTs>({
103
105
 
104
106
  const requestType = node.requestBody?.schema
105
107
  ? renderSchemaType({
106
- node: legacy ? nameUnnamedEnums(node.requestBody.schema, (baseResolver ?? resolver).resolveDataName(node)) : node.requestBody.schema,
108
+ node: legacy ? nameUnnamedEnums(node.requestBody.schema, baseResolver.resolveDataName(node)) : node.requestBody.schema,
107
109
  name: resolver.resolveDataName(node),
108
110
  typedName: resolver.resolveDataTypedName(node),
109
111
  description: node.requestBody.description ?? node.requestBody.schema.description,
@@ -119,21 +121,21 @@ export const typeGenerator = defineGenerator<PluginTs>({
119
121
  const legacyParamTypes = [
120
122
  pathParams.length > 0
121
123
  ? renderSchemaType({
122
- node: buildGroupedParamsSchema({ params: pathParams, parentName: (baseResolver ?? resolver).resolvePathParamsName!(node) }),
124
+ node: buildGroupedParamsSchema({ params: pathParams, parentName: baseResolver.resolvePathParamsName!(node) }),
123
125
  name: resolver.resolvePathParamsName!(node),
124
126
  typedName: resolver.resolvePathParamsTypedName!(node),
125
127
  })
126
128
  : null,
127
129
  queryParams.length > 0
128
130
  ? renderSchemaType({
129
- node: buildGroupedParamsSchema({ params: queryParams, parentName: (baseResolver ?? resolver).resolveQueryParamsName!(node) }),
131
+ node: buildGroupedParamsSchema({ params: queryParams, parentName: baseResolver.resolveQueryParamsName!(node) }),
130
132
  name: resolver.resolveQueryParamsName!(node),
131
133
  typedName: resolver.resolveQueryParamsTypedName!(node),
132
134
  })
133
135
  : null,
134
136
  headerParams.length > 0
135
137
  ? renderSchemaType({
136
- node: buildGroupedParamsSchema({ params: headerParams, parentName: (baseResolver ?? resolver).resolveHeaderParamsName!(node) }),
138
+ node: buildGroupedParamsSchema({ params: headerParams, parentName: baseResolver.resolveHeaderParamsName!(node) }),
137
139
  name: resolver.resolveHeaderParamsName!(node),
138
140
  typedName: resolver.resolveHeaderParamsTypedName!(node),
139
141
  })
@@ -213,14 +215,16 @@ export const typeGenerator = defineGenerator<PluginTs>({
213
215
  )
214
216
  },
215
217
  Schema({ node, adapter, options }) {
216
- const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, resolver, legacy } = options
218
+ const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, resolver, legacy, transformers = [] } = options
217
219
  const { mode, getFile, resolveBanner, resolveFooter } = useKubb<PluginTs>()
218
220
 
219
221
  if (!node.name) {
220
222
  return
221
223
  }
222
224
 
223
- const imports = adapter.getImports(node, (schemaName) => ({
225
+ const transformedNode = transform(node, composeTransformers(...transformers))
226
+
227
+ const imports = adapter.getImports(transformedNode, (schemaName) => ({
224
228
  name: resolver.default(schemaName, 'type'),
225
229
  path: getFile({ name: schemaName, extname: '.ts', mode }).path,
226
230
  }))
@@ -244,7 +248,7 @@ export const typeGenerator = defineGenerator<PluginTs>({
244
248
  <Type
245
249
  name={type.name}
246
250
  typedName={type.typedName}
247
- node={node}
251
+ node={transformedNode}
248
252
  enumType={enumType}
249
253
  enumKeyCasing={enumKeyCasing}
250
254
  optionalType={optionalType}
@@ -21,10 +21,10 @@ export function buildParamsSchema({ params, node, resolver }: BuildParamsSchemaO
21
21
  properties: params.map((param) =>
22
22
  createProperty({
23
23
  name: param.name,
24
+ required: param.required,
24
25
  schema: createSchema({
25
26
  type: 'ref',
26
27
  name: resolver.resolveParamName(node, param),
27
- optional: !param.required,
28
28
  }),
29
29
  }),
30
30
  ),
@@ -65,7 +65,8 @@ export function buildDataSchemaNode({ node, resolver }: BuildOperationSchemaOpti
65
65
  }),
66
66
  createProperty({
67
67
  name: 'pathParams',
68
- schema: pathParams.length > 0 ? buildParamsSchema({ params: pathParams, node, resolver }) : createSchema({ type: 'never', optional: true }),
68
+ required: pathParams.length > 0,
69
+ schema: pathParams.length > 0 ? buildParamsSchema({ params: pathParams, node, resolver }) : createSchema({ type: 'never' }),
69
70
  }),
70
71
  createProperty({
71
72
  name: 'queryParams',
@@ -83,6 +84,7 @@ export function buildDataSchemaNode({ node, resolver }: BuildOperationSchemaOpti
83
84
  }),
84
85
  createProperty({
85
86
  name: 'url',
87
+ required: true,
86
88
  schema: createSchema({ type: 'url', path: node.path }),
87
89
  }),
88
90
  ],
@@ -104,6 +106,7 @@ export function buildResponsesSchemaNode({ node, resolver }: BuildOperationSchem
104
106
  properties: node.responses.map((res) =>
105
107
  createProperty({
106
108
  name: String(res.statusCode),
109
+ required: true,
107
110
  schema: createSchema({
108
111
  type: 'ref',
109
112
  name: resolver.resolveResponseStatusTypedName(node, res.statusCode),
@@ -154,13 +157,13 @@ export function buildGroupedParamsSchema({ params, parentName }: BuildGroupedPar
154
157
  return createSchema({
155
158
  type: 'object',
156
159
  properties: params.map((param) => {
157
- let schema = { ...param.schema, optional: !param.required } as SchemaNode
158
- // Name unnamed enum properties so they are emitted as enum declarations
160
+ let schema = param.schema
159
161
  if (narrowSchema(schema, 'enum') && !schema.name && parentName) {
160
162
  schema = { ...schema, name: pascalCase([parentName, param.name, 'enum'].join(' ')) }
161
163
  }
162
164
  return createProperty({
163
165
  name: param.name,
166
+ required: param.required,
164
167
  schema,
165
168
  })
166
169
  }),
@@ -202,12 +205,13 @@ export function buildLegacyResponsesSchemaNode({ node, resolver }: BuildOperatio
202
205
  })
203
206
  : createSchema({ type: 'any' })
204
207
 
205
- const properties = [createProperty({ name: 'Response', schema: responseSchema })]
208
+ const properties = [createProperty({ name: 'Response', required: true, schema: responseSchema })]
206
209
 
207
210
  if (!isGet && node.requestBody?.schema) {
208
211
  properties.push(
209
212
  createProperty({
210
213
  name: 'Request',
214
+ required: true,
211
215
  schema: createSchema({ type: 'ref', name: resolver.resolveDataTypedName(node) }),
212
216
  }),
213
217
  )
@@ -217,6 +221,7 @@ export function buildLegacyResponsesSchemaNode({ node, resolver }: BuildOperatio
217
221
  properties.push(
218
222
  createProperty({
219
223
  name: 'QueryParams',
224
+ required: true,
220
225
  schema: createSchema({ type: 'ref', name: resolver.resolveQueryParamsTypedName(node) }),
221
226
  }),
222
227
  )
@@ -226,6 +231,7 @@ export function buildLegacyResponsesSchemaNode({ node, resolver }: BuildOperatio
226
231
  properties.push(
227
232
  createProperty({
228
233
  name: 'PathParams',
234
+ required: true,
229
235
  schema: createSchema({ type: 'ref', name: resolver.resolvePathParamsTypedName(node) }),
230
236
  }),
231
237
  )
@@ -235,12 +241,13 @@ export function buildLegacyResponsesSchemaNode({ node, resolver }: BuildOperatio
235
241
  properties.push(
236
242
  createProperty({
237
243
  name: 'HeaderParams',
244
+ required: true,
238
245
  schema: createSchema({ type: 'ref', name: resolver.resolveHeaderParamsTypedName(node) }),
239
246
  }),
240
247
  )
241
248
  }
242
249
 
243
- properties.push(createProperty({ name: 'Errors', schema: errorsSchema }))
250
+ properties.push(createProperty({ name: 'Errors', required: true, schema: errorsSchema }))
244
251
 
245
252
  return createSchema({ type: 'object', properties })
246
253
  }
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { pluginTs, pluginTsName } from './plugin.ts'
2
- export type { PluginTs } from './types.ts'
2
+ export { resolverTs, resolverTsLegacy } from './resolvers/index.ts'
3
+ export type { PluginTs, ResolverTs } from './types.ts'
package/src/plugin.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import path from 'node:path'
2
2
  import { camelCase } from '@internals/utils'
3
3
  import { walk } from '@kubb/ast'
4
- import { createPlugin, type Group, getBarrelFiles, getMode, renderOperation, renderSchema } from '@kubb/core'
4
+ import { createPlugin, type Group, getBarrelFiles, getMode, mergeResolvers, renderOperation, renderSchema } from '@kubb/core'
5
5
  import { typeGenerator } from './generators/index.ts'
6
6
  import { resolverTs, resolverTsLegacy } from './resolvers/index.ts'
7
7
  import type { PluginTs } from './types.ts'
@@ -20,27 +20,15 @@ export const pluginTs = createPlugin<PluginTs>((options) => {
20
20
  optionalType = 'questionToken',
21
21
  arrayType = 'array',
22
22
  syntaxType = 'type',
23
- transformers = {},
24
23
  paramsCasing,
25
24
  generators = [typeGenerator].filter(Boolean),
26
25
  legacy = false,
26
+ resolvers: userResolvers,
27
+ transformers = [],
27
28
  } = options
28
29
 
29
30
  const baseResolver = legacy ? resolverTsLegacy : resolverTs
30
-
31
- // When a `transformers.name` callback is provided, wrap the resolver so that
32
- // every name produced by `default()` (and therefore by every helper that calls
33
- // `this.default(...)`) flows through the user's transformer.
34
- const resolver: typeof baseResolver = transformers?.name
35
- ? {
36
- ...baseResolver,
37
- default(name, type) {
38
- const resolved = baseResolver.default(name, type)
39
-
40
- return transformers.name!(resolved, type) || resolved
41
- },
42
- }
43
- : baseResolver
31
+ const resolver = mergeResolvers(...(userResolvers ?? [baseResolver]))
44
32
 
45
33
  let resolveNameWarning = false
46
34
 
@@ -48,7 +36,6 @@ export const pluginTs = createPlugin<PluginTs>((options) => {
48
36
  name: pluginTsName,
49
37
  options: {
50
38
  output,
51
- transformers,
52
39
  optionalType,
53
40
  arrayType,
54
41
  enumType,
@@ -60,6 +47,7 @@ export const pluginTs = createPlugin<PluginTs>((options) => {
60
47
  legacy,
61
48
  resolver,
62
49
  baseResolver,
50
+ transformers,
63
51
  },
64
52
  resolvePath(baseName, pathMode, options) {
65
53
  const root = path.resolve(this.config.root, this.config.output.path)
@@ -115,60 +103,57 @@ export const pluginTs = createPlugin<PluginTs>((options) => {
115
103
 
116
104
  await openInStudio({ ast: true })
117
105
 
118
- await walk(
119
- rootNode,
120
- {
121
- async schema(schemaNode) {
122
- const writeTasks = generators.map(async (generator) => {
123
- if (generator.type === 'react' && generator.version === '2') {
124
- const options = resolver.resolveOptions(schemaNode, { options: plugin.options, exclude, include, override })
125
-
126
- if (options === null) {
127
- return
128
- }
129
-
130
- await renderSchema(schemaNode, {
131
- options,
132
- adapter,
133
- config,
134
- fabric,
135
- Component: generator.Schema,
136
- plugin,
137
- driver,
138
- mode,
139
- })
106
+ await walk(rootNode, {
107
+ depth: 'shallow',
108
+ async schema(schemaNode) {
109
+ const writeTasks = generators.map(async (generator) => {
110
+ if (generator.type === 'react' && generator.version === '2') {
111
+ const options = resolver.resolveOptions(schemaNode, { options: plugin.options, exclude, include, override })
112
+
113
+ if (options === null) {
114
+ return
140
115
  }
141
- })
142
-
143
- await Promise.all(writeTasks)
144
- },
145
- async operation(operationNode) {
146
- const writeTasks = generators.map(async (generator) => {
147
- if (generator.type === 'react' && generator.version === '2') {
148
- const options = resolver.resolveOptions(operationNode, { options: plugin.options, exclude, include, override })
149
-
150
- if (options === null) {
151
- return
152
- }
153
-
154
- await renderOperation(operationNode, {
155
- options,
156
- adapter,
157
- config,
158
- fabric,
159
- Component: generator.Operation,
160
- plugin,
161
- driver,
162
- mode,
163
- })
116
+
117
+ await renderSchema(schemaNode, {
118
+ options,
119
+ adapter,
120
+ config,
121
+ fabric,
122
+ Component: generator.Schema,
123
+ plugin,
124
+ driver,
125
+ mode,
126
+ })
127
+ }
128
+ })
129
+
130
+ await Promise.all(writeTasks)
131
+ },
132
+ async operation(operationNode) {
133
+ const writeTasks = generators.map(async (generator) => {
134
+ if (generator.type === 'react' && generator.version === '2') {
135
+ const options = resolver.resolveOptions(operationNode, { options: plugin.options, exclude, include, override })
136
+
137
+ if (options === null) {
138
+ return
164
139
  }
165
- })
166
140
 
167
- await Promise.all(writeTasks)
168
- },
141
+ await renderOperation(operationNode, {
142
+ options,
143
+ adapter,
144
+ config,
145
+ fabric,
146
+ Component: generator.Operation,
147
+ plugin,
148
+ driver,
149
+ mode,
150
+ })
151
+ }
152
+ })
153
+
154
+ await Promise.all(writeTasks)
169
155
  },
170
- { depth: 'shallow' },
171
- )
156
+ })
172
157
 
173
158
  const barrelFiles = await getBarrelFiles(this.fabric.files, {
174
159
  type: output.barrelType ?? 'named',
@@ -26,6 +26,7 @@ function resolveName(name: string, type?: 'file' | 'function' | 'type' | 'const'
26
26
  */
27
27
  export const resolverTs = defineResolver<PluginTs>(() => {
28
28
  return {
29
+ name: 'default',
29
30
  default(name, type) {
30
31
  return resolveName(name, type)
31
32
  },
@@ -27,6 +27,7 @@ import { resolverTs } from './resolverTs.ts'
27
27
  export const resolverTsLegacy = defineResolver<PluginTs>(() => {
28
28
  return {
29
29
  ...resolverTs,
30
+ name: 'legacy',
30
31
  resolveResponseStatusName(node, statusCode) {
31
32
  if (statusCode === 'default') {
32
33
  return this.resolveName(`${node.operationId} Error`)
package/src/types.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { OperationNode, ParameterNode, SchemaNode, StatusCode } from '@kubb/ast/types'
2
- import type { Group, Output, PluginFactoryOptions, ResolveNameParams, Resolver } from '@kubb/core'
1
+ import type { OperationNode, ParameterNode, SchemaNode, StatusCode, Visitor } from '@kubb/ast/types'
2
+ import type { Group, Output, PluginFactoryOptions, Resolver } from '@kubb/core'
3
3
  import type { contentType, Oas } from '@kubb/oas'
4
4
  import type { Exclude, Include, Override, ResolvePathOptions } from '@kubb/plugin-oas'
5
5
  import type { Generator } from '@kubb/plugin-oas/generators'
@@ -260,12 +260,6 @@ export type Options = {
260
260
  * @default 'array'
261
261
  */
262
262
  arrayType?: 'generic' | 'array'
263
- transformers?: {
264
- /**
265
- * Customize the names based on the type that is provided by the plugin.
266
- */
267
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string
268
- }
269
263
  /**
270
264
  * How to style your params, by default no casing is applied
271
265
  * - 'camelcase' uses camelCase for pathParams, queryParams and headerParams property names
@@ -283,15 +277,39 @@ export type Options = {
283
277
  UNSTABLE_NAMING?: true
284
278
  /**
285
279
  * Enable legacy naming conventions for backwards compatibility.
286
- * When enabled, operation-level types use the old naming scheme:
287
- * - GET responses → `<OperationId>QueryResponse`, `<OperationId>Query`
288
- * - Non-GET responses → `<OperationId>MutationResponse`, `<OperationId>Mutation`
289
- * - Request body → `<OperationId>QueryRequest` / `<OperationId>MutationRequest`
290
- * - Response status codes → `<OperationId><StatusCode>` (e.g. `CreatePets201`)
291
- * - Default/error response → `<OperationId>Error`
292
280
  * @default false
293
281
  */
294
282
  legacy?: boolean
283
+ /**
284
+ * Array of named resolvers that control naming conventions.
285
+ * Later entries override earlier ones (last wins).
286
+ * Built-in: `resolverTs` (default), `resolverTsLegacy`.
287
+ * @default [resolverTs]
288
+ */
289
+ resolvers?: Array<ResolverTs>
290
+ /**
291
+ * Array of AST visitors applied to each SchemaNode/OperationNode before printing.
292
+ * Uses `transform()` from `@kubb/ast` — visitors can modify, replace, or annotate nodes.
293
+ *
294
+ * @example Remove writeOnly properties from response types
295
+ * ```ts
296
+ * transformers: [{
297
+ * property(node) {
298
+ * if (node.schema.writeOnly) return undefined
299
+ * }
300
+ * }]
301
+ * ```
302
+ *
303
+ * @example Force all dates to plain strings
304
+ * ```ts
305
+ * transformers: [{
306
+ * schema(node) {
307
+ * if (node.type === 'date') return { ...node, type: 'string' }
308
+ * }
309
+ * }]
310
+ * ```
311
+ */
312
+ transformers?: Array<Visitor>
295
313
  }
296
314
 
297
315
  type ResolvedOptions = {
@@ -302,18 +320,17 @@ type ResolvedOptions = {
302
320
  enumKeyCasing: NonNullable<Options['enumKeyCasing']>
303
321
  optionalType: NonNullable<Options['optionalType']>
304
322
  arrayType: NonNullable<Options['arrayType']>
305
- transformers: NonNullable<Options['transformers']>
306
323
  syntaxType: NonNullable<Options['syntaxType']>
307
324
  paramsCasing: Options['paramsCasing']
308
325
  legacy: NonNullable<Options['legacy']>
309
326
  resolver: ResolverTs
310
327
  /**
311
- * The base resolver without any `transformers.name` wrapping.
312
- * Used internally to derive enum prefix names so that user-defined
313
- * name transformations (e.g. appending `Type`) are not embedded in
314
- * the middle of inline-enum identifiers.
328
+ * The resolver without user naming overrides applied.
329
+ * Used internally to derive stable names for unnamed enums and grouped params
330
+ * so that the schema tree stays consistent regardless of `transformers.name` / custom resolvers.
315
331
  */
316
- baseResolver?: ResolverTs
332
+ baseResolver: ResolverTs
333
+ transformers: Array<Visitor>
317
334
  }
318
335
 
319
336
  export type PluginTs = PluginFactoryOptions<'plugin-ts', Options, ResolvedOptions, never, ResolvePathOptions, ResolverTs>
@@ -1 +0,0 @@
1
- {"version":3,"file":"generators-CX3cSSdF.cjs","names":["pascalCase","File","Type","ENUM_TYPES_WITH_KEY_SUFFIX"],"sources":["../src/generators/utils.ts","../src/generators/typeGenerator.tsx"],"sourcesContent":["import { pascalCase } from '@internals/utils'\nimport { createProperty, createSchema, narrowSchema, transform } from '@kubb/ast'\nimport type { OperationNode, ParameterNode, SchemaNode } from '@kubb/ast/types'\nimport type { ResolverTs } from '../types.ts'\n\ntype BuildParamsSchemaOptions = {\n params: Array<ParameterNode>\n node: OperationNode\n resolver: ResolverTs\n}\n\n/**\n * Builds an `ObjectSchemaNode` for a group of parameters (path/query/header).\n * Each property is a `ref` schema pointing to the individually-resolved parameter type.\n * The ref name includes the parameter location so generated type names follow\n * the `<OperationId><Location><ParamName>` convention.\n */\nexport function buildParamsSchema({ params, node, resolver }: BuildParamsSchemaOptions): SchemaNode {\n return createSchema({\n type: 'object',\n properties: params.map((param) =>\n createProperty({\n name: param.name,\n schema: createSchema({\n type: 'ref',\n name: resolver.resolveParamName(node, param),\n optional: !param.required,\n }),\n }),\n ),\n })\n}\n\ntype BuildOperationSchemaOptions = {\n node: OperationNode\n resolver: ResolverTs\n}\n\n/**\n * Builds an `ObjectSchemaNode` representing the `<OperationId>RequestConfig` type:\n * - `data` → request body ref (optional) or `never`\n * - `pathParams` → inline object of path param refs, or `never`\n * - `queryParams` → inline object of query param refs (optional), or `never`\n * - `headerParams` → inline object of header param refs (optional), or `never`\n * - `url` → Express-style template literal (plugin-ts extension, handled by printer)\n */\nexport function buildDataSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode {\n const pathParams = node.parameters.filter((p) => p.in === 'path')\n const queryParams = node.parameters.filter((p) => p.in === 'query')\n const headerParams = node.parameters.filter((p) => p.in === 'header')\n\n return createSchema({\n type: 'object',\n deprecated: node.deprecated,\n properties: [\n createProperty({\n name: 'data',\n schema: node.requestBody?.schema\n ? createSchema({\n type: 'ref',\n name: resolver.resolveDataTypedName(node),\n optional: true,\n })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'pathParams',\n schema: pathParams.length > 0 ? buildParamsSchema({ params: pathParams, node, resolver }) : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'queryParams',\n schema:\n queryParams.length > 0\n ? createSchema({ ...buildParamsSchema({ params: queryParams, node, resolver }), optional: true })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'headerParams',\n schema:\n headerParams.length > 0\n ? createSchema({ ...buildParamsSchema({ params: headerParams, node, resolver }), optional: true })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'url',\n schema: createSchema({ type: 'url', path: node.path }),\n }),\n ],\n })\n}\n\n/**\n * Builds an `ObjectSchemaNode` representing `<OperationId>Responses` — keyed by HTTP status code.\n * Numeric status codes produce unquoted numeric keys (e.g. `200:`).\n * All responses are included; those without a schema are represented as a ref to a `never` type.\n */\nexport function buildResponsesSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n if (node.responses.length === 0) {\n return null\n }\n\n return createSchema({\n type: 'object',\n properties: node.responses.map((res) =>\n createProperty({\n name: String(res.statusCode),\n schema: createSchema({\n type: 'ref',\n name: resolver.resolveResponseStatusTypedName(node, res.statusCode),\n }),\n }),\n ),\n })\n}\n\n/**\n * Builds a `UnionSchemaNode` representing `<OperationId>Response` — all response types in union format.\n * Returns `null` when the operation has no responses with schemas.\n */\nexport function buildResponseUnionSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n const responsesWithSchema = node.responses.filter((res) => res.schema)\n\n if (responsesWithSchema.length === 0) {\n return null\n }\n\n return createSchema({\n type: 'union',\n members: responsesWithSchema.map((res) =>\n createSchema({\n type: 'ref',\n name: resolver.resolveResponseStatusTypedName(node, res.statusCode),\n }),\n ),\n })\n}\n\ntype BuildGroupedParamsSchemaOptions = {\n params: Array<ParameterNode>\n /**\n * Parent type name (e.g. `FindPetsByStatusQueryParams`) used to derive enum names\n * for inline enum properties (e.g. `FindPetsByStatusQueryParamsStatusEnum`).\n */\n parentName?: string\n}\n\n/**\n * Builds an `ObjectSchemaNode` for a grouped parameters type (path/query/header) in legacy mode.\n * Each property directly embeds the parameter's schema inline (not a ref).\n * Used to generate `<OperationId>PathParams`, `<OperationId>QueryParams`, `<OperationId>HeaderParams`.\n * @deprecated Legacy only — will be removed in v6.\n */\nexport function buildGroupedParamsSchema({ params, parentName }: BuildGroupedParamsSchemaOptions): SchemaNode {\n return createSchema({\n type: 'object',\n properties: params.map((param) => {\n let schema = { ...param.schema, optional: !param.required } as SchemaNode\n // Name unnamed enum properties so they are emitted as enum declarations\n if (narrowSchema(schema, 'enum') && !schema.name && parentName) {\n schema = { ...schema, name: pascalCase([parentName, param.name, 'enum'].join(' ')) }\n }\n return createProperty({\n name: param.name,\n schema,\n })\n }),\n })\n}\n\n/**\n * Builds the legacy wrapper `ObjectSchemaNode` for `<OperationId>Mutation` / `<OperationId>Query`.\n * Structure: `{ Response, Request?, QueryParams?, PathParams?, HeaderParams?, Errors }`.\n * Mirrors the v4 naming convention where this type acts as a namespace for the operation's shapes.\n *\n * @deprecated Legacy only — will be removed in v6.\n */\nexport function buildLegacyResponsesSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n const isGet = node.method.toLowerCase() === 'get'\n const successResponses = node.responses.filter((res) => {\n const code = Number(res.statusCode)\n return !Number.isNaN(code) && code >= 200 && code < 300\n })\n const errorResponses = node.responses.filter((res) => res.statusCode === 'default' || Number(res.statusCode) >= 400)\n\n const responseSchema =\n successResponses.length > 0\n ? successResponses.length === 1\n ? createSchema({ type: 'ref', name: resolver.resolveResponseStatusTypedName(node, successResponses[0]!.statusCode) })\n : createSchema({\n type: 'union',\n members: successResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusTypedName(node, res.statusCode) })),\n })\n : createSchema({ type: 'any' })\n\n const errorsSchema =\n errorResponses.length > 0\n ? errorResponses.length === 1\n ? createSchema({ type: 'ref', name: resolver.resolveResponseStatusTypedName(node, errorResponses[0]!.statusCode) })\n : createSchema({\n type: 'union',\n members: errorResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusTypedName(node, res.statusCode) })),\n })\n : createSchema({ type: 'any' })\n\n const properties = [createProperty({ name: 'Response', schema: responseSchema })]\n\n if (!isGet && node.requestBody?.schema) {\n properties.push(\n createProperty({\n name: 'Request',\n schema: createSchema({ type: 'ref', name: resolver.resolveDataTypedName(node) }),\n }),\n )\n }\n\n if (node.parameters.some((p) => p.in === 'query') && resolver.resolveQueryParamsTypedName) {\n properties.push(\n createProperty({\n name: 'QueryParams',\n schema: createSchema({ type: 'ref', name: resolver.resolveQueryParamsTypedName(node) }),\n }),\n )\n }\n\n if (node.parameters.some((p) => p.in === 'path') && resolver.resolvePathParamsTypedName) {\n properties.push(\n createProperty({\n name: 'PathParams',\n schema: createSchema({ type: 'ref', name: resolver.resolvePathParamsTypedName(node) }),\n }),\n )\n }\n\n if (node.parameters.some((p) => p.in === 'header') && resolver.resolveHeaderParamsTypedName) {\n properties.push(\n createProperty({\n name: 'HeaderParams',\n schema: createSchema({ type: 'ref', name: resolver.resolveHeaderParamsTypedName(node) }),\n }),\n )\n }\n\n properties.push(createProperty({ name: 'Errors', schema: errorsSchema }))\n\n return createSchema({ type: 'object', properties })\n}\n\n/**\n * Builds the legacy response union for `<OperationId>MutationResponse` / `<OperationId>QueryResponse`.\n * In legacy mode this is the **success** response only (not the full union including errors).\n * Returns an `any` schema when there is no success response, matching v4 behavior.\n * @deprecated Legacy only — will be removed in v6.\n */\nexport function buildLegacyResponseUnionSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode {\n const successResponses = node.responses.filter((res) => {\n const code = Number(res.statusCode)\n return !Number.isNaN(code) && code >= 200 && code < 300\n })\n\n if (successResponses.length === 0) {\n return createSchema({ type: 'any' })\n }\n\n if (successResponses.length === 1) {\n return createSchema({ type: 'ref', name: resolver.resolveResponseStatusTypedName(node, successResponses[0]!.statusCode) })\n }\n\n return createSchema({\n type: 'union',\n members: successResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusTypedName(node, res.statusCode) })),\n })\n}\n\n/**\n * Names unnamed enum nodes within a schema tree based on the parent type name.\n * Used in legacy mode to ensure inline enums in response/request schemas get\n * extracted as named enum declarations (e.g. `DeletePet200Enum`).\n *\n * @deprecated Legacy only — will be removed in v6.\n */\nexport function nameUnnamedEnums(node: SchemaNode, parentName: string): SchemaNode {\n return transform(node, {\n schema(n) {\n if (n.type === 'enum' && !n.name) {\n return { ...n, name: pascalCase([parentName, 'enum'].join(' ')) }\n }\n return undefined\n },\n property(p) {\n const enumNode = narrowSchema(p.schema, 'enum')\n if (enumNode && !enumNode.name) {\n return {\n ...p,\n schema: { ...enumNode, name: pascalCase([parentName, p.name, 'enum'].join(' ')) },\n }\n }\n return undefined\n },\n })\n}\n","import { applyParamsCasing } from '@kubb/ast'\nimport type { SchemaNode } from '@kubb/ast/types'\nimport { defineGenerator } from '@kubb/core'\nimport { useKubb } from '@kubb/core/hooks'\nimport { File } from '@kubb/react-fabric'\nimport { Type } from '../components/Type.tsx'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'\nimport type { PluginTs } from '../types'\nimport {\n buildDataSchemaNode,\n buildGroupedParamsSchema,\n buildLegacyResponsesSchemaNode,\n buildLegacyResponseUnionSchemaNode,\n buildParamsSchema,\n buildResponsesSchemaNode,\n buildResponseUnionSchemaNode,\n nameUnnamedEnums,\n} from './utils.ts'\n\nexport const typeGenerator = defineGenerator<PluginTs>({\n name: 'typescript',\n type: 'react',\n Operation({ node, adapter, options }) {\n const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, resolver, baseResolver, legacy } = options\n const { mode, getFile, resolveBanner, resolveFooter } = useKubb<PluginTs>()\n\n const file = getFile({\n name: node.operationId,\n extname: '.ts',\n mode,\n options: {\n group: group ? (group.type === 'tag' ? { tag: node.tags[0] ?? 'default' } : { path: node.path }) : undefined,\n },\n })\n const params = applyParamsCasing(node.parameters, paramsCasing)\n\n function renderSchemaType({\n node: schemaNode,\n name,\n typedName,\n description,\n keysToOmit,\n }: {\n node: SchemaNode | null\n name: string\n typedName: string\n description?: string\n keysToOmit?: Array<string>\n }) {\n if (!schemaNode) {\n return null\n }\n\n const imports = adapter.getImports(schemaNode, (schemaName) => ({\n name: resolver.default(schemaName, 'type'),\n path: getFile({ name: schemaName, extname: '.ts', mode }).path,\n }))\n\n return (\n <>\n {mode === 'split' &&\n imports.map((imp) => <File.Import key={[name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={name}\n typedName={typedName}\n node={schemaNode}\n description={description}\n enumType={enumType}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n keysToOmit={keysToOmit}\n legacy={legacy}\n />\n </>\n )\n }\n\n const responseTypes = legacy\n ? node.responses.map((res) => {\n const responseName = resolver.resolveResponseStatusName(node, res.statusCode)\n const baseResponseName = (baseResolver ?? resolver).resolveResponseStatusName(node, res.statusCode)\n\n return renderSchemaType({\n node: res.schema ? nameUnnamedEnums(res.schema, baseResponseName) : res.schema,\n name: responseName,\n typedName: resolver.resolveResponseStatusTypedName(node, res.statusCode),\n description: res.description,\n keysToOmit: res.keysToOmit,\n })\n })\n : node.responses.map((res) =>\n renderSchemaType({\n node: res.schema,\n name: resolver.resolveResponseStatusName(node, res.statusCode),\n typedName: resolver.resolveResponseStatusTypedName(node, res.statusCode),\n description: res.description,\n keysToOmit: res.keysToOmit,\n }),\n )\n\n const requestType = node.requestBody?.schema\n ? renderSchemaType({\n node: legacy ? nameUnnamedEnums(node.requestBody.schema, (baseResolver ?? resolver).resolveDataName(node)) : node.requestBody.schema,\n name: resolver.resolveDataName(node),\n typedName: resolver.resolveDataTypedName(node),\n description: node.requestBody.description ?? node.requestBody.schema.description,\n keysToOmit: node.requestBody.keysToOmit,\n })\n : null\n\n if (legacy) {\n const pathParams = params.filter((p) => p.in === 'path')\n const queryParams = params.filter((p) => p.in === 'query')\n const headerParams = params.filter((p) => p.in === 'header')\n\n const legacyParamTypes = [\n pathParams.length > 0\n ? renderSchemaType({\n node: buildGroupedParamsSchema({ params: pathParams, parentName: (baseResolver ?? resolver).resolvePathParamsName!(node) }),\n name: resolver.resolvePathParamsName!(node),\n typedName: resolver.resolvePathParamsTypedName!(node),\n })\n : null,\n queryParams.length > 0\n ? renderSchemaType({\n node: buildGroupedParamsSchema({ params: queryParams, parentName: (baseResolver ?? resolver).resolveQueryParamsName!(node) }),\n name: resolver.resolveQueryParamsName!(node),\n typedName: resolver.resolveQueryParamsTypedName!(node),\n })\n : null,\n headerParams.length > 0\n ? renderSchemaType({\n node: buildGroupedParamsSchema({ params: headerParams, parentName: (baseResolver ?? resolver).resolveHeaderParamsName!(node) }),\n name: resolver.resolveHeaderParamsName!(node),\n typedName: resolver.resolveHeaderParamsTypedName!(node),\n })\n : null,\n ]\n\n const legacyResponsesType = renderSchemaType({\n node: buildLegacyResponsesSchemaNode({ node, resolver }),\n name: resolver.resolveResponsesName(node),\n typedName: resolver.resolveResponsesTypedName(node),\n })\n\n const legacyResponseType = renderSchemaType({\n node: buildLegacyResponseUnionSchemaNode({ node, resolver }),\n name: resolver.resolveResponseName(node),\n typedName: resolver.resolveResponseTypedName(node),\n })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta} banner={resolveBanner()} footer={resolveFooter()}>\n {legacyParamTypes}\n {responseTypes}\n {requestType}\n {legacyResponseType}\n {legacyResponsesType}\n </File>\n )\n }\n\n const paramTypes = params.map((param) =>\n renderSchemaType({\n node: param.schema,\n name: resolver.resolveParamName(node, param),\n typedName: resolver.resolveParamTypedName(node, param),\n }),\n )\n\n const queryParamsList = params.filter((p) => p.in === 'query')\n const queryParamsType =\n queryParamsList.length > 0\n ? renderSchemaType({\n node: buildParamsSchema({ params: queryParamsList, node, resolver }),\n name: resolver.resolveQueryParamsName!(node),\n typedName: resolver.resolveQueryParamsTypedName!(node),\n })\n : null\n\n const dataType = renderSchemaType({\n node: buildDataSchemaNode({ node: { ...node, parameters: params }, resolver }),\n name: resolver.resolveRequestConfigName(node),\n typedName: resolver.resolveRequestConfigTypedName(node),\n })\n\n const responsesType = renderSchemaType({\n node: buildResponsesSchemaNode({ node, resolver }),\n name: resolver.resolveResponsesName(node),\n typedName: resolver.resolveResponsesTypedName(node),\n })\n\n const responseType = renderSchemaType({\n node: buildResponseUnionSchemaNode({ node, resolver }),\n name: resolver.resolveResponseName(node),\n typedName: resolver.resolveResponseTypedName(node),\n description: 'Union of all possible responses',\n })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta} banner={resolveBanner()} footer={resolveFooter()}>\n {paramTypes}\n {queryParamsType}\n {responseTypes}\n {requestType}\n {dataType}\n {responsesType}\n {responseType}\n </File>\n )\n },\n Schema({ node, adapter, options }) {\n const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, resolver, legacy } = options\n const { mode, getFile, resolveBanner, resolveFooter } = useKubb<PluginTs>()\n\n if (!node.name) {\n return\n }\n\n const imports = adapter.getImports(node, (schemaName) => ({\n name: resolver.default(schemaName, 'type'),\n path: getFile({ name: schemaName, extname: '.ts', mode }).path,\n }))\n\n const isEnumSchema = node.type === 'enum'\n\n const typedName = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolver.resolveEnumKeyTypedName(node) : resolver.resolveTypedName(node.name)\n\n const type = {\n name: resolver.resolveName(node.name),\n typedName,\n file: getFile({ name: node.name, extname: '.ts', mode }),\n } as const\n\n return (\n <File baseName={type.file.baseName} path={type.file.path} meta={type.file.meta} banner={resolveBanner()} footer={resolveFooter()}>\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[node.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 node={node}\n enumType={enumType}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n legacy={legacy}\n />\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,kBAAkB,EAAE,QAAQ,MAAM,YAAkD;AAClG,SAAA,GAAA,UAAA,cAAoB;EAClB,MAAM;EACN,YAAY,OAAO,KAAK,WAAA,GAAA,UAAA,gBACP;GACb,MAAM,MAAM;GACZ,SAAA,GAAA,UAAA,cAAqB;IACnB,MAAM;IACN,MAAM,SAAS,iBAAiB,MAAM,MAAM;IAC5C,UAAU,CAAC,MAAM;IAClB,CAAC;GACH,CAAC,CACH;EACF,CAAC;;;;;;;;;;AAgBJ,SAAgB,oBAAoB,EAAE,MAAM,YAAqD;CAC/F,MAAM,aAAa,KAAK,WAAW,QAAQ,MAAM,EAAE,OAAO,OAAO;CACjE,MAAM,cAAc,KAAK,WAAW,QAAQ,MAAM,EAAE,OAAO,QAAQ;CACnE,MAAM,eAAe,KAAK,WAAW,QAAQ,MAAM,EAAE,OAAO,SAAS;AAErE,SAAA,GAAA,UAAA,cAAoB;EAClB,MAAM;EACN,YAAY,KAAK;EACjB,YAAY;iCACK;IACb,MAAM;IACN,QAAQ,KAAK,aAAa,UAAA,GAAA,UAAA,cACT;KACX,MAAM;KACN,MAAM,SAAS,qBAAqB,KAAK;KACzC,UAAU;KACX,CAAC,IAAA,GAAA,UAAA,cACW;KAAE,MAAM;KAAS,UAAU;KAAM,CAAC;IACpD,CAAC;iCACa;IACb,MAAM;IACN,QAAQ,WAAW,SAAS,IAAI,kBAAkB;KAAE,QAAQ;KAAY;KAAM;KAAU,CAAC,IAAA,GAAA,UAAA,cAAgB;KAAE,MAAM;KAAS,UAAU;KAAM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eAAe,SAAS,wBAAwB,KAAK,GAAG,SAAS,iBAAiB,KAAK,KAAK;EAE1J,MAAM,OAAO;GACX,MAAM,SAAS,YAAY,KAAK,KAAK;GACrC;GACA,MAAM,QAAQ;IAAE,MAAM,KAAK;IAAM,SAAS;IAAO;IAAM,CAAC;GACzD;AAED,SACE,iBAAA,GAAA,+BAAA,MAACF,mBAAAA,MAAD;GAAM,UAAU,KAAK,KAAK;GAAU,MAAM,KAAK,KAAK;GAAM,MAAM,KAAK,KAAK;GAAM,QAAQ,eAAe;GAAE,QAAQ,eAAe;aAAhI,CACG,SAAS,WACR,QAAQ,KAAK,QACX,iBAAA,GAAA,+BAAA,KAACA,mBAAAA,KAAK,QAAN;IAAmE,MAAM,KAAK,KAAK;IAAM,MAAM,IAAI;IAAM,MAAM,IAAI;IAAM,YAAA;IAAa,EAApH;IAAC,KAAK;IAAM,IAAI;IAAM,IAAI;IAAW,CAAC,KAAK,IAAI,CAAqE,CACtI,EACJ,iBAAA,GAAA,+BAAA,KAACC,aAAAA,MAAD;IACE,MAAM,KAAK;IACX,WAAW,KAAK;IACV;IACI;IACK;IACD;IACH;IACC;IACF;IACF;IACR,CAAA,CACG;;;CAGZ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"generators-dCqW0ECC.js","names":[],"sources":["../src/generators/utils.ts","../src/generators/typeGenerator.tsx"],"sourcesContent":["import { pascalCase } from '@internals/utils'\nimport { createProperty, createSchema, narrowSchema, transform } from '@kubb/ast'\nimport type { OperationNode, ParameterNode, SchemaNode } from '@kubb/ast/types'\nimport type { ResolverTs } from '../types.ts'\n\ntype BuildParamsSchemaOptions = {\n params: Array<ParameterNode>\n node: OperationNode\n resolver: ResolverTs\n}\n\n/**\n * Builds an `ObjectSchemaNode` for a group of parameters (path/query/header).\n * Each property is a `ref` schema pointing to the individually-resolved parameter type.\n * The ref name includes the parameter location so generated type names follow\n * the `<OperationId><Location><ParamName>` convention.\n */\nexport function buildParamsSchema({ params, node, resolver }: BuildParamsSchemaOptions): SchemaNode {\n return createSchema({\n type: 'object',\n properties: params.map((param) =>\n createProperty({\n name: param.name,\n schema: createSchema({\n type: 'ref',\n name: resolver.resolveParamName(node, param),\n optional: !param.required,\n }),\n }),\n ),\n })\n}\n\ntype BuildOperationSchemaOptions = {\n node: OperationNode\n resolver: ResolverTs\n}\n\n/**\n * Builds an `ObjectSchemaNode` representing the `<OperationId>RequestConfig` type:\n * - `data` → request body ref (optional) or `never`\n * - `pathParams` → inline object of path param refs, or `never`\n * - `queryParams` → inline object of query param refs (optional), or `never`\n * - `headerParams` → inline object of header param refs (optional), or `never`\n * - `url` → Express-style template literal (plugin-ts extension, handled by printer)\n */\nexport function buildDataSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode {\n const pathParams = node.parameters.filter((p) => p.in === 'path')\n const queryParams = node.parameters.filter((p) => p.in === 'query')\n const headerParams = node.parameters.filter((p) => p.in === 'header')\n\n return createSchema({\n type: 'object',\n deprecated: node.deprecated,\n properties: [\n createProperty({\n name: 'data',\n schema: node.requestBody?.schema\n ? createSchema({\n type: 'ref',\n name: resolver.resolveDataTypedName(node),\n optional: true,\n })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'pathParams',\n schema: pathParams.length > 0 ? buildParamsSchema({ params: pathParams, node, resolver }) : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'queryParams',\n schema:\n queryParams.length > 0\n ? createSchema({ ...buildParamsSchema({ params: queryParams, node, resolver }), optional: true })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'headerParams',\n schema:\n headerParams.length > 0\n ? createSchema({ ...buildParamsSchema({ params: headerParams, node, resolver }), optional: true })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'url',\n schema: createSchema({ type: 'url', path: node.path }),\n }),\n ],\n })\n}\n\n/**\n * Builds an `ObjectSchemaNode` representing `<OperationId>Responses` — keyed by HTTP status code.\n * Numeric status codes produce unquoted numeric keys (e.g. `200:`).\n * All responses are included; those without a schema are represented as a ref to a `never` type.\n */\nexport function buildResponsesSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n if (node.responses.length === 0) {\n return null\n }\n\n return createSchema({\n type: 'object',\n properties: node.responses.map((res) =>\n createProperty({\n name: String(res.statusCode),\n schema: createSchema({\n type: 'ref',\n name: resolver.resolveResponseStatusTypedName(node, res.statusCode),\n }),\n }),\n ),\n })\n}\n\n/**\n * Builds a `UnionSchemaNode` representing `<OperationId>Response` — all response types in union format.\n * Returns `null` when the operation has no responses with schemas.\n */\nexport function buildResponseUnionSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n const responsesWithSchema = node.responses.filter((res) => res.schema)\n\n if (responsesWithSchema.length === 0) {\n return null\n }\n\n return createSchema({\n type: 'union',\n members: responsesWithSchema.map((res) =>\n createSchema({\n type: 'ref',\n name: resolver.resolveResponseStatusTypedName(node, res.statusCode),\n }),\n ),\n })\n}\n\ntype BuildGroupedParamsSchemaOptions = {\n params: Array<ParameterNode>\n /**\n * Parent type name (e.g. `FindPetsByStatusQueryParams`) used to derive enum names\n * for inline enum properties (e.g. `FindPetsByStatusQueryParamsStatusEnum`).\n */\n parentName?: string\n}\n\n/**\n * Builds an `ObjectSchemaNode` for a grouped parameters type (path/query/header) in legacy mode.\n * Each property directly embeds the parameter's schema inline (not a ref).\n * Used to generate `<OperationId>PathParams`, `<OperationId>QueryParams`, `<OperationId>HeaderParams`.\n * @deprecated Legacy only — will be removed in v6.\n */\nexport function buildGroupedParamsSchema({ params, parentName }: BuildGroupedParamsSchemaOptions): SchemaNode {\n return createSchema({\n type: 'object',\n properties: params.map((param) => {\n let schema = { ...param.schema, optional: !param.required } as SchemaNode\n // Name unnamed enum properties so they are emitted as enum declarations\n if (narrowSchema(schema, 'enum') && !schema.name && parentName) {\n schema = { ...schema, name: pascalCase([parentName, param.name, 'enum'].join(' ')) }\n }\n return createProperty({\n name: param.name,\n schema,\n })\n }),\n })\n}\n\n/**\n * Builds the legacy wrapper `ObjectSchemaNode` for `<OperationId>Mutation` / `<OperationId>Query`.\n * Structure: `{ Response, Request?, QueryParams?, PathParams?, HeaderParams?, Errors }`.\n * Mirrors the v4 naming convention where this type acts as a namespace for the operation's shapes.\n *\n * @deprecated Legacy only — will be removed in v6.\n */\nexport function buildLegacyResponsesSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n const isGet = node.method.toLowerCase() === 'get'\n const successResponses = node.responses.filter((res) => {\n const code = Number(res.statusCode)\n return !Number.isNaN(code) && code >= 200 && code < 300\n })\n const errorResponses = node.responses.filter((res) => res.statusCode === 'default' || Number(res.statusCode) >= 400)\n\n const responseSchema =\n successResponses.length > 0\n ? successResponses.length === 1\n ? createSchema({ type: 'ref', name: resolver.resolveResponseStatusTypedName(node, successResponses[0]!.statusCode) })\n : createSchema({\n type: 'union',\n members: successResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusTypedName(node, res.statusCode) })),\n })\n : createSchema({ type: 'any' })\n\n const errorsSchema =\n errorResponses.length > 0\n ? errorResponses.length === 1\n ? createSchema({ type: 'ref', name: resolver.resolveResponseStatusTypedName(node, errorResponses[0]!.statusCode) })\n : createSchema({\n type: 'union',\n members: errorResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusTypedName(node, res.statusCode) })),\n })\n : createSchema({ type: 'any' })\n\n const properties = [createProperty({ name: 'Response', schema: responseSchema })]\n\n if (!isGet && node.requestBody?.schema) {\n properties.push(\n createProperty({\n name: 'Request',\n schema: createSchema({ type: 'ref', name: resolver.resolveDataTypedName(node) }),\n }),\n )\n }\n\n if (node.parameters.some((p) => p.in === 'query') && resolver.resolveQueryParamsTypedName) {\n properties.push(\n createProperty({\n name: 'QueryParams',\n schema: createSchema({ type: 'ref', name: resolver.resolveQueryParamsTypedName(node) }),\n }),\n )\n }\n\n if (node.parameters.some((p) => p.in === 'path') && resolver.resolvePathParamsTypedName) {\n properties.push(\n createProperty({\n name: 'PathParams',\n schema: createSchema({ type: 'ref', name: resolver.resolvePathParamsTypedName(node) }),\n }),\n )\n }\n\n if (node.parameters.some((p) => p.in === 'header') && resolver.resolveHeaderParamsTypedName) {\n properties.push(\n createProperty({\n name: 'HeaderParams',\n schema: createSchema({ type: 'ref', name: resolver.resolveHeaderParamsTypedName(node) }),\n }),\n )\n }\n\n properties.push(createProperty({ name: 'Errors', schema: errorsSchema }))\n\n return createSchema({ type: 'object', properties })\n}\n\n/**\n * Builds the legacy response union for `<OperationId>MutationResponse` / `<OperationId>QueryResponse`.\n * In legacy mode this is the **success** response only (not the full union including errors).\n * Returns an `any` schema when there is no success response, matching v4 behavior.\n * @deprecated Legacy only — will be removed in v6.\n */\nexport function buildLegacyResponseUnionSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode {\n const successResponses = node.responses.filter((res) => {\n const code = Number(res.statusCode)\n return !Number.isNaN(code) && code >= 200 && code < 300\n })\n\n if (successResponses.length === 0) {\n return createSchema({ type: 'any' })\n }\n\n if (successResponses.length === 1) {\n return createSchema({ type: 'ref', name: resolver.resolveResponseStatusTypedName(node, successResponses[0]!.statusCode) })\n }\n\n return createSchema({\n type: 'union',\n members: successResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusTypedName(node, res.statusCode) })),\n })\n}\n\n/**\n * Names unnamed enum nodes within a schema tree based on the parent type name.\n * Used in legacy mode to ensure inline enums in response/request schemas get\n * extracted as named enum declarations (e.g. `DeletePet200Enum`).\n *\n * @deprecated Legacy only — will be removed in v6.\n */\nexport function nameUnnamedEnums(node: SchemaNode, parentName: string): SchemaNode {\n return transform(node, {\n schema(n) {\n if (n.type === 'enum' && !n.name) {\n return { ...n, name: pascalCase([parentName, 'enum'].join(' ')) }\n }\n return undefined\n },\n property(p) {\n const enumNode = narrowSchema(p.schema, 'enum')\n if (enumNode && !enumNode.name) {\n return {\n ...p,\n schema: { ...enumNode, name: pascalCase([parentName, p.name, 'enum'].join(' ')) },\n }\n }\n return undefined\n },\n })\n}\n","import { applyParamsCasing } from '@kubb/ast'\nimport type { SchemaNode } from '@kubb/ast/types'\nimport { defineGenerator } from '@kubb/core'\nimport { useKubb } from '@kubb/core/hooks'\nimport { File } from '@kubb/react-fabric'\nimport { Type } from '../components/Type.tsx'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'\nimport type { PluginTs } from '../types'\nimport {\n buildDataSchemaNode,\n buildGroupedParamsSchema,\n buildLegacyResponsesSchemaNode,\n buildLegacyResponseUnionSchemaNode,\n buildParamsSchema,\n buildResponsesSchemaNode,\n buildResponseUnionSchemaNode,\n nameUnnamedEnums,\n} from './utils.ts'\n\nexport const typeGenerator = defineGenerator<PluginTs>({\n name: 'typescript',\n type: 'react',\n Operation({ node, adapter, options }) {\n const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, resolver, baseResolver, legacy } = options\n const { mode, getFile, resolveBanner, resolveFooter } = useKubb<PluginTs>()\n\n const file = getFile({\n name: node.operationId,\n extname: '.ts',\n mode,\n options: {\n group: group ? (group.type === 'tag' ? { tag: node.tags[0] ?? 'default' } : { path: node.path }) : undefined,\n },\n })\n const params = applyParamsCasing(node.parameters, paramsCasing)\n\n function renderSchemaType({\n node: schemaNode,\n name,\n typedName,\n description,\n keysToOmit,\n }: {\n node: SchemaNode | null\n name: string\n typedName: string\n description?: string\n keysToOmit?: Array<string>\n }) {\n if (!schemaNode) {\n return null\n }\n\n const imports = adapter.getImports(schemaNode, (schemaName) => ({\n name: resolver.default(schemaName, 'type'),\n path: getFile({ name: schemaName, extname: '.ts', mode }).path,\n }))\n\n return (\n <>\n {mode === 'split' &&\n imports.map((imp) => <File.Import key={[name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={name}\n typedName={typedName}\n node={schemaNode}\n description={description}\n enumType={enumType}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n keysToOmit={keysToOmit}\n legacy={legacy}\n />\n </>\n )\n }\n\n const responseTypes = legacy\n ? node.responses.map((res) => {\n const responseName = resolver.resolveResponseStatusName(node, res.statusCode)\n const baseResponseName = (baseResolver ?? resolver).resolveResponseStatusName(node, res.statusCode)\n\n return renderSchemaType({\n node: res.schema ? nameUnnamedEnums(res.schema, baseResponseName) : res.schema,\n name: responseName,\n typedName: resolver.resolveResponseStatusTypedName(node, res.statusCode),\n description: res.description,\n keysToOmit: res.keysToOmit,\n })\n })\n : node.responses.map((res) =>\n renderSchemaType({\n node: res.schema,\n name: resolver.resolveResponseStatusName(node, res.statusCode),\n typedName: resolver.resolveResponseStatusTypedName(node, res.statusCode),\n description: res.description,\n keysToOmit: res.keysToOmit,\n }),\n )\n\n const requestType = node.requestBody?.schema\n ? renderSchemaType({\n node: legacy ? nameUnnamedEnums(node.requestBody.schema, (baseResolver ?? resolver).resolveDataName(node)) : node.requestBody.schema,\n name: resolver.resolveDataName(node),\n typedName: resolver.resolveDataTypedName(node),\n description: node.requestBody.description ?? node.requestBody.schema.description,\n keysToOmit: node.requestBody.keysToOmit,\n })\n : null\n\n if (legacy) {\n const pathParams = params.filter((p) => p.in === 'path')\n const queryParams = params.filter((p) => p.in === 'query')\n const headerParams = params.filter((p) => p.in === 'header')\n\n const legacyParamTypes = [\n pathParams.length > 0\n ? renderSchemaType({\n node: buildGroupedParamsSchema({ params: pathParams, parentName: (baseResolver ?? resolver).resolvePathParamsName!(node) }),\n name: resolver.resolvePathParamsName!(node),\n typedName: resolver.resolvePathParamsTypedName!(node),\n })\n : null,\n queryParams.length > 0\n ? renderSchemaType({\n node: buildGroupedParamsSchema({ params: queryParams, parentName: (baseResolver ?? resolver).resolveQueryParamsName!(node) }),\n name: resolver.resolveQueryParamsName!(node),\n typedName: resolver.resolveQueryParamsTypedName!(node),\n })\n : null,\n headerParams.length > 0\n ? renderSchemaType({\n node: buildGroupedParamsSchema({ params: headerParams, parentName: (baseResolver ?? resolver).resolveHeaderParamsName!(node) }),\n name: resolver.resolveHeaderParamsName!(node),\n typedName: resolver.resolveHeaderParamsTypedName!(node),\n })\n : null,\n ]\n\n const legacyResponsesType = renderSchemaType({\n node: buildLegacyResponsesSchemaNode({ node, resolver }),\n name: resolver.resolveResponsesName(node),\n typedName: resolver.resolveResponsesTypedName(node),\n })\n\n const legacyResponseType = renderSchemaType({\n node: buildLegacyResponseUnionSchemaNode({ node, resolver }),\n name: resolver.resolveResponseName(node),\n typedName: resolver.resolveResponseTypedName(node),\n })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta} banner={resolveBanner()} footer={resolveFooter()}>\n {legacyParamTypes}\n {responseTypes}\n {requestType}\n {legacyResponseType}\n {legacyResponsesType}\n </File>\n )\n }\n\n const paramTypes = params.map((param) =>\n renderSchemaType({\n node: param.schema,\n name: resolver.resolveParamName(node, param),\n typedName: resolver.resolveParamTypedName(node, param),\n }),\n )\n\n const queryParamsList = params.filter((p) => p.in === 'query')\n const queryParamsType =\n queryParamsList.length > 0\n ? renderSchemaType({\n node: buildParamsSchema({ params: queryParamsList, node, resolver }),\n name: resolver.resolveQueryParamsName!(node),\n typedName: resolver.resolveQueryParamsTypedName!(node),\n })\n : null\n\n const dataType = renderSchemaType({\n node: buildDataSchemaNode({ node: { ...node, parameters: params }, resolver }),\n name: resolver.resolveRequestConfigName(node),\n typedName: resolver.resolveRequestConfigTypedName(node),\n })\n\n const responsesType = renderSchemaType({\n node: buildResponsesSchemaNode({ node, resolver }),\n name: resolver.resolveResponsesName(node),\n typedName: resolver.resolveResponsesTypedName(node),\n })\n\n const responseType = renderSchemaType({\n node: buildResponseUnionSchemaNode({ node, resolver }),\n name: resolver.resolveResponseName(node),\n typedName: resolver.resolveResponseTypedName(node),\n description: 'Union of all possible responses',\n })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta} banner={resolveBanner()} footer={resolveFooter()}>\n {paramTypes}\n {queryParamsType}\n {responseTypes}\n {requestType}\n {dataType}\n {responsesType}\n {responseType}\n </File>\n )\n },\n Schema({ node, adapter, options }) {\n const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, resolver, legacy } = options\n const { mode, getFile, resolveBanner, resolveFooter } = useKubb<PluginTs>()\n\n if (!node.name) {\n return\n }\n\n const imports = adapter.getImports(node, (schemaName) => ({\n name: resolver.default(schemaName, 'type'),\n path: getFile({ name: schemaName, extname: '.ts', mode }).path,\n }))\n\n const isEnumSchema = node.type === 'enum'\n\n const typedName = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolver.resolveEnumKeyTypedName(node) : resolver.resolveTypedName(node.name)\n\n const type = {\n name: resolver.resolveName(node.name),\n typedName,\n file: getFile({ name: node.name, extname: '.ts', mode }),\n } as const\n\n return (\n <File baseName={type.file.baseName} path={type.file.path} meta={type.file.meta} banner={resolveBanner()} footer={resolveFooter()}>\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[node.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 node={node}\n enumType={enumType}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n legacy={legacy}\n />\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,SAAgB,kBAAkB,EAAE,QAAQ,MAAM,YAAkD;AAClG,QAAO,aAAa;EAClB,MAAM;EACN,YAAY,OAAO,KAAK,UACtB,eAAe;GACb,MAAM,MAAM;GACZ,QAAQ,aAAa;IACnB,MAAM;IACN,MAAM,SAAS,iBAAiB,MAAM,MAAM;IAC5C,UAAU,CAAC,MAAM;IAClB,CAAC;GACH,CAAC,CACH;EACF,CAAC;;;;;;;;;;AAgBJ,SAAgB,oBAAoB,EAAE,MAAM,YAAqD;CAC/F,MAAM,aAAa,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