@kubb/plugin-solid-query 4.3.1 → 4.4.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.
Files changed (38) hide show
  1. package/dist/chunk-DMmIE7y6.js +28 -0
  2. package/dist/{components-D0g890Z2.cjs → components-CHqaXKs-.cjs} +29 -29
  3. package/dist/components-CHqaXKs-.cjs.map +1 -0
  4. package/dist/{components-Coq1fmcl.js → components-Cp1BuWfr.js} +3 -3
  5. package/dist/components-Cp1BuWfr.js.map +1 -0
  6. package/dist/components.cjs +1 -1
  7. package/dist/components.d.cts +12 -15
  8. package/dist/components.d.ts +12 -15
  9. package/dist/components.js +1 -1
  10. package/dist/{generators-D-_RURdc.js → generators-DnKjkxgk.js} +4 -4
  11. package/dist/generators-DnKjkxgk.js.map +1 -0
  12. package/dist/{generators-DSsFHoN2.cjs → generators-U3zy_ocI.cjs} +33 -33
  13. package/dist/generators-U3zy_ocI.cjs.map +1 -0
  14. package/dist/generators.cjs +2 -2
  15. package/dist/generators.d.cts +3 -3
  16. package/dist/generators.d.ts +3 -3
  17. package/dist/generators.js +2 -2
  18. package/dist/index.cjs +3 -2
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +3 -2
  23. package/dist/index.js.map +1 -1
  24. package/dist/{types-MNYQehp6.d.ts → types-Cya9QjJw.d.ts} +230 -325
  25. package/dist/{types-DjxPjdTZ.d.cts → types-DGoK3Yh1.d.cts} +230 -325
  26. package/package.json +18 -14
  27. package/src/components/Mutation.tsx +13 -3
  28. package/src/components/MutationKey.tsx +3 -2
  29. package/src/components/Query.tsx +3 -2
  30. package/src/components/QueryKey.tsx +3 -2
  31. package/src/components/QueryOptions.tsx +3 -2
  32. package/src/generators/mutationGenerator.tsx +1 -1
  33. package/src/generators/queryGenerator.tsx +1 -1
  34. package/src/plugin.ts +1 -0
  35. package/dist/components-Coq1fmcl.js.map +0 -1
  36. package/dist/components-D0g890Z2.cjs.map +0 -1
  37. package/dist/generators-D-_RURdc.js.map +0 -1
  38. package/dist/generators-DSsFHoN2.cjs.map +0 -1
@@ -4,8 +4,10 @@ import { Operation, Operation as Operation$1 } from "oas/operation";
4
4
  import { OpenAPIV3 } from "openapi-types";
5
5
  import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
6
6
  import BaseOas from "oas";
7
+ import { KubbFile } from "@kubb/fabric-core/types";
8
+ import { Fabric, FileManager } from "@kubb/react-fabric";
7
9
  import { ConsolaInstance, LogLevel } from "consola";
8
- import { FileManager } from "@kubb/fabric-core";
10
+ import { KubbNode } from "@kubb/react-fabric/types";
9
11
 
10
12
  //#region ../oas/src/types.d.ts
11
13
  type contentType = 'application/json' | (string & {});
@@ -47,130 +49,15 @@ declare class Oas<const TOAS = unknown> extends BaseOas {
47
49
  * Abstract class that contains the building blocks for plugins to create their own Generator
48
50
  * @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137
49
51
  */
50
- declare abstract class BaseGenerator<TOptions$1 = unknown, TContext = unknown> {
52
+ declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
51
53
  #private;
52
- constructor(options?: TOptions$1, context?: TContext);
53
- get options(): TOptions$1;
54
+ constructor(options?: TOptions, context?: TContext);
55
+ get options(): TOptions;
54
56
  get context(): TContext;
55
- set options(options: TOptions$1);
57
+ set options(options: TOptions);
56
58
  abstract build(...params: unknown[]): unknown;
57
59
  }
58
60
  //#endregion
59
- //#region ../core/src/fs/types.d.ts
60
- type BasePath<T$1 extends string = string> = `${T$1}/`;
61
- type Import = {
62
- /**
63
- * Import name to be used
64
- * @example ["useState"]
65
- * @example "React"
66
- */
67
- name: string | Array<string | {
68
- propertyName: string;
69
- name?: string;
70
- }>;
71
- /**
72
- * Path for the import
73
- * @example '@kubb/core'
74
- */
75
- path: string;
76
- /**
77
- * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
78
- */
79
- isTypeOnly?: boolean;
80
- isNameSpace?: boolean;
81
- /**
82
- * When root is set it will get the path with relative getRelativePath(root, path).
83
- */
84
- root?: string;
85
- };
86
- type Source = {
87
- name?: string;
88
- value?: string;
89
- isTypeOnly?: boolean;
90
- /**
91
- * Has const or type 'export'
92
- * @default false
93
- */
94
- isExportable?: boolean;
95
- /**
96
- * When set, barrel generation will add this
97
- * @default false
98
- */
99
- isIndexable?: boolean;
100
- };
101
- type Export = {
102
- /**
103
- * Export name to be used.
104
- * @example ["useState"]
105
- * @example "React"
106
- */
107
- name?: string | Array<string>;
108
- /**
109
- * Path for the import.
110
- * @example '@kubb/core'
111
- */
112
- path: string;
113
- /**
114
- * Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
115
- */
116
- isTypeOnly?: boolean;
117
- /**
118
- * Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
119
- */
120
- asAlias?: boolean;
121
- };
122
- type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
123
- type Mode = 'single' | 'split';
124
- /**
125
- * Name to be used to dynamicly create the baseName(based on input.path)
126
- * Based on UNIX basename
127
- * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
128
- */
129
- type BaseName = `${string}.${string}`;
130
- /**
131
- * Path will be full qualified path to a specified file
132
- */
133
- type Path = string;
134
- type AdvancedPath<T$1 extends BaseName = BaseName> = `${BasePath}${T$1}`;
135
- type OptionalPath = Path | undefined | null;
136
- type File<TMeta extends object = object> = {
137
- /**
138
- * Name to be used to create the path
139
- * Based on UNIX basename, `${name}.extname`
140
- * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
141
- */
142
- baseName: BaseName;
143
- /**
144
- * Path will be full qualified path to a specified file
145
- */
146
- path: AdvancedPath<BaseName> | Path;
147
- sources: Array<Source>;
148
- imports?: Array<Import>;
149
- exports?: Array<Export>;
150
- /**
151
- * Use extra meta, this is getting used to generate the barrel/index files.
152
- */
153
- meta?: TMeta;
154
- banner?: string;
155
- footer?: string;
156
- };
157
- type ResolvedImport = Import;
158
- type ResolvedExport = Export;
159
- type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
160
- /**
161
- * @default object-hash
162
- */
163
- id: string;
164
- /**
165
- * Contains the first part of the baseName, generated based on baseName
166
- * @link https://nodejs.org/api/path.html#pathformatpathobject
167
- */
168
- name: string;
169
- extname: Extname;
170
- imports: Array<ResolvedImport>;
171
- exports: Array<ResolvedExport>;
172
- };
173
- //#endregion
174
61
  //#region ../core/src/utils/EventEmitter.d.ts
175
62
  declare class EventEmitter<TEvents extends Record<string, any>> {
176
63
  #private;
@@ -220,7 +107,7 @@ type Logger = {
220
107
  };
221
108
  //#endregion
222
109
  //#region ../core/src/utils/types.d.ts
223
- type PossiblePromise<T$1> = Promise<T$1> | T$1;
110
+ type PossiblePromise<T> = Promise<T> | T;
224
111
  //#endregion
225
112
  //#region ../core/src/types.d.ts
226
113
  type InputPath = {
@@ -294,7 +181,7 @@ type Config<TInput = Input> = {
294
181
  * Override the extension to the generated imports and exports, by default each plugin will add an extension
295
182
  * @default { '.ts': '.ts'}
296
183
  */
297
- extension?: Record<Extname, Extname | ''>;
184
+ extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
298
185
  /**
299
186
  * 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`.
300
187
  * @default 'named'
@@ -333,11 +220,11 @@ TName extends string = string,
333
220
  /**
334
221
  * Options of the plugin.
335
222
  */
336
- TOptions$1 extends object = object,
223
+ TOptions extends object = object,
337
224
  /**
338
225
  * Options of the plugin that can be used later on, see `options` inside your plugin config.
339
226
  */
340
- TResolvedOptions extends object = TOptions$1,
227
+ TResolvedOptions extends object = TOptions,
341
228
  /**
342
229
  * Context that you want to expose to other plugins.
343
230
  */
@@ -351,23 +238,23 @@ TResolvePathOptions extends object = object> = {
351
238
  * Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
352
239
  */
353
240
  key: PluginKey<TName | string>;
354
- options: TOptions$1;
241
+ options: TOptions;
355
242
  resolvedOptions: TResolvedOptions;
356
243
  context: TContext;
357
244
  resolvePathOptions: TResolvePathOptions;
358
245
  };
359
246
  type PluginKey<TName> = [name: TName, identifier?: string | number];
360
- type UserPlugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
247
+ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
361
248
  /**
362
249
  * Unique name used for the plugin
363
250
  * The name of the plugin follows the format scope:foo-bar or foo-bar, adding scope: can avoid naming conflicts with other plugins.
364
251
  * @example @kubb/typescript
365
252
  */
366
- name: TOptions$1['name'];
253
+ name: TOptions['name'];
367
254
  /**
368
255
  * Options set for a specific plugin(see kubb.config.js), passthrough of options.
369
256
  */
370
- options: TOptions$1['resolvedOptions'];
257
+ options: TOptions['resolvedOptions'];
371
258
  /**
372
259
  * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
373
260
  * Can be used to validate dependent plugins.
@@ -377,23 +264,23 @@ type UserPlugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions>
377
264
  * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin will be executed before these plugins.
378
265
  */
379
266
  post?: Array<string>;
380
- } & (TOptions$1['context'] extends never ? {
267
+ } & (TOptions['context'] extends never ? {
381
268
  context?: never;
382
269
  } : {
383
- context: (this: TOptions$1['name'] extends 'core' ? null : Omit<PluginContext<TOptions$1>, 'addFile'>) => TOptions$1['context'];
270
+ context: (this: TOptions['name'] extends 'core' ? null : Omit<PluginContext<TOptions>, 'addFile'>) => TOptions['context'];
384
271
  });
385
- type UserPluginWithLifeCycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions$1> & PluginLifecycle<TOptions$1>;
386
- type Plugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
272
+ type UserPluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions> & PluginLifecycle<TOptions>;
273
+ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
387
274
  /**
388
275
  * Unique name used for the plugin
389
276
  * @example @kubb/typescript
390
277
  */
391
- name: TOptions$1['name'];
278
+ name: TOptions['name'];
392
279
  /**
393
280
  * Internal key used when a developer uses more than one of the same plugin
394
281
  * @private
395
282
  */
396
- key: TOptions$1['key'];
283
+ key: TOptions['key'];
397
284
  /**
398
285
  * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
399
286
  * Can be used to validate dependent plugins.
@@ -406,49 +293,49 @@ type Plugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
406
293
  /**
407
294
  * Options set for a specific plugin(see kubb.config.js), passthrough of options.
408
295
  */
409
- options: TOptions$1['resolvedOptions'];
410
- } & (TOptions$1['context'] extends never ? {
296
+ options: TOptions['resolvedOptions'];
297
+ } & (TOptions['context'] extends never ? {
411
298
  context?: never;
412
299
  } : {
413
- context: TOptions$1['context'];
300
+ context: TOptions['context'];
414
301
  });
415
- type PluginWithLifeCycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions$1> & PluginLifecycle<TOptions$1>;
416
- type PluginLifecycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
302
+ type PluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions> & PluginLifecycle<TOptions>;
303
+ type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
417
304
  /**
418
305
  * Start of the lifecycle of a plugin.
419
306
  * @type hookParallel
420
307
  */
421
- buildStart?: (this: PluginContext<TOptions$1>, Config: Config) => PossiblePromise<void>;
308
+ buildStart?: (this: PluginContext<TOptions>, Config: Config) => PossiblePromise<void>;
422
309
  /**
423
310
  * Resolve to a Path based on a baseName(example: `./Pet.ts`) and directory(example: `./models`).
424
311
  * Options can als be included.
425
312
  * @type hookFirst
426
313
  * @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
427
314
  */
428
- resolvePath?: (this: PluginContext<TOptions$1>, baseName: BaseName, mode?: Mode, options?: TOptions$1['resolvePathOptions']) => OptionalPath;
315
+ resolvePath?: (this: PluginContext<TOptions>, baseName: KubbFile.BaseName, mode?: KubbFile.Mode, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath;
429
316
  /**
430
317
  * Resolve to a name based on a string.
431
318
  * Useful when converting to PascalCase or camelCase.
432
319
  * @type hookFirst
433
320
  * @example ('pet') => 'Pet'
434
321
  */
435
- resolveName?: (this: PluginContext<TOptions$1>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
322
+ resolveName?: (this: PluginContext<TOptions>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
436
323
  /**
437
324
  * End of the plugin lifecycle.
438
325
  * @type hookParallel
439
326
  */
440
- buildEnd?: (this: PluginContext<TOptions$1>) => PossiblePromise<void>;
327
+ buildEnd?: (this: PluginContext<TOptions>) => PossiblePromise<void>;
441
328
  };
442
329
  type PluginLifecycleHooks = keyof PluginLifecycle;
443
- type PluginParameter<H$1 extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H$1]>;
444
- type ResolvePathParams<TOptions$1 = object> = {
330
+ type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
331
+ type ResolvePathParams<TOptions = object> = {
445
332
  pluginKey?: Plugin['key'];
446
- baseName: BaseName;
447
- mode?: Mode;
333
+ baseName: KubbFile.BaseName;
334
+ mode?: KubbFile.Mode;
448
335
  /**
449
336
  * Options to be passed to 'resolvePath' 3th parameter
450
337
  */
451
- options?: TOptions$1;
338
+ options?: TOptions;
452
339
  };
453
340
  type ResolveNameParams = {
454
341
  name: string;
@@ -461,15 +348,16 @@ type ResolveNameParams = {
461
348
  */
462
349
  type?: 'file' | 'function' | 'type' | 'const';
463
350
  };
464
- type PluginContext<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
351
+ type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
352
+ fabric: Fabric;
465
353
  config: Config;
466
354
  /**
467
355
  * @deprecated
468
356
  */
469
357
  fileManager: FileManager;
470
358
  pluginManager: PluginManager;
471
- addFile: (...file: Array<File>) => Promise<Array<ResolvedFile>>;
472
- resolvePath: (params: ResolvePathParams<TOptions$1['resolvePathOptions']>) => OptionalPath;
359
+ addFile: (...file: Array<KubbFile.File>) => Promise<Array<KubbFile.ResolvedFile>>;
360
+ resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => KubbFile.OptionalPath;
473
361
  resolveName: (params: ResolveNameParams) => string;
474
362
  logger: Logger;
475
363
  /**
@@ -479,12 +367,12 @@ type PluginContext<TOptions$1 extends PluginFactoryOptions = PluginFactoryOption
479
367
  /**
480
368
  * Current plugin
481
369
  */
482
- plugin: Plugin<TOptions$1>;
370
+ plugin: Plugin<TOptions>;
483
371
  };
484
372
  /**
485
373
  * Specify the export location for the files and define the behavior of the output
486
374
  */
487
- type Output<TOptions$1> = {
375
+ type Output<TOptions> = {
488
376
  /**
489
377
  * Path to the output folder or file that will contain the generated code
490
378
  */
@@ -497,11 +385,11 @@ type Output<TOptions$1> = {
497
385
  /**
498
386
  * Add a banner text in the beginning of every file
499
387
  */
500
- banner?: string | ((options: TOptions$1) => string);
388
+ banner?: string | ((options: TOptions) => string);
501
389
  /**
502
390
  * Add a footer text in the beginning of every file
503
391
  */
504
- footer?: string | ((options: TOptions$1) => string);
392
+ footer?: string | ((options: TOptions) => string);
505
393
  };
506
394
  type GroupContext = {
507
395
  group: string;
@@ -520,20 +408,21 @@ type Group = {
520
408
  //#region ../core/src/PluginManager.d.ts
521
409
  type RequiredPluginLifecycle = Required<PluginLifecycle>;
522
410
  type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
523
- type Executer<H$1 extends PluginLifecycleHooks = PluginLifecycleHooks> = {
411
+ type Executer<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
524
412
  message: string;
525
413
  strategy: Strategy;
526
- hookName: H$1;
414
+ hookName: H;
527
415
  plugin: Plugin;
528
416
  parameters?: unknown[] | undefined;
529
417
  output?: unknown;
530
418
  };
531
- type ParseResult<H$1 extends PluginLifecycleHooks> = RequiredPluginLifecycle[H$1];
532
- type SafeParseResult<H$1 extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H$1>>> = {
419
+ type ParseResult<H extends PluginLifecycleHooks> = RequiredPluginLifecycle[H];
420
+ type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H>>> = {
533
421
  result: Result;
534
422
  plugin: Plugin;
535
423
  };
536
424
  type Options$3 = {
425
+ fabric: Fabric;
537
426
  logger: Logger;
538
427
  /**
539
428
  * @default Number.POSITIVE_INFINITY
@@ -545,20 +434,16 @@ type Events = {
545
434
  executed: [executer: Executer];
546
435
  error: [error: Error];
547
436
  };
548
- type GetFileProps<TOptions$1 = object> = {
437
+ type GetFileProps<TOptions = object> = {
549
438
  name: string;
550
- mode?: Mode;
551
- extname: Extname;
439
+ mode?: KubbFile.Mode;
440
+ extname: KubbFile.Extname;
552
441
  pluginKey: Plugin['key'];
553
- options?: TOptions$1;
442
+ options?: TOptions;
554
443
  };
555
444
  declare class PluginManager {
556
445
  #private;
557
446
  readonly plugins: Set<Plugin<PluginFactoryOptions<string, object, object, any, object>>>;
558
- /**
559
- * @deprecated do not use from pluginManager
560
- */
561
- readonly fileManager: FileManager;
562
447
  readonly events: EventEmitter<Events>;
563
448
  readonly config: Config;
564
449
  readonly executed: Array<Executer>;
@@ -571,10 +456,10 @@ declare class PluginManager {
571
456
  extname,
572
457
  pluginKey,
573
458
  options
574
- }: GetFileProps<TOptions>): File<{
459
+ }: GetFileProps<TOptions>): KubbFile.File<{
575
460
  pluginKey: Plugin['key'];
576
461
  }>;
577
- resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => OptionalPath;
462
+ resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => KubbFile.OptionalPath;
578
463
  resolveName: (params: ResolveNameParams) => string;
579
464
  /**
580
465
  * Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
@@ -671,6 +556,170 @@ type FileMetaBase = {
671
556
  pluginKey?: Plugin['key'];
672
557
  };
673
558
  //#endregion
559
+ //#region ../plugin-oas/src/generators/createReactGenerator.d.ts
560
+ type ReactGenerator<TOptions extends PluginFactoryOptions> = {
561
+ name: string;
562
+ type: 'react';
563
+ Operations: (props: OperationsProps<TOptions>) => KubbNode;
564
+ Operation: (props: OperationProps<TOptions>) => KubbNode;
565
+ Schema: (props: SchemaProps$1<TOptions>) => KubbNode;
566
+ };
567
+ //#endregion
568
+ //#region ../plugin-oas/src/generators/types.d.ts
569
+ type OperationsProps<TOptions extends PluginFactoryOptions> = {
570
+ /**
571
+ * @deprecated
572
+ */
573
+ instance: Omit<OperationGenerator<TOptions>, 'build'>;
574
+ options: TOptions['resolvedOptions'];
575
+ operations: Array<Operation$1>;
576
+ };
577
+ type OperationProps<TOptions extends PluginFactoryOptions> = {
578
+ /**
579
+ * @deprecated
580
+ */
581
+ instance: Omit<OperationGenerator<TOptions>, 'build'>;
582
+ options: TOptions['resolvedOptions'];
583
+ operation: Operation$1;
584
+ };
585
+ type SchemaProps$1<TOptions extends PluginFactoryOptions> = {
586
+ instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
587
+ options: TOptions['resolvedOptions'];
588
+ schema: {
589
+ name: string;
590
+ tree: Array<Schema>;
591
+ value: SchemaObject$1;
592
+ };
593
+ };
594
+ type Generator<TOptions extends PluginFactoryOptions> = CoreGenerator<TOptions> | ReactGenerator<TOptions>;
595
+ //#endregion
596
+ //#region ../plugin-oas/src/generators/createGenerator.d.ts
597
+ type CoreGenerator<TOptions extends PluginFactoryOptions> = {
598
+ name: string;
599
+ type: 'core';
600
+ operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
601
+ operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
602
+ schema: (props: SchemaProps$1<TOptions>) => Promise<KubbFile.File[]>;
603
+ };
604
+ //#endregion
605
+ //#region ../plugin-oas/src/types.d.ts
606
+ type ResolvePathOptions = {
607
+ pluginKey?: Plugin['key'];
608
+ group?: {
609
+ tag?: string;
610
+ path?: string;
611
+ };
612
+ type?: ResolveNameParams['type'];
613
+ };
614
+ /**
615
+ * `propertyName` is the ref name + resolved with the nameResolver
616
+ * @example import { Pet } from './Pet'
617
+ *
618
+ * `originalName` is the original name used(in PascalCase), only used to remove duplicates
619
+ *
620
+ * `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
621
+ * @example import a type(plugin-ts) for a mock file(swagger-faker)
622
+ */
623
+ type Ref = {
624
+ propertyName: string;
625
+ originalName: string;
626
+ path: KubbFile.OptionalPath;
627
+ pluginKey?: Plugin['key'];
628
+ };
629
+ type Refs = Record<string, Ref>;
630
+ type OperationSchema = {
631
+ /**
632
+ * Converted name, contains already `PathParams`, `QueryParams`, ...
633
+ */
634
+ name: string;
635
+ schema: SchemaObject$1;
636
+ operation?: Operation$1;
637
+ /**
638
+ * OperationName in PascalCase, only being used in OperationGenerator
639
+ */
640
+ operationName: string;
641
+ description?: string;
642
+ statusCode?: number;
643
+ keys?: string[];
644
+ keysToOmit?: string[];
645
+ withData?: boolean;
646
+ };
647
+ type OperationSchemas = {
648
+ pathParams?: OperationSchema & {
649
+ keysToOmit?: never;
650
+ };
651
+ queryParams?: OperationSchema & {
652
+ keysToOmit?: never;
653
+ };
654
+ headerParams?: OperationSchema & {
655
+ keysToOmit?: never;
656
+ };
657
+ request?: OperationSchema;
658
+ response: OperationSchema;
659
+ responses: Array<OperationSchema>;
660
+ statusCodes?: Array<OperationSchema>;
661
+ errors?: Array<OperationSchema>;
662
+ };
663
+ type ByTag = {
664
+ type: 'tag';
665
+ pattern: string | RegExp;
666
+ };
667
+ type ByOperationId = {
668
+ type: 'operationId';
669
+ pattern: string | RegExp;
670
+ };
671
+ type ByPath = {
672
+ type: 'path';
673
+ pattern: string | RegExp;
674
+ };
675
+ type ByMethod = {
676
+ type: 'method';
677
+ pattern: HttpMethod | RegExp;
678
+ };
679
+ type BySchemaName = {
680
+ type: 'schemaName';
681
+ pattern: string | RegExp;
682
+ };
683
+ type ByContentType = {
684
+ type: 'contentType';
685
+ pattern: string | RegExp;
686
+ };
687
+ type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
688
+ type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
689
+ type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
690
+ options: Partial<TOptions>;
691
+ };
692
+ //#endregion
693
+ //#region ../plugin-oas/src/OperationGenerator.d.ts
694
+ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
695
+ fabric: Fabric;
696
+ oas: Oas;
697
+ exclude: Array<Exclude$1> | undefined;
698
+ include: Array<Include> | undefined;
699
+ override: Array<Override<TOptions>> | undefined;
700
+ contentType: contentType | undefined;
701
+ pluginManager: PluginManager;
702
+ /**
703
+ * Current plugin
704
+ */
705
+ plugin: Plugin<TPluginOptions>;
706
+ mode: KubbFile.Mode;
707
+ };
708
+ declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
709
+ #private;
710
+ getSchemas(operation: Operation$1, {
711
+ resolveName
712
+ }?: {
713
+ resolveName?: (name: string) => string;
714
+ }): OperationSchemas;
715
+ getOperations(): Promise<Array<{
716
+ path: string;
717
+ method: HttpMethod;
718
+ operation: Operation$1;
719
+ }>>;
720
+ build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
721
+ }
722
+ //#endregion
674
723
  //#region ../plugin-oas/src/SchemaMapper.d.ts
675
724
  type SchemaKeywordMapper = {
676
725
  object: {
@@ -784,7 +833,7 @@ type SchemaKeywordMapper = {
784
833
  /**
785
834
  * Full qualified path.
786
835
  */
787
- path: OptionalPath;
836
+ path: KubbFile.OptionalPath;
788
837
  /**
789
838
  * When true `File.Import` will be used.
790
839
  * When false a reference will be used inside the current file.
@@ -888,105 +937,18 @@ type Schema = {
888
937
  keyword: string;
889
938
  } | SchemaKeywordMapper[keyof SchemaKeywordMapper];
890
939
  //#endregion
891
- //#region ../plugin-oas/src/types.d.ts
892
- type ResolvePathOptions = {
893
- pluginKey?: Plugin['key'];
894
- group?: {
895
- tag?: string;
896
- path?: string;
897
- };
898
- type?: ResolveNameParams['type'];
899
- };
900
- /**
901
- * `propertyName` is the ref name + resolved with the nameResolver
902
- * @example import { Pet } from './Pet'
903
- *
904
- * `originalName` is the original name used(in PascalCase), only used to remove duplicates
905
- *
906
- * `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
907
- * @example import a type(plugin-ts) for a mock file(swagger-faker)
908
- */
909
- type Ref = {
910
- propertyName: string;
911
- originalName: string;
912
- path: OptionalPath;
913
- pluginKey?: Plugin['key'];
914
- };
915
- type Refs = Record<string, Ref>;
916
- type OperationSchema = {
917
- /**
918
- * Converted name, contains already `PathParams`, `QueryParams`, ...
919
- */
920
- name: string;
921
- schema: SchemaObject$1;
922
- operation?: Operation$1;
923
- /**
924
- * OperationName in PascalCase, only being used in OperationGenerator
925
- */
926
- operationName: string;
927
- description?: string;
928
- statusCode?: number;
929
- keys?: string[];
930
- keysToOmit?: string[];
931
- withData?: boolean;
932
- };
933
- type OperationSchemas = {
934
- pathParams?: OperationSchema & {
935
- keysToOmit?: never;
936
- };
937
- queryParams?: OperationSchema & {
938
- keysToOmit?: never;
939
- };
940
- headerParams?: OperationSchema & {
941
- keysToOmit?: never;
942
- };
943
- request?: OperationSchema;
944
- response: OperationSchema;
945
- responses: Array<OperationSchema>;
946
- statusCodes?: Array<OperationSchema>;
947
- errors?: Array<OperationSchema>;
948
- };
949
- type ByTag = {
950
- type: 'tag';
951
- pattern: string | RegExp;
952
- };
953
- type ByOperationId = {
954
- type: 'operationId';
955
- pattern: string | RegExp;
956
- };
957
- type ByPath = {
958
- type: 'path';
959
- pattern: string | RegExp;
960
- };
961
- type ByMethod = {
962
- type: 'method';
963
- pattern: HttpMethod | RegExp;
964
- };
965
- type BySchemaName = {
966
- type: 'schemaName';
967
- pattern: string | RegExp;
968
- };
969
- type ByContentType = {
970
- type: 'contentType';
971
- pattern: string | RegExp;
972
- };
973
- type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
974
- type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
975
- type Override<TOptions$1> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
976
- options: Partial<TOptions$1>;
977
- };
978
- //#endregion
979
940
  //#region ../plugin-oas/src/SchemaGenerator.d.ts
980
- type Context$1<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
941
+ type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
942
+ fabric: Fabric;
981
943
  oas: Oas;
982
944
  pluginManager: PluginManager;
983
945
  /**
984
946
  * Current plugin
985
947
  */
986
948
  plugin: Plugin<TPluginOptions>;
987
- mode: Mode;
949
+ mode: KubbFile.Mode;
988
950
  include?: Array<'schemas' | 'responses' | 'requestBodies'>;
989
- override: Array<Override<TOptions$1>> | undefined;
951
+ override: Array<Override<TOptions>> | undefined;
990
952
  contentType?: contentType;
991
953
  output?: string;
992
954
  };
@@ -1009,15 +971,15 @@ type SchemaGeneratorOptions = {
1009
971
  * TODO TODO add docs
1010
972
  * @beta
1011
973
  */
1012
- schema?: (schemaProps: SchemaProps$1, defaultSchemas: Schema[]) => Schema[] | undefined;
974
+ schema?: (schemaProps: SchemaProps, defaultSchemas: Schema[]) => Schema[] | undefined;
1013
975
  };
1014
976
  };
1015
- type SchemaProps$1 = {
977
+ type SchemaProps = {
1016
978
  schemaObject?: SchemaObject$1;
1017
979
  name?: string;
1018
980
  parentName?: string;
1019
981
  };
1020
- declare class SchemaGenerator<TOptions$1 extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions$1, Context$1<TOptions$1, TPluginOptions>> {
982
+ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context<TOptions, TPluginOptions>> {
1021
983
  #private;
1022
984
  refs: Refs;
1023
985
  /**
@@ -1025,71 +987,14 @@ declare class SchemaGenerator<TOptions$1 extends SchemaGeneratorOptions = Schema
1025
987
  * Delegates to getBaseTypeFromSchema internally and
1026
988
  * optionally adds a union with null.
1027
989
  */
1028
- parse(props: SchemaProps$1): Schema[];
990
+ parse(props: SchemaProps): Schema[];
1029
991
  deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
1030
992
  find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
1031
993
  static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
1032
994
  static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
1033
995
  static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
1034
996
  static combineObjects(tree: Schema[] | undefined): Schema[];
1035
- build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
1036
- }
1037
- //#endregion
1038
- //#region ../plugin-oas/src/generator.d.ts
1039
- type OperationsProps<TOptions$1 extends PluginFactoryOptions> = {
1040
- instance: Omit<OperationGenerator<TOptions$1>, 'build'>;
1041
- options: TOptions$1['resolvedOptions'];
1042
- operations: Array<Operation$1>;
1043
- };
1044
- type OperationProps<TOptions$1 extends PluginFactoryOptions> = {
1045
- instance: Omit<OperationGenerator<TOptions$1>, 'build'>;
1046
- options: TOptions$1['resolvedOptions'];
1047
- operation: Operation$1;
1048
- };
1049
- type SchemaProps<TOptions$1 extends PluginFactoryOptions> = {
1050
- instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions$1>, 'build'>;
1051
- options: TOptions$1['resolvedOptions'];
1052
- schema: {
1053
- name: string;
1054
- tree: Array<Schema>;
1055
- value: SchemaObject$1;
1056
- };
1057
- };
1058
- type GeneratorOptions<TOptions$1 extends PluginFactoryOptions> = {
1059
- name: string;
1060
- operations?: (this: GeneratorOptions<TOptions$1>, props: OperationsProps<TOptions$1>) => Promise<File[]>;
1061
- operation?: (this: GeneratorOptions<TOptions$1>, props: OperationProps<TOptions$1>) => Promise<File[]>;
1062
- schema?: (this: GeneratorOptions<TOptions$1>, props: SchemaProps<TOptions$1>) => Promise<File[]>;
1063
- };
1064
- type Generator<TOptions$1 extends PluginFactoryOptions> = GeneratorOptions<TOptions$1>;
1065
- //#endregion
1066
- //#region ../plugin-oas/src/OperationGenerator.d.ts
1067
- type Context<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
1068
- oas: Oas;
1069
- exclude: Array<Exclude$1> | undefined;
1070
- include: Array<Include> | undefined;
1071
- override: Array<Override<TOptions$1>> | undefined;
1072
- contentType: contentType | undefined;
1073
- pluginManager: PluginManager;
1074
- /**
1075
- * Current plugin
1076
- */
1077
- plugin: Plugin<TPluginOptions>;
1078
- mode: Mode;
1079
- };
1080
- declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context<TPluginOptions['resolvedOptions'], TPluginOptions>> {
1081
- #private;
1082
- getSchemas(operation: Operation$1, {
1083
- resolveName
1084
- }?: {
1085
- resolveName?: (name: string) => string;
1086
- }): OperationSchemas;
1087
- getOperations(): Promise<Array<{
1088
- path: string;
1089
- method: HttpMethod;
1090
- operation: Operation$1;
1091
- }>>;
1092
- build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
997
+ build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
1093
998
  }
1094
999
  //#endregion
1095
1000
  //#region ../plugin-client/src/types.d.ts
@@ -1342,5 +1247,5 @@ type ResolvedOptions = {
1342
1247
  };
1343
1248
  type PluginSolidQuery = PluginFactoryOptions<'plugin-solid-query', Options$1, ResolvedOptions, never, ResolvePathOptions>;
1344
1249
  //#endregion
1345
- export { OperationSchemas as a, Generator as i, PluginSolidQuery as n, UserPluginWithLifeCycle as o, Transformer as r, Operation$1 as s, Options$1 as t };
1346
- //# sourceMappingURL=types-DjxPjdTZ.d.cts.map
1250
+ export { ReactGenerator as a, OperationSchemas as i, PluginSolidQuery as n, UserPluginWithLifeCycle as o, Transformer as r, Operation$1 as s, Options$1 as t };
1251
+ //# sourceMappingURL=types-DGoK3Yh1.d.cts.map