@kubb/plugin-zod 4.3.1 → 4.4.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.
- package/dist/chunk-DMmIE7y6.js +28 -0
- package/dist/{components-MHUlEVjU.cjs → components-BiOh-7_I.cjs} +19 -19
- package/dist/components-BiOh-7_I.cjs.map +1 -0
- package/dist/{components-BUkyR7lK.js → components-DUJ6Xkpc.js} +3 -3
- package/dist/components-DUJ6Xkpc.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.cts +4 -3
- package/dist/components.d.ts +4 -3
- package/dist/components.js +1 -1
- package/dist/{generators-Bo3q-m_p.cjs → generators-B2hD7k6l.cjs} +25 -24
- package/dist/generators-B2hD7k6l.cjs.map +1 -0
- package/dist/{generators-8AD8PdD3.js → generators-CwEOtNXG.js} +6 -5
- package/dist/generators-CwEOtNXG.js.map +1 -0
- package/dist/generators.cjs +2 -2
- package/dist/generators.d.cts +3 -3
- package/dist/generators.d.ts +3 -3
- package/dist/generators.js +2 -2
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/{types-CjFerqx4.d.cts → types-CENqfJvI.d.cts} +93 -74
- package/dist/{types-DfzoyARl.d.ts → types-DRKJPaUn.d.ts} +99 -80
- package/package.json +9 -9
- package/src/components/Operations.tsx +4 -4
- package/src/components/Zod.tsx +3 -2
- package/src/generators/operationsGenerator.tsx +1 -1
- package/src/generators/zodGenerator.tsx +3 -2
- package/src/plugin.ts +2 -0
- package/src/types.ts +2 -1
- package/dist/components-BUkyR7lK.js.map +0 -1
- package/dist/components-MHUlEVjU.cjs.map +0 -1
- package/dist/generators-8AD8PdD3.js.map +0 -1
- package/dist/generators-Bo3q-m_p.cjs.map +0 -1
|
@@ -4,8 +4,9 @@ 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 { Fabric, FileManager } from "@kubb/react-fabric";
|
|
7
8
|
import { ConsolaInstance, LogLevel } from "consola";
|
|
8
|
-
import {
|
|
9
|
+
import { KubbNode } from "@kubb/react-fabric/types";
|
|
9
10
|
|
|
10
11
|
//#region ../oas/src/types.d.ts
|
|
11
12
|
type contentType = 'application/json' | (string & {});
|
|
@@ -47,17 +48,17 @@ declare class Oas<const TOAS = unknown> extends BaseOas {
|
|
|
47
48
|
* Abstract class that contains the building blocks for plugins to create their own Generator
|
|
48
49
|
* @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137
|
|
49
50
|
*/
|
|
50
|
-
declare abstract class BaseGenerator<TOptions
|
|
51
|
+
declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
|
|
51
52
|
#private;
|
|
52
|
-
constructor(options?: TOptions
|
|
53
|
-
get options(): TOptions
|
|
53
|
+
constructor(options?: TOptions, context?: TContext);
|
|
54
|
+
get options(): TOptions;
|
|
54
55
|
get context(): TContext;
|
|
55
|
-
set options(options: TOptions
|
|
56
|
+
set options(options: TOptions);
|
|
56
57
|
abstract build(...params: unknown[]): unknown;
|
|
57
58
|
}
|
|
58
59
|
//#endregion
|
|
59
60
|
//#region ../core/src/fs/types.d.ts
|
|
60
|
-
type BasePath<T
|
|
61
|
+
type BasePath<T extends string = string> = `${T}/`;
|
|
61
62
|
type Import = {
|
|
62
63
|
/**
|
|
63
64
|
* Import name to be used
|
|
@@ -131,7 +132,7 @@ type BaseName = `${string}.${string}`;
|
|
|
131
132
|
* Path will be full qualified path to a specified file
|
|
132
133
|
*/
|
|
133
134
|
type Path = string;
|
|
134
|
-
type AdvancedPath<T
|
|
135
|
+
type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
|
|
135
136
|
type OptionalPath = Path | undefined | null;
|
|
136
137
|
type File<TMeta extends object = object> = {
|
|
137
138
|
/**
|
|
@@ -220,7 +221,7 @@ type Logger = {
|
|
|
220
221
|
};
|
|
221
222
|
//#endregion
|
|
222
223
|
//#region ../core/src/utils/types.d.ts
|
|
223
|
-
type PossiblePromise<T
|
|
224
|
+
type PossiblePromise<T> = Promise<T> | T;
|
|
224
225
|
//#endregion
|
|
225
226
|
//#region ../core/src/types.d.ts
|
|
226
227
|
type InputPath = {
|
|
@@ -333,11 +334,11 @@ TName extends string = string,
|
|
|
333
334
|
/**
|
|
334
335
|
* Options of the plugin.
|
|
335
336
|
*/
|
|
336
|
-
TOptions
|
|
337
|
+
TOptions extends object = object,
|
|
337
338
|
/**
|
|
338
339
|
* Options of the plugin that can be used later on, see `options` inside your plugin config.
|
|
339
340
|
*/
|
|
340
|
-
TResolvedOptions extends object = TOptions
|
|
341
|
+
TResolvedOptions extends object = TOptions,
|
|
341
342
|
/**
|
|
342
343
|
* Context that you want to expose to other plugins.
|
|
343
344
|
*/
|
|
@@ -351,23 +352,23 @@ TResolvePathOptions extends object = object> = {
|
|
|
351
352
|
* Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
|
|
352
353
|
*/
|
|
353
354
|
key: PluginKey<TName | string>;
|
|
354
|
-
options: TOptions
|
|
355
|
+
options: TOptions;
|
|
355
356
|
resolvedOptions: TResolvedOptions;
|
|
356
357
|
context: TContext;
|
|
357
358
|
resolvePathOptions: TResolvePathOptions;
|
|
358
359
|
};
|
|
359
360
|
type PluginKey<TName> = [name: TName, identifier?: string | number];
|
|
360
|
-
type UserPlugin<TOptions
|
|
361
|
+
type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
361
362
|
/**
|
|
362
363
|
* Unique name used for the plugin
|
|
363
364
|
* The name of the plugin follows the format scope:foo-bar or foo-bar, adding scope: can avoid naming conflicts with other plugins.
|
|
364
365
|
* @example @kubb/typescript
|
|
365
366
|
*/
|
|
366
|
-
name: TOptions
|
|
367
|
+
name: TOptions['name'];
|
|
367
368
|
/**
|
|
368
369
|
* Options set for a specific plugin(see kubb.config.js), passthrough of options.
|
|
369
370
|
*/
|
|
370
|
-
options: TOptions
|
|
371
|
+
options: TOptions['resolvedOptions'];
|
|
371
372
|
/**
|
|
372
373
|
* 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
374
|
* Can be used to validate dependent plugins.
|
|
@@ -377,23 +378,23 @@ type UserPlugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions>
|
|
|
377
378
|
* 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
379
|
*/
|
|
379
380
|
post?: Array<string>;
|
|
380
|
-
} & (TOptions
|
|
381
|
+
} & (TOptions['context'] extends never ? {
|
|
381
382
|
context?: never;
|
|
382
383
|
} : {
|
|
383
|
-
context: (this: TOptions
|
|
384
|
+
context: (this: TOptions['name'] extends 'core' ? null : Omit<PluginContext<TOptions>, 'addFile'>) => TOptions['context'];
|
|
384
385
|
});
|
|
385
|
-
type UserPluginWithLifeCycle<TOptions
|
|
386
|
-
type Plugin<TOptions
|
|
386
|
+
type UserPluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions> & PluginLifecycle<TOptions>;
|
|
387
|
+
type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
387
388
|
/**
|
|
388
389
|
* Unique name used for the plugin
|
|
389
390
|
* @example @kubb/typescript
|
|
390
391
|
*/
|
|
391
|
-
name: TOptions
|
|
392
|
+
name: TOptions['name'];
|
|
392
393
|
/**
|
|
393
394
|
* Internal key used when a developer uses more than one of the same plugin
|
|
394
395
|
* @private
|
|
395
396
|
*/
|
|
396
|
-
key: TOptions
|
|
397
|
+
key: TOptions['key'];
|
|
397
398
|
/**
|
|
398
399
|
* 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
400
|
* Can be used to validate dependent plugins.
|
|
@@ -406,49 +407,49 @@ type Plugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
|
406
407
|
/**
|
|
407
408
|
* Options set for a specific plugin(see kubb.config.js), passthrough of options.
|
|
408
409
|
*/
|
|
409
|
-
options: TOptions
|
|
410
|
-
} & (TOptions
|
|
410
|
+
options: TOptions['resolvedOptions'];
|
|
411
|
+
} & (TOptions['context'] extends never ? {
|
|
411
412
|
context?: never;
|
|
412
413
|
} : {
|
|
413
|
-
context: TOptions
|
|
414
|
+
context: TOptions['context'];
|
|
414
415
|
});
|
|
415
|
-
type PluginWithLifeCycle<TOptions
|
|
416
|
-
type PluginLifecycle<TOptions
|
|
416
|
+
type PluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions> & PluginLifecycle<TOptions>;
|
|
417
|
+
type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
417
418
|
/**
|
|
418
419
|
* Start of the lifecycle of a plugin.
|
|
419
420
|
* @type hookParallel
|
|
420
421
|
*/
|
|
421
|
-
buildStart?: (this: PluginContext<TOptions
|
|
422
|
+
buildStart?: (this: PluginContext<TOptions>, Config: Config) => PossiblePromise<void>;
|
|
422
423
|
/**
|
|
423
424
|
* Resolve to a Path based on a baseName(example: `./Pet.ts`) and directory(example: `./models`).
|
|
424
425
|
* Options can als be included.
|
|
425
426
|
* @type hookFirst
|
|
426
427
|
* @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
|
|
427
428
|
*/
|
|
428
|
-
resolvePath?: (this: PluginContext<TOptions
|
|
429
|
+
resolvePath?: (this: PluginContext<TOptions>, baseName: BaseName, mode?: Mode, options?: TOptions['resolvePathOptions']) => OptionalPath;
|
|
429
430
|
/**
|
|
430
431
|
* Resolve to a name based on a string.
|
|
431
432
|
* Useful when converting to PascalCase or camelCase.
|
|
432
433
|
* @type hookFirst
|
|
433
434
|
* @example ('pet') => 'Pet'
|
|
434
435
|
*/
|
|
435
|
-
resolveName?: (this: PluginContext<TOptions
|
|
436
|
+
resolveName?: (this: PluginContext<TOptions>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
436
437
|
/**
|
|
437
438
|
* End of the plugin lifecycle.
|
|
438
439
|
* @type hookParallel
|
|
439
440
|
*/
|
|
440
|
-
buildEnd?: (this: PluginContext<TOptions
|
|
441
|
+
buildEnd?: (this: PluginContext<TOptions>) => PossiblePromise<void>;
|
|
441
442
|
};
|
|
442
443
|
type PluginLifecycleHooks = keyof PluginLifecycle;
|
|
443
|
-
type PluginParameter<H
|
|
444
|
-
type ResolvePathParams<TOptions
|
|
444
|
+
type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
|
|
445
|
+
type ResolvePathParams<TOptions = object> = {
|
|
445
446
|
pluginKey?: Plugin['key'];
|
|
446
447
|
baseName: BaseName;
|
|
447
448
|
mode?: Mode;
|
|
448
449
|
/**
|
|
449
450
|
* Options to be passed to 'resolvePath' 3th parameter
|
|
450
451
|
*/
|
|
451
|
-
options?: TOptions
|
|
452
|
+
options?: TOptions;
|
|
452
453
|
};
|
|
453
454
|
type ResolveNameParams = {
|
|
454
455
|
name: string;
|
|
@@ -461,7 +462,8 @@ type ResolveNameParams = {
|
|
|
461
462
|
*/
|
|
462
463
|
type?: 'file' | 'function' | 'type' | 'const';
|
|
463
464
|
};
|
|
464
|
-
type PluginContext<TOptions
|
|
465
|
+
type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
466
|
+
fabric: Fabric;
|
|
465
467
|
config: Config;
|
|
466
468
|
/**
|
|
467
469
|
* @deprecated
|
|
@@ -469,7 +471,7 @@ type PluginContext<TOptions$1 extends PluginFactoryOptions = PluginFactoryOption
|
|
|
469
471
|
fileManager: FileManager;
|
|
470
472
|
pluginManager: PluginManager;
|
|
471
473
|
addFile: (...file: Array<File>) => Promise<Array<ResolvedFile>>;
|
|
472
|
-
resolvePath: (params: ResolvePathParams<TOptions
|
|
474
|
+
resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => OptionalPath;
|
|
473
475
|
resolveName: (params: ResolveNameParams) => string;
|
|
474
476
|
logger: Logger;
|
|
475
477
|
/**
|
|
@@ -479,12 +481,12 @@ type PluginContext<TOptions$1 extends PluginFactoryOptions = PluginFactoryOption
|
|
|
479
481
|
/**
|
|
480
482
|
* Current plugin
|
|
481
483
|
*/
|
|
482
|
-
plugin: Plugin<TOptions
|
|
484
|
+
plugin: Plugin<TOptions>;
|
|
483
485
|
};
|
|
484
486
|
/**
|
|
485
487
|
* Specify the export location for the files and define the behavior of the output
|
|
486
488
|
*/
|
|
487
|
-
type Output<TOptions
|
|
489
|
+
type Output<TOptions> = {
|
|
488
490
|
/**
|
|
489
491
|
* Path to the output folder or file that will contain the generated code
|
|
490
492
|
*/
|
|
@@ -497,11 +499,11 @@ type Output<TOptions$1> = {
|
|
|
497
499
|
/**
|
|
498
500
|
* Add a banner text in the beginning of every file
|
|
499
501
|
*/
|
|
500
|
-
banner?: string | ((options: TOptions
|
|
502
|
+
banner?: string | ((options: TOptions) => string);
|
|
501
503
|
/**
|
|
502
504
|
* Add a footer text in the beginning of every file
|
|
503
505
|
*/
|
|
504
|
-
footer?: string | ((options: TOptions
|
|
506
|
+
footer?: string | ((options: TOptions) => string);
|
|
505
507
|
};
|
|
506
508
|
type GroupContext = {
|
|
507
509
|
group: string;
|
|
@@ -520,20 +522,21 @@ type Group = {
|
|
|
520
522
|
//#region ../core/src/PluginManager.d.ts
|
|
521
523
|
type RequiredPluginLifecycle = Required<PluginLifecycle>;
|
|
522
524
|
type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
|
|
523
|
-
type Executer<H
|
|
525
|
+
type Executer<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
524
526
|
message: string;
|
|
525
527
|
strategy: Strategy;
|
|
526
|
-
hookName: H
|
|
528
|
+
hookName: H;
|
|
527
529
|
plugin: Plugin;
|
|
528
530
|
parameters?: unknown[] | undefined;
|
|
529
531
|
output?: unknown;
|
|
530
532
|
};
|
|
531
|
-
type ParseResult<H
|
|
532
|
-
type SafeParseResult<H
|
|
533
|
+
type ParseResult<H extends PluginLifecycleHooks> = RequiredPluginLifecycle[H];
|
|
534
|
+
type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H>>> = {
|
|
533
535
|
result: Result;
|
|
534
536
|
plugin: Plugin;
|
|
535
537
|
};
|
|
536
538
|
type Options$2 = {
|
|
539
|
+
fabric: Fabric;
|
|
537
540
|
logger: Logger;
|
|
538
541
|
/**
|
|
539
542
|
* @default Number.POSITIVE_INFINITY
|
|
@@ -545,20 +548,16 @@ type Events = {
|
|
|
545
548
|
executed: [executer: Executer];
|
|
546
549
|
error: [error: Error];
|
|
547
550
|
};
|
|
548
|
-
type GetFileProps<TOptions
|
|
551
|
+
type GetFileProps<TOptions = object> = {
|
|
549
552
|
name: string;
|
|
550
553
|
mode?: Mode;
|
|
551
554
|
extname: Extname;
|
|
552
555
|
pluginKey: Plugin['key'];
|
|
553
|
-
options?: TOptions
|
|
556
|
+
options?: TOptions;
|
|
554
557
|
};
|
|
555
558
|
declare class PluginManager {
|
|
556
559
|
#private;
|
|
557
560
|
readonly plugins: Set<Plugin<PluginFactoryOptions<string, object, object, any, object>>>;
|
|
558
|
-
/**
|
|
559
|
-
* @deprecated do not use from pluginManager
|
|
560
|
-
*/
|
|
561
|
-
readonly fileManager: FileManager;
|
|
562
561
|
readonly events: EventEmitter<Events>;
|
|
563
562
|
readonly config: Config;
|
|
564
563
|
readonly executed: Array<Executer>;
|
|
@@ -671,12 +670,31 @@ type FileMetaBase = {
|
|
|
671
670
|
pluginKey?: Plugin['key'];
|
|
672
671
|
};
|
|
673
672
|
//#endregion
|
|
673
|
+
//#region ../plugin-oas/src/generators/createGenerator.d.ts
|
|
674
|
+
type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
675
|
+
name: string;
|
|
676
|
+
type: 'core';
|
|
677
|
+
operations: (props: OperationsProps<TOptions>) => Promise<File[]>;
|
|
678
|
+
operation: (props: OperationProps<TOptions>) => Promise<File[]>;
|
|
679
|
+
schema: (props: SchemaProps<TOptions>) => Promise<File[]>;
|
|
680
|
+
};
|
|
681
|
+
//#endregion
|
|
682
|
+
//#region ../plugin-oas/src/generators/createReactGenerator.d.ts
|
|
683
|
+
type ReactGenerator<TOptions extends PluginFactoryOptions> = {
|
|
684
|
+
name: string;
|
|
685
|
+
type: 'react';
|
|
686
|
+
Operations: (props: OperationsProps<TOptions>) => KubbNode;
|
|
687
|
+
Operation: (props: OperationProps<TOptions>) => KubbNode;
|
|
688
|
+
Schema: (props: SchemaProps<TOptions>) => KubbNode;
|
|
689
|
+
};
|
|
690
|
+
//#endregion
|
|
674
691
|
//#region ../plugin-oas/src/OperationGenerator.d.ts
|
|
675
|
-
type Context$1<TOptions
|
|
692
|
+
type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
693
|
+
fabric: Fabric;
|
|
676
694
|
oas: Oas;
|
|
677
695
|
exclude: Array<Exclude$1> | undefined;
|
|
678
696
|
include: Array<Include> | undefined;
|
|
679
|
-
override: Array<Override<TOptions
|
|
697
|
+
override: Array<Override<TOptions>> | undefined;
|
|
680
698
|
contentType: contentType | undefined;
|
|
681
699
|
pluginManager: PluginManager;
|
|
682
700
|
/**
|
|
@@ -918,7 +936,8 @@ type Schema = {
|
|
|
918
936
|
} | SchemaKeywordMapper[keyof SchemaKeywordMapper];
|
|
919
937
|
//#endregion
|
|
920
938
|
//#region ../plugin-oas/src/SchemaGenerator.d.ts
|
|
921
|
-
type Context<TOptions
|
|
939
|
+
type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
940
|
+
fabric: Fabric;
|
|
922
941
|
oas: Oas;
|
|
923
942
|
pluginManager: PluginManager;
|
|
924
943
|
/**
|
|
@@ -927,7 +946,7 @@ type Context<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
927
946
|
plugin: Plugin<TPluginOptions>;
|
|
928
947
|
mode: Mode;
|
|
929
948
|
include?: Array<'schemas' | 'responses' | 'requestBodies'>;
|
|
930
|
-
override: Array<Override<TOptions
|
|
949
|
+
override: Array<Override<TOptions>> | undefined;
|
|
931
950
|
contentType?: contentType;
|
|
932
951
|
output?: string;
|
|
933
952
|
};
|
|
@@ -958,7 +977,7 @@ type SchemaProps$1 = {
|
|
|
958
977
|
name?: string;
|
|
959
978
|
parentName?: string;
|
|
960
979
|
};
|
|
961
|
-
declare class SchemaGenerator<TOptions
|
|
980
|
+
declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context<TOptions, TPluginOptions>> {
|
|
962
981
|
#private;
|
|
963
982
|
refs: Refs;
|
|
964
983
|
/**
|
|
@@ -976,33 +995,33 @@ declare class SchemaGenerator<TOptions$1 extends SchemaGeneratorOptions = Schema
|
|
|
976
995
|
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
|
|
977
996
|
}
|
|
978
997
|
//#endregion
|
|
979
|
-
//#region ../plugin-oas/src/
|
|
980
|
-
type OperationsProps<TOptions
|
|
981
|
-
|
|
982
|
-
|
|
998
|
+
//#region ../plugin-oas/src/generators/types.d.ts
|
|
999
|
+
type OperationsProps<TOptions extends PluginFactoryOptions> = {
|
|
1000
|
+
/**
|
|
1001
|
+
* @deprecated
|
|
1002
|
+
*/
|
|
1003
|
+
instance: Omit<OperationGenerator<TOptions>, 'build'>;
|
|
1004
|
+
options: TOptions['resolvedOptions'];
|
|
983
1005
|
operations: Array<Operation$1>;
|
|
984
1006
|
};
|
|
985
|
-
type OperationProps<TOptions
|
|
986
|
-
|
|
987
|
-
|
|
1007
|
+
type OperationProps<TOptions extends PluginFactoryOptions> = {
|
|
1008
|
+
/**
|
|
1009
|
+
* @deprecated
|
|
1010
|
+
*/
|
|
1011
|
+
instance: Omit<OperationGenerator<TOptions>, 'build'>;
|
|
1012
|
+
options: TOptions['resolvedOptions'];
|
|
988
1013
|
operation: Operation$1;
|
|
989
1014
|
};
|
|
990
|
-
type SchemaProps<TOptions
|
|
991
|
-
instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions
|
|
992
|
-
options: TOptions
|
|
1015
|
+
type SchemaProps<TOptions extends PluginFactoryOptions> = {
|
|
1016
|
+
instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
|
|
1017
|
+
options: TOptions['resolvedOptions'];
|
|
993
1018
|
schema: {
|
|
994
1019
|
name: string;
|
|
995
1020
|
tree: Array<Schema>;
|
|
996
1021
|
value: SchemaObject$1;
|
|
997
1022
|
};
|
|
998
1023
|
};
|
|
999
|
-
type
|
|
1000
|
-
name: string;
|
|
1001
|
-
operations?: (this: GeneratorOptions<TOptions$1>, props: OperationsProps<TOptions$1>) => Promise<File[]>;
|
|
1002
|
-
operation?: (this: GeneratorOptions<TOptions$1>, props: OperationProps<TOptions$1>) => Promise<File[]>;
|
|
1003
|
-
schema?: (this: GeneratorOptions<TOptions$1>, props: SchemaProps<TOptions$1>) => Promise<File[]>;
|
|
1004
|
-
};
|
|
1005
|
-
type Generator<TOptions$1 extends PluginFactoryOptions> = GeneratorOptions<TOptions$1>;
|
|
1024
|
+
type Generator<TOptions extends PluginFactoryOptions> = CoreGenerator<TOptions> | ReactGenerator<TOptions>;
|
|
1006
1025
|
//#endregion
|
|
1007
1026
|
//#region ../plugin-oas/src/types.d.ts
|
|
1008
1027
|
type ResolvePathOptions = {
|
|
@@ -1088,8 +1107,8 @@ type ByContentType = {
|
|
|
1088
1107
|
};
|
|
1089
1108
|
type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
1090
1109
|
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
1091
|
-
type Override<TOptions
|
|
1092
|
-
options: Partial<TOptions
|
|
1110
|
+
type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
1111
|
+
options: Partial<TOptions>;
|
|
1093
1112
|
};
|
|
1094
1113
|
//#endregion
|
|
1095
1114
|
//#region src/types.d.ts
|
|
@@ -1218,5 +1237,5 @@ type ResolvedOptions = {
|
|
|
1218
1237
|
};
|
|
1219
1238
|
type PluginZod = PluginFactoryOptions<'plugin-zod', Options$1, ResolvedOptions, never, ResolvePathOptions>;
|
|
1220
1239
|
//#endregion
|
|
1221
|
-
export { UserPluginWithLifeCycle as a,
|
|
1222
|
-
//# sourceMappingURL=types-
|
|
1240
|
+
export { UserPluginWithLifeCycle as a, ReactGenerator as i, PluginZod as n, Operation$1 as o, Schema as r, SchemaObject$1 as s, Options$1 as t };
|
|
1241
|
+
//# sourceMappingURL=types-CENqfJvI.d.cts.map
|