@kubb/plugin-ts 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 PluginTs, o as SchemaObject } from "./types-CKtzgWEC.cjs";
1
+ import { i as Schema, n as PluginTs, o as SchemaObject } from "./types-njfY0PGo.cjs";
2
2
  import { KubbNode } from "@kubb/react-fabric/types";
3
3
 
4
4
  //#region src/components/Type.d.ts
@@ -1,4 +1,4 @@
1
- import { i as Schema, n as PluginTs, o as SchemaObject } from "./types-CnQREd_1.js";
1
+ import { i as Schema, n as PluginTs, o as SchemaObject } from "./types-D59kq_S_.js";
2
2
  import { KubbNode } from "@kubb/react-fabric/types";
3
3
 
4
4
  //#region src/components/Type.d.ts
@@ -1,4 +1,4 @@
1
- import { n as PluginTs, r as ReactGenerator } from "./types-CKtzgWEC.cjs";
1
+ import { n as PluginTs, r as ReactGenerator } from "./types-njfY0PGo.cjs";
2
2
 
3
3
  //#region src/generators/typeGenerator.d.ts
4
4
  declare const typeGenerator: ReactGenerator<PluginTs>;
@@ -1,4 +1,4 @@
1
- import { n as PluginTs, r as ReactGenerator } from "./types-CnQREd_1.js";
1
+ import { n as PluginTs, r as ReactGenerator } from "./types-D59kq_S_.js";
2
2
 
3
3
  //#region src/generators/typeGenerator.d.ts
4
4
  declare const typeGenerator: ReactGenerator<PluginTs>;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as UserPluginWithLifeCycle, n as PluginTs, t as Options } from "./types-CKtzgWEC.cjs";
1
+ import { a as UserPluginWithLifeCycle, n as PluginTs, t as Options } from "./types-njfY0PGo.cjs";
2
2
 
3
3
  //#region src/plugin.d.ts
4
4
  declare const pluginTsName = "plugin-ts";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as UserPluginWithLifeCycle, n as PluginTs, t as Options } from "./types-CnQREd_1.js";
1
+ import { a as UserPluginWithLifeCycle, n as PluginTs, t as Options } from "./types-D59kq_S_.js";
2
2
 
3
3
  //#region src/plugin.d.ts
4
4
  declare const pluginTsName = "plugin-ts";
@@ -1,11 +1,11 @@
1
+ import { Fabric } from "@kubb/react-fabric";
2
+ import ts from "typescript";
1
3
  import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
2
4
  import BaseOas from "oas";
3
5
  import { Operation } from "oas/operation";
4
6
  import { DiscriminatorObject, HttpMethods, OASDocument, SchemaObject } from "oas/types";
5
7
  import { KubbFile } from "@kubb/fabric-core/types";
6
- import { Fabric } from "@kubb/react-fabric";
7
8
  import { KubbNode } from "@kubb/react-fabric/types";
8
- import ts from "typescript";
9
9
 
10
10
  //#region ../oas/src/types.d.ts
11
11
  type contentType = 'application/json' | (string & {});
@@ -392,6 +392,13 @@ type Config<TInput = Input> = {
392
392
  * @default 'simple'
393
393
  */
394
394
  defaultBanner?: 'simple' | 'full' | false;
395
+ /**
396
+ * Whether to override existing external files if they already exist.
397
+ * When setting the option in the global configuration, all plugins inherit the same behavior by default.
398
+ * However, all plugins also have an `output.override` option, which can be used to override the behavior for a specific plugin.
399
+ * @default false
400
+ */
401
+ override?: boolean;
395
402
  };
396
403
  /**
397
404
  * An array of Kubb plugins that will be used in the generation.
@@ -579,6 +586,11 @@ type Output<TOptions> = {
579
586
  * Add a footer text in the beginning of every file
580
587
  */
581
588
  footer?: string | ((options: TOptions) => string);
589
+ /**
590
+ * Whether to override existing external files if they already exist.
591
+ * @default false
592
+ */
593
+ override?: boolean;
582
594
  };
583
595
  type GroupContext = {
584
596
  group: string;
@@ -832,6 +844,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
832
844
  };
833
845
  declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
834
846
  #private;
847
+ getOptions(operation: Operation$1, method: HttpMethod): Partial<TPluginOptions['resolvedOptions']>;
835
848
  getSchemas(operation: Operation$1, {
836
849
  resolveName
837
850
  }?: {
@@ -1288,4 +1301,4 @@ type ResolvedOptions = {
1288
1301
  type PluginTs = PluginFactoryOptions<'plugin-ts', Options, ResolvedOptions, never, ResolvePathOptions>;
1289
1302
  //#endregion
1290
1303
  export { UserPluginWithLifeCycle as a, Schema as i, PluginTs as n, SchemaObject$1 as o, ReactGenerator as r, Options as t };
1291
- //# sourceMappingURL=types-CKtzgWEC.d.cts.map
1304
+ //# sourceMappingURL=types-D59kq_S_.d.ts.map
@@ -1,11 +1,11 @@
1
- import { Fabric } from "@kubb/react-fabric";
2
- import ts from "typescript";
3
1
  import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
4
2
  import BaseOas from "oas";
5
3
  import { Operation } from "oas/operation";
6
4
  import { DiscriminatorObject, HttpMethods, OASDocument, SchemaObject } from "oas/types";
7
5
  import { KubbFile } from "@kubb/fabric-core/types";
6
+ import { Fabric } from "@kubb/react-fabric";
8
7
  import { KubbNode } from "@kubb/react-fabric/types";
8
+ import ts from "typescript";
9
9
 
10
10
  //#region ../oas/src/types.d.ts
11
11
  type contentType = 'application/json' | (string & {});
@@ -392,6 +392,13 @@ type Config<TInput = Input> = {
392
392
  * @default 'simple'
393
393
  */
394
394
  defaultBanner?: 'simple' | 'full' | false;
395
+ /**
396
+ * Whether to override existing external files if they already exist.
397
+ * When setting the option in the global configuration, all plugins inherit the same behavior by default.
398
+ * However, all plugins also have an `output.override` option, which can be used to override the behavior for a specific plugin.
399
+ * @default false
400
+ */
401
+ override?: boolean;
395
402
  };
396
403
  /**
397
404
  * An array of Kubb plugins that will be used in the generation.
@@ -579,6 +586,11 @@ type Output<TOptions> = {
579
586
  * Add a footer text in the beginning of every file
580
587
  */
581
588
  footer?: string | ((options: TOptions) => string);
589
+ /**
590
+ * Whether to override existing external files if they already exist.
591
+ * @default false
592
+ */
593
+ override?: boolean;
582
594
  };
583
595
  type GroupContext = {
584
596
  group: string;
@@ -832,6 +844,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
832
844
  };
833
845
  declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
834
846
  #private;
847
+ getOptions(operation: Operation$1, method: HttpMethod): Partial<TPluginOptions['resolvedOptions']>;
835
848
  getSchemas(operation: Operation$1, {
836
849
  resolveName
837
850
  }?: {
@@ -1288,4 +1301,4 @@ type ResolvedOptions = {
1288
1301
  type PluginTs = PluginFactoryOptions<'plugin-ts', Options, ResolvedOptions, never, ResolvePathOptions>;
1289
1302
  //#endregion
1290
1303
  export { UserPluginWithLifeCycle as a, Schema as i, PluginTs as n, SchemaObject$1 as o, ReactGenerator as r, Options as t };
1291
- //# sourceMappingURL=types-CnQREd_1.d.ts.map
1304
+ //# sourceMappingURL=types-njfY0PGo.d.cts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-ts",
3
- "version": "4.14.1",
3
+ "version": "4.15.0",
4
4
  "description": "TypeScript code generation plugin for Kubb, transforming OpenAPI schemas into TypeScript interfaces, types, and utility functions.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -69,9 +69,9 @@
69
69
  "natural-orderby": "^5.0.0",
70
70
  "remeda": "^2.33.1",
71
71
  "typescript": "5.9.3",
72
- "@kubb/core": "4.14.1",
73
- "@kubb/oas": "4.14.1",
74
- "@kubb/plugin-oas": "4.14.1"
72
+ "@kubb/core": "4.15.0",
73
+ "@kubb/oas": "4.15.0",
74
+ "@kubb/plugin-oas": "4.15.0"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "@kubb/react-fabric": "0.9.2",