@kubb/plugin-msw 4.14.1 → 4.15.1

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 { h as Operation } from "./index-DQ_gP-zu.cjs";
1
+ import { h as Operation } from "./index-BKi86a7m.cjs";
2
2
  import { KubbNode } from "@kubb/react-fabric/types";
3
3
 
4
4
  //#region src/components/Handlers.d.ts
@@ -1,4 +1,4 @@
1
- import { h as Operation } from "./index-BC25ub0a.js";
1
+ import { h as Operation } from "./index-DsObfYme.js";
2
2
  import { KubbNode } from "@kubb/react-fabric/types";
3
3
 
4
4
  //#region src/components/Handlers.d.ts
@@ -1,5 +1,5 @@
1
- import "./index-DQ_gP-zu.cjs";
2
- import { n as PluginMsw, r as ReactGenerator } from "./types-BxbkrRzL.cjs";
1
+ import "./index-BKi86a7m.cjs";
2
+ import { n as PluginMsw, r as ReactGenerator } from "./types-C-42E1Jz.cjs";
3
3
 
4
4
  //#region src/generators/handlersGenerator.d.ts
5
5
  declare const handlersGenerator: ReactGenerator<PluginMsw>;
@@ -1,5 +1,5 @@
1
- import "./index-BC25ub0a.js";
2
- import { n as PluginMsw, r as ReactGenerator } from "./types-B7KpvM6o.js";
1
+ import "./index-DsObfYme.js";
2
+ import { n as PluginMsw, r as ReactGenerator } from "./types-DjFMooWJ.js";
3
3
 
4
4
  //#region src/generators/handlersGenerator.d.ts
5
5
  declare const handlersGenerator: ReactGenerator<PluginMsw>;
@@ -390,6 +390,13 @@ type Config<TInput = Input> = {
390
390
  * @default 'simple'
391
391
  */
392
392
  defaultBanner?: 'simple' | 'full' | false;
393
+ /**
394
+ * Whether to override existing external files if they already exist.
395
+ * When setting the option in the global configuration, all plugins inherit the same behavior by default.
396
+ * However, all plugins also have an `output.override` option, which can be used to override the behavior for a specific plugin.
397
+ * @default false
398
+ */
399
+ override?: boolean;
393
400
  };
394
401
  /**
395
402
  * An array of Kubb plugins that will be used in the generation.
@@ -577,6 +584,11 @@ type Output<TOptions> = {
577
584
  * Add a footer text in the beginning of every file
578
585
  */
579
586
  footer?: string | ((options: TOptions) => string);
587
+ /**
588
+ * Whether to override existing external files if they already exist.
589
+ * @default false
590
+ */
591
+ override?: boolean;
580
592
  };
581
593
  type GroupContext = {
582
594
  group: string;
@@ -712,4 +724,4 @@ type FileMetaBase = {
712
724
  };
713
725
  //#endregion
714
726
  export { contentType as _, Output as a, ResolveNameParams as c, KubbEvents as d, BaseGenerator as f, SchemaObject$1 as g, Operation$1 as h, Group as i, UserPluginWithLifeCycle as l, HttpMethod as m, PluginManager as n, Plugin as o, Oas as p, Config as r, PluginFactoryOptions as s, FileMetaBase as t, AsyncEventEmitter as u };
715
- //# sourceMappingURL=index-DQ_gP-zu.d.cts.map
727
+ //# sourceMappingURL=index-BKi86a7m.d.cts.map
@@ -390,6 +390,13 @@ type Config<TInput = Input> = {
390
390
  * @default 'simple'
391
391
  */
392
392
  defaultBanner?: 'simple' | 'full' | false;
393
+ /**
394
+ * Whether to override existing external files if they already exist.
395
+ * When setting the option in the global configuration, all plugins inherit the same behavior by default.
396
+ * However, all plugins also have an `output.override` option, which can be used to override the behavior for a specific plugin.
397
+ * @default false
398
+ */
399
+ override?: boolean;
393
400
  };
394
401
  /**
395
402
  * An array of Kubb plugins that will be used in the generation.
@@ -577,6 +584,11 @@ type Output<TOptions> = {
577
584
  * Add a footer text in the beginning of every file
578
585
  */
579
586
  footer?: string | ((options: TOptions) => string);
587
+ /**
588
+ * Whether to override existing external files if they already exist.
589
+ * @default false
590
+ */
591
+ override?: boolean;
580
592
  };
581
593
  type GroupContext = {
582
594
  group: string;
@@ -712,4 +724,4 @@ type FileMetaBase = {
712
724
  };
713
725
  //#endregion
714
726
  export { contentType as _, Output as a, ResolveNameParams as c, KubbEvents as d, BaseGenerator as f, SchemaObject$1 as g, Operation$1 as h, Group as i, UserPluginWithLifeCycle as l, HttpMethod as m, PluginManager as n, Plugin as o, Oas as p, Config as r, PluginFactoryOptions as s, FileMetaBase as t, AsyncEventEmitter as u };
715
- //# sourceMappingURL=index-BC25ub0a.d.ts.map
727
+ //# sourceMappingURL=index-DsObfYme.d.ts.map
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { l as UserPluginWithLifeCycle } from "./index-DQ_gP-zu.cjs";
2
- import { n as PluginMsw, t as Options } from "./types-BxbkrRzL.cjs";
1
+ import { l as UserPluginWithLifeCycle } from "./index-BKi86a7m.cjs";
2
+ import { n as PluginMsw, t as Options } from "./types-C-42E1Jz.cjs";
3
3
 
4
4
  //#region src/plugin.d.ts
5
5
  declare const pluginMswName = "plugin-msw";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { l as UserPluginWithLifeCycle } from "./index-BC25ub0a.js";
2
- import { n as PluginMsw, t as Options } from "./types-B7KpvM6o.js";
1
+ import { l as UserPluginWithLifeCycle } from "./index-DsObfYme.js";
2
+ import { n as PluginMsw, t as Options } from "./types-DjFMooWJ.js";
3
3
 
4
4
  //#region src/plugin.d.ts
5
5
  declare const pluginMswName = "plugin-msw";
@@ -1,4 +1,4 @@
1
- import { _ as contentType, a as Output, c as ResolveNameParams, d as KubbEvents, f as BaseGenerator, g as SchemaObject, h as Operation, i as Group, m as HttpMethod, n as PluginManager, o as Plugin, p as Oas, r as Config, s as PluginFactoryOptions, t as FileMetaBase, u as AsyncEventEmitter } from "./index-DQ_gP-zu.cjs";
1
+ import { _ as contentType, a as Output, c as ResolveNameParams, d as KubbEvents, f as BaseGenerator, g as SchemaObject, h as Operation, i as Group, m as HttpMethod, n as PluginManager, o as Plugin, p as Oas, r as Config, s as PluginFactoryOptions, t as FileMetaBase, u as AsyncEventEmitter } from "./index-BKi86a7m.cjs";
2
2
  import { KubbNode } from "@kubb/react-fabric/types";
3
3
  import { KubbFile } from "@kubb/fabric-core/types";
4
4
  import { Fabric } from "@kubb/react-fabric";
@@ -122,6 +122,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
122
122
  };
123
123
  declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
124
124
  #private;
125
+ getOptions(operation: Operation, method: HttpMethod): Partial<TPluginOptions['resolvedOptions']>;
125
126
  getSchemas(operation: Operation, {
126
127
  resolveName
127
128
  }?: {
@@ -515,4 +516,4 @@ type ResolvedOptions = {
515
516
  type PluginMsw = PluginFactoryOptions<'plugin-msw', Options, ResolvedOptions, never, ResolvePathOptions>;
516
517
  //#endregion
517
518
  export { PluginMsw as n, ReactGenerator as r, Options as t };
518
- //# sourceMappingURL=types-BxbkrRzL.d.cts.map
519
+ //# sourceMappingURL=types-C-42E1Jz.d.cts.map
@@ -1,4 +1,4 @@
1
- import { _ as contentType, a as Output, c as ResolveNameParams, d as KubbEvents, f as BaseGenerator, g as SchemaObject, h as Operation, i as Group, m as HttpMethod, n as PluginManager, o as Plugin, p as Oas, r as Config, s as PluginFactoryOptions, t as FileMetaBase, u as AsyncEventEmitter } from "./index-BC25ub0a.js";
1
+ import { _ as contentType, a as Output, c as ResolveNameParams, d as KubbEvents, f as BaseGenerator, g as SchemaObject, h as Operation, i as Group, m as HttpMethod, n as PluginManager, o as Plugin, p as Oas, r as Config, s as PluginFactoryOptions, t as FileMetaBase, u as AsyncEventEmitter } from "./index-DsObfYme.js";
2
2
  import { Fabric } from "@kubb/react-fabric";
3
3
  import { KubbNode } from "@kubb/react-fabric/types";
4
4
  import { KubbFile } from "@kubb/fabric-core/types";
@@ -122,6 +122,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
122
122
  };
123
123
  declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
124
124
  #private;
125
+ getOptions(operation: Operation, method: HttpMethod): Partial<TPluginOptions['resolvedOptions']>;
125
126
  getSchemas(operation: Operation, {
126
127
  resolveName
127
128
  }?: {
@@ -515,4 +516,4 @@ type ResolvedOptions = {
515
516
  type PluginMsw = PluginFactoryOptions<'plugin-msw', Options, ResolvedOptions, never, ResolvePathOptions>;
516
517
  //#endregion
517
518
  export { PluginMsw as n, ReactGenerator as r, Options as t };
518
- //# sourceMappingURL=types-B7KpvM6o.d.ts.map
519
+ //# sourceMappingURL=types-DjFMooWJ.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-msw",
3
- "version": "4.14.1",
3
+ "version": "4.15.1",
4
4
  "description": "Mock Service Worker (MSW) handlers generator plugin for Kubb, creating API mocks from OpenAPI specifications for frontend development and testing.",
5
5
  "keywords": [
6
6
  "msw",
@@ -74,11 +74,11 @@
74
74
  ],
75
75
  "dependencies": {
76
76
  "@kubb/react-fabric": "0.9.2",
77
- "@kubb/core": "4.14.1",
78
- "@kubb/oas": "4.14.1",
79
- "@kubb/plugin-faker": "4.14.1",
80
- "@kubb/plugin-oas": "4.14.1",
81
- "@kubb/plugin-ts": "4.14.1"
77
+ "@kubb/core": "4.15.1",
78
+ "@kubb/oas": "4.15.1",
79
+ "@kubb/plugin-faker": "4.15.1",
80
+ "@kubb/plugin-oas": "4.15.1",
81
+ "@kubb/plugin-ts": "4.15.1"
82
82
  },
83
83
  "devDependencies": {},
84
84
  "engines": {