@kubb/plugin-ts 4.13.1 → 4.14.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 (45) hide show
  1. package/dist/{components-x14CeHxX.js → components-BE9rQGox.js} +74 -58
  2. package/dist/components-BE9rQGox.js.map +1 -0
  3. package/dist/{components-BkxV2jhh.cjs → components-CGcs8968.cjs} +103 -63
  4. package/dist/components-CGcs8968.cjs.map +1 -0
  5. package/dist/components.cjs +1 -2
  6. package/dist/components.d.cts +4 -17
  7. package/dist/components.d.ts +4 -17
  8. package/dist/components.js +2 -2
  9. package/dist/generators.cjs +1 -1
  10. package/dist/generators.d.cts +1 -1
  11. package/dist/generators.d.ts +1 -1
  12. package/dist/generators.js +1 -1
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.d.cts +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/{plugin-BM1VkXZS.cjs → plugin-B96TNDf4.cjs} +174 -21
  18. package/dist/plugin-B96TNDf4.cjs.map +1 -0
  19. package/dist/{plugin-BiVCDKei.js → plugin-DXyNbr_u.js} +175 -23
  20. package/dist/plugin-DXyNbr_u.js.map +1 -0
  21. package/dist/{types-WHo75HZq.d.cts → types-CKtzgWEC.d.cts} +22 -6
  22. package/dist/{types-De3dRAE2.d.ts → types-CnQREd_1.d.ts} +22 -6
  23. package/package.json +4 -4
  24. package/src/components/Type.tsx +33 -22
  25. package/src/components/index.ts +0 -1
  26. package/src/factory.ts +79 -5
  27. package/src/generators/__snapshots__/createPet.ts +1 -1
  28. package/src/generators/__snapshots__/createPetWithEmptySchemaTypeUnknown.ts +1 -1
  29. package/src/generators/__snapshots__/createPetWithEmptySchemaTypeVoid.ts +1 -1
  30. package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +1 -1
  31. package/src/generators/__snapshots__/createPetWithUnknownTypeVoid.ts +1 -1
  32. package/src/generators/__snapshots__/deletePet.ts +1 -1
  33. package/src/generators/__snapshots__/enumNamesInlineLiteral.ts +6 -0
  34. package/src/generators/__snapshots__/getPets.ts +1 -1
  35. package/src/generators/__snapshots__/showPetById.ts +1 -1
  36. package/src/generators/__snapshots__/systemsWithExplodeForm.ts +1 -1
  37. package/src/generators/typeGenerator.tsx +232 -8
  38. package/src/parser.ts +28 -23
  39. package/src/plugin.ts +4 -0
  40. package/src/types.ts +16 -2
  41. package/dist/components-BkxV2jhh.cjs.map +0 -1
  42. package/dist/components-x14CeHxX.js.map +0 -1
  43. package/dist/plugin-BM1VkXZS.cjs.map +0 -1
  44. package/dist/plugin-BiVCDKei.js.map +0 -1
  45. package/src/components/OasType.tsx +0 -28
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as UserPluginWithLifeCycle, n as PluginTs, t as Options } from "./types-De3dRAE2.js";
1
+ import { a as UserPluginWithLifeCycle, n as PluginTs, t as Options } from "./types-CnQREd_1.js";
2
2
 
3
3
  //#region src/plugin.d.ts
4
4
  declare const pluginTsName = "plugin-ts";
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as pluginTsName, t as pluginTs } from "./plugin-BiVCDKei.js";
1
+ import { n as pluginTsName, t as pluginTs } from "./plugin-DXyNbr_u.js";
2
2
 
3
3
  export { pluginTs, pluginTsName };
@@ -1,4 +1,4 @@
1
- const require_components = require('./components-BkxV2jhh.cjs');
1
+ const require_components = require('./components-CGcs8968.cjs');
2
2
  let node_path = require("node:path");
3
3
  node_path = require_components.__toESM(node_path);
4
4
  let _kubb_core = require("@kubb/core");
@@ -11,6 +11,8 @@ let _kubb_plugin_oas_generators = require("@kubb/plugin-oas/generators");
11
11
  let _kubb_plugin_oas_hooks = require("@kubb/plugin-oas/hooks");
12
12
  let _kubb_plugin_oas_utils = require("@kubb/plugin-oas/utils");
13
13
  let _kubb_react_fabric = require("@kubb/react-fabric");
14
+ let typescript = require("typescript");
15
+ typescript = require_components.__toESM(typescript);
14
16
  let _kubb_react_fabric_jsx_runtime = require("@kubb/react-fabric/jsx-runtime");
15
17
 
16
18
  //#region src/generators/typeGenerator.tsx
@@ -77,22 +79,145 @@ function printCombinedSchema({ name, schemas, pluginManager }) {
77
79
  modifiers: [require_components.modifiers.export]
78
80
  }));
79
81
  }
82
+ function printRequestSchema({ baseName, operation, schemas, pluginManager }) {
83
+ const name = pluginManager.resolveName({
84
+ name: `${baseName} Request`,
85
+ pluginKey: [pluginTsName],
86
+ type: "type"
87
+ });
88
+ const results = [];
89
+ const dataRequestProperties = [];
90
+ if (schemas.request) {
91
+ const identifier = pluginManager.resolveName({
92
+ name: schemas.request.name,
93
+ pluginKey: [pluginTsName],
94
+ type: "type"
95
+ });
96
+ dataRequestProperties.push(require_components.createPropertySignature({
97
+ name: "data",
98
+ questionToken: true,
99
+ type: require_components.createTypeReferenceNode(require_components.createIdentifier(identifier), void 0)
100
+ }));
101
+ } else dataRequestProperties.push(require_components.createPropertySignature({
102
+ name: "data",
103
+ questionToken: true,
104
+ type: require_components.keywordTypeNodes.never
105
+ }));
106
+ if (schemas.pathParams) {
107
+ const identifier = pluginManager.resolveName({
108
+ name: schemas.pathParams.name,
109
+ pluginKey: [pluginTsName],
110
+ type: "type"
111
+ });
112
+ dataRequestProperties.push(require_components.createPropertySignature({
113
+ name: "pathParams",
114
+ type: require_components.createTypeReferenceNode(require_components.createIdentifier(identifier), void 0)
115
+ }));
116
+ } else dataRequestProperties.push(require_components.createPropertySignature({
117
+ name: "pathParams",
118
+ questionToken: true,
119
+ type: require_components.keywordTypeNodes.never
120
+ }));
121
+ if (schemas.queryParams) {
122
+ const identifier = pluginManager.resolveName({
123
+ name: schemas.queryParams.name,
124
+ pluginKey: [pluginTsName],
125
+ type: "type"
126
+ });
127
+ dataRequestProperties.push(require_components.createPropertySignature({
128
+ name: "queryParams",
129
+ questionToken: true,
130
+ type: require_components.createTypeReferenceNode(require_components.createIdentifier(identifier), void 0)
131
+ }));
132
+ } else dataRequestProperties.push(require_components.createPropertySignature({
133
+ name: "queryParams",
134
+ questionToken: true,
135
+ type: require_components.keywordTypeNodes.never
136
+ }));
137
+ if (schemas.headerParams) {
138
+ const identifier = pluginManager.resolveName({
139
+ name: schemas.headerParams.name,
140
+ pluginKey: [pluginTsName],
141
+ type: "type"
142
+ });
143
+ dataRequestProperties.push(require_components.createPropertySignature({
144
+ name: "headerParams",
145
+ questionToken: true,
146
+ type: require_components.createTypeReferenceNode(require_components.createIdentifier(identifier), void 0)
147
+ }));
148
+ } else dataRequestProperties.push(require_components.createPropertySignature({
149
+ name: "headerParams",
150
+ questionToken: true,
151
+ type: require_components.keywordTypeNodes.never
152
+ }));
153
+ dataRequestProperties.push(require_components.createPropertySignature({
154
+ name: "url",
155
+ type: require_components.createUrlTemplateType(operation.path)
156
+ }));
157
+ const dataRequestNode = require_components.createTypeAliasDeclaration({
158
+ name,
159
+ type: require_components.createTypeLiteralNode(dataRequestProperties),
160
+ modifiers: [require_components.modifiers.export]
161
+ });
162
+ results.push((0, _kubb_fabric_core_parsers_typescript.safePrint)(dataRequestNode));
163
+ return results.join("\n\n");
164
+ }
165
+ function printResponseSchema({ baseName, schemas, pluginManager, unknownType }) {
166
+ const results = [];
167
+ const name = pluginManager.resolveName({
168
+ name: `${baseName} ResponseData`,
169
+ pluginKey: [pluginTsName],
170
+ type: "type"
171
+ });
172
+ if (schemas.responses && schemas.responses.length > 0) {
173
+ const responsesProperties = schemas.responses.map((res) => {
174
+ const identifier = pluginManager.resolveName({
175
+ name: res.name,
176
+ pluginKey: [pluginTsName],
177
+ type: "type"
178
+ });
179
+ return require_components.createPropertySignature({
180
+ name: res.statusCode?.toString() ?? "default",
181
+ type: require_components.createTypeReferenceNode(require_components.createIdentifier(identifier), void 0)
182
+ });
183
+ });
184
+ const responsesNode = require_components.createTypeAliasDeclaration({
185
+ name: `${baseName}Responses`,
186
+ type: require_components.createTypeLiteralNode(responsesProperties),
187
+ modifiers: [require_components.modifiers.export]
188
+ });
189
+ results.push((0, _kubb_fabric_core_parsers_typescript.safePrint)(responsesNode));
190
+ const responseNode = require_components.createTypeAliasDeclaration({
191
+ name,
192
+ type: require_components.createIndexedAccessTypeNode(require_components.createTypeReferenceNode(require_components.createIdentifier(`${baseName}Responses`), void 0), require_components.createTypeOperatorNode(typescript.default.SyntaxKind.KeyOfKeyword, require_components.createTypeReferenceNode(require_components.createIdentifier(`${baseName}Responses`), void 0))),
193
+ modifiers: [require_components.modifiers.export]
194
+ });
195
+ results.push((0, _kubb_fabric_core_parsers_typescript.safePrint)(responseNode));
196
+ } else {
197
+ const responseNode = require_components.createTypeAliasDeclaration({
198
+ name,
199
+ modifiers: [require_components.modifiers.export],
200
+ type: require_components.getUnknownType(unknownType)
201
+ });
202
+ results.push((0, _kubb_fabric_core_parsers_typescript.safePrint)(responseNode));
203
+ }
204
+ return results.join("\n\n");
205
+ }
80
206
  const typeGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
81
207
  name: "typescript",
82
208
  Operation({ operation, generator, plugin }) {
83
- const { options, options: { mapper, enumType, syntaxType, optionalType } } = plugin;
209
+ const { options, options: { mapper, enumType, syntaxType, optionalType, arrayType, unknownType } } = plugin;
84
210
  const mode = (0, _kubb_core_hooks.useMode)();
85
211
  const pluginManager = (0, _kubb_core_hooks.usePluginManager)();
86
212
  const oas = (0, _kubb_plugin_oas_hooks.useOas)();
87
213
  const { getSchemas, getFile, getName, getGroup } = (0, _kubb_plugin_oas_hooks.useOperationManager)(generator);
88
214
  const schemaManager = (0, _kubb_plugin_oas_hooks.useSchemaManager)();
89
- const file = getFile(operation);
90
- const schemas = getSchemas(operation);
91
- const type = getName(operation, {
92
- type: "function",
215
+ const name = getName(operation, {
216
+ type: "type",
93
217
  pluginKey: [pluginTsName]
94
218
  });
95
- const combinedSchemaName = operation.method === "get" ? `${type}Query` : `${type}Mutation`;
219
+ const file = getFile(operation);
220
+ const schemas = getSchemas(operation);
96
221
  const schemaGenerator = new _kubb_plugin_oas.SchemaGenerator(options, {
97
222
  fabric: generator.context.fabric,
98
223
  oas,
@@ -110,18 +235,18 @@ const typeGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
110
235
  schemas.request,
111
236
  schemas.response
112
237
  ].flat().filter(Boolean);
113
- const mapOperationSchema = ({ name, schema, description, keysToOmit, ...options$1 }) => {
238
+ const mapOperationSchema = ({ name: name$1, schema, description, keysToOmit, ...options$1 }) => {
114
239
  const tree = schemaGenerator.parse({
115
240
  schema,
116
- name,
241
+ name: name$1,
117
242
  parentName: null
118
243
  });
119
244
  const imports = schemaManager.getImports(tree);
120
245
  const group = options$1.operation ? getGroup(options$1.operation) : void 0;
121
- const type$1 = {
122
- name: schemaManager.getName(name, { type: "type" }),
123
- typedName: schemaManager.getName(name, { type: "type" }),
124
- file: schemaManager.getFile(options$1.operationName || name, { group })
246
+ const type = {
247
+ name: schemaManager.getName(name$1, { type: "type" }),
248
+ typedName: schemaManager.getName(name$1, { type: "type" }),
249
+ file: schemaManager.getFile(options$1.operationName || name$1, { group })
125
250
  };
126
251
  return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric_jsx_runtime.Fragment, { children: [mode === "split" && imports.map((imp) => /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
127
252
  root: file.path,
@@ -129,23 +254,26 @@ const typeGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
129
254
  name: imp.name,
130
255
  isTypeOnly: true
131
256
  }, [
132
- name,
257
+ name$1,
133
258
  imp.name,
134
259
  imp.path,
135
260
  imp.isTypeOnly
136
261
  ].join("-"))), /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(require_components.Type, {
137
- name: type$1.name,
138
- typedName: type$1.typedName,
262
+ name: type.name,
263
+ typedName: type.typedName,
139
264
  description,
140
265
  tree,
141
266
  schema,
142
267
  mapper,
143
268
  enumType,
144
269
  optionalType,
270
+ arrayType,
145
271
  keysToOmit,
146
272
  syntaxType
147
273
  })] });
148
274
  };
275
+ const responseName = schemaManager.getName(schemas.response.name, { type: "type" });
276
+ const combinedSchemaName = operation.method === "get" ? `${name}Query` : `${name}Mutation`;
149
277
  return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric.File, {
150
278
  baseName: file.baseName,
151
279
  path: file.path,
@@ -159,7 +287,29 @@ const typeGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
159
287
  oas,
160
288
  output: plugin.options.output
161
289
  }),
162
- children: [operationSchemas.map(mapOperationSchema), /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
290
+ children: [operationSchemas.map(mapOperationSchema), generator.context.UNSTABLE_NAMING ? /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
291
+ name: `${name}Request`,
292
+ isExportable: true,
293
+ isIndexable: true,
294
+ isTypeOnly: true,
295
+ children: printRequestSchema({
296
+ baseName: name,
297
+ operation,
298
+ schemas,
299
+ pluginManager
300
+ })
301
+ }), /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
302
+ name: responseName,
303
+ isExportable: true,
304
+ isIndexable: true,
305
+ isTypeOnly: true,
306
+ children: printResponseSchema({
307
+ baseName: name,
308
+ schemas,
309
+ pluginManager,
310
+ unknownType
311
+ })
312
+ })] }) : /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
163
313
  name: combinedSchemaName,
164
314
  isExportable: true,
165
315
  isIndexable: true,
@@ -173,7 +323,7 @@ const typeGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
173
323
  });
174
324
  },
175
325
  Schema({ schema, plugin }) {
176
- const { options: { mapper, enumType, syntaxType, optionalType, output } } = plugin;
326
+ const { options: { mapper, enumType, syntaxType, optionalType, arrayType, output } } = plugin;
177
327
  const mode = (0, _kubb_core_hooks.useMode)();
178
328
  const oas = (0, _kubb_plugin_oas_hooks.useOas)();
179
329
  const pluginManager = (0, _kubb_core_hooks.usePluginManager)();
@@ -218,6 +368,7 @@ const typeGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
218
368
  mapper,
219
369
  enumType,
220
370
  optionalType,
371
+ arrayType,
221
372
  syntaxType
222
373
  })]
223
374
  });
@@ -231,7 +382,7 @@ const pluginTs = (0, _kubb_core.definePlugin)((options) => {
231
382
  const { output = {
232
383
  path: "types",
233
384
  barrelType: "named"
234
- }, group, exclude = [], include, override = [], enumType = "asConst", enumSuffix = "enum", dateType = "string", unknownType = "any", optionalType = "questionToken", emptySchemaType = unknownType, syntaxType = "type", transformers: transformers$1 = {}, mapper = {}, generators = [typeGenerator].filter(Boolean), contentType } = options;
385
+ }, group, exclude = [], include, override = [], enumType = "asConst", enumSuffix = "enum", dateType = "string", unknownType = "any", optionalType = "questionToken", arrayType = "array", emptySchemaType = unknownType, syntaxType = "type", transformers: transformers$1 = {}, mapper = {}, generators = [typeGenerator].filter(Boolean), contentType, UNSTABLE_NAMING } = options;
235
386
  return {
236
387
  name: pluginTsName,
237
388
  options: {
@@ -239,6 +390,7 @@ const pluginTs = (0, _kubb_core.definePlugin)((options) => {
239
390
  transformers: transformers$1,
240
391
  dateType,
241
392
  optionalType,
393
+ arrayType,
242
394
  enumType,
243
395
  enumSuffix,
244
396
  unknownType,
@@ -299,7 +451,8 @@ const pluginTs = (0, _kubb_core.definePlugin)((options) => {
299
451
  exclude,
300
452
  include,
301
453
  override,
302
- mode
454
+ mode,
455
+ UNSTABLE_NAMING
303
456
  }).build(...generators);
304
457
  await this.upsertFile(...operationFiles);
305
458
  const barrelFiles = await (0, _kubb_core.getBarrelFiles)(this.fabric.files, {
@@ -332,4 +485,4 @@ Object.defineProperty(exports, 'typeGenerator', {
332
485
  return typeGenerator;
333
486
  }
334
487
  });
335
- //# sourceMappingURL=plugin-BM1VkXZS.cjs.map
488
+ //# sourceMappingURL=plugin-B96TNDf4.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-B96TNDf4.cjs","names":["properties: Record<string, ts.TypeNode>","transformers","results: string[]","dataRequestProperties: ts.PropertySignature[]","keywordTypeNodes","createUrlTemplateType","responsesProperties: ts.PropertySignature[]","ts","getUnknownType","SchemaGenerator","options","name","File","Type","schemaKeywords","pluginOasName","path","options","groupName: Group['name']","transformers","SchemaGenerator","OperationGenerator"],"sources":["../src/generators/typeGenerator.tsx","../src/plugin.ts"],"sourcesContent":["import type { PluginManager } from '@kubb/core'\nimport { useMode, usePluginManager } from '@kubb/core/hooks'\nimport transformers from '@kubb/core/transformers'\nimport { safePrint } from '@kubb/fabric-core/parsers/typescript'\nimport type { Operation } from '@kubb/oas'\nimport { isKeyword, type OperationSchemas, type OperationSchema as OperationSchemaType, SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager, useSchemaManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File } from '@kubb/react-fabric'\nimport ts from 'typescript'\nimport { Type } from '../components'\nimport * as factory from '../factory.ts'\nimport { createUrlTemplateType, getUnknownType, keywordTypeNodes } from '../factory.ts'\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 safePrint(namespaceNode)\n}\n\nfunction printRequestSchema({\n baseName,\n operation,\n schemas,\n pluginManager,\n}: {\n baseName: string\n operation: Operation\n schemas: OperationSchemas\n pluginManager: PluginManager\n}): string {\n const name = pluginManager.resolveName({\n name: `${baseName} Request`,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n const results: string[] = []\n\n // Generate DataRequest type\n const dataRequestProperties: ts.PropertySignature[] = []\n\n if (schemas.request) {\n const identifier = pluginManager.resolveName({\n name: schemas.request.name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'data',\n questionToken: true,\n type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),\n }),\n )\n } else {\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'data',\n questionToken: true,\n type: keywordTypeNodes.never,\n }),\n )\n }\n\n // Add pathParams property\n if (schemas.pathParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.pathParams.name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'pathParams',\n type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),\n }),\n )\n } else {\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'pathParams',\n questionToken: true,\n type: keywordTypeNodes.never,\n }),\n )\n }\n\n // Add queryParams property\n if (schemas.queryParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.queryParams.name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'queryParams',\n questionToken: true,\n type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),\n }),\n )\n } else {\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'queryParams',\n questionToken: true,\n type: keywordTypeNodes.never,\n }),\n )\n }\n\n // Add headerParams property\n if (schemas.headerParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.headerParams.name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'headerParams',\n questionToken: true,\n type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),\n }),\n )\n } else {\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'headerParams',\n questionToken: true,\n type: keywordTypeNodes.never,\n }),\n )\n }\n\n // Add url property with template literal type\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'url',\n type: createUrlTemplateType(operation.path),\n }),\n )\n\n const dataRequestNode = factory.createTypeAliasDeclaration({\n name,\n type: factory.createTypeLiteralNode(dataRequestProperties),\n modifiers: [factory.modifiers.export],\n })\n\n results.push(safePrint(dataRequestNode))\n\n return results.join('\\n\\n')\n}\n\nfunction printResponseSchema({\n baseName,\n schemas,\n pluginManager,\n unknownType,\n}: {\n baseName: string\n schemas: OperationSchemas\n pluginManager: PluginManager\n unknownType: PluginTs['resolvedOptions']['unknownType']\n}): string {\n const results: string[] = []\n\n const name = pluginManager.resolveName({\n name: `${baseName} ResponseData`,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n // Generate Responses type (mapping status codes to response types)\n if (schemas.responses && schemas.responses.length > 0) {\n const responsesProperties: ts.PropertySignature[] = schemas.responses.map((res) => {\n const identifier = pluginManager.resolveName({\n name: res.name,\n pluginKey: [pluginTsName],\n type: 'type',\n })\n\n return factory.createPropertySignature({\n name: res.statusCode?.toString() ?? 'default',\n type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),\n })\n })\n\n const responsesNode = factory.createTypeAliasDeclaration({\n name: `${baseName}Responses`,\n type: factory.createTypeLiteralNode(responsesProperties),\n modifiers: [factory.modifiers.export],\n })\n\n results.push(safePrint(responsesNode))\n\n // Generate Response type (union via indexed access)\n const responseNode = factory.createTypeAliasDeclaration({\n name,\n type: factory.createIndexedAccessTypeNode(\n factory.createTypeReferenceNode(factory.createIdentifier(`${baseName}Responses`), undefined),\n factory.createTypeOperatorNode(\n ts.SyntaxKind.KeyOfKeyword,\n factory.createTypeReferenceNode(factory.createIdentifier(`${baseName}Responses`), undefined),\n ),\n ),\n modifiers: [factory.modifiers.export],\n })\n\n results.push(safePrint(responseNode))\n } else {\n const responseNode = factory.createTypeAliasDeclaration({\n name,\n modifiers: [factory.modifiers.export],\n type: getUnknownType(unknownType),\n })\n\n results.push(safePrint(responseNode))\n }\n\n return results.join('\\n\\n')\n}\n\nexport const typeGenerator = createReactGenerator<PluginTs>({\n name: 'typescript',\n Operation({ operation, generator, plugin }) {\n const {\n options,\n options: { mapper, enumType, syntaxType, optionalType, arrayType, unknownType },\n } = plugin\n\n const mode = useMode()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getFile, getName, getGroup } = useOperationManager(generator)\n const schemaManager = useSchemaManager()\n\n const name = getName(operation, { type: 'type', pluginKey: [pluginTsName] })\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const schemaGenerator = new SchemaGenerator(options, {\n fabric: generator.context.fabric,\n oas,\n events: generator.context.events,\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) => {\n const tree = schemaGenerator.parse({ schema, name, parentName: null })\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 <>\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[name, 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={schema}\n mapper={mapper}\n enumType={enumType}\n optionalType={optionalType}\n arrayType={arrayType}\n keysToOmit={keysToOmit}\n syntaxType={syntaxType}\n />\n </>\n )\n }\n\n const responseName = schemaManager.getName(schemas.response.name, {\n type: 'type',\n })\n const combinedSchemaName = operation.method === 'get' ? `${name}Query` : `${name}Mutation`\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 {generator.context.UNSTABLE_NAMING ? (\n <>\n <File.Source name={`${name}Request`} isExportable isIndexable isTypeOnly>\n {printRequestSchema({ baseName: name, operation, schemas, pluginManager })}\n </File.Source>\n <File.Source name={responseName} isExportable isIndexable isTypeOnly>\n {printResponseSchema({ baseName: name, schemas, pluginManager, unknownType })}\n </File.Source>\n </>\n ) : (\n <File.Source name={combinedSchemaName} isExportable isIndexable isTypeOnly>\n {printCombinedSchema({ name: combinedSchemaName, schemas, pluginManager })}\n </File.Source>\n )}\n </File>\n )\n },\n Schema({ schema, plugin }) {\n const {\n options: { mapper, enumType, syntaxType, optionalType, arrayType, output },\n } = plugin\n const mode = useMode()\n\n const oas = useOas()\n const pluginManager = usePluginManager()\n\n const { getName, getImports, getFile } = useSchemaManager()\n const imports = getImports(schema.tree)\n const schemaFromTree = schema.tree.find((item) => item.keyword === schemaKeywords.schema)\n\n let typedName = getName(schema.name, { type: 'type' })\n\n if (enumType === 'asConst' && schemaFromTree && isKeyword(schemaFromTree, schemaKeywords.enum)) {\n typedName = typedName += 'Key' //Suffix for avoiding collisions (https://github.com/kubb-labs/kubb/issues/1873)\n }\n\n const type = {\n name: getName(schema.name, { type: 'function' }),\n typedName,\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={[schema.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 arrayType={arrayType}\n syntaxType={syntaxType}\n />\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { definePlugin, type Group, getBarrelFiles, getMode } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { OperationGenerator, pluginOasName, SchemaGenerator } from '@kubb/plugin-oas'\nimport { typeGenerator } from './generators'\nimport type { PluginTs } from './types.ts'\n\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\nexport const pluginTs = definePlugin<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 arrayType = 'array',\n emptySchemaType = unknownType,\n syntaxType = 'type',\n transformers = {},\n mapper = {},\n generators = [typeGenerator].filter(Boolean),\n contentType,\n UNSTABLE_NAMING,\n } = options\n\n const usedEnumNames = {}\n\n return {\n name: pluginTsName,\n options: {\n output,\n transformers,\n dateType,\n optionalType,\n arrayType,\n enumType,\n enumSuffix,\n unknownType,\n emptySchemaType,\n syntaxType,\n group,\n override,\n mapper,\n usedEnumNames,\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 ?? 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 install() {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n const oas = await this.getOas()\n\n const schemaGenerator = new SchemaGenerator(this.plugin.options, {\n fabric: this.fabric,\n oas,\n pluginManager: this.pluginManager,\n events: this.events,\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.upsertFile(...schemaFiles)\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n fabric: this.fabric,\n oas,\n pluginManager: this.pluginManager,\n events: this.events,\n plugin: this.plugin,\n contentType,\n exclude,\n include,\n override,\n mode,\n UNSTABLE_NAMING,\n })\n\n const operationFiles = await operationGenerator.build(...generators)\n await this.upsertFile(...operationFiles)\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginKey: this.plugin.key,\n },\n })\n\n await this.upsertFile(...barrelFiles)\n },\n }\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,SAAS,oBAAoB,EAAE,MAAM,SAAS,iBAAoG;CAChJ,MAAMA,aAA0C,EAAE;AAElD,KAAI,QAAQ,SACV,YAAW,wDAA6C,EACtD,OAAO,QAAQ,UAAU,KAAK,QAAQ;EACpC,MAAM,aAAa,cAAc,YAAY;GAC3C,MAAM,IAAI;GACV,WAAW,CAAC,aAAa;GACzB,MAAM;GACP,CAAC;AAEF,wFAAgE,WAAW,EAAE,OAAU;GACvF,EACH,CAAC;AAGJ,KAAI,QAAQ,SAAS;EACnB,MAAM,aAAa,cAAc,YAAY;GAC3C,MAAM,QAAQ,QAAQ;GACtB,WAAW,CAAC,aAAa;GACzB,MAAM;GACP,CAAC;AACF,aAAW,4FAAsE,WAAW,EAAE,OAAU;;AAG1G,KAAI,QAAQ,YAAY;EACtB,MAAM,aAAa,cAAc,YAAY;GAC3C,MAAM,QAAQ,WAAW;GACzB,WAAW,CAAC,aAAa;GACzB,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