@kubb/plugin-ts 3.16.2 → 3.16.4

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 (39) hide show
  1. package/dist/components-6F5RoYuJ.js +2240 -0
  2. package/dist/components-6F5RoYuJ.js.map +1 -0
  3. package/dist/components-B-Jx1kI5.cjs +2256 -0
  4. package/dist/components-B-Jx1kI5.cjs.map +1 -0
  5. package/dist/components.cjs +3 -15
  6. package/dist/components.d.cts +40 -26
  7. package/dist/components.d.ts +40 -26
  8. package/dist/components.js +3 -3
  9. package/dist/generators.cjs +4 -16
  10. package/dist/generators.d.cts +8 -9
  11. package/dist/generators.d.ts +8 -9
  12. package/dist/generators.js +4 -4
  13. package/dist/index.cjs +4 -17
  14. package/dist/index.d.cts +6 -8
  15. package/dist/index.d.ts +6 -8
  16. package/dist/index.js +3 -6
  17. package/dist/plugin-BXxI6FcR.cjs +378 -0
  18. package/dist/plugin-BXxI6FcR.cjs.map +1 -0
  19. package/dist/plugin-DXUISuTd.js +355 -0
  20. package/dist/plugin-DXUISuTd.js.map +1 -0
  21. package/dist/types-BL0qEGbB.d.cts +1223 -0
  22. package/dist/types-DFDnGwpy.d.ts +1223 -0
  23. package/package.json +22 -27
  24. package/dist/chunk-AUYOLJ62.js +0 -358
  25. package/dist/chunk-AUYOLJ62.js.map +0 -1
  26. package/dist/chunk-NAZDWNS6.cjs +0 -387
  27. package/dist/chunk-NAZDWNS6.cjs.map +0 -1
  28. package/dist/chunk-NDI35YW5.cjs +0 -2611
  29. package/dist/chunk-NDI35YW5.cjs.map +0 -1
  30. package/dist/chunk-V4C2DOV5.js +0 -2585
  31. package/dist/chunk-V4C2DOV5.js.map +0 -1
  32. package/dist/components.cjs.map +0 -1
  33. package/dist/components.js.map +0 -1
  34. package/dist/generators.cjs.map +0 -1
  35. package/dist/generators.js.map +0 -1
  36. package/dist/index.cjs.map +0 -1
  37. package/dist/index.js.map +0 -1
  38. package/dist/types-DkvPgLAK.d.cts +0 -116
  39. package/dist/types-DkvPgLAK.d.ts +0 -116
@@ -1,11 +1,10 @@
1
- import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
- import { P as PluginTs } from './types-DkvPgLAK.js';
3
- import '@kubb/core';
4
- import '@kubb/oas';
5
- import 'typescript';
6
-
7
- declare const typeGenerator: _kubb_plugin_oas.Generator<PluginTs>;
8
-
9
- declare const oasGenerator: _kubb_plugin_oas.Generator<PluginTs>;
1
+ import { Generator, PluginTs } from "./types-DFDnGwpy.js";
10
2
 
3
+ //#region src/generators/typeGenerator.d.ts
4
+ declare const typeGenerator: Generator<PluginTs>;
5
+ //#endregion
6
+ //#region src/generators/oasGenerator.d.ts
7
+ declare const oasGenerator: Generator<PluginTs>;
8
+ //#endregion
11
9
  export { oasGenerator, typeGenerator };
10
+ //# sourceMappingURL=generators.d.ts.map
@@ -1,4 +1,4 @@
1
- export { oasGenerator, typeGenerator } from './chunk-AUYOLJ62.js';
2
- import './chunk-V4C2DOV5.js';
3
- //# sourceMappingURL=generators.js.map
4
- //# sourceMappingURL=generators.js.map
1
+ import "./components-6F5RoYuJ.js";
2
+ import { oasGenerator, typeGenerator } from "./plugin-DXUISuTd.js";
3
+
4
+ export { oasGenerator, typeGenerator };
package/dist/index.cjs CHANGED
@@ -1,18 +1,5 @@
1
- 'use strict';
1
+ require('./components-B-Jx1kI5.cjs');
2
+ const require_plugin = require('./plugin-BXxI6FcR.cjs');
2
3
 
3
- var chunkNAZDWNS6_cjs = require('./chunk-NAZDWNS6.cjs');
4
- var chunkNDI35YW5_cjs = require('./chunk-NDI35YW5.cjs');
5
-
6
- // src/index.ts
7
- chunkNDI35YW5_cjs.init_cjs_shims();
8
-
9
- Object.defineProperty(exports, "pluginTs", {
10
- enumerable: true,
11
- get: function () { return chunkNAZDWNS6_cjs.pluginTs; }
12
- });
13
- Object.defineProperty(exports, "pluginTsName", {
14
- enumerable: true,
15
- get: function () { return chunkNAZDWNS6_cjs.pluginTsName; }
16
- });
17
- //# sourceMappingURL=index.cjs.map
18
- //# sourceMappingURL=index.cjs.map
4
+ exports.pluginTs = require_plugin.pluginTs;
5
+ exports.pluginTsName = require_plugin.pluginTsName;
package/dist/index.d.cts CHANGED
@@ -1,10 +1,8 @@
1
- import * as _kubb_core from '@kubb/core';
2
- import { O as Options, P as PluginTs } from './types-DkvPgLAK.cjs';
3
- import '@kubb/oas';
4
- import '@kubb/plugin-oas';
5
- import 'typescript';
1
+ import { Options, PluginTs, UserPluginWithLifeCycle } from "./types-BL0qEGbB.cjs";
6
2
 
3
+ //#region src/plugin.d.ts
7
4
  declare const pluginTsName = "plugin-ts";
8
- declare const pluginTs: (options?: Options | undefined) => _kubb_core.UserPluginWithLifeCycle<PluginTs>;
9
-
10
- export { PluginTs, pluginTs, pluginTsName };
5
+ declare const pluginTs: (options?: Options | undefined) => UserPluginWithLifeCycle<PluginTs>;
6
+ //#endregion
7
+ export { type PluginTs, pluginTs, pluginTsName };
8
+ //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- import * as _kubb_core from '@kubb/core';
2
- import { O as Options, P as PluginTs } from './types-DkvPgLAK.js';
3
- import '@kubb/oas';
4
- import '@kubb/plugin-oas';
5
- import 'typescript';
1
+ import { Options, PluginTs, UserPluginWithLifeCycle } from "./types-DFDnGwpy.js";
6
2
 
3
+ //#region src/plugin.d.ts
7
4
  declare const pluginTsName = "plugin-ts";
8
- declare const pluginTs: (options?: Options | undefined) => _kubb_core.UserPluginWithLifeCycle<PluginTs>;
9
-
10
- export { PluginTs, pluginTs, pluginTsName };
5
+ declare const pluginTs: (options?: Options | undefined) => UserPluginWithLifeCycle<PluginTs>;
6
+ //#endregion
7
+ export { type PluginTs, pluginTs, pluginTsName };
8
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,7 +1,4 @@
1
- export { pluginTs, pluginTsName } from './chunk-AUYOLJ62.js';
2
- import { init_esm_shims } from './chunk-V4C2DOV5.js';
1
+ import "./components-6F5RoYuJ.js";
2
+ import { pluginTs, pluginTsName } from "./plugin-DXUISuTd.js";
3
3
 
4
- // src/index.ts
5
- init_esm_shims();
6
- //# sourceMappingURL=index.js.map
7
- //# sourceMappingURL=index.js.map
4
+ export { pluginTs, pluginTsName };
@@ -0,0 +1,378 @@
1
+ const require_components = require('./components-B-Jx1kI5.cjs');
2
+ const node_path = require_components.__toESM(require("node:path"));
3
+ const __kubb_core = require_components.__toESM(require("@kubb/core"));
4
+ const __kubb_core_transformers = require_components.__toESM(require("@kubb/core/transformers"));
5
+ const __kubb_plugin_oas = require_components.__toESM(require("@kubb/plugin-oas"));
6
+ const __kubb_parser_ts = require_components.__toESM(require("@kubb/parser-ts"));
7
+ const __kubb_parser_ts_factory = require_components.__toESM(require("@kubb/parser-ts/factory"));
8
+ const __kubb_plugin_oas_components = require_components.__toESM(require("@kubb/plugin-oas/components"));
9
+ const __kubb_plugin_oas_hooks = require_components.__toESM(require("@kubb/plugin-oas/hooks"));
10
+ const __kubb_plugin_oas_utils = require_components.__toESM(require("@kubb/plugin-oas/utils"));
11
+ const __kubb_react = require_components.__toESM(require("@kubb/react"));
12
+ const __kubb_react_jsx_runtime = require_components.__toESM(require("@kubb/react/jsx-runtime"));
13
+
14
+ //#region src/generators/typeGenerator.tsx
15
+ function printCombinedSchema({ name, schemas, pluginManager }) {
16
+ const properties = {};
17
+ if (schemas.response) properties["response"] = __kubb_parser_ts_factory.createUnionDeclaration({ nodes: schemas.responses.map((res) => {
18
+ const identifier = pluginManager.resolveName({
19
+ name: res.name,
20
+ pluginKey: [pluginTsName],
21
+ type: "function"
22
+ });
23
+ return __kubb_parser_ts_factory.createTypeReferenceNode(__kubb_parser_ts_factory.createIdentifier(identifier), void 0);
24
+ }) });
25
+ if (schemas.request) {
26
+ const identifier = pluginManager.resolveName({
27
+ name: schemas.request.name,
28
+ pluginKey: [pluginTsName],
29
+ type: "function"
30
+ });
31
+ properties["request"] = __kubb_parser_ts_factory.createTypeReferenceNode(__kubb_parser_ts_factory.createIdentifier(identifier), void 0);
32
+ }
33
+ if (schemas.pathParams) {
34
+ const identifier = pluginManager.resolveName({
35
+ name: schemas.pathParams.name,
36
+ pluginKey: [pluginTsName],
37
+ type: "function"
38
+ });
39
+ properties["pathParams"] = __kubb_parser_ts_factory.createTypeReferenceNode(__kubb_parser_ts_factory.createIdentifier(identifier), void 0);
40
+ }
41
+ if (schemas.queryParams) {
42
+ const identifier = pluginManager.resolveName({
43
+ name: schemas.queryParams.name,
44
+ pluginKey: [pluginTsName],
45
+ type: "function"
46
+ });
47
+ properties["queryParams"] = __kubb_parser_ts_factory.createTypeReferenceNode(__kubb_parser_ts_factory.createIdentifier(identifier), void 0);
48
+ }
49
+ if (schemas.headerParams) {
50
+ const identifier = pluginManager.resolveName({
51
+ name: schemas.headerParams.name,
52
+ pluginKey: [pluginTsName],
53
+ type: "function"
54
+ });
55
+ properties["headerParams"] = __kubb_parser_ts_factory.createTypeReferenceNode(__kubb_parser_ts_factory.createIdentifier(identifier), void 0);
56
+ }
57
+ if (schemas.errors) properties["errors"] = __kubb_parser_ts_factory.createUnionDeclaration({ nodes: schemas.errors.map((error) => {
58
+ const identifier = pluginManager.resolveName({
59
+ name: error.name,
60
+ pluginKey: [pluginTsName],
61
+ type: "function"
62
+ });
63
+ return __kubb_parser_ts_factory.createTypeReferenceNode(__kubb_parser_ts_factory.createIdentifier(identifier), void 0);
64
+ }) });
65
+ const namespaceNode = __kubb_parser_ts_factory.createTypeAliasDeclaration({
66
+ name,
67
+ type: __kubb_parser_ts_factory.createTypeLiteralNode(Object.keys(properties).map((key) => {
68
+ const type = properties[key];
69
+ if (!type) return void 0;
70
+ return __kubb_parser_ts_factory.createPropertySignature({
71
+ name: __kubb_core_transformers.default.pascalCase(key),
72
+ type
73
+ });
74
+ }).filter(Boolean)),
75
+ modifiers: [__kubb_parser_ts_factory.modifiers.export]
76
+ });
77
+ return (0, __kubb_parser_ts.print)([namespaceNode]);
78
+ }
79
+ const typeGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
80
+ name: "typescript",
81
+ Operation({ operation, options }) {
82
+ const { mapper, enumType, syntaxType, optionalType } = options;
83
+ const { plugin, pluginManager, mode } = (0, __kubb_react.useApp)();
84
+ const oas = (0, __kubb_plugin_oas_hooks.useOas)();
85
+ const { getSchemas, getFile, getName, getGroup } = (0, __kubb_plugin_oas_hooks.useOperationManager)();
86
+ const schemaManager = (0, __kubb_plugin_oas_hooks.useSchemaManager)();
87
+ const file = getFile(operation);
88
+ const schemas = getSchemas(operation);
89
+ const type = getName(operation, {
90
+ type: "function",
91
+ pluginKey: [pluginTsName]
92
+ });
93
+ const combinedSchemaName = operation.method === "get" ? `${type}Query` : `${type}Mutation`;
94
+ const schemaGenerator = new __kubb_plugin_oas.SchemaGenerator(options, {
95
+ oas,
96
+ plugin,
97
+ pluginManager,
98
+ mode,
99
+ override: options.override
100
+ });
101
+ const operationSchemas = [
102
+ schemas.pathParams,
103
+ schemas.queryParams,
104
+ schemas.headerParams,
105
+ schemas.statusCodes,
106
+ schemas.request,
107
+ schemas.response
108
+ ].flat().filter(Boolean);
109
+ const mapOperationSchema = ({ name, schema: schemaObject, description, keysToOmit,...options$1 }) => {
110
+ const tree = schemaGenerator.parse({
111
+ schemaObject,
112
+ name
113
+ });
114
+ const imports = schemaManager.getImports(tree);
115
+ const group = options$1.operation ? getGroup(options$1.operation) : void 0;
116
+ const type$1 = {
117
+ name: schemaManager.getName(name, { type: "type" }),
118
+ typedName: schemaManager.getName(name, { type: "type" }),
119
+ file: schemaManager.getFile(options$1.operationName || name, { group })
120
+ };
121
+ return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_plugin_oas_components.Oas.Schema, {
122
+ name,
123
+ schemaObject,
124
+ tree,
125
+ children: [mode === "split" && imports.map((imp) => /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
126
+ root: file.path,
127
+ path: imp.path,
128
+ name: imp.name,
129
+ isTypeOnly: true
130
+ }, [
131
+ name,
132
+ imp.name,
133
+ imp.path,
134
+ imp.isTypeOnly
135
+ ].join("-"))), /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(require_components.Type, {
136
+ name: type$1.name,
137
+ typedName: type$1.typedName,
138
+ description,
139
+ tree,
140
+ schema: schemaObject,
141
+ mapper,
142
+ enumType,
143
+ optionalType,
144
+ keysToOmit,
145
+ syntaxType
146
+ })]
147
+ }, [name, schemaObject.$ref].join("-"));
148
+ };
149
+ return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_react.File, {
150
+ baseName: file.baseName,
151
+ path: file.path,
152
+ meta: file.meta,
153
+ banner: (0, __kubb_plugin_oas_utils.getBanner)({
154
+ oas,
155
+ output: plugin.options.output,
156
+ config: pluginManager.config
157
+ }),
158
+ footer: (0, __kubb_plugin_oas_utils.getFooter)({
159
+ oas,
160
+ output: plugin.options.output
161
+ }),
162
+ children: [operationSchemas.map(mapOperationSchema), /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Source, {
163
+ name: combinedSchemaName,
164
+ isExportable: true,
165
+ isIndexable: true,
166
+ isTypeOnly: true,
167
+ children: printCombinedSchema({
168
+ name: combinedSchemaName,
169
+ schemas,
170
+ pluginManager
171
+ })
172
+ })]
173
+ });
174
+ },
175
+ Schema({ schema, options }) {
176
+ const { mapper, enumType, syntaxType, optionalType } = options;
177
+ const { mode, plugin: { options: { output } }, pluginManager } = (0, __kubb_react.useApp)();
178
+ const oas = (0, __kubb_plugin_oas_hooks.useOas)();
179
+ const { getName, getImports, getFile } = (0, __kubb_plugin_oas_hooks.useSchemaManager)();
180
+ const imports = getImports(schema.tree);
181
+ if (enumType === "asPascalConst") console.warn(`enumType '${enumType}' is deprecated`);
182
+ const type = {
183
+ name: getName(schema.name, { type: "function" }),
184
+ typedName: getName(schema.name, { type: "type" }),
185
+ file: getFile(schema.name)
186
+ };
187
+ return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_react.File, {
188
+ baseName: type.file.baseName,
189
+ path: type.file.path,
190
+ meta: type.file.meta,
191
+ banner: (0, __kubb_plugin_oas_utils.getBanner)({
192
+ oas,
193
+ output,
194
+ config: pluginManager.config
195
+ }),
196
+ footer: (0, __kubb_plugin_oas_utils.getFooter)({
197
+ oas,
198
+ output
199
+ }),
200
+ children: [mode === "split" && imports.map((imp) => /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
201
+ root: type.file.path,
202
+ path: imp.path,
203
+ name: imp.name,
204
+ isTypeOnly: true
205
+ }, [
206
+ schema.name,
207
+ imp.path,
208
+ imp.isTypeOnly
209
+ ].join("-"))), /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(require_components.Type, {
210
+ name: type.name,
211
+ typedName: type.typedName,
212
+ description: schema.value.description,
213
+ tree: schema.tree,
214
+ schema: schema.value,
215
+ mapper,
216
+ enumType,
217
+ optionalType,
218
+ syntaxType
219
+ })]
220
+ });
221
+ }
222
+ });
223
+
224
+ //#endregion
225
+ //#region src/generators/oasGenerator.tsx
226
+ const oasGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
227
+ name: "oas",
228
+ Operations() {
229
+ const { pluginManager, plugin: { options: { output }, key: pluginKey } } = (0, __kubb_react.useApp)();
230
+ const oas = (0, __kubb_plugin_oas_hooks.useOas)();
231
+ const file = pluginManager.getFile({
232
+ name: "oas",
233
+ extname: ".ts",
234
+ pluginKey
235
+ });
236
+ return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_react.File, {
237
+ baseName: file.baseName,
238
+ path: file.path,
239
+ meta: file.meta,
240
+ banner: (0, __kubb_plugin_oas_utils.getBanner)({
241
+ oas,
242
+ output,
243
+ config: pluginManager.config
244
+ }),
245
+ footer: (0, __kubb_plugin_oas_utils.getFooter)({
246
+ oas,
247
+ output
248
+ }),
249
+ children: [/* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
250
+ name: ["Infer"],
251
+ path: "@kubb/oas",
252
+ isTypeOnly: true
253
+ }), /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(require_components.OasType, {
254
+ name: "oas",
255
+ typeName: "Oas",
256
+ api: oas.api
257
+ })]
258
+ });
259
+ }
260
+ });
261
+
262
+ //#endregion
263
+ //#region src/plugin.ts
264
+ const pluginTsName = "plugin-ts";
265
+ const pluginTs = (0, __kubb_core.createPlugin)((options) => {
266
+ const { output = {
267
+ path: "types",
268
+ barrelType: "named"
269
+ }, group, exclude = [], include, override = [], enumType = "asConst", enumSuffix = "enum", dateType = "string", unknownType = "any", optionalType = "questionToken", emptySchemaType = unknownType, syntaxType = "type", transformers: transformers$1 = {}, oasType = false, mapper = {}, generators = [typeGenerator, oasType === "infer" ? oasGenerator : void 0].filter(Boolean), contentType } = options;
270
+ return {
271
+ name: pluginTsName,
272
+ options: {
273
+ output,
274
+ transformers: transformers$1,
275
+ dateType,
276
+ optionalType,
277
+ oasType,
278
+ enumType,
279
+ enumSuffix,
280
+ usedEnumNames: {},
281
+ unknownType,
282
+ emptySchemaType,
283
+ syntaxType,
284
+ group,
285
+ override,
286
+ mapper
287
+ },
288
+ pre: [__kubb_plugin_oas.pluginOasName],
289
+ resolvePath(baseName, pathMode, options$1) {
290
+ const root = node_path.default.resolve(this.config.root, this.config.output.path);
291
+ const mode = pathMode ?? __kubb_core.FileManager.getMode(node_path.default.resolve(root, output.path));
292
+ if (mode === "single")
293
+ /**
294
+ * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend
295
+ * Other plugins then need to call addOrAppend instead of just add from the fileManager class
296
+ */
297
+ return node_path.default.resolve(root, output.path);
298
+ if (group && (options$1?.group?.path || options$1?.group?.tag)) {
299
+ const groupName = group?.name ? group.name : (ctx) => {
300
+ if (group?.type === "path") return `${ctx.group.split("/")[1]}`;
301
+ return `${(0, __kubb_core_transformers.camelCase)(ctx.group)}Controller`;
302
+ };
303
+ return node_path.default.resolve(root, output.path, groupName({ group: group.type === "path" ? options$1.group.path : options$1.group.tag }), baseName);
304
+ }
305
+ return node_path.default.resolve(root, output.path, baseName);
306
+ },
307
+ resolveName(name, type) {
308
+ const resolvedName = (0, __kubb_core_transformers.pascalCase)(name, { isFile: type === "file" });
309
+ if (type) return transformers$1?.name?.(resolvedName, type) || resolvedName;
310
+ return resolvedName;
311
+ },
312
+ async buildStart() {
313
+ const [swaggerPlugin] = __kubb_core.PluginManager.getDependedPlugins(this.plugins, [__kubb_plugin_oas.pluginOasName]);
314
+ const oas = await swaggerPlugin.context.getOas();
315
+ const root = node_path.default.resolve(this.config.root, this.config.output.path);
316
+ const mode = __kubb_core.FileManager.getMode(node_path.default.resolve(root, output.path));
317
+ const schemaGenerator = new __kubb_plugin_oas.SchemaGenerator(this.plugin.options, {
318
+ oas,
319
+ pluginManager: this.pluginManager,
320
+ plugin: this.plugin,
321
+ contentType,
322
+ include: void 0,
323
+ override,
324
+ mode,
325
+ output: output.path
326
+ });
327
+ const schemaFiles = await schemaGenerator.build(...generators);
328
+ await this.addFile(...schemaFiles);
329
+ const operationGenerator = new __kubb_plugin_oas.OperationGenerator(this.plugin.options, {
330
+ oas,
331
+ pluginManager: this.pluginManager,
332
+ plugin: this.plugin,
333
+ contentType,
334
+ exclude,
335
+ include,
336
+ override,
337
+ mode
338
+ });
339
+ const operationFiles = await operationGenerator.build(...generators);
340
+ await this.addFile(...operationFiles);
341
+ const barrelFiles = await this.fileManager.getBarrelFiles({
342
+ type: output.barrelType ?? "named",
343
+ root,
344
+ output,
345
+ meta: { pluginKey: this.plugin.key },
346
+ logger: this.logger
347
+ });
348
+ await this.addFile(...barrelFiles);
349
+ }
350
+ };
351
+ });
352
+
353
+ //#endregion
354
+ Object.defineProperty(exports, 'oasGenerator', {
355
+ enumerable: true,
356
+ get: function () {
357
+ return oasGenerator;
358
+ }
359
+ });
360
+ Object.defineProperty(exports, 'pluginTs', {
361
+ enumerable: true,
362
+ get: function () {
363
+ return pluginTs;
364
+ }
365
+ });
366
+ Object.defineProperty(exports, 'pluginTsName', {
367
+ enumerable: true,
368
+ get: function () {
369
+ return pluginTsName;
370
+ }
371
+ });
372
+ Object.defineProperty(exports, 'typeGenerator', {
373
+ enumerable: true,
374
+ get: function () {
375
+ return typeGenerator;
376
+ }
377
+ });
378
+ //# sourceMappingURL=plugin-BXxI6FcR.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-BXxI6FcR.cjs","names":["properties: Record<string, ts.TypeNode>","factory","transformers","SchemaGenerator","options","type","Oas","File","Type","File","OasType","pluginOasName","options","path","FileManager","groupName: Group['name']","transformers","PluginManager","SchemaGenerator","OperationGenerator"],"sources":["../src/generators/typeGenerator.tsx","../src/generators/oasGenerator.tsx","../src/plugin.ts"],"sourcesContent":["import type { PluginManager } from '@kubb/core'\nimport transformers from '@kubb/core/transformers'\nimport { print } from '@kubb/parser-ts'\nimport * as factory from '@kubb/parser-ts/factory'\nimport { createReactGenerator, type OperationSchemas, type OperationSchema as OperationSchemaType, SchemaGenerator } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperationManager, useSchemaManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, useApp } from '@kubb/react'\nimport type ts from 'typescript'\nimport { Type } from '../components'\nimport { pluginTsName } from '../plugin.ts'\nimport type { PluginTs } from '../types'\n\nfunction printCombinedSchema({ name, schemas, pluginManager }: { name: string; schemas: OperationSchemas; pluginManager: PluginManager }): string {\n const properties: Record<string, ts.TypeNode> = {}\n\n if (schemas.response) {\n properties['response'] = factory.createUnionDeclaration({\n nodes: schemas.responses.map((res) => {\n const identifier = pluginManager.resolveName({\n name: res.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }),\n })!\n }\n\n if (schemas.request) {\n const identifier = pluginManager.resolveName({\n name: schemas.request.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['request'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.pathParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.pathParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['pathParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.queryParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.queryParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['queryParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.headerParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.headerParams.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n properties['headerParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.errors) {\n properties['errors'] = factory.createUnionDeclaration({\n nodes: schemas.errors.map((error) => {\n const identifier = pluginManager.resolveName({\n name: error.name,\n pluginKey: [pluginTsName],\n type: 'function',\n })\n\n return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }),\n })!\n }\n\n const namespaceNode = factory.createTypeAliasDeclaration({\n name,\n type: factory.createTypeLiteralNode(\n Object.keys(properties)\n .map((key) => {\n const type = properties[key]\n if (!type) {\n return undefined\n }\n\n return factory.createPropertySignature({\n name: transformers.pascalCase(key),\n type,\n })\n })\n .filter(Boolean),\n ),\n modifiers: [factory.modifiers.export],\n })\n\n return print([namespaceNode])\n}\n\nexport const typeGenerator = createReactGenerator<PluginTs>({\n name: 'typescript',\n Operation({ operation, options }) {\n const { mapper, enumType, syntaxType, optionalType } = options\n\n const { plugin, pluginManager, mode } = useApp<PluginTs>()\n const oas = useOas()\n const { getSchemas, getFile, getName, getGroup } = useOperationManager()\n const schemaManager = useSchemaManager()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const type = getName(operation, { type: 'function', pluginKey: [pluginTsName] })\n const combinedSchemaName = operation.method === 'get' ? `${type}Query` : `${type}Mutation`\n const schemaGenerator = new SchemaGenerator(options, {\n oas,\n plugin,\n pluginManager,\n mode,\n override: options.override,\n })\n\n const operationSchemas = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response]\n .flat()\n .filter(Boolean)\n\n const mapOperationSchema = ({ name, schema: schemaObject, description, keysToOmit, ...options }: OperationSchemaType) => {\n const tree = schemaGenerator.parse({ schemaObject, name })\n const imports = schemaManager.getImports(tree)\n const group = options.operation ? getGroup(options.operation) : undefined\n\n const type = {\n name: schemaManager.getName(name, { type: 'type' }),\n typedName: schemaManager.getName(name, { type: 'type' }),\n file: schemaManager.getFile(options.operationName || name, { group }),\n }\n\n return (\n <Oas.Schema key={[name, schemaObject.$ref].join('-')} name={name} schemaObject={schemaObject} tree={tree}>\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={schemaObject}\n mapper={mapper}\n enumType={enumType}\n optionalType={optionalType}\n keysToOmit={keysToOmit}\n syntaxType={syntaxType}\n />\n </Oas.Schema>\n )\n }\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: plugin.options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: plugin.options.output })}\n >\n {operationSchemas.map(mapOperationSchema)}\n\n <File.Source name={combinedSchemaName} isExportable isIndexable isTypeOnly>\n {printCombinedSchema({ name: combinedSchemaName, schemas, pluginManager })}\n </File.Source>\n </File>\n )\n },\n Schema({ schema, options }) {\n const { mapper, enumType, syntaxType, optionalType } = options\n const {\n mode,\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginTs>()\n const oas = useOas()\n\n const { getName, getImports, getFile } = useSchemaManager()\n const imports = getImports(schema.tree)\n\n if (enumType === 'asPascalConst') {\n console.warn(`enumType '${enumType}' is deprecated`)\n }\n\n const type = {\n name: getName(schema.name, { type: 'function' }),\n typedName: getName(schema.name, { type: 'type' }),\n file: getFile(schema.name),\n }\n\n return (\n <File\n baseName={type.file.baseName}\n path={type.file.path}\n meta={type.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[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 syntaxType={syntaxType}\n />\n </File>\n )\n },\n})\n","import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, useApp } from '@kubb/react'\nimport { OasType } from '../components'\nimport type { PluginTs } from '../types.ts'\n\nexport const oasGenerator = createReactGenerator<PluginTs>({\n name: 'oas',\n Operations() {\n const {\n pluginManager,\n plugin: {\n options: { output },\n key: pluginKey,\n },\n } = useApp<PluginTs>()\n const oas = useOas()\n\n const file = pluginManager.getFile({ name: 'oas', extname: '.ts', pluginKey })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import name={['Infer']} path=\"@kubb/oas\" isTypeOnly />\n\n <OasType name={'oas'} typeName={'Oas'} api={oas.api} />\n </File>\n )\n },\n})\n","import path from 'node:path'\n\nimport { FileManager, type Group, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { OperationGenerator, SchemaGenerator, pluginOasName } from '@kubb/plugin-oas'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { oasGenerator, typeGenerator } from './generators'\nimport type { PluginTs } from './types.ts'\n\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\nexport const pluginTs = createPlugin<PluginTs>((options) => {\n const {\n output = { path: 'types', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumSuffix = 'enum',\n dateType = 'string',\n unknownType = 'any',\n optionalType = 'questionToken',\n emptySchemaType = unknownType,\n syntaxType = 'type',\n transformers = {},\n oasType = false,\n mapper = {},\n generators = [typeGenerator, oasType === 'infer' ? oasGenerator : undefined].filter(Boolean),\n contentType,\n } = options\n\n return {\n name: pluginTsName,\n options: {\n output,\n transformers,\n dateType,\n optionalType,\n oasType,\n enumType,\n enumSuffix,\n // keep the used enumnames between SchemaGenerator and OperationGenerator per plugin(pluginKey)\n usedEnumNames: {},\n unknownType,\n emptySchemaType,\n syntaxType,\n group,\n override,\n mapper,\n },\n pre: [pluginOasName],\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (group && (options?.group?.path || options?.group?.tag)) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n }\n\n return path.resolve(\n root,\n output.path,\n groupName({\n group: group.type === 'path' ? options.group.path! : options.group.tag!,\n }),\n baseName,\n )\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n const resolvedName = pascalCase(name, { isFile: type === 'file' })\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n\n const schemaGenerator = new SchemaGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build(...generators)\n await this.addFile(...schemaFiles)\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const operationFiles = await operationGenerator.build(...generators)\n await this.addFile(...operationFiles)\n\n const barrelFiles = await this.fileManager.getBarrelFiles({\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n },\n }\n})\n"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,oBAAoB,EAAE,MAAM,SAAS,eAA0F,EAAU;CAChJ,MAAMA,aAA0C,CAAE;AAElD,KAAI,QAAQ,UACV,WAAW,cAAcC,yBAAQ,uBAAuB,EACtD,OAAO,QAAQ,UAAU,IAAI,CAAC,QAAQ;EACpC,MAAM,aAAa,cAAc,YAAY;GAC3C,MAAM,IAAI;GACV,WAAW,CAAC,YAAa;GACzB,MAAM;EACP,EAAC;AAEF,SAAOA,yBAAQ,wBAAwBA,yBAAQ,iBAAiB,WAAW,EAAE,OAAU;CACxF,EAAC,CACH,EAAC;AAGJ,KAAI,QAAQ,SAAS;EACnB,MAAM,aAAa,cAAc,YAAY;GAC3C,MAAM,QAAQ,QAAQ;GACtB,WAAW,CAAC,YAAa;GACzB,MAAM;EACP,EAAC;EACF,WAA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