@kubb/plugin-zod 3.16.1 → 3.16.3

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 (47) hide show
  1. package/dist/components-CJ6RN1R2.js +414 -0
  2. package/dist/components-CJ6RN1R2.js.map +1 -0
  3. package/dist/components-GvkeO2ig.cjs +454 -0
  4. package/dist/components-GvkeO2ig.cjs.map +1 -0
  5. package/dist/components.cjs +3 -15
  6. package/dist/components.d.cts +56 -26
  7. package/dist/components.d.ts +56 -26
  8. package/dist/components.js +3 -3
  9. package/dist/generators-B13NknOz.cjs +265 -0
  10. package/dist/generators-B13NknOz.cjs.map +1 -0
  11. package/dist/generators-DcUZYcq0.js +254 -0
  12. package/dist/generators-DcUZYcq0.js.map +1 -0
  13. package/dist/generators.cjs +4 -16
  14. package/dist/generators.d.cts +8 -8
  15. package/dist/generators.d.ts +8 -8
  16. package/dist/generators.js +4 -4
  17. package/dist/index.cjs +103 -137
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +6 -7
  20. package/dist/index.d.ts +6 -7
  21. package/dist/index.js +103 -131
  22. package/dist/index.js.map +1 -1
  23. package/dist/types-B0UqdcbG.d.cts +1237 -0
  24. package/dist/types-YpNWeJUW.d.ts +1237 -0
  25. package/dist/utils.cjs +0 -4
  26. package/dist/utils.d.cts +18 -24
  27. package/dist/utils.d.ts +18 -24
  28. package/dist/utils.js +1 -3
  29. package/package.json +24 -30
  30. package/src/components/Zod.tsx +3 -2
  31. package/src/parser.ts +8 -0
  32. package/dist/chunk-AHCG4FYY.js +0 -448
  33. package/dist/chunk-AHCG4FYY.js.map +0 -1
  34. package/dist/chunk-QNMY34G2.cjs +0 -455
  35. package/dist/chunk-QNMY34G2.cjs.map +0 -1
  36. package/dist/chunk-RQAEGENA.cjs +0 -184
  37. package/dist/chunk-RQAEGENA.cjs.map +0 -1
  38. package/dist/chunk-Z6ERLJH7.js +0 -181
  39. package/dist/chunk-Z6ERLJH7.js.map +0 -1
  40. package/dist/components.cjs.map +0 -1
  41. package/dist/components.js.map +0 -1
  42. package/dist/generators.cjs.map +0 -1
  43. package/dist/generators.js.map +0 -1
  44. package/dist/types-BOF1ntMm.d.cts +0 -130
  45. package/dist/types-BOF1ntMm.d.ts +0 -130
  46. package/dist/utils.cjs.map +0 -1
  47. package/dist/utils.js.map +0 -1
@@ -1,17 +1,5 @@
1
- 'use strict';
1
+ require('./components-GvkeO2ig.cjs');
2
+ const require_generators = require('./generators-B13NknOz.cjs');
2
3
 
3
- var chunkRQAEGENA_cjs = require('./chunk-RQAEGENA.cjs');
4
- require('./chunk-QNMY34G2.cjs');
5
-
6
-
7
-
8
- Object.defineProperty(exports, "operationsGenerator", {
9
- enumerable: true,
10
- get: function () { return chunkRQAEGENA_cjs.operationsGenerator; }
11
- });
12
- Object.defineProperty(exports, "zodGenerator", {
13
- enumerable: true,
14
- get: function () { return chunkRQAEGENA_cjs.zodGenerator; }
15
- });
16
- //# sourceMappingURL=generators.cjs.map
17
- //# sourceMappingURL=generators.cjs.map
4
+ exports.operationsGenerator = require_generators.operationsGenerator;
5
+ exports.zodGenerator = require_generators.zodGenerator;
@@ -1,10 +1,10 @@
1
- import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
- import { P as PluginZod } from './types-BOF1ntMm.cjs';
3
- import '@kubb/core';
4
- import '@kubb/oas';
5
-
6
- declare const zodGenerator: _kubb_plugin_oas.Generator<PluginZod>;
7
-
8
- declare const operationsGenerator: _kubb_plugin_oas.Generator<PluginZod>;
1
+ import { Generator, PluginZod } from "./types-B0UqdcbG.cjs";
9
2
 
3
+ //#region src/generators/zodGenerator.d.ts
4
+ declare const zodGenerator: Generator<PluginZod>;
5
+ //#endregion
6
+ //#region src/generators/operationsGenerator.d.ts
7
+ declare const operationsGenerator: Generator<PluginZod>;
8
+ //#endregion
10
9
  export { operationsGenerator, zodGenerator };
10
+ //# sourceMappingURL=generators.d.cts.map
@@ -1,10 +1,10 @@
1
- import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
- import { P as PluginZod } from './types-BOF1ntMm.js';
3
- import '@kubb/core';
4
- import '@kubb/oas';
5
-
6
- declare const zodGenerator: _kubb_plugin_oas.Generator<PluginZod>;
7
-
8
- declare const operationsGenerator: _kubb_plugin_oas.Generator<PluginZod>;
1
+ import { Generator, PluginZod } from "./types-YpNWeJUW.js";
9
2
 
3
+ //#region src/generators/zodGenerator.d.ts
4
+ declare const zodGenerator: Generator<PluginZod>;
5
+ //#endregion
6
+ //#region src/generators/operationsGenerator.d.ts
7
+ declare const operationsGenerator: Generator<PluginZod>;
8
+ //#endregion
10
9
  export { operationsGenerator, zodGenerator };
10
+ //# sourceMappingURL=generators.d.ts.map
@@ -1,4 +1,4 @@
1
- export { operationsGenerator, zodGenerator } from './chunk-Z6ERLJH7.js';
2
- import './chunk-AHCG4FYY.js';
3
- //# sourceMappingURL=generators.js.map
4
- //# sourceMappingURL=generators.js.map
1
+ import "./components-CJ6RN1R2.js";
2
+ import { operationsGenerator, zodGenerator } from "./generators-DcUZYcq0.js";
3
+
4
+ export { operationsGenerator, zodGenerator };
package/dist/index.cjs CHANGED
@@ -1,143 +1,109 @@
1
- 'use strict';
1
+ const require_components = require('./components-GvkeO2ig.cjs');
2
+ const require_generators = require('./generators-B13NknOz.cjs');
3
+ const node_path = require_components.__toESM(require("node:path"));
4
+ const __kubb_core = require_components.__toESM(require("@kubb/core"));
5
+ const __kubb_core_transformers = require_components.__toESM(require("@kubb/core/transformers"));
6
+ const __kubb_plugin_oas = require_components.__toESM(require("@kubb/plugin-oas"));
7
+ const __kubb_plugin_ts = require_components.__toESM(require("@kubb/plugin-ts"));
2
8
 
3
- var chunkRQAEGENA_cjs = require('./chunk-RQAEGENA.cjs');
4
- require('./chunk-QNMY34G2.cjs');
5
- var path = require('path');
6
- var core = require('@kubb/core');
7
- var transformers = require('@kubb/core/transformers');
8
- var pluginOas = require('@kubb/plugin-oas');
9
- var pluginTs = require('@kubb/plugin-ts');
10
-
11
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
-
13
- var path__default = /*#__PURE__*/_interopDefault(path);
14
-
15
- var pluginZodName = "plugin-zod";
16
- var pluginZod = core.createPlugin((options) => {
17
- const {
18
- output = { path: "zod", barrelType: "named" },
19
- group,
20
- exclude = [],
21
- include,
22
- override = [],
23
- transformers: transformers$1 = {},
24
- dateType = "string",
25
- unknownType = "any",
26
- emptySchemaType = unknownType,
27
- typed = false,
28
- mapper = {},
29
- operations = false,
30
- version = "3",
31
- importPath = version === "4" ? "zod/v4" : "zod",
32
- coercion = false,
33
- inferred = false,
34
- generators = [chunkRQAEGENA_cjs.zodGenerator, operations ? chunkRQAEGENA_cjs.operationsGenerator : void 0].filter(Boolean),
35
- wrapOutput = void 0,
36
- contentType
37
- } = options;
38
- return {
39
- name: pluginZodName,
40
- options: {
41
- output,
42
- transformers: transformers$1,
43
- include,
44
- exclude,
45
- override,
46
- typed,
47
- dateType,
48
- unknownType,
49
- emptySchemaType,
50
- mapper,
51
- importPath,
52
- coercion,
53
- operations,
54
- inferred,
55
- group,
56
- wrapOutput,
57
- version
58
- },
59
- pre: [pluginOas.pluginOasName, typed ? pluginTs.pluginTsName : void 0].filter(Boolean),
60
- resolvePath(baseName, pathMode, options2) {
61
- const root = path__default.default.resolve(this.config.root, this.config.output.path);
62
- const mode = pathMode ?? core.FileManager.getMode(path__default.default.resolve(root, output.path));
63
- if (mode === "single") {
64
- return path__default.default.resolve(root, output.path);
65
- }
66
- if (group && (options2?.group?.path || options2?.group?.tag)) {
67
- const groupName = group?.name ? group.name : (ctx) => {
68
- if (group?.type === "path") {
69
- return `${ctx.group.split("/")[1]}`;
70
- }
71
- return `${transformers.camelCase(ctx.group)}Controller`;
72
- };
73
- return path__default.default.resolve(
74
- root,
75
- output.path,
76
- groupName({
77
- group: group.type === "path" ? options2.group.path : options2.group.tag
78
- }),
79
- baseName
80
- );
81
- }
82
- return path__default.default.resolve(root, output.path, baseName);
83
- },
84
- resolveName(name, type) {
85
- let resolvedName = transformers.camelCase(name, {
86
- suffix: type ? "schema" : void 0,
87
- isFile: type === "file"
88
- });
89
- if (type === "type") {
90
- resolvedName = transformers.pascalCase(resolvedName);
91
- }
92
- if (type) {
93
- return transformers$1?.name?.(resolvedName, type) || resolvedName;
94
- }
95
- return resolvedName;
96
- },
97
- async buildStart() {
98
- const [swaggerPlugin] = core.PluginManager.getDependedPlugins(this.plugins, [pluginOas.pluginOasName]);
99
- const oas = await swaggerPlugin.context.getOas();
100
- const root = path__default.default.resolve(this.config.root, this.config.output.path);
101
- const mode = core.FileManager.getMode(path__default.default.resolve(root, output.path));
102
- const schemaGenerator = new pluginOas.SchemaGenerator(this.plugin.options, {
103
- oas,
104
- pluginManager: this.pluginManager,
105
- plugin: this.plugin,
106
- contentType,
107
- include: void 0,
108
- override,
109
- mode,
110
- output: output.path
111
- });
112
- const schemaFiles = await schemaGenerator.build(...generators);
113
- await this.addFile(...schemaFiles);
114
- const operationGenerator = new pluginOas.OperationGenerator(this.plugin.options, {
115
- oas,
116
- pluginManager: this.pluginManager,
117
- plugin: this.plugin,
118
- contentType,
119
- exclude,
120
- include,
121
- override,
122
- mode
123
- });
124
- const operationFiles = await operationGenerator.build(...generators);
125
- await this.addFile(...operationFiles);
126
- const barrelFiles = await this.fileManager.getBarrelFiles({
127
- type: output.barrelType ?? "named",
128
- root,
129
- output,
130
- meta: {
131
- pluginKey: this.plugin.key
132
- },
133
- logger: this.logger
134
- });
135
- await this.addFile(...barrelFiles);
136
- }
137
- };
9
+ //#region src/plugin.ts
10
+ const pluginZodName = "plugin-zod";
11
+ const pluginZod = (0, __kubb_core.createPlugin)((options) => {
12
+ const { output = {
13
+ path: "zod",
14
+ barrelType: "named"
15
+ }, group, exclude = [], include, override = [], transformers = {}, dateType = "string", unknownType = "any", emptySchemaType = unknownType, typed = false, mapper = {}, operations = false, version = "3", importPath = version === "4" ? "zod/v4" : "zod", coercion = false, inferred = false, generators = [require_generators.zodGenerator, operations ? require_generators.operationsGenerator : void 0].filter(Boolean), wrapOutput = void 0, contentType } = options;
16
+ return {
17
+ name: pluginZodName,
18
+ options: {
19
+ output,
20
+ transformers,
21
+ include,
22
+ exclude,
23
+ override,
24
+ typed,
25
+ dateType,
26
+ unknownType,
27
+ emptySchemaType,
28
+ mapper,
29
+ importPath,
30
+ coercion,
31
+ operations,
32
+ inferred,
33
+ group,
34
+ wrapOutput,
35
+ version
36
+ },
37
+ pre: [__kubb_plugin_oas.pluginOasName, typed ? __kubb_plugin_ts.pluginTsName : void 0].filter(Boolean),
38
+ resolvePath(baseName, pathMode, options$1) {
39
+ const root = node_path.default.resolve(this.config.root, this.config.output.path);
40
+ const mode = pathMode ?? __kubb_core.FileManager.getMode(node_path.default.resolve(root, output.path));
41
+ if (mode === "single")
42
+ /**
43
+ * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend
44
+ * Other plugins then need to call addOrAppend instead of just add from the fileManager class
45
+ */
46
+ return node_path.default.resolve(root, output.path);
47
+ if (group && (options$1?.group?.path || options$1?.group?.tag)) {
48
+ const groupName = group?.name ? group.name : (ctx) => {
49
+ if (group?.type === "path") return `${ctx.group.split("/")[1]}`;
50
+ return `${(0, __kubb_core_transformers.camelCase)(ctx.group)}Controller`;
51
+ };
52
+ return node_path.default.resolve(root, output.path, groupName({ group: group.type === "path" ? options$1.group.path : options$1.group.tag }), baseName);
53
+ }
54
+ return node_path.default.resolve(root, output.path, baseName);
55
+ },
56
+ resolveName(name, type) {
57
+ let resolvedName = (0, __kubb_core_transformers.camelCase)(name, {
58
+ suffix: type ? "schema" : void 0,
59
+ isFile: type === "file"
60
+ });
61
+ if (type === "type") resolvedName = (0, __kubb_core_transformers.pascalCase)(resolvedName);
62
+ if (type) return transformers?.name?.(resolvedName, type) || resolvedName;
63
+ return resolvedName;
64
+ },
65
+ async buildStart() {
66
+ const [swaggerPlugin] = __kubb_core.PluginManager.getDependedPlugins(this.plugins, [__kubb_plugin_oas.pluginOasName]);
67
+ const oas = await swaggerPlugin.context.getOas();
68
+ const root = node_path.default.resolve(this.config.root, this.config.output.path);
69
+ const mode = __kubb_core.FileManager.getMode(node_path.default.resolve(root, output.path));
70
+ const schemaGenerator = new __kubb_plugin_oas.SchemaGenerator(this.plugin.options, {
71
+ oas,
72
+ pluginManager: this.pluginManager,
73
+ plugin: this.plugin,
74
+ contentType,
75
+ include: void 0,
76
+ override,
77
+ mode,
78
+ output: output.path
79
+ });
80
+ const schemaFiles = await schemaGenerator.build(...generators);
81
+ await this.addFile(...schemaFiles);
82
+ const operationGenerator = new __kubb_plugin_oas.OperationGenerator(this.plugin.options, {
83
+ oas,
84
+ pluginManager: this.pluginManager,
85
+ plugin: this.plugin,
86
+ contentType,
87
+ exclude,
88
+ include,
89
+ override,
90
+ mode
91
+ });
92
+ const operationFiles = await operationGenerator.build(...generators);
93
+ await this.addFile(...operationFiles);
94
+ const barrelFiles = await this.fileManager.getBarrelFiles({
95
+ type: output.barrelType ?? "named",
96
+ root,
97
+ output,
98
+ meta: { pluginKey: this.plugin.key },
99
+ logger: this.logger
100
+ });
101
+ await this.addFile(...barrelFiles);
102
+ }
103
+ };
138
104
  });
139
105
 
106
+ //#endregion
140
107
  exports.pluginZod = pluginZod;
141
108
  exports.pluginZodName = pluginZodName;
142
- //# sourceMappingURL=index.cjs.map
143
109
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugin.ts"],"names":["createPlugin","transformers","zodGenerator","operationsGenerator","pluginOasName","pluginTsName","options","path","FileManager","camelCase","pascalCase","PluginManager","SchemaGenerator","OperationGenerator"],"mappings":";;;;;;;;;;;;;;AAWO,IAAM,aAAgB,GAAA;AAEhB,IAAA,SAAA,GAAYA,iBAAwB,CAAA,CAAC,OAAY,KAAA;AAC5D,EAAM,MAAA;AAAA,IACJ,MAAS,GAAA,EAAE,IAAM,EAAA,KAAA,EAAO,YAAY,OAAQ,EAAA;AAAA,IAC5C,KAAA;AAAA,IACA,UAAU,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AA;AAAA,QACrE,GAAA;AAAA,QACA,eAAe,IAAK,CAAA,aAAA;AAAA,QACpB,QAAQ,IAAK,CAAA,MAAA;AAAA,QACb,WAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA;AAAA,QACA,QAAA;AAAA,QACA;AAAA,OACD,CAAA;AAED,MAAA,MAAM,cAAiB,GAAA,MAAM,kBAAmB,CAAA,KAAA,CAAM,GAAG,UAAU,CAAA;AACnE,MAAM,MAAA,IAAA,CAAK,OAAQ,CAAA,GAAG,cAAc,CAAA;AAEpC,MAAA,MAAM,WAAc,GAAA,MAAM,IAAK,CAAA,WAAA,CAAY,cAAe,CAAA;AAAA,QACxD,IAAA,EAAM,OAAO,UAAc,IAAA,OAAA;AAAA,QAC3B,IAAA;AAAA,QACA,MAAA;AAAA,QACA,IAAM,EAAA;AAAA,UACJ,SAAA,EAAW,KAAK,MAAO,CAAA;AAAA,SACzB;AAAA,QACA,QAAQ,IAAK,CAAA;AAAA,OACd,CAAA;AAED,MAAM,MAAA,IAAA,CAAK,OAAQ,CAAA,GAAG,WAAW,CAAA;AAAA;AACnC,GACF;AACF,CAAC","file":"index.cjs","sourcesContent":["import path from 'node:path'\nimport type { Plugin } from '@kubb/core'\nimport { createPlugin, FileManager, type Group, PluginManager } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { OperationGenerator, pluginOasName, SchemaGenerator } from '@kubb/plugin-oas'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { operationsGenerator } from './generators'\nimport { zodGenerator } from './generators/zodGenerator.tsx'\nimport type { PluginZod } from './types.ts'\n\nexport const pluginZodName = 'plugin-zod' satisfies PluginZod['name']\n\nexport const pluginZod = createPlugin<PluginZod>((options) => {\n const {\n output = { path: 'zod', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n transformers = {},\n dateType = 'string',\n unknownType = 'any',\n emptySchemaType = unknownType,\n typed = false,\n mapper = {},\n operations = false,\n version = '3',\n importPath = version === '4' ? 'zod/v4' : 'zod',\n coercion = false,\n inferred = false,\n generators = [zodGenerator, operations ? operationsGenerator : undefined].filter(Boolean),\n wrapOutput = undefined,\n contentType,\n } = options\n\n return {\n name: pluginZodName,\n options: {\n output,\n transformers,\n include,\n exclude,\n override,\n typed,\n dateType,\n unknownType,\n emptySchemaType,\n mapper,\n importPath,\n coercion,\n operations,\n inferred,\n group,\n wrapOutput,\n version,\n },\n pre: [pluginOasName, typed ? pluginTsName : undefined].filter(Boolean),\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 let resolvedName = camelCase(name, {\n suffix: type ? 'schema' : undefined,\n isFile: type === 'file',\n })\n\n if (type === 'type') {\n resolvedName = pascalCase(resolvedName)\n }\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"]}
1
+ {"version":3,"file":"index.cjs","names":["zodGenerator","operationsGenerator","pluginOasName","pluginTsName","options","path","FileManager","groupName: Group['name']","PluginManager","SchemaGenerator","OperationGenerator"],"sources":["../src/plugin.ts"],"sourcesContent":["import path from 'node:path'\nimport type { Plugin } from '@kubb/core'\nimport { createPlugin, FileManager, type Group, PluginManager } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { OperationGenerator, pluginOasName, SchemaGenerator } from '@kubb/plugin-oas'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { operationsGenerator } from './generators'\nimport { zodGenerator } from './generators/zodGenerator.tsx'\nimport type { PluginZod } from './types.ts'\n\nexport const pluginZodName = 'plugin-zod' satisfies PluginZod['name']\n\nexport const pluginZod = createPlugin<PluginZod>((options) => {\n const {\n output = { path: 'zod', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n transformers = {},\n dateType = 'string',\n unknownType = 'any',\n emptySchemaType = unknownType,\n typed = false,\n mapper = {},\n operations = false,\n version = '3',\n importPath = version === '4' ? 'zod/v4' : 'zod',\n coercion = false,\n inferred = false,\n generators = [zodGenerator, operations ? operationsGenerator : undefined].filter(Boolean),\n wrapOutput = undefined,\n contentType,\n } = options\n\n return {\n name: pluginZodName,\n options: {\n output,\n transformers,\n include,\n exclude,\n override,\n typed,\n dateType,\n unknownType,\n emptySchemaType,\n mapper,\n importPath,\n coercion,\n operations,\n inferred,\n group,\n wrapOutput,\n version,\n },\n pre: [pluginOasName, typed ? pluginTsName : undefined].filter(Boolean),\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 let resolvedName = camelCase(name, {\n suffix: type ? 'schema' : undefined,\n isFile: type === 'file',\n })\n\n if (type === 'type') {\n resolvedName = pascalCase(resolvedName)\n }\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":";;;;;;;;;AAWA,MAAa,gBAAgB;AAE7B,MAAa,0CAAoC,CAAC,YAAY;CAC5D,MAAM,EACJ,SAAS;EAAE,MAAM;EAAO,YAAY;CAAS,GAC7C,OACA,UAAU,CAAE,GACZ,SACA,WAAW,CAAE,GACb,eAAe,CAAE,GACjB,WAAW,UACX,cAAc,OACd,kBAAkB,aAClB,QAAQ,OACR,SAAS,CAAE,GACX,aAAa,OACb,UAAU,KACV,aAAa,YAAY,MAAM,WAAW,OAC1C,WAAW,OACX,WAAW,OACX,aAAa,CAACA,iCAAc,aAAaC,yCAAsB,MAAU,EAAC,OAAO,QAAQ,EACzF,aAAa,QACb,aACD,GAAG;AAEJ,QAAO;EACL,MAAM;EACN,SAAS;GACP;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD;EACD,KAAK,CAACC,iCAAe,QAAQC,gCAAe,MAAU,EAAC,OAAO,QAAQ;EACtE,YAAY,UAAU,UAAUC,WAAS;GACvC,MAAM,OAAOC,kBAAK,QAAQ,KAAK,OAAO,MAAM,KAAK,OAAO,OAAO,KAAK;GACpE,MAAM,OAAO,YAAYC,wBAAY,QAAQD,kBAAK,QAAQ,MAAM,OAAO,KAAK,CAAC;AAE7E,OAAI,SAAS;;;;;AAKX,UAAOA,kBAAK,QAAQ,MAAM,OAAO,KAAK;AAGxC,OAAI,UAAUD,WAAS,OAAO,QAAQ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Q,KAAK;IACb;IACA;IACA;IACA;IACA;GACD;GAED,MAAM,iBAAiB,MAAM,mBAAmB,MAAM,GAAG,WAAW;GACpE,MAAM,KAAK,QAAQ,GAAG,eAAe;GAErC,MAAM,cAAc,MAAM,KAAK,YAAY,eAAe;IACxD,MAAM,OAAO,cAAc;IAC3B;IACA;IACA,MAAM,EACJ,WAAW,KAAK,OAAO,IACxB;IACD,QAAQ,KAAK;GACd,EAAC;GAEF,MAAM,KAAK,QAAQ,GAAG,YAAY;EACnC;CACF;AACF,EAAC"}
package/dist/index.d.cts CHANGED
@@ -1,9 +1,8 @@
1
- import * as _kubb_core from '@kubb/core';
2
- import { O as Options, P as PluginZod } from './types-BOF1ntMm.cjs';
3
- import '@kubb/oas';
4
- import '@kubb/plugin-oas';
1
+ import { Options, PluginZod, UserPluginWithLifeCycle } from "./types-B0UqdcbG.cjs";
5
2
 
3
+ //#region src/plugin.d.ts
6
4
  declare const pluginZodName = "plugin-zod";
7
- declare const pluginZod: (options?: Options | undefined) => _kubb_core.UserPluginWithLifeCycle<PluginZod>;
8
-
9
- export { PluginZod, pluginZod, pluginZodName };
5
+ declare const pluginZod: (options?: Options | undefined) => UserPluginWithLifeCycle<PluginZod>;
6
+ //#endregion
7
+ export { type PluginZod, pluginZod, pluginZodName };
8
+ //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import * as _kubb_core from '@kubb/core';
2
- import { O as Options, P as PluginZod } from './types-BOF1ntMm.js';
3
- import '@kubb/oas';
4
- import '@kubb/plugin-oas';
1
+ import { Options, PluginZod, UserPluginWithLifeCycle } from "./types-YpNWeJUW.js";
5
2
 
3
+ //#region src/plugin.d.ts
6
4
  declare const pluginZodName = "plugin-zod";
7
- declare const pluginZod: (options?: Options | undefined) => _kubb_core.UserPluginWithLifeCycle<PluginZod>;
8
-
9
- export { PluginZod, pluginZod, pluginZodName };
5
+ declare const pluginZod: (options?: Options | undefined) => UserPluginWithLifeCycle<PluginZod>;
6
+ //#endregion
7
+ export { type PluginZod, pluginZod, pluginZodName };
8
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,136 +1,108 @@
1
- import { zodGenerator, operationsGenerator } from './chunk-Z6ERLJH7.js';
2
- import './chunk-AHCG4FYY.js';
3
- import path from 'path';
4
- import { createPlugin, PluginManager, FileManager } from '@kubb/core';
5
- import { camelCase, pascalCase } from '@kubb/core/transformers';
6
- import { pluginOasName, SchemaGenerator, OperationGenerator } from '@kubb/plugin-oas';
7
- import { pluginTsName } from '@kubb/plugin-ts';
1
+ import "./components-CJ6RN1R2.js";
2
+ import { operationsGenerator, zodGenerator } from "./generators-DcUZYcq0.js";
3
+ import path from "node:path";
4
+ import { FileManager, PluginManager, createPlugin } from "@kubb/core";
5
+ import { camelCase, pascalCase } from "@kubb/core/transformers";
6
+ import { OperationGenerator, SchemaGenerator, pluginOasName } from "@kubb/plugin-oas";
7
+ import { pluginTsName } from "@kubb/plugin-ts";
8
8
 
9
- var pluginZodName = "plugin-zod";
10
- var pluginZod = createPlugin((options) => {
11
- const {
12
- output = { path: "zod", barrelType: "named" },
13
- group,
14
- exclude = [],
15
- include,
16
- override = [],
17
- transformers = {},
18
- dateType = "string",
19
- unknownType = "any",
20
- emptySchemaType = unknownType,
21
- typed = false,
22
- mapper = {},
23
- operations = false,
24
- version = "3",
25
- importPath = version === "4" ? "zod/v4" : "zod",
26
- coercion = false,
27
- inferred = false,
28
- generators = [zodGenerator, operations ? operationsGenerator : void 0].filter(Boolean),
29
- wrapOutput = void 0,
30
- contentType
31
- } = options;
32
- return {
33
- name: pluginZodName,
34
- options: {
35
- output,
36
- transformers,
37
- include,
38
- exclude,
39
- override,
40
- typed,
41
- dateType,
42
- unknownType,
43
- emptySchemaType,
44
- mapper,
45
- importPath,
46
- coercion,
47
- operations,
48
- inferred,
49
- group,
50
- wrapOutput,
51
- version
52
- },
53
- pre: [pluginOasName, typed ? pluginTsName : void 0].filter(Boolean),
54
- resolvePath(baseName, pathMode, options2) {
55
- const root = path.resolve(this.config.root, this.config.output.path);
56
- const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path));
57
- if (mode === "single") {
58
- return path.resolve(root, output.path);
59
- }
60
- if (group && (options2?.group?.path || options2?.group?.tag)) {
61
- const groupName = group?.name ? group.name : (ctx) => {
62
- if (group?.type === "path") {
63
- return `${ctx.group.split("/")[1]}`;
64
- }
65
- return `${camelCase(ctx.group)}Controller`;
66
- };
67
- return path.resolve(
68
- root,
69
- output.path,
70
- groupName({
71
- group: group.type === "path" ? options2.group.path : options2.group.tag
72
- }),
73
- baseName
74
- );
75
- }
76
- return path.resolve(root, output.path, baseName);
77
- },
78
- resolveName(name, type) {
79
- let resolvedName = camelCase(name, {
80
- suffix: type ? "schema" : void 0,
81
- isFile: type === "file"
82
- });
83
- if (type === "type") {
84
- resolvedName = pascalCase(resolvedName);
85
- }
86
- if (type) {
87
- return transformers?.name?.(resolvedName, type) || resolvedName;
88
- }
89
- return resolvedName;
90
- },
91
- async buildStart() {
92
- const [swaggerPlugin] = PluginManager.getDependedPlugins(this.plugins, [pluginOasName]);
93
- const oas = await swaggerPlugin.context.getOas();
94
- const root = path.resolve(this.config.root, this.config.output.path);
95
- const mode = FileManager.getMode(path.resolve(root, output.path));
96
- const schemaGenerator = new SchemaGenerator(this.plugin.options, {
97
- oas,
98
- pluginManager: this.pluginManager,
99
- plugin: this.plugin,
100
- contentType,
101
- include: void 0,
102
- override,
103
- mode,
104
- output: output.path
105
- });
106
- const schemaFiles = await schemaGenerator.build(...generators);
107
- await this.addFile(...schemaFiles);
108
- const operationGenerator = new OperationGenerator(this.plugin.options, {
109
- oas,
110
- pluginManager: this.pluginManager,
111
- plugin: this.plugin,
112
- contentType,
113
- exclude,
114
- include,
115
- override,
116
- mode
117
- });
118
- const operationFiles = await operationGenerator.build(...generators);
119
- await this.addFile(...operationFiles);
120
- const barrelFiles = await this.fileManager.getBarrelFiles({
121
- type: output.barrelType ?? "named",
122
- root,
123
- output,
124
- meta: {
125
- pluginKey: this.plugin.key
126
- },
127
- logger: this.logger
128
- });
129
- await this.addFile(...barrelFiles);
130
- }
131
- };
9
+ //#region src/plugin.ts
10
+ const pluginZodName = "plugin-zod";
11
+ const pluginZod = createPlugin((options) => {
12
+ const { output = {
13
+ path: "zod",
14
+ barrelType: "named"
15
+ }, group, exclude = [], include, override = [], transformers: transformers$1 = {}, dateType = "string", unknownType = "any", emptySchemaType = unknownType, typed = false, mapper = {}, operations = false, version = "3", importPath = version === "4" ? "zod/v4" : "zod", coercion = false, inferred = false, generators = [zodGenerator, operations ? operationsGenerator : void 0].filter(Boolean), wrapOutput = void 0, contentType } = options;
16
+ return {
17
+ name: pluginZodName,
18
+ options: {
19
+ output,
20
+ transformers: transformers$1,
21
+ include,
22
+ exclude,
23
+ override,
24
+ typed,
25
+ dateType,
26
+ unknownType,
27
+ emptySchemaType,
28
+ mapper,
29
+ importPath,
30
+ coercion,
31
+ operations,
32
+ inferred,
33
+ group,
34
+ wrapOutput,
35
+ version
36
+ },
37
+ pre: [pluginOasName, typed ? pluginTsName : void 0].filter(Boolean),
38
+ resolvePath(baseName, pathMode, options$1) {
39
+ const root = path.resolve(this.config.root, this.config.output.path);
40
+ const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path));
41
+ if (mode === "single")
42
+ /**
43
+ * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend
44
+ * Other plugins then need to call addOrAppend instead of just add from the fileManager class
45
+ */
46
+ return path.resolve(root, output.path);
47
+ if (group && (options$1?.group?.path || options$1?.group?.tag)) {
48
+ const groupName = group?.name ? group.name : (ctx) => {
49
+ if (group?.type === "path") return `${ctx.group.split("/")[1]}`;
50
+ return `${camelCase(ctx.group)}Controller`;
51
+ };
52
+ return path.resolve(root, output.path, groupName({ group: group.type === "path" ? options$1.group.path : options$1.group.tag }), baseName);
53
+ }
54
+ return path.resolve(root, output.path, baseName);
55
+ },
56
+ resolveName(name, type) {
57
+ let resolvedName = camelCase(name, {
58
+ suffix: type ? "schema" : void 0,
59
+ isFile: type === "file"
60
+ });
61
+ if (type === "type") resolvedName = pascalCase(resolvedName);
62
+ if (type) return transformers$1?.name?.(resolvedName, type) || resolvedName;
63
+ return resolvedName;
64
+ },
65
+ async buildStart() {
66
+ const [swaggerPlugin] = PluginManager.getDependedPlugins(this.plugins, [pluginOasName]);
67
+ const oas = await swaggerPlugin.context.getOas();
68
+ const root = path.resolve(this.config.root, this.config.output.path);
69
+ const mode = FileManager.getMode(path.resolve(root, output.path));
70
+ const schemaGenerator = new SchemaGenerator(this.plugin.options, {
71
+ oas,
72
+ pluginManager: this.pluginManager,
73
+ plugin: this.plugin,
74
+ contentType,
75
+ include: void 0,
76
+ override,
77
+ mode,
78
+ output: output.path
79
+ });
80
+ const schemaFiles = await schemaGenerator.build(...generators);
81
+ await this.addFile(...schemaFiles);
82
+ const operationGenerator = new OperationGenerator(this.plugin.options, {
83
+ oas,
84
+ pluginManager: this.pluginManager,
85
+ plugin: this.plugin,
86
+ contentType,
87
+ exclude,
88
+ include,
89
+ override,
90
+ mode
91
+ });
92
+ const operationFiles = await operationGenerator.build(...generators);
93
+ await this.addFile(...operationFiles);
94
+ const barrelFiles = await this.fileManager.getBarrelFiles({
95
+ type: output.barrelType ?? "named",
96
+ root,
97
+ output,
98
+ meta: { pluginKey: this.plugin.key },
99
+ logger: this.logger
100
+ });
101
+ await this.addFile(...barrelFiles);
102
+ }
103
+ };
132
104
  });
133
105
 
106
+ //#endregion
134
107
  export { pluginZod, pluginZodName };
135
- //# sourceMappingURL=index.js.map
136
108
  //# sourceMappingURL=index.js.map