@kubb/plugin-msw 4.4.0 → 4.5.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,10 +1,11 @@
1
1
  import { a as contentType, i as SchemaObject$1, n as OasTypes, r as Operation$1, t as HttpMethod } from "./types-8ZXwr93_.cjs";
2
+ import { KubbNode } from "@kubb/react-fabric/types";
2
3
  import { OASDocument, SchemaObject, User } from "oas/types";
3
4
  import { Operation } from "oas/operation";
4
5
  import { OpenAPIV3 } from "openapi-types";
5
6
  import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
6
7
  import BaseOas from "oas";
7
- import { KubbNode } from "@kubb/react-fabric/types";
8
+ import { KubbFile } from "@kubb/fabric-core/types";
8
9
  import { Fabric, FileManager } from "@kubb/react-fabric";
9
10
  import { ConsolaInstance, LogLevel } from "consola";
10
11
 
@@ -50,121 +51,6 @@ declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
50
51
  abstract build(...params: unknown[]): unknown;
51
52
  }
52
53
  //#endregion
53
- //#region ../core/src/fs/types.d.ts
54
- type BasePath<T extends string = string> = `${T}/`;
55
- type Import = {
56
- /**
57
- * Import name to be used
58
- * @example ["useState"]
59
- * @example "React"
60
- */
61
- name: string | Array<string | {
62
- propertyName: string;
63
- name?: string;
64
- }>;
65
- /**
66
- * Path for the import
67
- * @example '@kubb/core'
68
- */
69
- path: string;
70
- /**
71
- * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
72
- */
73
- isTypeOnly?: boolean;
74
- isNameSpace?: boolean;
75
- /**
76
- * When root is set it will get the path with relative getRelativePath(root, path).
77
- */
78
- root?: string;
79
- };
80
- type Source = {
81
- name?: string;
82
- value?: string;
83
- isTypeOnly?: boolean;
84
- /**
85
- * Has const or type 'export'
86
- * @default false
87
- */
88
- isExportable?: boolean;
89
- /**
90
- * When set, barrel generation will add this
91
- * @default false
92
- */
93
- isIndexable?: boolean;
94
- };
95
- type Export = {
96
- /**
97
- * Export name to be used.
98
- * @example ["useState"]
99
- * @example "React"
100
- */
101
- name?: string | Array<string>;
102
- /**
103
- * Path for the import.
104
- * @example '@kubb/core'
105
- */
106
- path: string;
107
- /**
108
- * Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
109
- */
110
- isTypeOnly?: boolean;
111
- /**
112
- * Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
113
- */
114
- asAlias?: boolean;
115
- };
116
- type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
117
- type Mode = 'single' | 'split';
118
- /**
119
- * Name to be used to dynamicly create the baseName(based on input.path)
120
- * Based on UNIX basename
121
- * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
122
- */
123
- type BaseName = `${string}.${string}`;
124
- /**
125
- * Path will be full qualified path to a specified file
126
- */
127
- type Path = string;
128
- type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
129
- type OptionalPath = Path | undefined | null;
130
- type File<TMeta extends object = object> = {
131
- /**
132
- * Name to be used to create the path
133
- * Based on UNIX basename, `${name}.extname`
134
- * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
135
- */
136
- baseName: BaseName;
137
- /**
138
- * Path will be full qualified path to a specified file
139
- */
140
- path: AdvancedPath<BaseName> | Path;
141
- sources: Array<Source>;
142
- imports?: Array<Import>;
143
- exports?: Array<Export>;
144
- /**
145
- * Use extra meta, this is getting used to generate the barrel/index files.
146
- */
147
- meta?: TMeta;
148
- banner?: string;
149
- footer?: string;
150
- };
151
- type ResolvedImport = Import;
152
- type ResolvedExport = Export;
153
- type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
154
- /**
155
- * @default object-hash
156
- */
157
- id: string;
158
- /**
159
- * Contains the first part of the baseName, generated based on baseName
160
- * @link https://nodejs.org/api/path.html#pathformatpathobject
161
- */
162
- name: string;
163
- extname: Extname;
164
- imports: Array<ResolvedImport>;
165
- exports: Array<ResolvedExport>;
166
- };
167
- //#endregion
168
54
  //#region ../core/src/utils/EventEmitter.d.ts
169
55
  declare class EventEmitter<TEvents extends Record<string, any>> {
170
56
  #private;
@@ -288,7 +174,7 @@ type Config<TInput = Input> = {
288
174
  * Override the extension to the generated imports and exports, by default each plugin will add an extension
289
175
  * @default { '.ts': '.ts'}
290
176
  */
291
- extension?: Record<Extname, Extname | ''>;
177
+ extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
292
178
  /**
293
179
  * Specify how `index.ts` files should be created. You can also disable the generation of barrel files here. While each plugin has its own `barrelType` option, this setting controls the creation of the root barrel file, such as` src/gen/index.ts`.
294
180
  * @default 'named'
@@ -419,7 +305,7 @@ type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOption
419
305
  * @type hookFirst
420
306
  * @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
421
307
  */
422
- resolvePath?: (this: PluginContext<TOptions>, baseName: BaseName, mode?: Mode, options?: TOptions['resolvePathOptions']) => OptionalPath;
308
+ resolvePath?: (this: PluginContext<TOptions>, baseName: KubbFile.BaseName, mode?: KubbFile.Mode, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath;
423
309
  /**
424
310
  * Resolve to a name based on a string.
425
311
  * Useful when converting to PascalCase or camelCase.
@@ -437,8 +323,8 @@ type PluginLifecycleHooks = keyof PluginLifecycle;
437
323
  type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
438
324
  type ResolvePathParams<TOptions = object> = {
439
325
  pluginKey?: Plugin['key'];
440
- baseName: BaseName;
441
- mode?: Mode;
326
+ baseName: KubbFile.BaseName;
327
+ mode?: KubbFile.Mode;
442
328
  /**
443
329
  * Options to be passed to 'resolvePath' 3th parameter
444
330
  */
@@ -463,8 +349,8 @@ type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions>
463
349
  */
464
350
  fileManager: FileManager;
465
351
  pluginManager: PluginManager;
466
- addFile: (...file: Array<File>) => Promise<Array<ResolvedFile>>;
467
- resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => OptionalPath;
352
+ addFile: (...file: Array<KubbFile.File>) => Promise<Array<KubbFile.ResolvedFile>>;
353
+ resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => KubbFile.OptionalPath;
468
354
  resolveName: (params: ResolveNameParams) => string;
469
355
  logger: Logger;
470
356
  /**
@@ -543,8 +429,8 @@ type Events = {
543
429
  };
544
430
  type GetFileProps<TOptions = object> = {
545
431
  name: string;
546
- mode?: Mode;
547
- extname: Extname;
432
+ mode?: KubbFile.Mode;
433
+ extname: KubbFile.Extname;
548
434
  pluginKey: Plugin['key'];
549
435
  options?: TOptions;
550
436
  };
@@ -563,10 +449,10 @@ declare class PluginManager {
563
449
  extname,
564
450
  pluginKey,
565
451
  options
566
- }: GetFileProps<TOptions>): File<{
452
+ }: GetFileProps<TOptions>): KubbFile.File<{
567
453
  pluginKey: Plugin['key'];
568
454
  }>;
569
- resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => OptionalPath;
455
+ resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => KubbFile.OptionalPath;
570
456
  resolveName: (params: ResolveNameParams) => string;
571
457
  /**
572
458
  * Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
@@ -663,15 +549,6 @@ type FileMetaBase = {
663
549
  pluginKey?: Plugin['key'];
664
550
  };
665
551
  //#endregion
666
- //#region ../plugin-oas/src/generators/createGenerator.d.ts
667
- type CoreGenerator<TOptions extends PluginFactoryOptions> = {
668
- name: string;
669
- type: 'core';
670
- operations: (props: OperationsProps<TOptions>) => Promise<File[]>;
671
- operation: (props: OperationProps<TOptions>) => Promise<File[]>;
672
- schema: (props: SchemaProps<TOptions>) => Promise<File[]>;
673
- };
674
- //#endregion
675
552
  //#region ../plugin-oas/src/types.d.ts
676
553
  type ResolvePathOptions = {
677
554
  pluginKey?: Plugin['key'];
@@ -693,7 +570,7 @@ type ResolvePathOptions = {
693
570
  type Ref = {
694
571
  propertyName: string;
695
572
  originalName: string;
696
- path: OptionalPath;
573
+ path: KubbFile.OptionalPath;
697
574
  pluginKey?: Plugin['key'];
698
575
  };
699
576
  type Refs = Record<string, Ref>;
@@ -773,7 +650,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
773
650
  * Current plugin
774
651
  */
775
652
  plugin: Plugin<TPluginOptions>;
776
- mode: Mode;
653
+ mode: KubbFile.Mode;
777
654
  };
778
655
  declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
779
656
  #private;
@@ -787,7 +664,7 @@ declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = P
787
664
  method: HttpMethod;
788
665
  operation: Operation$1;
789
666
  }>>;
790
- build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
667
+ build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
791
668
  }
792
669
  //#endregion
793
670
  //#region ../plugin-oas/src/SchemaMapper.d.ts
@@ -903,7 +780,7 @@ type SchemaKeywordMapper = {
903
780
  /**
904
781
  * Full qualified path.
905
782
  */
906
- path: OptionalPath;
783
+ path: KubbFile.OptionalPath;
907
784
  /**
908
785
  * When true `File.Import` will be used.
909
786
  * When false a reference will be used inside the current file.
@@ -1016,7 +893,7 @@ type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
1016
893
  * Current plugin
1017
894
  */
1018
895
  plugin: Plugin<TPluginOptions>;
1019
- mode: Mode;
896
+ mode: KubbFile.Mode;
1020
897
  include?: Array<'schemas' | 'responses' | 'requestBodies'>;
1021
898
  override: Array<Override<TOptions>> | undefined;
1022
899
  contentType?: contentType;
@@ -1058,35 +935,38 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
1058
935
  * optionally adds a union with null.
1059
936
  */
1060
937
  parse(props: SchemaProps$1): Schema[];
1061
- deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
1062
- find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
1063
938
  static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
1064
- static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
1065
939
  static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
1066
940
  static combineObjects(tree: Schema[] | undefined): Schema[];
1067
- build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
941
+ build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
1068
942
  }
1069
943
  //#endregion
944
+ //#region ../plugin-oas/src/generators/createGenerator.d.ts
945
+ type CoreGenerator<TOptions extends PluginFactoryOptions> = {
946
+ name: string;
947
+ type: 'core';
948
+ operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
949
+ operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
950
+ schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>;
951
+ };
952
+ //#endregion
1070
953
  //#region ../plugin-oas/src/generators/types.d.ts
1071
954
  type OperationsProps<TOptions extends PluginFactoryOptions> = {
1072
- /**
1073
- * @deprecated
1074
- */
1075
- instance: Omit<OperationGenerator<TOptions>, 'build'>;
1076
- options: TOptions['resolvedOptions'];
955
+ config: Config;
956
+ generator: Omit<OperationGenerator<TOptions>, 'build'>;
957
+ plugin: Plugin<TOptions>;
1077
958
  operations: Array<Operation$1>;
1078
959
  };
1079
960
  type OperationProps<TOptions extends PluginFactoryOptions> = {
1080
- /**
1081
- * @deprecated
1082
- */
1083
- instance: Omit<OperationGenerator<TOptions>, 'build'>;
1084
- options: TOptions['resolvedOptions'];
961
+ config: Config;
962
+ generator: Omit<OperationGenerator<TOptions>, 'build'>;
963
+ plugin: Plugin<TOptions>;
1085
964
  operation: Operation$1;
1086
965
  };
1087
966
  type SchemaProps<TOptions extends PluginFactoryOptions> = {
1088
- instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
1089
- options: TOptions['resolvedOptions'];
967
+ config: Config;
968
+ generator: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
969
+ plugin: Plugin<TOptions>;
1090
970
  schema: {
1091
971
  name: string;
1092
972
  tree: Array<Schema>;
@@ -1165,4 +1045,4 @@ type ResolvedOptions = {
1165
1045
  type PluginMsw = PluginFactoryOptions<'plugin-msw', Options$1, ResolvedOptions, never, ResolvePathOptions>;
1166
1046
  //#endregion
1167
1047
  export { UserPluginWithLifeCycle as i, PluginMsw as n, ReactGenerator as r, Options$1 as t };
1168
- //# sourceMappingURL=types-BXU1IBpt.d.cts.map
1048
+ //# sourceMappingURL=types-C9Jm40mM.d.cts.map
@@ -1,11 +1,12 @@
1
1
  import { a as contentType, i as SchemaObject$1, n as OasTypes, r as Operation$1, t as HttpMethod } from "./types-D0JuaurR.js";
2
2
  import { Fabric, FileManager } from "@kubb/react-fabric";
3
+ import { KubbNode } from "@kubb/react-fabric/types";
3
4
  import { OASDocument, SchemaObject, User } from "oas/types";
4
5
  import { Operation } from "oas/operation";
5
6
  import { OpenAPIV3 } from "openapi-types";
6
7
  import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
7
8
  import BaseOas from "oas";
8
- import { KubbNode } from "@kubb/react-fabric/types";
9
+ import { KubbFile } from "@kubb/fabric-core/types";
9
10
  import { ConsolaInstance, LogLevel } from "consola";
10
11
 
11
12
  //#region ../oas/src/Oas.d.ts
@@ -50,121 +51,6 @@ declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
50
51
  abstract build(...params: unknown[]): unknown;
51
52
  }
52
53
  //#endregion
53
- //#region ../core/src/fs/types.d.ts
54
- type BasePath<T extends string = string> = `${T}/`;
55
- type Import = {
56
- /**
57
- * Import name to be used
58
- * @example ["useState"]
59
- * @example "React"
60
- */
61
- name: string | Array<string | {
62
- propertyName: string;
63
- name?: string;
64
- }>;
65
- /**
66
- * Path for the import
67
- * @example '@kubb/core'
68
- */
69
- path: string;
70
- /**
71
- * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
72
- */
73
- isTypeOnly?: boolean;
74
- isNameSpace?: boolean;
75
- /**
76
- * When root is set it will get the path with relative getRelativePath(root, path).
77
- */
78
- root?: string;
79
- };
80
- type Source = {
81
- name?: string;
82
- value?: string;
83
- isTypeOnly?: boolean;
84
- /**
85
- * Has const or type 'export'
86
- * @default false
87
- */
88
- isExportable?: boolean;
89
- /**
90
- * When set, barrel generation will add this
91
- * @default false
92
- */
93
- isIndexable?: boolean;
94
- };
95
- type Export = {
96
- /**
97
- * Export name to be used.
98
- * @example ["useState"]
99
- * @example "React"
100
- */
101
- name?: string | Array<string>;
102
- /**
103
- * Path for the import.
104
- * @example '@kubb/core'
105
- */
106
- path: string;
107
- /**
108
- * Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
109
- */
110
- isTypeOnly?: boolean;
111
- /**
112
- * Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
113
- */
114
- asAlias?: boolean;
115
- };
116
- type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
117
- type Mode = 'single' | 'split';
118
- /**
119
- * Name to be used to dynamicly create the baseName(based on input.path)
120
- * Based on UNIX basename
121
- * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
122
- */
123
- type BaseName = `${string}.${string}`;
124
- /**
125
- * Path will be full qualified path to a specified file
126
- */
127
- type Path = string;
128
- type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
129
- type OptionalPath = Path | undefined | null;
130
- type File$1<TMeta extends object = object> = {
131
- /**
132
- * Name to be used to create the path
133
- * Based on UNIX basename, `${name}.extname`
134
- * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
135
- */
136
- baseName: BaseName;
137
- /**
138
- * Path will be full qualified path to a specified file
139
- */
140
- path: AdvancedPath<BaseName> | Path;
141
- sources: Array<Source>;
142
- imports?: Array<Import>;
143
- exports?: Array<Export>;
144
- /**
145
- * Use extra meta, this is getting used to generate the barrel/index files.
146
- */
147
- meta?: TMeta;
148
- banner?: string;
149
- footer?: string;
150
- };
151
- type ResolvedImport = Import;
152
- type ResolvedExport = Export;
153
- type ResolvedFile<TMeta extends object = object> = File$1<TMeta> & {
154
- /**
155
- * @default object-hash
156
- */
157
- id: string;
158
- /**
159
- * Contains the first part of the baseName, generated based on baseName
160
- * @link https://nodejs.org/api/path.html#pathformatpathobject
161
- */
162
- name: string;
163
- extname: Extname;
164
- imports: Array<ResolvedImport>;
165
- exports: Array<ResolvedExport>;
166
- };
167
- //#endregion
168
54
  //#region ../core/src/utils/EventEmitter.d.ts
169
55
  declare class EventEmitter<TEvents extends Record<string, any>> {
170
56
  #private;
@@ -288,7 +174,7 @@ type Config<TInput = Input> = {
288
174
  * Override the extension to the generated imports and exports, by default each plugin will add an extension
289
175
  * @default { '.ts': '.ts'}
290
176
  */
291
- extension?: Record<Extname, Extname | ''>;
177
+ extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
292
178
  /**
293
179
  * Specify how `index.ts` files should be created. You can also disable the generation of barrel files here. While each plugin has its own `barrelType` option, this setting controls the creation of the root barrel file, such as` src/gen/index.ts`.
294
180
  * @default 'named'
@@ -419,7 +305,7 @@ type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOption
419
305
  * @type hookFirst
420
306
  * @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
421
307
  */
422
- resolvePath?: (this: PluginContext<TOptions>, baseName: BaseName, mode?: Mode, options?: TOptions['resolvePathOptions']) => OptionalPath;
308
+ resolvePath?: (this: PluginContext<TOptions>, baseName: KubbFile.BaseName, mode?: KubbFile.Mode, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath;
423
309
  /**
424
310
  * Resolve to a name based on a string.
425
311
  * Useful when converting to PascalCase or camelCase.
@@ -437,8 +323,8 @@ type PluginLifecycleHooks = keyof PluginLifecycle;
437
323
  type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
438
324
  type ResolvePathParams<TOptions = object> = {
439
325
  pluginKey?: Plugin['key'];
440
- baseName: BaseName;
441
- mode?: Mode;
326
+ baseName: KubbFile.BaseName;
327
+ mode?: KubbFile.Mode;
442
328
  /**
443
329
  * Options to be passed to 'resolvePath' 3th parameter
444
330
  */
@@ -463,8 +349,8 @@ type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions>
463
349
  */
464
350
  fileManager: FileManager;
465
351
  pluginManager: PluginManager;
466
- addFile: (...file: Array<File$1>) => Promise<Array<ResolvedFile>>;
467
- resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => OptionalPath;
352
+ addFile: (...file: Array<KubbFile.File>) => Promise<Array<KubbFile.ResolvedFile>>;
353
+ resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => KubbFile.OptionalPath;
468
354
  resolveName: (params: ResolveNameParams) => string;
469
355
  logger: Logger;
470
356
  /**
@@ -543,8 +429,8 @@ type Events = {
543
429
  };
544
430
  type GetFileProps<TOptions = object> = {
545
431
  name: string;
546
- mode?: Mode;
547
- extname: Extname;
432
+ mode?: KubbFile.Mode;
433
+ extname: KubbFile.Extname;
548
434
  pluginKey: Plugin['key'];
549
435
  options?: TOptions;
550
436
  };
@@ -563,10 +449,10 @@ declare class PluginManager {
563
449
  extname,
564
450
  pluginKey,
565
451
  options
566
- }: GetFileProps<TOptions>): File$1<{
452
+ }: GetFileProps<TOptions>): KubbFile.File<{
567
453
  pluginKey: Plugin['key'];
568
454
  }>;
569
- resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => OptionalPath;
455
+ resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => KubbFile.OptionalPath;
570
456
  resolveName: (params: ResolveNameParams) => string;
571
457
  /**
572
458
  * Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
@@ -663,15 +549,6 @@ type FileMetaBase = {
663
549
  pluginKey?: Plugin['key'];
664
550
  };
665
551
  //#endregion
666
- //#region ../plugin-oas/src/generators/createGenerator.d.ts
667
- type CoreGenerator<TOptions extends PluginFactoryOptions> = {
668
- name: string;
669
- type: 'core';
670
- operations: (props: OperationsProps<TOptions>) => Promise<File$1[]>;
671
- operation: (props: OperationProps<TOptions>) => Promise<File$1[]>;
672
- schema: (props: SchemaProps<TOptions>) => Promise<File$1[]>;
673
- };
674
- //#endregion
675
552
  //#region ../plugin-oas/src/types.d.ts
676
553
  type ResolvePathOptions = {
677
554
  pluginKey?: Plugin['key'];
@@ -693,7 +570,7 @@ type ResolvePathOptions = {
693
570
  type Ref = {
694
571
  propertyName: string;
695
572
  originalName: string;
696
- path: OptionalPath;
573
+ path: KubbFile.OptionalPath;
697
574
  pluginKey?: Plugin['key'];
698
575
  };
699
576
  type Refs = Record<string, Ref>;
@@ -773,7 +650,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
773
650
  * Current plugin
774
651
  */
775
652
  plugin: Plugin<TPluginOptions>;
776
- mode: Mode;
653
+ mode: KubbFile.Mode;
777
654
  };
778
655
  declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
779
656
  #private;
@@ -787,7 +664,7 @@ declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = P
787
664
  method: HttpMethod;
788
665
  operation: Operation$1;
789
666
  }>>;
790
- build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File$1<TFileMeta>>>;
667
+ build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
791
668
  }
792
669
  //#endregion
793
670
  //#region ../plugin-oas/src/SchemaMapper.d.ts
@@ -903,7 +780,7 @@ type SchemaKeywordMapper = {
903
780
  /**
904
781
  * Full qualified path.
905
782
  */
906
- path: OptionalPath;
783
+ path: KubbFile.OptionalPath;
907
784
  /**
908
785
  * When true `File.Import` will be used.
909
786
  * When false a reference will be used inside the current file.
@@ -1016,7 +893,7 @@ type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
1016
893
  * Current plugin
1017
894
  */
1018
895
  plugin: Plugin<TPluginOptions>;
1019
- mode: Mode;
896
+ mode: KubbFile.Mode;
1020
897
  include?: Array<'schemas' | 'responses' | 'requestBodies'>;
1021
898
  override: Array<Override<TOptions>> | undefined;
1022
899
  contentType?: contentType;
@@ -1058,35 +935,38 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
1058
935
  * optionally adds a union with null.
1059
936
  */
1060
937
  parse(props: SchemaProps$1): Schema[];
1061
- deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
1062
- find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
1063
938
  static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
1064
- static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
1065
939
  static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
1066
940
  static combineObjects(tree: Schema[] | undefined): Schema[];
1067
- build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File$1<TFileMeta>>>;
941
+ build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
1068
942
  }
1069
943
  //#endregion
944
+ //#region ../plugin-oas/src/generators/createGenerator.d.ts
945
+ type CoreGenerator<TOptions extends PluginFactoryOptions> = {
946
+ name: string;
947
+ type: 'core';
948
+ operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
949
+ operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
950
+ schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>;
951
+ };
952
+ //#endregion
1070
953
  //#region ../plugin-oas/src/generators/types.d.ts
1071
954
  type OperationsProps<TOptions extends PluginFactoryOptions> = {
1072
- /**
1073
- * @deprecated
1074
- */
1075
- instance: Omit<OperationGenerator<TOptions>, 'build'>;
1076
- options: TOptions['resolvedOptions'];
955
+ config: Config;
956
+ generator: Omit<OperationGenerator<TOptions>, 'build'>;
957
+ plugin: Plugin<TOptions>;
1077
958
  operations: Array<Operation$1>;
1078
959
  };
1079
960
  type OperationProps<TOptions extends PluginFactoryOptions> = {
1080
- /**
1081
- * @deprecated
1082
- */
1083
- instance: Omit<OperationGenerator<TOptions>, 'build'>;
1084
- options: TOptions['resolvedOptions'];
961
+ config: Config;
962
+ generator: Omit<OperationGenerator<TOptions>, 'build'>;
963
+ plugin: Plugin<TOptions>;
1085
964
  operation: Operation$1;
1086
965
  };
1087
966
  type SchemaProps<TOptions extends PluginFactoryOptions> = {
1088
- instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
1089
- options: TOptions['resolvedOptions'];
967
+ config: Config;
968
+ generator: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
969
+ plugin: Plugin<TOptions>;
1090
970
  schema: {
1091
971
  name: string;
1092
972
  tree: Array<Schema>;
@@ -1165,4 +1045,4 @@ type ResolvedOptions = {
1165
1045
  type PluginMsw = PluginFactoryOptions<'plugin-msw', Options$1, ResolvedOptions, never, ResolvePathOptions>;
1166
1046
  //#endregion
1167
1047
  export { UserPluginWithLifeCycle as i, PluginMsw as n, ReactGenerator as r, Options$1 as t };
1168
- //# sourceMappingURL=types-Bd9L1DM6.d.ts.map
1048
+ //# sourceMappingURL=types-DSnvepCr.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-msw",
3
- "version": "4.4.0",
3
+ "version": "4.5.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",
@@ -65,20 +65,24 @@
65
65
  "!/**/**.test.**",
66
66
  "!/**/__tests__/**"
67
67
  ],
68
+ "size-limit": [
69
+ {
70
+ "path": "./dist/*.js",
71
+ "limit": "510 KiB",
72
+ "gzip": true
73
+ }
74
+ ],
68
75
  "dependencies": {
69
- "@kubb/react-fabric": "0.2.8",
70
- "@kubb/core": "4.4.0",
71
- "@kubb/oas": "4.4.0",
72
- "@kubb/plugin-faker": "4.4.0",
73
- "@kubb/plugin-oas": "4.4.0",
74
- "@kubb/plugin-ts": "4.4.0"
75
- },
76
- "devDependencies": {
77
- "tsdown": "^0.15.11",
78
- "typescript": "^5.9.3"
76
+ "@kubb/react-fabric": "0.2.14",
77
+ "@kubb/core": "4.5.0",
78
+ "@kubb/oas": "4.5.0",
79
+ "@kubb/plugin-faker": "4.5.0",
80
+ "@kubb/plugin-oas": "4.5.0",
81
+ "@kubb/plugin-ts": "4.5.0"
79
82
  },
83
+ "devDependencies": {},
80
84
  "peerDependencies": {
81
- "@kubb/react-fabric": "0.2.8"
85
+ "@kubb/react-fabric": "0.2.14"
82
86
  },
83
87
  "engines": {
84
88
  "node": ">=20"
@@ -88,7 +92,7 @@
88
92
  "registry": "https://registry.npmjs.org/"
89
93
  },
90
94
  "scripts": {
91
- "build": "tsdown",
95
+ "build": "tsdown && size-limit",
92
96
  "clean": "npx rimraf ./dist",
93
97
  "lint": "bun biome lint .",
94
98
  "lint:fix": "bun biome lint --fix --unsafe .",