@kubb/plugin-msw 4.18.5 → 4.19.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 { h as Operation, v as __name } from "./index-CJNbXw24.cjs";
1
+ import { h as Operation, v as __name } from "./index-B4gKt7dm.cjs";
2
2
  import { KubbNode } from "@kubb/react-fabric/types";
3
3
 
4
4
  //#region src/components/Handlers.d.ts
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import { h as Operation } from "./index-CbLk6i3C.js";
2
+ import { h as Operation } from "./index-Cdqo2P0B.js";
3
3
  import { KubbNode } from "@kubb/react-fabric/types";
4
4
 
5
5
  //#region src/components/Handlers.d.ts
@@ -1,5 +1,5 @@
1
- import { v as __name } from "./index-CJNbXw24.cjs";
2
- import { n as PluginMsw, r as ReactGenerator } from "./types-B6OpXWFz.cjs";
1
+ import { v as __name } from "./index-B4gKt7dm.cjs";
2
+ import { n as PluginMsw, r as ReactGenerator } from "./types-BKj4cTq4.cjs";
3
3
 
4
4
  //#region src/generators/handlersGenerator.d.ts
5
5
  declare const handlersGenerator: ReactGenerator<PluginMsw>;
@@ -1,6 +1,6 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import "./index-CbLk6i3C.js";
3
- import { n as PluginMsw, r as ReactGenerator } from "./types-DA9U9Z0N.js";
2
+ import "./index-Cdqo2P0B.js";
3
+ import { n as PluginMsw, r as ReactGenerator } from "./types-DlVj7qjw.js";
4
4
 
5
5
  //#region src/generators/handlersGenerator.d.ts
6
6
  declare const handlersGenerator: ReactGenerator<PluginMsw>;
@@ -19,16 +19,21 @@ type Operation$1 = Operation;
19
19
  type DiscriminatorObject$1 = DiscriminatorObject;
20
20
  //#endregion
21
21
  //#region ../oas/src/Oas.d.ts
22
- type Options$1 = {
22
+ type OasOptions = {
23
23
  contentType?: contentType;
24
24
  discriminator?: 'strict' | 'inherit';
25
+ /**
26
+ * Resolve name collisions when schemas from different components share the same name (case-insensitive).
27
+ * @default false
28
+ */
29
+ collisionDetection?: boolean;
25
30
  };
26
31
  declare class Oas extends BaseOas {
27
32
  #private;
28
33
  document: Document;
29
34
  constructor(document: Document);
30
- setOptions(options: Options$1): void;
31
- get options(): Options$1;
35
+ setOptions(options: OasOptions): void;
36
+ get options(): OasOptions;
32
37
  get<T = unknown>($ref: string): T | null;
33
38
  getKey($ref: string): string | undefined;
34
39
  set($ref: string, value: unknown): false | undefined;
@@ -39,6 +44,18 @@ declare class Oas extends BaseOas {
39
44
  getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
40
45
  validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
41
46
  flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
47
+ /**
48
+ * Get schemas from OpenAPI components (schemas, responses, requestBodies).
49
+ * Returns schemas in dependency order along with name mapping for collision resolution.
50
+ */
51
+ getSchemas(options?: {
52
+ contentType?: contentType;
53
+ includes?: Array<'schemas' | 'responses' | 'requestBodies'>;
54
+ collisionDetection?: boolean;
55
+ }): {
56
+ schemas: Record<string, SchemaObject$1>;
57
+ nameMapping: Map<string, string>;
58
+ };
42
59
  }
43
60
  //#endregion
44
61
  //#region ../core/src/BaseGenerator.d.ts
@@ -729,4 +746,4 @@ type FileMetaBase = {
729
746
  };
730
747
  //#endregion
731
748
  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, __name as v };
732
- //# sourceMappingURL=index-CJNbXw24.d.cts.map
749
+ //# sourceMappingURL=index-B4gKt7dm.d.cts.map
@@ -18,16 +18,21 @@ type Operation$1 = Operation;
18
18
  type DiscriminatorObject$1 = DiscriminatorObject;
19
19
  //#endregion
20
20
  //#region ../oas/src/Oas.d.ts
21
- type Options$1 = {
21
+ type OasOptions = {
22
22
  contentType?: contentType;
23
23
  discriminator?: 'strict' | 'inherit';
24
+ /**
25
+ * Resolve name collisions when schemas from different components share the same name (case-insensitive).
26
+ * @default false
27
+ */
28
+ collisionDetection?: boolean;
24
29
  };
25
30
  declare class Oas extends BaseOas {
26
31
  #private;
27
32
  document: Document;
28
33
  constructor(document: Document);
29
- setOptions(options: Options$1): void;
30
- get options(): Options$1;
34
+ setOptions(options: OasOptions): void;
35
+ get options(): OasOptions;
31
36
  get<T = unknown>($ref: string): T | null;
32
37
  getKey($ref: string): string | undefined;
33
38
  set($ref: string, value: unknown): false | undefined;
@@ -38,6 +43,18 @@ declare class Oas extends BaseOas {
38
43
  getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
39
44
  validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
40
45
  flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
46
+ /**
47
+ * Get schemas from OpenAPI components (schemas, responses, requestBodies).
48
+ * Returns schemas in dependency order along with name mapping for collision resolution.
49
+ */
50
+ getSchemas(options?: {
51
+ contentType?: contentType;
52
+ includes?: Array<'schemas' | 'responses' | 'requestBodies'>;
53
+ collisionDetection?: boolean;
54
+ }): {
55
+ schemas: Record<string, SchemaObject$1>;
56
+ nameMapping: Map<string, string>;
57
+ };
41
58
  }
42
59
  //#endregion
43
60
  //#region ../core/src/BaseGenerator.d.ts
@@ -728,4 +745,4 @@ type FileMetaBase = {
728
745
  };
729
746
  //#endregion
730
747
  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 };
731
- //# sourceMappingURL=index-CbLk6i3C.d.ts.map
748
+ //# sourceMappingURL=index-Cdqo2P0B.d.ts.map
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { l as UserPluginWithLifeCycle, v as __name } from "./index-CJNbXw24.cjs";
2
- import { n as PluginMsw, t as Options } from "./types-B6OpXWFz.cjs";
1
+ import { l as UserPluginWithLifeCycle, v as __name } from "./index-B4gKt7dm.cjs";
2
+ import { n as PluginMsw, t as Options } from "./types-BKj4cTq4.cjs";
3
3
 
4
4
  //#region src/plugin.d.ts
5
5
  declare const pluginMswName = "plugin-msw";
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import { l as UserPluginWithLifeCycle } from "./index-CbLk6i3C.js";
3
- import { n as PluginMsw, t as Options } from "./types-DA9U9Z0N.js";
2
+ import { l as UserPluginWithLifeCycle } from "./index-Cdqo2P0B.js";
3
+ import { n as PluginMsw, t as Options } from "./types-DlVj7qjw.js";
4
4
 
5
5
  //#region src/plugin.d.ts
6
6
  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, v as __name } from "./index-CJNbXw24.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, v as __name } from "./index-B4gKt7dm.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";
@@ -516,4 +516,4 @@ type ResolvedOptions = {
516
516
  type PluginMsw = PluginFactoryOptions<'plugin-msw', Options, ResolvedOptions, never, ResolvePathOptions>;
517
517
  //#endregion
518
518
  export { PluginMsw as n, ReactGenerator as r, Options as t };
519
- //# sourceMappingURL=types-B6OpXWFz.d.cts.map
519
+ //# sourceMappingURL=types-BKj4cTq4.d.cts.map
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- 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-CbLk6i3C.js";
2
+ 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-Cdqo2P0B.js";
3
3
  import { Fabric } from "@kubb/react-fabric";
4
4
  import { KubbNode } from "@kubb/react-fabric/types";
5
5
  import { KubbFile } from "@kubb/fabric-core/types";
@@ -517,4 +517,4 @@ type ResolvedOptions = {
517
517
  type PluginMsw = PluginFactoryOptions<'plugin-msw', Options, ResolvedOptions, never, ResolvePathOptions>;
518
518
  //#endregion
519
519
  export { PluginMsw as n, ReactGenerator as r, Options as t };
520
- //# sourceMappingURL=types-DA9U9Z0N.d.ts.map
520
+ //# sourceMappingURL=types-DlVj7qjw.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-msw",
3
- "version": "4.18.5",
3
+ "version": "4.19.0",
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.12.4",
77
- "@kubb/core": "4.18.5",
78
- "@kubb/oas": "4.18.5",
79
- "@kubb/plugin-faker": "4.18.5",
80
- "@kubb/plugin-oas": "4.18.5",
81
- "@kubb/plugin-ts": "4.18.5"
77
+ "@kubb/core": "4.19.0",
78
+ "@kubb/oas": "4.19.0",
79
+ "@kubb/plugin-faker": "4.19.0",
80
+ "@kubb/plugin-oas": "4.19.0",
81
+ "@kubb/plugin-ts": "4.19.0"
82
82
  },
83
83
  "devDependencies": {},
84
84
  "engines": {