@kubb/swagger-ts 2.6.6 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,3 @@
1
- import transformers2, { camelCase, pascalCase } from '@kubb/core/transformers';
2
- import { print } from '@kubb/parser';
3
- import * as factory2 from '@kubb/parser/factory';
4
- import { keywordTypeNodes } from '@kubb/parser/factory';
5
- import { usePlugin, useFile, File, usePluginManager, createRoot, Type } from '@kubb/react';
6
- import { useOas, useSchemas, useOperationFile, useOperationName, useOperation } from '@kubb/swagger/hooks';
7
- import { pluginName as pluginName$1, OasBuilder, OperationGenerator as OperationGenerator$1 } from '@kubb/swagger';
8
- import { refsSorter, isReference, getSchemaFactory } from '@kubb/swagger/utils';
9
- import { createPlugin, FileManager, PluginManager, Generator } from '@kubb/core';
10
- import { renderTemplate, getUniqueName } from '@kubb/core/utils';
11
- import path from 'path';
12
- import { jsx, jsxs, Fragment } from '@kubb/react/jsx-runtime';
13
-
14
1
  var __accessCheck = (obj, member, msg) => {
15
2
  if (!member.has(obj))
16
3
  throw TypeError("Cannot " + msg);
@@ -28,6 +15,44 @@ var __privateMethod = (obj, member, method) => {
28
15
  __accessCheck(obj, member, "access private method");
29
16
  return method;
30
17
  };
18
+
19
+ // src/components/Mutation.tsx
20
+ import transformers4 from "@kubb/core/transformers";
21
+ import { print as print3 } from "@kubb/parser";
22
+ import * as factory3 from "@kubb/parser/factory";
23
+ import { Editor as Editor3, File as File3, usePlugin as usePlugin3, usePluginManager as usePluginManager2 } from "@kubb/react";
24
+ import { useOas as useOas3, useOperation as useOperation2, useOperationFile as useOperationFile2, useOperationName as useOperationName2, useSchemas as useSchemas2 } from "@kubb/swagger/hooks";
25
+
26
+ // src/TypeBuilder.ts
27
+ import transformers3 from "@kubb/core/transformers";
28
+ import { print as print2 } from "@kubb/parser";
29
+ import { OasBuilder } from "@kubb/swagger";
30
+ import { refsSorter } from "@kubb/swagger/utils";
31
+
32
+ // src/TypeGenerator.ts
33
+ import { Generator as Generator2 } from "@kubb/core";
34
+ import transformers2 from "@kubb/core/transformers";
35
+ import { getUniqueName } from "@kubb/core/utils";
36
+ import * as factory2 from "@kubb/parser/factory";
37
+ import { keywordTypeNodes as keywordTypeNodes2 } from "@kubb/parser/factory";
38
+ import { getSchemaFactory, isReference } from "@kubb/swagger/utils";
39
+
40
+ // src/plugin.ts
41
+ import path from "path";
42
+ import { createPlugin, FileManager, PluginManager } from "@kubb/core";
43
+ import { camelCase, pascalCase } from "@kubb/core/transformers";
44
+ import { renderTemplate } from "@kubb/core/utils";
45
+ import { pluginName as swaggerPluginName } from "@kubb/swagger";
46
+
47
+ // src/OperationGenerator.tsx
48
+ import { createRoot } from "@kubb/react";
49
+ import { OperationGenerator as Generator } from "@kubb/swagger";
50
+
51
+ // src/components/Oas.tsx
52
+ import { Editor, File, Type, usePlugin } from "@kubb/react";
53
+ import { useFile } from "@kubb/react";
54
+ import { useOas } from "@kubb/swagger/hooks";
55
+ import { Fragment, jsx, jsxs } from "@kubb/react/jsx-runtime";
31
56
  function Template({
32
57
  name,
33
58
  typeName,
@@ -50,9 +75,9 @@ function Oas({
50
75
  }
51
76
  Oas.File = function({ name, typeName, templates = defaultTemplates }) {
52
77
  const { key: pluginKey2 } = usePlugin();
53
- const file = useFile({ name, pluginKey: pluginKey2 });
78
+ const file = useFile({ name, extName: ".ts", pluginKey: pluginKey2 });
54
79
  const Template2 = templates.default;
55
- return /* @__PURE__ */ jsxs(
80
+ return /* @__PURE__ */ jsx(Editor, { language: "typescript", children: /* @__PURE__ */ jsxs(
56
81
  File,
57
82
  {
58
83
  baseName: file.baseName,
@@ -63,67 +88,75 @@ Oas.File = function({ name, typeName, templates = defaultTemplates }) {
63
88
  /* @__PURE__ */ jsx(File.Source, { children: /* @__PURE__ */ jsx(Oas, { Template: Template2, name, typeName }) })
64
89
  ]
65
90
  }
66
- );
91
+ ) });
67
92
  };
68
93
  Oas.templates = defaultTemplates;
94
+
95
+ // src/components/Query.tsx
96
+ import transformers from "@kubb/core/transformers";
97
+ import { print } from "@kubb/parser";
98
+ import * as factory from "@kubb/parser/factory";
99
+ import { Editor as Editor2, File as File2, usePlugin as usePlugin2, usePluginManager } from "@kubb/react";
100
+ import { useOas as useOas2, useOperation, useOperationFile, useOperationName, useSchemas } from "@kubb/swagger/hooks";
101
+ import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "@kubb/react/jsx-runtime";
69
102
  function printCombinedSchema(name, operation, schemas) {
70
103
  const properties = {
71
- "response": factory2.createTypeReferenceNode(
72
- factory2.createIdentifier(schemas.response.name),
104
+ "response": factory.createTypeReferenceNode(
105
+ factory.createIdentifier(schemas.response.name),
73
106
  void 0
74
107
  )
75
108
  };
76
109
  if (schemas.request) {
77
- properties["request"] = factory2.createTypeReferenceNode(
78
- factory2.createIdentifier(schemas.request.name),
110
+ properties["request"] = factory.createTypeReferenceNode(
111
+ factory.createIdentifier(schemas.request.name),
79
112
  void 0
80
113
  );
81
114
  }
82
115
  if (schemas.pathParams) {
83
- properties["pathParams"] = factory2.createTypeReferenceNode(
84
- factory2.createIdentifier(schemas.pathParams.name),
116
+ properties["pathParams"] = factory.createTypeReferenceNode(
117
+ factory.createIdentifier(schemas.pathParams.name),
85
118
  void 0
86
119
  );
87
120
  }
88
121
  if (schemas.queryParams) {
89
- properties["queryParams"] = factory2.createTypeReferenceNode(
90
- factory2.createIdentifier(schemas.queryParams.name),
122
+ properties["queryParams"] = factory.createTypeReferenceNode(
123
+ factory.createIdentifier(schemas.queryParams.name),
91
124
  void 0
92
125
  );
93
126
  }
94
127
  if (schemas.headerParams) {
95
- properties["headerParams"] = factory2.createTypeReferenceNode(
96
- factory2.createIdentifier(schemas.headerParams.name),
128
+ properties["headerParams"] = factory.createTypeReferenceNode(
129
+ factory.createIdentifier(schemas.headerParams.name),
97
130
  void 0
98
131
  );
99
132
  }
100
133
  if (schemas.errors) {
101
- properties["errors"] = factory2.createUnionDeclaration({
134
+ properties["errors"] = factory.createUnionDeclaration({
102
135
  nodes: schemas.errors.map((error) => {
103
- return factory2.createTypeReferenceNode(
104
- factory2.createIdentifier(error.name),
136
+ return factory.createTypeReferenceNode(
137
+ factory.createIdentifier(error.name),
105
138
  void 0
106
139
  );
107
140
  })
108
141
  });
109
142
  }
110
- const namespaceNode = factory2.createTypeAliasDeclaration({
143
+ const namespaceNode = factory.createTypeAliasDeclaration({
111
144
  name: operation.method === "get" ? `${name}Query` : `${name}Mutation`,
112
- type: factory2.createTypeLiteralNode(
145
+ type: factory.createTypeLiteralNode(
113
146
  Object.keys(properties).map((key) => {
114
147
  const type = properties[key];
115
148
  if (!type) {
116
149
  return void 0;
117
150
  }
118
- return factory2.createPropertySignature(
151
+ return factory.createPropertySignature(
119
152
  {
120
- name: transformers2.pascalCase(key),
153
+ name: transformers.pascalCase(key),
121
154
  type
122
155
  }
123
156
  );
124
157
  }).filter(Boolean)
125
158
  ),
126
- modifiers: [factory2.modifiers.export]
159
+ modifiers: [factory.modifiers.export]
127
160
  });
128
161
  return print(namespaceNode);
129
162
  }
@@ -131,29 +164,29 @@ function Query({
131
164
  builder
132
165
  }) {
133
166
  const { source } = builder.build();
134
- return /* @__PURE__ */ jsx(Fragment, { children: source });
167
+ return /* @__PURE__ */ jsx2(Fragment2, { children: source });
135
168
  }
136
169
  Query.File = function({ mode }) {
137
- const { options } = usePlugin();
170
+ const { options } = usePlugin2();
138
171
  const schemas = useSchemas();
139
172
  const pluginManager = usePluginManager();
140
- const oas = useOas();
173
+ const oas = useOas2();
141
174
  const file = useOperationFile();
142
175
  const factoryName = useOperationName({ type: "type" });
143
176
  const operation = useOperation();
144
177
  const builder = new TypeBuilder(options, { oas, pluginManager }).add(schemas.pathParams).add(schemas.queryParams).add(schemas.headerParams).add(schemas.response).add(schemas.statusCodes);
145
178
  const { source, imports } = builder.build();
146
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
147
- File,
179
+ return /* @__PURE__ */ jsx2(Editor2, { language: "typescript", children: /* @__PURE__ */ jsxs2(
180
+ File2,
148
181
  {
149
182
  baseName: file.baseName,
150
183
  path: file.path,
151
184
  meta: file.meta,
152
185
  children: [
153
186
  mode === "directory" && imports.map((item, index) => {
154
- return /* @__PURE__ */ jsx(File.Import, { root: file.path, ...item }, index);
187
+ return /* @__PURE__ */ jsx2(File2.Import, { root: file.path, ...item }, index);
155
188
  }),
156
- /* @__PURE__ */ jsxs(File.Source, { children: [
189
+ /* @__PURE__ */ jsxs2(File2.Source, { children: [
157
190
  source,
158
191
  printCombinedSchema(factoryName, operation, schemas)
159
192
  ] })
@@ -161,7 +194,10 @@ Query.File = function({ mode }) {
161
194
  }
162
195
  ) });
163
196
  };
164
- var OperationGenerator = class extends OperationGenerator$1 {
197
+
198
+ // src/OperationGenerator.tsx
199
+ import { jsx as jsx3 } from "@kubb/react/jsx-runtime";
200
+ var OperationGenerator = class extends Generator {
165
201
  async all() {
166
202
  const { oas, pluginManager, plugin } = this.context;
167
203
  if (!plugin.options.oasType) {
@@ -169,7 +205,7 @@ var OperationGenerator = class extends OperationGenerator$1 {
169
205
  }
170
206
  const root = createRoot({ logger: pluginManager.logger });
171
207
  root.render(
172
- /* @__PURE__ */ jsx(Oas.File, { name: "oas", typeName: "Oas" }),
208
+ /* @__PURE__ */ jsx3(Oas.File, { name: "oas", typeName: "Oas" }),
173
209
  { meta: { oas, pluginManager, plugin } }
174
210
  );
175
211
  return root.files;
@@ -178,7 +214,7 @@ var OperationGenerator = class extends OperationGenerator$1 {
178
214
  const { oas, pluginManager, plugin, mode = "directory" } = this.context;
179
215
  const root = createRoot({ logger: pluginManager.logger });
180
216
  root.render(
181
- /* @__PURE__ */ jsx(Query.File, { mode }),
217
+ /* @__PURE__ */ jsx3(Query.File, { mode }),
182
218
  { meta: { oas, pluginManager, plugin: { ...plugin, options }, schemas, operation } }
183
219
  );
184
220
  return root.files;
@@ -187,7 +223,7 @@ var OperationGenerator = class extends OperationGenerator$1 {
187
223
  const { oas, pluginManager, plugin, mode = "directory" } = this.context;
188
224
  const root = createRoot({ logger: pluginManager.logger });
189
225
  root.render(
190
- /* @__PURE__ */ jsx(Mutation.File, { mode }),
226
+ /* @__PURE__ */ jsx3(Mutation.File, { mode }),
191
227
  { meta: { oas, pluginManager, plugin: { ...plugin, options }, schemas, operation } }
192
228
  );
193
229
  return root.files;
@@ -233,7 +269,7 @@ var definePlugin = createPlugin((options) => {
233
269
  usedEnumNames: {},
234
270
  unknownType
235
271
  },
236
- pre: [pluginName$1],
272
+ pre: [swaggerPluginName],
237
273
  resolvePath(baseName, directory, options2) {
238
274
  const root = path.resolve(this.config.root, this.config.output.path);
239
275
  const mode = FileManager.getMode(path.resolve(root, output.path));
@@ -260,7 +296,7 @@ var definePlugin = createPlugin((options) => {
260
296
  return this.fileManager.write(source, writePath, { sanity: false });
261
297
  },
262
298
  async buildStart() {
263
- const [swaggerPlugin] = PluginManager.getDependedPlugins(this.plugins, [pluginName$1]);
299
+ const [swaggerPlugin] = PluginManager.getDependedPlugins(this.plugins, [swaggerPluginName]);
264
300
  const oas = await swaggerPlugin.api.getOas();
265
301
  const schemas = await swaggerPlugin.api.getSchemas();
266
302
  const root = path.resolve(this.config.root, this.config.output.path);
@@ -338,7 +374,7 @@ var definePlugin = createPlugin((options) => {
338
374
 
339
375
  // src/TypeGenerator.ts
340
376
  var _usedAliasNames, _getTypeFromProperties, getTypeFromProperties_fn, _getRefAlias, getRefAlias_fn, _getParsedSchema, getParsedSchema_fn, _getBaseTypeFromSchema, getBaseTypeFromSchema_fn, _unknownReturn, unknownReturn_get;
341
- var TypeGenerator = class extends Generator {
377
+ var TypeGenerator = class extends Generator2 {
342
378
  constructor() {
343
379
  super(...arguments);
344
380
  /**
@@ -597,7 +633,7 @@ getBaseTypeFromSchema_fn = function(_schema, baseName) {
597
633
  return factory2.createLiteralTypeNode(factory2.createNumericLiteral(schema["const"]));
598
634
  }
599
635
  } else {
600
- return keywordTypeNodes.null;
636
+ return keywordTypeNodes2.null;
601
637
  }
602
638
  }
603
639
  if (schema.type) {
@@ -641,7 +677,7 @@ var TypeBuilder = class extends OasBuilder {
641
677
  build(name) {
642
678
  const importMeta = [];
643
679
  const codes = [];
644
- const generated = this.items.filter((operationSchema) => name ? operationSchema.name === name : true).sort(transformers2.nameSorter).map((operationSchema) => {
680
+ const generated = this.items.filter((operationSchema) => name ? operationSchema.name === name : true).sort(transformers3.nameSorter).map((operationSchema) => {
645
681
  const generator = new TypeGenerator(this.options, this.context);
646
682
  const required = Array.isArray(operationSchema.schema?.required) ? !!operationSchema.schema.required.length : !!operationSchema.schema?.required;
647
683
  const sources = generator.build({
@@ -661,7 +697,7 @@ var TypeBuilder = class extends OasBuilder {
661
697
  };
662
698
  }).sort(refsSorter);
663
699
  generated.forEach((item) => {
664
- codes.push(print(item.sources));
700
+ codes.push(print2(item.sources));
665
701
  });
666
702
  const imports = importMeta.map((item) => {
667
703
  return {
@@ -672,98 +708,101 @@ var TypeBuilder = class extends OasBuilder {
672
708
  });
673
709
  return {
674
710
  imports,
675
- source: transformers2.combineCodes(codes)
711
+ source: transformers3.combineCodes(codes)
676
712
  };
677
713
  }
678
714
  };
715
+
716
+ // src/components/Mutation.tsx
717
+ import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs3 } from "@kubb/react/jsx-runtime";
679
718
  function printCombinedSchema2(name, operation, schemas) {
680
719
  const properties = {
681
- "response": factory2.createTypeReferenceNode(
682
- factory2.createIdentifier(schemas.response.name),
720
+ "response": factory3.createTypeReferenceNode(
721
+ factory3.createIdentifier(schemas.response.name),
683
722
  void 0
684
723
  )
685
724
  };
686
725
  if (schemas.request) {
687
- properties["request"] = factory2.createTypeReferenceNode(
688
- factory2.createIdentifier(schemas.request.name),
726
+ properties["request"] = factory3.createTypeReferenceNode(
727
+ factory3.createIdentifier(schemas.request.name),
689
728
  void 0
690
729
  );
691
730
  }
692
731
  if (schemas.pathParams) {
693
- properties["pathParams"] = factory2.createTypeReferenceNode(
694
- factory2.createIdentifier(schemas.pathParams.name),
732
+ properties["pathParams"] = factory3.createTypeReferenceNode(
733
+ factory3.createIdentifier(schemas.pathParams.name),
695
734
  void 0
696
735
  );
697
736
  }
698
737
  if (schemas.queryParams) {
699
- properties["queryParams"] = factory2.createTypeReferenceNode(
700
- factory2.createIdentifier(schemas.queryParams.name),
738
+ properties["queryParams"] = factory3.createTypeReferenceNode(
739
+ factory3.createIdentifier(schemas.queryParams.name),
701
740
  void 0
702
741
  );
703
742
  }
704
743
  if (schemas.headerParams) {
705
- properties["headerParams"] = factory2.createTypeReferenceNode(
706
- factory2.createIdentifier(schemas.headerParams.name),
744
+ properties["headerParams"] = factory3.createTypeReferenceNode(
745
+ factory3.createIdentifier(schemas.headerParams.name),
707
746
  void 0
708
747
  );
709
748
  }
710
749
  if (schemas.errors) {
711
- properties["errors"] = factory2.createUnionDeclaration({
750
+ properties["errors"] = factory3.createUnionDeclaration({
712
751
  nodes: schemas.errors.map((error) => {
713
- return factory2.createTypeReferenceNode(
714
- factory2.createIdentifier(error.name),
752
+ return factory3.createTypeReferenceNode(
753
+ factory3.createIdentifier(error.name),
715
754
  void 0
716
755
  );
717
756
  })
718
757
  });
719
758
  }
720
- const namespaceNode = factory2.createTypeAliasDeclaration({
759
+ const namespaceNode = factory3.createTypeAliasDeclaration({
721
760
  name: operation.method === "get" ? `${name}Query` : `${name}Mutation`,
722
- type: factory2.createTypeLiteralNode(
761
+ type: factory3.createTypeLiteralNode(
723
762
  Object.keys(properties).map((key) => {
724
763
  const type = properties[key];
725
764
  if (!type) {
726
765
  return void 0;
727
766
  }
728
- return factory2.createPropertySignature(
767
+ return factory3.createPropertySignature(
729
768
  {
730
- name: transformers2.pascalCase(key),
769
+ name: transformers4.pascalCase(key),
731
770
  type
732
771
  }
733
772
  );
734
773
  }).filter(Boolean)
735
774
  ),
736
- modifiers: [factory2.modifiers.export]
775
+ modifiers: [factory3.modifiers.export]
737
776
  });
738
- return print(namespaceNode);
777
+ return print3(namespaceNode);
739
778
  }
740
779
  function Mutation({
741
780
  builder
742
781
  }) {
743
782
  const { source } = builder.build();
744
- return /* @__PURE__ */ jsx(Fragment, { children: source });
783
+ return /* @__PURE__ */ jsx4(Fragment3, { children: source });
745
784
  }
746
785
  Mutation.File = function({ mode }) {
747
- const { options } = usePlugin();
748
- const schemas = useSchemas();
749
- const pluginManager = usePluginManager();
750
- const oas = useOas();
751
- const file = useOperationFile();
752
- const factoryName = useOperationName({ type: "type" });
753
- const operation = useOperation();
786
+ const { options } = usePlugin3();
787
+ const schemas = useSchemas2();
788
+ const pluginManager = usePluginManager2();
789
+ const oas = useOas3();
790
+ const file = useOperationFile2();
791
+ const factoryName = useOperationName2({ type: "type" });
792
+ const operation = useOperation2();
754
793
  const builder = new TypeBuilder(options, { oas, pluginManager }).add(schemas.pathParams).add(schemas.queryParams).add(schemas.headerParams).add(schemas.response).add(schemas.request).add(schemas.statusCodes);
755
794
  const { source, imports } = builder.build();
756
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
757
- File,
795
+ return /* @__PURE__ */ jsx4(Editor3, { language: "typescript", children: /* @__PURE__ */ jsxs3(
796
+ File3,
758
797
  {
759
798
  baseName: file.baseName,
760
799
  path: file.path,
761
800
  meta: file.meta,
762
801
  children: [
763
802
  mode === "directory" && imports.map((item, index) => {
764
- return /* @__PURE__ */ jsx(File.Import, { root: file.path, ...item }, index);
803
+ return /* @__PURE__ */ jsx4(File3.Import, { root: file.path, ...item }, index);
765
804
  }),
766
- /* @__PURE__ */ jsxs(File.Source, { children: [
805
+ /* @__PURE__ */ jsxs3(File3.Source, { children: [
767
806
  source,
768
807
  printCombinedSchema2(factoryName, operation, schemas)
769
808
  ] })
@@ -772,6 +811,12 @@ Mutation.File = function({ mode }) {
772
811
  ) });
773
812
  };
774
813
 
775
- export { Mutation, Oas, Query, definePlugin, pluginKey, pluginName };
776
- //# sourceMappingURL=out.js.map
777
- //# sourceMappingURL=chunk-UUY4IHAG.js.map
814
+ export {
815
+ Mutation,
816
+ Oas,
817
+ Query,
818
+ pluginName,
819
+ pluginKey,
820
+ definePlugin
821
+ };
822
+ //# sourceMappingURL=chunk-AXUXMMYD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Mutation.tsx","../src/TypeBuilder.ts","../src/TypeGenerator.ts","../src/plugin.ts","../src/OperationGenerator.tsx","../src/components/Oas.tsx","../src/components/Query.tsx"],"sourcesContent":["import transformers from '@kubb/core/transformers'\nimport { print } from '@kubb/parser'\nimport * as factory from '@kubb/parser/factory'\nimport { Editor, File, usePlugin, usePluginManager } from '@kubb/react'\nimport { useOas, useOperation, useOperationFile, useOperationName, useSchemas } from '@kubb/swagger/hooks'\n\nimport { TypeBuilder } from '../TypeBuilder.ts'\n\nimport type { KubbFile } from '@kubb/core'\nimport type { ts } from '@kubb/parser'\nimport type { OperationSchemas } from '@kubb/swagger'\nimport type { Operation } from '@kubb/swagger/oas'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginOptions } from '../types.ts'\n\ntype Props = {\n builder: TypeBuilder\n}\n\nfunction printCombinedSchema(name: string, operation: Operation, schemas: OperationSchemas): string {\n const properties: Record<string, ts.TypeNode> = {\n 'response': factory.createTypeReferenceNode(\n factory.createIdentifier(schemas.response.name),\n undefined,\n ),\n }\n\n if (schemas.request) {\n properties['request'] = factory.createTypeReferenceNode(\n factory.createIdentifier(schemas.request.name),\n undefined,\n )\n }\n\n if (schemas.pathParams) {\n properties['pathParams'] = factory.createTypeReferenceNode(\n factory.createIdentifier(schemas.pathParams.name),\n undefined,\n )\n }\n\n if (schemas.queryParams) {\n properties['queryParams'] = factory.createTypeReferenceNode(\n factory.createIdentifier(schemas.queryParams.name),\n undefined,\n )\n }\n\n if (schemas.headerParams) {\n properties['headerParams'] = factory.createTypeReferenceNode(\n factory.createIdentifier(schemas.headerParams.name),\n undefined,\n )\n }\n\n if (schemas.errors) {\n properties['errors'] = factory.createUnionDeclaration({\n nodes: schemas.errors.map(error => {\n return factory.createTypeReferenceNode(\n factory.createIdentifier(error.name),\n undefined,\n )\n }),\n })!\n }\n const namespaceNode = factory.createTypeAliasDeclaration({\n name: operation.method === 'get' ? `${name}Query` : `${name}Mutation`,\n type: factory.createTypeLiteralNode(\n Object.keys(properties).map(key => {\n const type = properties[key]\n if (!type) {\n return undefined\n }\n\n return factory.createPropertySignature(\n {\n name: transformers.pascalCase(key),\n type,\n },\n )\n }).filter(Boolean),\n ),\n modifiers: [factory.modifiers.export],\n })\n\n return print(namespaceNode)\n}\n\nexport function Mutation({\n builder,\n}: Props): ReactNode {\n const { source } = builder.build()\n\n return (\n <>\n {source}\n </>\n )\n}\n\ntype FileProps = {\n mode: KubbFile.Mode\n}\n\nMutation.File = function({ mode }: FileProps): ReactNode {\n const { options } = usePlugin<PluginOptions>()\n\n const schemas = useSchemas()\n const pluginManager = usePluginManager()\n const oas = useOas()\n const file = useOperationFile()\n const factoryName = useOperationName({ type: 'type' })\n const operation = useOperation()\n\n const builder = new TypeBuilder(options, { oas, pluginManager })\n .add(schemas.pathParams)\n .add(schemas.queryParams)\n .add(schemas.headerParams)\n .add(schemas.response)\n .add(schemas.request)\n .add(schemas.statusCodes)\n\n const { source, imports } = builder.build()\n\n return (\n <Editor language=\"typescript\">\n <File<FileMeta>\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n >\n {mode === 'directory' && imports.map((item, index) => {\n return <File.Import key={index} root={file.path} {...item} />\n })}\n <File.Source>\n {source}\n {printCombinedSchema(factoryName, operation, schemas)}\n </File.Source>\n </File>\n </Editor>\n )\n}\n","import transformers from '@kubb/core/transformers'\nimport { print } from '@kubb/parser'\nimport { OasBuilder } from '@kubb/swagger'\nimport { refsSorter } from '@kubb/swagger/utils'\n\nimport { TypeGenerator } from './TypeGenerator.ts'\n\nimport type { KubbFile } from '@kubb/core'\nimport type { ImportMeta } from '@kubb/swagger'\nimport type { PluginOptions } from './types.ts'\n\nexport class TypeBuilder extends OasBuilder<PluginOptions['resolvedOptions']> {\n build(name?: string): Required<Pick<KubbFile.File, 'imports' | 'source'>> {\n const importMeta: ImportMeta[] = []\n const codes: string[] = []\n\n const generated = this.items\n .filter((operationSchema) => (name ? operationSchema.name === name : true))\n .sort(transformers.nameSorter)\n .map((operationSchema) => {\n const generator = new TypeGenerator(this.options, this.context)\n const required = Array.isArray(operationSchema.schema?.required) ? !!operationSchema.schema.required.length : !!operationSchema.schema?.required\n\n const sources = generator.build({\n schema: operationSchema.schema,\n baseName: operationSchema.name,\n description: operationSchema.description,\n keysToOmit: operationSchema.keysToOmit,\n optional: !required && !!operationSchema.name.includes('Params'),\n })\n\n importMeta.push(...generator.imports)\n\n return {\n import: {\n refs: generator.refs,\n name: operationSchema.name,\n },\n sources,\n }\n })\n .sort(refsSorter)\n\n generated.forEach((item) => {\n codes.push(print(item.sources))\n })\n\n const imports: KubbFile.Import[] = importMeta.map((item) => {\n return {\n name: [item.ref.propertyName],\n path: item.path,\n isTypeOnly: item.isTypeOnly,\n }\n })\n\n return {\n imports,\n source: transformers.combineCodes(codes),\n }\n }\n}\n","import { Generator } from '@kubb/core'\nimport transformers from '@kubb/core/transformers'\nimport { getUniqueName } from '@kubb/core/utils'\nimport * as factory from '@kubb/parser/factory'\nimport { keywordTypeNodes } from '@kubb/parser/factory'\nimport { getSchemaFactory, isReference } from '@kubb/swagger/utils'\n\nimport { pluginKey } from './plugin.ts'\n\nimport type { PluginManager } from '@kubb/core'\nimport type { ts } from '@kubb/parser'\nimport type { ImportMeta, Refs } from '@kubb/swagger'\nimport type { Oas, OasTypes, OpenAPIV3, OpenAPIV3_1 } from '@kubb/swagger/oas'\nimport type { PluginOptions } from './types.ts'\n\n// based on https://github.com/cellular/oazapfts/blob/7ba226ebb15374e8483cc53e7532f1663179a22c/src/codegen/generate.ts#L398\n\ntype Context = {\n oas: Oas\n pluginManager: PluginManager\n}\n\nexport class TypeGenerator extends Generator<PluginOptions['resolvedOptions'], Context> {\n refs: Refs = {}\n imports: ImportMeta[] = []\n\n extraNodes: ts.Node[] = []\n\n aliases: ts.TypeAliasDeclaration[] = []\n\n // Keep track of already used type aliases\n #usedAliasNames: Record<string, number> = {}\n\n build({\n schema,\n optional,\n baseName,\n description,\n keysToOmit,\n }: {\n schema: OasTypes.SchemaObject\n baseName: string\n description?: string\n optional?: boolean\n keysToOmit?: string[]\n }): ts.Node[] {\n const nodes: ts.Node[] = []\n let type = this.getTypeFromSchema(schema, baseName)\n\n if (!type) {\n return this.extraNodes\n }\n\n if (optional) {\n type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] }) as ts.TypeNode\n }\n\n const node = factory.createTypeAliasDeclaration({\n modifiers: [factory.modifiers.export],\n name: this.context.pluginManager.resolveName({ name: baseName, pluginKey, type: 'type' }),\n type: keysToOmit?.length ? factory.createOmitDeclaration({ keys: keysToOmit, type, nonNullable: true }) : type,\n })\n\n if (description) {\n nodes.push(\n factory.appendJSDocToNode({\n node,\n comments: [`@description ${transformers.trim(description)}`],\n }),\n )\n } else {\n nodes.push(node)\n }\n\n // filter out if the export name is the same as one that we already defined in extraNodes(see enum)\n const filterdNodes = nodes.filter(\n (node: ts.Node) =>\n !this.extraNodes.some(\n (extraNode: ts.Node) => (extraNode as ts.TypeAliasDeclaration)?.name?.escapedText === (node as ts.TypeAliasDeclaration)?.name?.escapedText,\n ),\n )\n\n return [...this.extraNodes, ...filterdNodes]\n }\n\n /**\n * Creates a type node from a given schema.\n * Delegates to getBaseTypeFromSchema internally and\n * optionally adds a union with null.\n */\n getTypeFromSchema(schema?: OasTypes.SchemaObject, name?: string): ts.TypeNode | null {\n const type = this.#getBaseTypeFromSchema(schema, name)\n\n if (!type) {\n return null\n }\n\n if (schema && !schema.nullable) {\n return type\n }\n\n return factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.null] })\n }\n\n /**\n * Recursively creates a type literal with the given props.\n */\n #getTypeFromProperties(baseSchema?: OasTypes.SchemaObject, baseName?: string): ts.TypeNode | null {\n const { optionalType } = this.options\n const properties = baseSchema?.properties || {}\n const required = baseSchema?.required\n const additionalProperties = baseSchema?.additionalProperties\n\n const members: Array<ts.TypeElement | null> = Object.keys(properties).map((name) => {\n const schema = properties[name] as OasTypes.SchemaObject\n\n const isRequired = Array.isArray(required) ? required.includes(name) : !!required\n let type = this.getTypeFromSchema(schema, this.context.pluginManager.resolveName({ name: `${baseName || ''} ${name}`, pluginKey, type: 'type' }))\n\n if (!type) {\n return null\n }\n\n if (!isRequired && ['undefined', 'questionTokenAndUndefined'].includes(optionalType as string)) {\n type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] })\n }\n const propertySignature = factory.createPropertySignature({\n questionToken: ['questionToken', 'questionTokenAndUndefined'].includes(optionalType as string) && !isRequired,\n name,\n type: type as ts.TypeNode,\n readOnly: schema.readOnly,\n })\n\n return factory.appendJSDocToNode({\n node: propertySignature,\n comments: [\n schema.description ? `@description ${schema.description}` : undefined,\n schema.type ? `@type ${schema.type?.toString()}${isRequired ? '' : ' | undefined'} ${schema.format || ''}` : undefined,\n schema.example ? `@example ${schema.example as string}` : undefined,\n schema.deprecated ? `@deprecated` : undefined,\n schema.default !== undefined && typeof schema.default === 'string' ? `@default '${schema.default}'` : undefined,\n schema.default !== undefined && typeof schema.default !== 'string' ? `@default ${schema.default as string}` : undefined,\n ].filter(Boolean),\n })\n })\n if (additionalProperties) {\n const type = additionalProperties === true ? this.#unknownReturn : this.getTypeFromSchema(additionalProperties as OasTypes.SchemaObject)\n\n if (type) {\n members.push(factory.createIndexSignature(type))\n }\n }\n return factory.createTypeLiteralNode(members.filter(Boolean))\n }\n\n /**\n * Create a type alias for the schema referenced by the given ReferenceObject\n */\n #getRefAlias(obj: OpenAPIV3.ReferenceObject, _baseName?: string) {\n const { $ref } = obj\n let ref = this.refs[$ref]\n\n if (ref) {\n return factory.createTypeReferenceNode(ref.propertyName, undefined)\n }\n\n const originalName = getUniqueName($ref.replace(/.+\\//, ''), this.#usedAliasNames)\n const propertyName = this.context.pluginManager.resolveName({ name: originalName, pluginKey, type: 'type' })\n\n ref = this.refs[$ref] = {\n propertyName,\n originalName,\n }\n\n const fileName = this.context.pluginManager.resolveName({ name: originalName, pluginKey, type: 'file' })\n const path = this.context.pluginManager.resolvePath({ baseName: fileName, pluginKey })\n\n this.imports.push({\n ref,\n path: path || '',\n isTypeOnly: true,\n })\n\n return factory.createTypeReferenceNode(ref.propertyName, undefined)\n }\n\n #getParsedSchema(schema?: OasTypes.SchemaObject) {\n const parsedSchema = getSchemaFactory(this.context.oas)(schema)\n return parsedSchema\n }\n\n /**\n * This is the very core of the OpenAPI to TS conversion - it takes a\n * schema and returns the appropriate type.\n */\n #getBaseTypeFromSchema(\n _schema: OasTypes.SchemaObject | undefined,\n baseName?: string,\n ): ts.TypeNode | null {\n const { schema, version } = this.#getParsedSchema(_schema)\n\n if (!schema) {\n return this.#unknownReturn\n }\n\n if (isReference(schema)) {\n return this.#getRefAlias(schema, baseName)\n }\n\n if (schema.oneOf) {\n // union\n const schemaWithoutOneOf = { ...schema, oneOf: undefined } as OasTypes.SchemaObject\n\n const union = factory.createUnionDeclaration({\n withParentheses: true,\n nodes: schema.oneOf\n .map((item) => {\n return item && this.getTypeFromSchema(item as OasTypes.SchemaObject)\n })\n .filter((item) => {\n return item && item !== this.#unknownReturn\n }) as Array<ts.TypeNode>,\n })\n\n if (schemaWithoutOneOf.properties) {\n return factory.createIntersectionDeclaration({\n nodes: [this.getTypeFromSchema(schemaWithoutOneOf, baseName), union].filter(Boolean),\n })\n }\n\n return union\n }\n\n if (schema.anyOf) {\n const schemaWithoutAnyOf = { ...schema, anyOf: undefined } as OasTypes.SchemaObject\n\n const union = factory.createUnionDeclaration({\n withParentheses: true,\n nodes: schema.anyOf\n .map((item) => {\n return item && this.getTypeFromSchema(item as OasTypes.SchemaObject)\n })\n .filter((item) => {\n return item && item !== this.#unknownReturn\n }) as Array<ts.TypeNode>,\n })\n\n if (schemaWithoutAnyOf.properties) {\n return factory.createIntersectionDeclaration({\n nodes: [this.getTypeFromSchema(schemaWithoutAnyOf, baseName), union].filter(Boolean),\n })\n }\n\n return union\n }\n if (schema.allOf) {\n // intersection/add\n const schemaWithoutAllOf = { ...schema, allOf: undefined } as OasTypes.SchemaObject\n\n const and = factory.createIntersectionDeclaration({\n withParentheses: true,\n nodes: schema.allOf\n .map((item) => {\n return item && this.getTypeFromSchema(item as OasTypes.SchemaObject)\n })\n .filter((item) => {\n return item && item !== this.#unknownReturn\n }) as Array<ts.TypeNode>,\n })\n\n if (schemaWithoutAllOf.properties) {\n return factory.createIntersectionDeclaration({\n nodes: [this.getTypeFromSchema(schemaWithoutAllOf, baseName), and].filter(Boolean),\n })\n }\n\n return and\n }\n\n /**\n * Enum will be defined outside the baseType(hints the baseName check)\n */\n if (schema.enum && baseName) {\n const enumName = getUniqueName(baseName, this.options.usedEnumNames)\n\n let enums: [key: string, value: string | number][] = [...new Set(schema.enum)].map((key) => [key, key])\n\n const extensionEnums: Array<typeof enums> = ['x-enumNames', 'x-enum-varnames']\n .filter(extensionKey => extensionKey in schema)\n .map((extensionKey) =>\n [...new Set(schema[extensionKey as keyof typeof schema] as string[])].map((key, index) => [key, schema.enum?.[index] as string] as const)\n )\n\n if (extensionEnums.length > 0 && extensionEnums[0]) {\n enums = extensionEnums[0]\n }\n\n this.extraNodes.push(\n ...factory.createEnumDeclaration({\n name: transformers.camelCase(enumName),\n typeName: this.context.pluginManager.resolveName({ name: enumName, pluginKey, type: 'type' }),\n enums,\n type: this.options.enumType,\n }),\n )\n return factory.createTypeReferenceNode(this.context.pluginManager.resolveName({ name: enumName, pluginKey, type: 'type' }), undefined)\n }\n\n if (schema.enum) {\n return factory.createUnionDeclaration({\n nodes: schema.enum.map((name) => {\n return factory.createLiteralTypeNode(typeof name === 'number' ? factory.createNumericLiteral(name) : factory.createStringLiteral(`${name}`))\n }) as unknown as Array<ts.TypeNode>,\n })\n }\n\n if ('items' in schema) {\n // items -> array\n const node = this.getTypeFromSchema(schema.items as OasTypes.SchemaObject, baseName)\n if (node) {\n return factory.createArrayTypeNode(node)\n }\n }\n\n /**\n * OpenAPI 3.1\n * @link https://json-schema.org/understanding-json-schema/reference/array.html#tuple-validation\n */\n\n if ('prefixItems' in schema) {\n const prefixItems = schema.prefixItems as OasTypes.SchemaObject[]\n\n return factory.createTupleDeclaration({\n nodes: prefixItems.map((item) => {\n // no baseType so we can fall back on an union when using enum\n return this.getTypeFromSchema(item, undefined)\n }) as Array<ts.TypeNode>,\n })\n }\n\n if (schema.properties || schema.additionalProperties) {\n // properties -> literal type\n return this.#getTypeFromProperties(schema, baseName)\n }\n\n /**\n * validate \"const\" property as defined in JSON-Schema-Validation\n *\n * https://json-schema.org/draft/2020-12/json-schema-validation#name-const\n *\n * > 6.1.3. const\n * > The value of this keyword MAY be of any type, including null.\n * > Use of this keyword is functionally equivalent to an \"enum\" (Section 6.1.2) with a single value.\n * > An instance validates successfully against this keyword if its value is equal to the value of the keyword.\n */\n if (version === '3.1' && 'const' in schema) {\n // const keyword takes precendence over the actual type.\n if (schema['const']) {\n if (typeof schema['const'] === 'string') {\n return factory.createLiteralTypeNode(factory.createStringLiteral(schema['const']))\n } else if (typeof schema['const'] === 'number') {\n return factory.createLiteralTypeNode(factory.createNumericLiteral(schema['const']))\n }\n } else {\n return keywordTypeNodes.null\n }\n }\n\n if (schema.type) {\n if (Array.isArray(schema.type)) {\n // TODO remove hardcoded first type, second nullable\n // OPENAPI v3.1.0: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0\n const [type, nullable] = schema.type as Array<OpenAPIV3_1.NonArraySchemaObjectType>\n\n return factory.createUnionDeclaration({\n nodes: [\n this.getTypeFromSchema(\n {\n ...schema,\n type,\n },\n baseName,\n ),\n nullable ? factory.createLiteralTypeNode(factory.createNull()) : undefined,\n ].filter(Boolean),\n })\n }\n\n if (this.options.dateType === 'date' && ['date', 'date-time'].some((item) => item === schema.format)) {\n return factory.createTypeReferenceNode(factory.createIdentifier('Date'))\n }\n\n // string, boolean, null, number\n if (schema.type in factory.keywordTypeNodes) {\n return factory.keywordTypeNodes[schema.type as keyof typeof factory.keywordTypeNodes]\n }\n }\n\n if (schema.format === 'binary') {\n return factory.createTypeReferenceNode('Blob', [])\n }\n\n return this.#unknownReturn\n }\n\n get #unknownReturn() {\n if (this.options.unknownType === 'any') {\n return factory.keywordTypeNodes.any\n }\n\n return factory.keywordTypeNodes.unknown\n }\n}\n","import path from 'node:path'\n\nimport { createPlugin, FileManager, PluginManager } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { pluginName as swaggerPluginName } from '@kubb/swagger'\n\nimport { OperationGenerator } from './OperationGenerator.tsx'\nimport { TypeBuilder } from './TypeBuilder.ts'\n\nimport type { KubbFile, Plugin } from '@kubb/core'\nimport type { PluginOptions as SwaggerPluginOptions } from '@kubb/swagger'\nimport type { OasTypes } from '@kubb/swagger/oas'\nimport type { PluginOptions } from './types.ts'\nexport const pluginName = 'swagger-ts' satisfies PluginOptions['name']\nexport const pluginKey: PluginOptions['key'] = [pluginName] satisfies PluginOptions['key']\n\nexport const definePlugin = createPlugin<PluginOptions>((options) => {\n const {\n output = { path: 'types' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n dateType = 'string',\n unknownType = 'any',\n optionalType = 'questionToken',\n transformers = {},\n oasType = false,\n } = options\n const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`\n\n return {\n name: pluginName,\n options: {\n transformers,\n dateType,\n enumType,\n optionalType,\n oasType,\n // keep the used enumnames between TypeBuilder and OperationGenerator per plugin(pluginKey)\n usedEnumNames: {},\n unknownType,\n },\n pre: [swaggerPluginName],\n resolvePath(baseName, directory, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'file') {\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 (options?.tag && group?.type === 'tag') {\n const tag = camelCase(options.tag)\n\n return path.resolve(root, renderTemplate(template, { tag }), baseName)\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 writeFile(source, writePath) {\n if (!writePath.endsWith('.ts') || !source) {\n return\n }\n\n return this.fileManager.write(source, writePath, { sanity: false })\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [swaggerPluginName])\n\n const oas = await swaggerPlugin.api.getOas()\n\n const schemas = await swaggerPlugin.api.getSchemas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n const builder = new TypeBuilder(this.plugin.options, { oas, pluginManager: this.pluginManager })\n\n builder.add(\n Object.entries(schemas).map(([name, schema]: [string, OasTypes.SchemaObject]) => ({ name, schema })),\n )\n\n if (mode === 'directory') {\n const mapFolderSchema = async ([name]: [string, OasTypes.SchemaObject]) => {\n const baseName = `${this.resolveName({ name, pluginKey: this.plugin.key, type: 'file' })}.ts` as const\n const resolvedPath = this.resolvePath({ baseName, pluginKey: this.plugin.key })\n const { source, imports } = builder.build(name)\n\n if (!resolvedPath) {\n return null\n }\n\n return this.addFile({\n path: resolvedPath,\n baseName,\n source,\n imports: imports.map(item => ({ ...item, root: resolvedPath })),\n meta: {\n pluginKey: this.plugin.key,\n },\n })\n }\n\n const promises = Object.entries(schemas).map(mapFolderSchema)\n\n await Promise.all(promises)\n }\n\n if (mode === 'file') {\n const resolvedPath = this.resolvePath({ baseName: '', pluginKey: this.plugin.key })\n const { source } = builder.build()\n\n if (!resolvedPath) {\n return\n }\n\n await this.addFile({\n path: resolvedPath,\n baseName: output.path as KubbFile.BaseName,\n source,\n imports: [],\n meta: {\n pluginKey: this.plugin.key,\n },\n })\n }\n\n const operationGenerator = new OperationGenerator(\n this.plugin.options,\n {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.api.contentType,\n exclude,\n include,\n override,\n mode,\n },\n )\n\n const files = await operationGenerator.build()\n await this.addFile(...files)\n },\n async buildEnd() {\n if (this.config.output.write === false) {\n return\n }\n\n const root = path.resolve(this.config.root, this.config.output.path)\n\n await this.fileManager.addIndexes({\n root,\n output,\n meta: { pluginKey: this.plugin.key },\n })\n },\n }\n})\n","import { createRoot } from '@kubb/react'\nimport { OperationGenerator as Generator } from '@kubb/swagger'\n\nimport { Mutation } from './components/Mutation.tsx'\nimport { Oas } from './components/Oas.tsx'\nimport { Query } from './components/Query.tsx'\n\nimport type { AppContextProps } from '@kubb/react'\nimport type { OperationMethodResult, OperationSchemas } from '@kubb/swagger'\nimport type { Operation } from '@kubb/swagger/oas'\nimport type { FileMeta, PluginOptions } from './types.ts'\n\nexport class OperationGenerator extends Generator<PluginOptions['resolvedOptions'], PluginOptions> {\n async all(): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin } = this.context\n\n if (!plugin.options.oasType) {\n return null\n }\n\n const root = createRoot<AppContextProps>({ logger: pluginManager.logger })\n root.render(\n <Oas.File name=\"oas\" typeName=\"Oas\" />,\n { meta: { oas, pluginManager, plugin } },\n )\n\n return root.files\n }\n\n async get(operation: Operation, schemas: OperationSchemas, options: PluginOptions['resolvedOptions']): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode = 'directory' } = this.context\n\n const root = createRoot<AppContextProps<PluginOptions['appMeta']>>({ logger: pluginManager.logger })\n root.render(\n <Query.File mode={mode} />,\n { meta: { oas, pluginManager, plugin: { ...plugin, options }, schemas, operation } },\n )\n\n return root.files\n }\n\n async post(operation: Operation, schemas: OperationSchemas, options: PluginOptions['resolvedOptions']): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode = 'directory' } = this.context\n\n const root = createRoot<AppContextProps<PluginOptions['appMeta']>>({ logger: pluginManager.logger })\n root.render(\n <Mutation.File mode={mode} />,\n { meta: { oas, pluginManager, plugin: { ...plugin, options }, schemas, operation } },\n )\n\n return root.files\n }\n\n async put(operation: Operation, schemas: OperationSchemas, options: PluginOptions['resolvedOptions']): OperationMethodResult<FileMeta> {\n return this.post(operation, schemas, options)\n }\n async patch(operation: Operation, schemas: OperationSchemas, options: PluginOptions['resolvedOptions']): OperationMethodResult<FileMeta> {\n return this.post(operation, schemas, options)\n }\n async delete(operation: Operation, schemas: OperationSchemas, options: PluginOptions['resolvedOptions']): OperationMethodResult<FileMeta> {\n return this.post(operation, schemas, options)\n }\n}\n","import { Editor, File, Type, usePlugin } from '@kubb/react'\nimport { useFile } from '@kubb/react'\nimport { useOas } from '@kubb/swagger/hooks'\n\nimport type { OasTypes } from '@kubb/swagger/oas'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginOptions } from '../types.ts'\n\ntype TemplateProps = {\n /**\n * Name of the function\n */\n name: string\n typeName: string\n api: OasTypes.OASDocument\n}\n\nfunction Template({\n name,\n typeName,\n api,\n}: TemplateProps): ReactNode {\n return (\n <>\n {`export const ${name} = ${JSON.stringify(api, undefined, 2)} as const`}\n <br />\n <Type name={typeName} export>\n {`Infer<typeof ${name}>`}\n </Type>\n </>\n )\n}\n\nconst defaultTemplates = { default: Template } as const\n\ntype Props = {\n name: string\n typeName: string\n /**\n * This will make it possible to override the default behaviour.\n */\n Template?: React.ComponentType<React.ComponentProps<typeof Template>>\n}\n\nexport function Oas({\n name,\n typeName,\n Template = defaultTemplates.default,\n}: Props): ReactNode {\n const oas = useOas()\n\n return <Template name={name} typeName={typeName} api={oas.api} />\n}\n\ntype FileProps = {\n name: string\n typeName: string\n /**\n * This will make it possible to override the default behaviour.\n */\n templates?: typeof defaultTemplates\n}\n\nOas.File = function({ name, typeName, templates = defaultTemplates }: FileProps): ReactNode {\n const { key: pluginKey } = usePlugin<PluginOptions>()\n const file = useFile({ name, extName: '.ts', pluginKey })\n\n const Template = templates.default\n\n return (\n <Editor language=\"typescript\">\n <File<FileMeta>\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n >\n <File.Import name={['Infer']} path=\"@kubb/swagger-ts/oas\" isTypeOnly />\n <File.Source>\n <Oas Template={Template} name={name} typeName={typeName} />\n </File.Source>\n </File>\n </Editor>\n )\n}\n\nOas.templates = defaultTemplates\n","import transformers from '@kubb/core/transformers'\nimport { print } from '@kubb/parser'\nimport * as factory from '@kubb/parser/factory'\nimport { Editor, File, usePlugin, usePluginManager } from '@kubb/react'\nimport { useOas, useOperation, useOperationFile, useOperationName, useSchemas } from '@kubb/swagger/hooks'\n\nimport { TypeBuilder } from '../TypeBuilder.ts'\n\nimport type { KubbFile } from '@kubb/core'\nimport type { ts } from '@kubb/parser'\nimport type { OperationSchemas } from '@kubb/swagger'\nimport type { Operation } from '@kubb/swagger/oas'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginOptions } from '../types.ts'\n\ntype Props = {\n builder: TypeBuilder\n}\n\nfunction printCombinedSchema(name: string, operation: Operation, schemas: OperationSchemas): string {\n const properties: Record<string, ts.TypeNode> = {\n 'response': factory.createTypeReferenceNode(\n factory.createIdentifier(schemas.response.name),\n undefined,\n ),\n }\n\n if (schemas.request) {\n properties['request'] = factory.createTypeReferenceNode(\n factory.createIdentifier(schemas.request.name),\n undefined,\n )\n }\n\n if (schemas.pathParams) {\n properties['pathParams'] = factory.createTypeReferenceNode(\n factory.createIdentifier(schemas.pathParams.name),\n undefined,\n )\n }\n\n if (schemas.queryParams) {\n properties['queryParams'] = factory.createTypeReferenceNode(\n factory.createIdentifier(schemas.queryParams.name),\n undefined,\n )\n }\n\n if (schemas.headerParams) {\n properties['headerParams'] = factory.createTypeReferenceNode(\n factory.createIdentifier(schemas.headerParams.name),\n undefined,\n )\n }\n\n if (schemas.errors) {\n properties['errors'] = factory.createUnionDeclaration({\n nodes: schemas.errors.map(error => {\n return factory.createTypeReferenceNode(\n factory.createIdentifier(error.name),\n undefined,\n )\n }),\n })!\n }\n\n const namespaceNode = factory.createTypeAliasDeclaration({\n name: operation.method === 'get' ? `${name}Query` : `${name}Mutation`,\n type: factory.createTypeLiteralNode(\n Object.keys(properties).map(key => {\n const type = properties[key]\n if (!type) {\n return undefined\n }\n\n return factory.createPropertySignature(\n {\n name: transformers.pascalCase(key),\n type,\n },\n )\n }).filter(Boolean),\n ),\n modifiers: [factory.modifiers.export],\n })\n\n return print(namespaceNode)\n}\n\nexport function Query({\n builder,\n}: Props): ReactNode {\n const { source } = builder.build()\n\n return (\n <>\n {source}\n </>\n )\n}\n\ntype FileProps = {\n mode: KubbFile.Mode\n}\n\nQuery.File = function({ mode }: FileProps): ReactNode {\n const { options } = usePlugin<PluginOptions>()\n\n const schemas = useSchemas()\n const pluginManager = usePluginManager()\n const oas = useOas()\n const file = useOperationFile()\n const factoryName = useOperationName({ type: 'type' })\n const operation = useOperation()\n\n const builder = new TypeBuilder(options, { oas, pluginManager })\n .add(schemas.pathParams)\n .add(schemas.queryParams)\n .add(schemas.headerParams)\n .add(schemas.response)\n .add(schemas.statusCodes)\n\n const { source, imports } = builder.build()\n\n return (\n <Editor language=\"typescript\">\n <File<FileMeta>\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n >\n {mode === 'directory' && imports.map((item, index) => {\n return <File.Import key={index} root={file.path} {...item} />\n })}\n <File.Source>\n {source}\n {printCombinedSchema(factoryName, operation, schemas)}\n </File.Source>\n </File>\n </Editor>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,mBAAkB;AACzB,SAAS,SAAAC,cAAa;AACtB,YAAYC,cAAa;AACzB,SAAS,UAAAC,SAAQ,QAAAC,OAAM,aAAAC,YAAW,oBAAAC,yBAAwB;AAC1D,SAAS,UAAAC,SAAQ,gBAAAC,eAAc,oBAAAC,mBAAkB,oBAAAC,mBAAkB,cAAAC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AAQ,WAAW,EACvB,IAAI,QAAQ,YAAY,EACxB,IAAI,QAAQ,QAAQ,EACpB,IAAI,QAAQ,OAAO,EACnB,IAAI,QAAQ,WAAW;AAE1B,QAAM,EAAE,QAAQ,QAAQ,IAAI,QAAQ,MAAM;AAE1C,SACE,gBAAAX,KAACY,SAAA,EAAO,UAAS,cACf,0BAAAX;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,UAAU,KAAK;AAAA,MACf,MAAM,KAAK;AAAA,MACX,MAAM,KAAK;AAAA,MAEV;AAAA,iBAAS,eAAe,QAAQ,IAAI,CAAC,MAAM,UAAU;AACpD,iBAAO,gBAAAb,KAACa,MAAK,QAAL,EAAwB,MAAM,KAAK,MAAO,GAAG,QAA5B,KAAkC;AAAA,QAC7D,CAAC;AAAA,QACD,gBAAAZ,MAACY,MAAK,QAAL,EACE;AAAA;AAAA,UACAX,qBAAoB,aAAa,WAAW,OAAO;AAAA,WACtD;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":["transformers","print","factory","Editor","File","usePlugin","usePluginManager","useOas","useOperation","useOperationFile","useOperationName","useSchemas","transformers","print","Generator","transformers","factory","keywordTypeNodes","Template","pluginKey","Editor","File","usePlugin","useOas","Fragment","jsx","jsxs","usePlugin","useOas","Editor","File","jsx","transformers","options","Generator","transformers","node","path","keywordTypeNodes","transformers","print","Fragment","jsx","jsxs","printCombinedSchema","transformers","print","usePlugin","useSchemas","usePluginManager","useOas","useOperationFile","useOperationName","useOperation","Editor","File"]}