@kubb/plugin-zod 4.14.1 → 4.15.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,4 +1,4 @@
1
- import { i as Schema, n as PluginZod, o as Operation, s as SchemaObject } from "./types-Bjmybk4n.cjs";
1
+ import { i as Schema, n as PluginZod, o as Operation, s as SchemaObject } from "./types-BshzN0sW.cjs";
2
2
  import { KubbFile } from "@kubb/fabric-core/types";
3
3
  import { KubbNode } from "@kubb/react-fabric/types";
4
4
 
@@ -1,4 +1,4 @@
1
- import { i as Schema, n as PluginZod, o as Operation, s as SchemaObject } from "./types-BB0QENnz.js";
1
+ import { i as Schema, n as PluginZod, o as Operation, s as SchemaObject } from "./types-DYDPZSaV.js";
2
2
  import { KubbFile } from "@kubb/fabric-core/types";
3
3
  import { KubbNode } from "@kubb/react-fabric/types";
4
4
 
@@ -1,4 +1,4 @@
1
- import { n as PluginZod, r as ReactGenerator } from "./types-Bjmybk4n.cjs";
1
+ import { n as PluginZod, r as ReactGenerator } from "./types-BshzN0sW.cjs";
2
2
 
3
3
  //#region src/generators/operationsGenerator.d.ts
4
4
  declare const operationsGenerator: ReactGenerator<PluginZod>;
@@ -1,4 +1,4 @@
1
- import { n as PluginZod, r as ReactGenerator } from "./types-BB0QENnz.js";
1
+ import { n as PluginZod, r as ReactGenerator } from "./types-DYDPZSaV.js";
2
2
 
3
3
  //#region src/generators/operationsGenerator.d.ts
4
4
  declare const operationsGenerator: ReactGenerator<PluginZod>;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as UserPluginWithLifeCycle, n as PluginZod, t as Options } from "./types-Bjmybk4n.cjs";
1
+ import { a as UserPluginWithLifeCycle, n as PluginZod, t as Options } from "./types-BshzN0sW.cjs";
2
2
 
3
3
  //#region src/plugin.d.ts
4
4
  declare const pluginZodName = "plugin-zod";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as UserPluginWithLifeCycle, n as PluginZod, t as Options } from "./types-BB0QENnz.js";
1
+ import { a as UserPluginWithLifeCycle, n as PluginZod, t as Options } from "./types-DYDPZSaV.js";
2
2
 
3
3
  //#region src/plugin.d.ts
4
4
  declare const pluginZodName = "plugin-zod";
@@ -391,6 +391,13 @@ type Config<TInput = Input> = {
391
391
  * @default 'simple'
392
392
  */
393
393
  defaultBanner?: 'simple' | 'full' | false;
394
+ /**
395
+ * Whether to override existing external files if they already exist.
396
+ * When setting the option in the global configuration, all plugins inherit the same behavior by default.
397
+ * However, all plugins also have an `output.override` option, which can be used to override the behavior for a specific plugin.
398
+ * @default false
399
+ */
400
+ override?: boolean;
394
401
  };
395
402
  /**
396
403
  * An array of Kubb plugins that will be used in the generation.
@@ -578,6 +585,11 @@ type Output<TOptions> = {
578
585
  * Add a footer text in the beginning of every file
579
586
  */
580
587
  footer?: string | ((options: TOptions) => string);
588
+ /**
589
+ * Whether to override existing external files if they already exist.
590
+ * @default false
591
+ */
592
+ override?: boolean;
581
593
  };
582
594
  type GroupContext = {
583
595
  group: string;
@@ -1150,6 +1162,7 @@ type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
1150
1162
  };
1151
1163
  declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context<TPluginOptions['resolvedOptions'], TPluginOptions>> {
1152
1164
  #private;
1165
+ getOptions(operation: Operation$1, method: HttpMethod): Partial<TPluginOptions['resolvedOptions']>;
1153
1166
  getSchemas(operation: Operation$1, {
1154
1167
  resolveName
1155
1168
  }?: {
@@ -1298,4 +1311,4 @@ type ResolvedOptions = {
1298
1311
  type PluginZod = PluginFactoryOptions<'plugin-zod', Options, ResolvedOptions, never, ResolvePathOptions>;
1299
1312
  //#endregion
1300
1313
  export { UserPluginWithLifeCycle as a, Schema as i, PluginZod as n, Operation$1 as o, ReactGenerator as r, SchemaObject$1 as s, Options as t };
1301
- //# sourceMappingURL=types-Bjmybk4n.d.cts.map
1314
+ //# sourceMappingURL=types-BshzN0sW.d.cts.map
@@ -391,6 +391,13 @@ type Config<TInput = Input> = {
391
391
  * @default 'simple'
392
392
  */
393
393
  defaultBanner?: 'simple' | 'full' | false;
394
+ /**
395
+ * Whether to override existing external files if they already exist.
396
+ * When setting the option in the global configuration, all plugins inherit the same behavior by default.
397
+ * However, all plugins also have an `output.override` option, which can be used to override the behavior for a specific plugin.
398
+ * @default false
399
+ */
400
+ override?: boolean;
394
401
  };
395
402
  /**
396
403
  * An array of Kubb plugins that will be used in the generation.
@@ -578,6 +585,11 @@ type Output<TOptions> = {
578
585
  * Add a footer text in the beginning of every file
579
586
  */
580
587
  footer?: string | ((options: TOptions) => string);
588
+ /**
589
+ * Whether to override existing external files if they already exist.
590
+ * @default false
591
+ */
592
+ override?: boolean;
581
593
  };
582
594
  type GroupContext = {
583
595
  group: string;
@@ -1150,6 +1162,7 @@ type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
1150
1162
  };
1151
1163
  declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context<TPluginOptions['resolvedOptions'], TPluginOptions>> {
1152
1164
  #private;
1165
+ getOptions(operation: Operation$1, method: HttpMethod): Partial<TPluginOptions['resolvedOptions']>;
1153
1166
  getSchemas(operation: Operation$1, {
1154
1167
  resolveName
1155
1168
  }?: {
@@ -1298,4 +1311,4 @@ type ResolvedOptions = {
1298
1311
  type PluginZod = PluginFactoryOptions<'plugin-zod', Options, ResolvedOptions, never, ResolvePathOptions>;
1299
1312
  //#endregion
1300
1313
  export { UserPluginWithLifeCycle as a, Schema as i, PluginZod as n, Operation$1 as o, ReactGenerator as r, SchemaObject$1 as s, Options as t };
1301
- //# sourceMappingURL=types-BB0QENnz.d.ts.map
1314
+ //# sourceMappingURL=types-DYDPZSaV.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-zod",
3
- "version": "4.14.1",
3
+ "version": "4.15.0",
4
4
  "description": "Zod schema generator plugin for Kubb, creating type-safe validation schemas from OpenAPI specifications for runtime data validation.",
5
5
  "keywords": [
6
6
  "zod",
@@ -69,10 +69,10 @@
69
69
  ],
70
70
  "dependencies": {
71
71
  "@kubb/react-fabric": "0.9.2",
72
- "@kubb/core": "4.14.1",
73
- "@kubb/oas": "4.14.1",
74
- "@kubb/plugin-oas": "4.14.1",
75
- "@kubb/plugin-ts": "4.14.1"
72
+ "@kubb/core": "4.15.0",
73
+ "@kubb/oas": "4.15.0",
74
+ "@kubb/plugin-oas": "4.15.0",
75
+ "@kubb/plugin-ts": "4.15.0"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@asteasolutions/zod-to-openapi": "^8.4.0",