@kubb/plugin-msw 4.12.9 → 4.12.11

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-CfuomfBr.cjs";
1
+ import { h as Operation } from "./index-1BLErTHB.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-BxrZCazk.js";
1
+ import { h as Operation } from "./index-BTzTv3qO.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-CfuomfBr.cjs";
2
- import { n as PluginMsw, r as ReactGenerator } from "./types-qrusQNto.cjs";
1
+ import "./index-1BLErTHB.cjs";
2
+ import { n as PluginMsw, r as ReactGenerator } from "./types-By9Z224I.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-BxrZCazk.js";
2
- import { n as PluginMsw, r as ReactGenerator } from "./types-DrSnvT6c.js";
1
+ import "./index-BTzTv3qO.js";
2
+ import { n as PluginMsw, r as ReactGenerator } from "./types-D98l2Yc_.js";
3
3
 
4
4
  //#region src/generators/handlersGenerator.d.ts
5
5
  declare const handlersGenerator: ReactGenerator<PluginMsw>;
@@ -1,46 +1,42 @@
1
- import { Fabric } from "@kubb/react-fabric";
2
- import * as OasTypes from "oas/types";
3
- import { HttpMethods as HttpMethod, OASDocument, SchemaObject, User } from "oas/types";
4
- import { Operation, Operation as Operation$1 } from "oas/operation";
5
- import { OpenAPIV3 } from "openapi-types";
6
1
  import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
7
2
  import BaseOas from "oas";
3
+ import { Operation } from "oas/operation";
4
+ import { DiscriminatorObject, HttpMethods, OASDocument, SchemaObject } from "oas/types";
8
5
  import { KubbFile } from "@kubb/fabric-core/types";
6
+ import { Fabric } from "@kubb/react-fabric";
9
7
 
10
8
  //#region ../oas/src/types.d.ts
11
9
  type contentType = 'application/json' | (string & {});
12
- type SchemaObject$1 = OasTypes.SchemaObject & {
10
+ type SchemaObject$1 = SchemaObject & {
13
11
  'x-nullable'?: boolean;
14
12
  $ref?: string;
15
13
  };
14
+ type HttpMethod = HttpMethods;
15
+ type Document = OASDocument;
16
+ type Operation$1 = Operation;
17
+ type DiscriminatorObject$1 = DiscriminatorObject;
16
18
  //#endregion
17
19
  //#region ../oas/src/Oas.d.ts
18
20
  type Options$1 = {
19
21
  contentType?: contentType;
20
22
  discriminator?: 'strict' | 'inherit';
21
23
  };
22
- declare class Oas<const TOAS = unknown> extends BaseOas {
24
+ declare class Oas extends BaseOas {
23
25
  #private;
24
- document: TOAS;
25
- constructor({
26
- oas,
27
- user
28
- }: {
29
- oas: TOAS | OASDocument | string;
30
- user?: User;
31
- });
26
+ document: Document;
27
+ constructor(document: Document);
32
28
  setOptions(options: Options$1): void;
33
29
  get options(): Options$1;
34
- get($ref: string): any;
30
+ get<T = unknown>($ref: string): T | null;
35
31
  getKey($ref: string): string | undefined;
36
32
  set($ref: string, value: unknown): false | undefined;
37
- getDiscriminator(schema: OasTypes.SchemaObject): OpenAPIV3.DiscriminatorObject | undefined;
38
- dereferenceWithRef(schema?: unknown): any;
39
- getResponseSchema(operation: Operation, statusCode: string | number): SchemaObject;
40
- getRequestSchema(operation: Operation): SchemaObject | undefined;
41
- getParametersSchema(operation: Operation, inKey: 'path' | 'query' | 'header'): SchemaObject | null;
33
+ getDiscriminator(schema: SchemaObject$1 | null): DiscriminatorObject$1 | null;
34
+ dereferenceWithRef<T = unknown>(schema?: T): T;
35
+ getResponseSchema(operation: Operation$1, statusCode: string | number): SchemaObject$1;
36
+ getRequestSchema(operation: Operation$1): SchemaObject$1 | undefined;
37
+ getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
42
38
  valdiate(): Promise<oas_normalize_lib_types0.ValidationResult>;
43
- flattenSchema(schema?: SchemaObject): SchemaObject | undefined;
39
+ flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
44
40
  }
45
41
  //#endregion
46
42
  //#region ../core/src/BaseGenerator.d.ts
@@ -711,4 +707,4 @@ type FileMetaBase = {
711
707
  };
712
708
  //#endregion
713
709
  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 };
714
- //# sourceMappingURL=index-BxrZCazk.d.ts.map
710
+ //# sourceMappingURL=index-1BLErTHB.d.cts.map
@@ -1,46 +1,42 @@
1
- import * as OasTypes from "oas/types";
2
- import { HttpMethods as HttpMethod, OASDocument, SchemaObject, User } from "oas/types";
3
- import { Operation, Operation as Operation$1 } from "oas/operation";
4
- import { OpenAPIV3 } from "openapi-types";
1
+ import { Fabric } from "@kubb/react-fabric";
5
2
  import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
6
3
  import BaseOas from "oas";
4
+ import { Operation } from "oas/operation";
5
+ import { DiscriminatorObject, HttpMethods, OASDocument, SchemaObject } from "oas/types";
7
6
  import { KubbFile } from "@kubb/fabric-core/types";
8
- import { Fabric } from "@kubb/react-fabric";
9
7
 
10
8
  //#region ../oas/src/types.d.ts
11
9
  type contentType = 'application/json' | (string & {});
12
- type SchemaObject$1 = OasTypes.SchemaObject & {
10
+ type SchemaObject$1 = SchemaObject & {
13
11
  'x-nullable'?: boolean;
14
12
  $ref?: string;
15
13
  };
14
+ type HttpMethod = HttpMethods;
15
+ type Document = OASDocument;
16
+ type Operation$1 = Operation;
17
+ type DiscriminatorObject$1 = DiscriminatorObject;
16
18
  //#endregion
17
19
  //#region ../oas/src/Oas.d.ts
18
20
  type Options$1 = {
19
21
  contentType?: contentType;
20
22
  discriminator?: 'strict' | 'inherit';
21
23
  };
22
- declare class Oas<const TOAS = unknown> extends BaseOas {
24
+ declare class Oas extends BaseOas {
23
25
  #private;
24
- document: TOAS;
25
- constructor({
26
- oas,
27
- user
28
- }: {
29
- oas: TOAS | OASDocument | string;
30
- user?: User;
31
- });
26
+ document: Document;
27
+ constructor(document: Document);
32
28
  setOptions(options: Options$1): void;
33
29
  get options(): Options$1;
34
- get($ref: string): any;
30
+ get<T = unknown>($ref: string): T | null;
35
31
  getKey($ref: string): string | undefined;
36
32
  set($ref: string, value: unknown): false | undefined;
37
- getDiscriminator(schema: OasTypes.SchemaObject): OpenAPIV3.DiscriminatorObject | undefined;
38
- dereferenceWithRef(schema?: unknown): any;
39
- getResponseSchema(operation: Operation, statusCode: string | number): SchemaObject;
40
- getRequestSchema(operation: Operation): SchemaObject | undefined;
41
- getParametersSchema(operation: Operation, inKey: 'path' | 'query' | 'header'): SchemaObject | null;
33
+ getDiscriminator(schema: SchemaObject$1 | null): DiscriminatorObject$1 | null;
34
+ dereferenceWithRef<T = unknown>(schema?: T): T;
35
+ getResponseSchema(operation: Operation$1, statusCode: string | number): SchemaObject$1;
36
+ getRequestSchema(operation: Operation$1): SchemaObject$1 | undefined;
37
+ getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
42
38
  valdiate(): Promise<oas_normalize_lib_types0.ValidationResult>;
43
- flattenSchema(schema?: SchemaObject): SchemaObject | undefined;
39
+ flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
44
40
  }
45
41
  //#endregion
46
42
  //#region ../core/src/BaseGenerator.d.ts
@@ -711,4 +707,4 @@ type FileMetaBase = {
711
707
  };
712
708
  //#endregion
713
709
  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 };
714
- //# sourceMappingURL=index-CfuomfBr.d.cts.map
710
+ //# sourceMappingURL=index-BTzTv3qO.d.ts.map
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { l as UserPluginWithLifeCycle } from "./index-CfuomfBr.cjs";
2
- import { n as PluginMsw, t as Options } from "./types-qrusQNto.cjs";
1
+ import { l as UserPluginWithLifeCycle } from "./index-1BLErTHB.cjs";
2
+ import { n as PluginMsw, t as Options } from "./types-By9Z224I.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-BxrZCazk.js";
2
- import { n as PluginMsw, t as Options } from "./types-DrSnvT6c.js";
1
+ import { l as UserPluginWithLifeCycle } from "./index-BTzTv3qO.js";
2
+ import { n as PluginMsw, t as Options } from "./types-D98l2Yc_.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-CfuomfBr.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-1BLErTHB.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";
@@ -143,6 +143,7 @@ type SchemaKeywordMapper = {
143
143
  [x: string]: Schema[];
144
144
  };
145
145
  additionalProperties: Schema[];
146
+ patternProperties?: Record<string, Schema[]>;
146
147
  strict?: boolean;
147
148
  };
148
149
  };
@@ -386,13 +387,13 @@ type SchemaGeneratorOptions = {
386
387
  * TODO TODO add docs
387
388
  * @beta
388
389
  */
389
- schema?: (schemaProps: SchemaProps$1, defaultSchemas: Schema[]) => Schema[] | undefined;
390
+ schema?: (schemaProps: SchemaProps$1, defaultSchemas: Schema[]) => Array<Schema> | undefined;
390
391
  };
391
392
  };
392
393
  type SchemaProps$1 = {
393
- schemaObject?: SchemaObject;
394
- name?: string;
395
- parentName?: string;
394
+ schema: SchemaObject | null;
395
+ name: string | null;
396
+ parentName: string | null;
396
397
  };
397
398
  declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context<TOptions, TPluginOptions>> {
398
399
  #private;
@@ -513,4 +514,4 @@ type ResolvedOptions = {
513
514
  type PluginMsw = PluginFactoryOptions<'plugin-msw', Options, ResolvedOptions, never, ResolvePathOptions>;
514
515
  //#endregion
515
516
  export { PluginMsw as n, ReactGenerator as r, Options as t };
516
- //# sourceMappingURL=types-qrusQNto.d.cts.map
517
+ //# sourceMappingURL=types-By9Z224I.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-BxrZCazk.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-BTzTv3qO.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";
@@ -143,6 +143,7 @@ type SchemaKeywordMapper = {
143
143
  [x: string]: Schema[];
144
144
  };
145
145
  additionalProperties: Schema[];
146
+ patternProperties?: Record<string, Schema[]>;
146
147
  strict?: boolean;
147
148
  };
148
149
  };
@@ -386,13 +387,13 @@ type SchemaGeneratorOptions = {
386
387
  * TODO TODO add docs
387
388
  * @beta
388
389
  */
389
- schema?: (schemaProps: SchemaProps$1, defaultSchemas: Schema[]) => Schema[] | undefined;
390
+ schema?: (schemaProps: SchemaProps$1, defaultSchemas: Schema[]) => Array<Schema> | undefined;
390
391
  };
391
392
  };
392
393
  type SchemaProps$1 = {
393
- schemaObject?: SchemaObject;
394
- name?: string;
395
- parentName?: string;
394
+ schema: SchemaObject | null;
395
+ name: string | null;
396
+ parentName: string | null;
396
397
  };
397
398
  declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context<TOptions, TPluginOptions>> {
398
399
  #private;
@@ -513,4 +514,4 @@ type ResolvedOptions = {
513
514
  type PluginMsw = PluginFactoryOptions<'plugin-msw', Options, ResolvedOptions, never, ResolvePathOptions>;
514
515
  //#endregion
515
516
  export { PluginMsw as n, ReactGenerator as r, Options as t };
516
- //# sourceMappingURL=types-DrSnvT6c.d.ts.map
517
+ //# sourceMappingURL=types-D98l2Yc_.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-msw",
3
- "version": "4.12.9",
3
+ "version": "4.12.11",
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.7.4",
77
- "@kubb/core": "4.12.9",
78
- "@kubb/oas": "4.12.9",
79
- "@kubb/plugin-faker": "4.12.9",
80
- "@kubb/plugin-oas": "4.12.9",
81
- "@kubb/plugin-ts": "4.12.9"
77
+ "@kubb/core": "4.12.11",
78
+ "@kubb/oas": "4.12.11",
79
+ "@kubb/plugin-faker": "4.12.11",
80
+ "@kubb/plugin-oas": "4.12.11",
81
+ "@kubb/plugin-ts": "4.12.11"
82
82
  },
83
83
  "devDependencies": {},
84
84
  "engines": {