@kubb/plugin-zod 4.1.4 → 4.2.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.
- package/dist/{components-fQ1lNRge.js → components-8y_GG0Uf.js} +2 -2
- package/dist/{components-fQ1lNRge.js.map → components-8y_GG0Uf.js.map} +1 -1
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/{generators-D7INxuXC.cjs → generators-BO4N79H7.cjs} +10 -4
- package/dist/generators-BO4N79H7.cjs.map +1 -0
- package/dist/{generators-DJH-fpYZ.js → generators-bYDLojHd.js} +12 -7
- package/dist/generators-bYDLojHd.js.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +2 -2
- package/dist/index.cjs +4 -4
- 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 +6 -6
- package/dist/index.js.map +1 -1
- package/dist/{types-BY-RtmUj.d.ts → types-QZU4k-_1.d.ts} +78 -122
- package/dist/{types-C4zDVwZ4.d.cts → types-vzmWp6Js.d.cts} +78 -122
- package/package.json +9 -10
- package/src/generators/operationsGenerator.tsx +8 -8
- package/src/generators/zodGenerator.tsx +9 -7
- package/src/plugin.ts +4 -4
- package/dist/generators-D7INxuXC.cjs.map +0 -1
- package/dist/generators-DJH-fpYZ.js.map +0 -1
|
@@ -5,6 +5,7 @@ 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
7
|
import { ConsolaInstance, LogLevel } from "consola";
|
|
8
|
+
import { FileManager } from "@kubb/fabric-core";
|
|
8
9
|
|
|
9
10
|
//#region ../oas/src/types.d.ts
|
|
10
11
|
type contentType = 'application/json' | (string & {});
|
|
@@ -46,17 +47,17 @@ declare class Oas<const TOAS = unknown> extends BaseOas {
|
|
|
46
47
|
* Abstract class that contains the building blocks for plugins to create their own Generator
|
|
47
48
|
* @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137
|
|
48
49
|
*/
|
|
49
|
-
declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
|
|
50
|
+
declare abstract class BaseGenerator<TOptions$1 = unknown, TContext = unknown> {
|
|
50
51
|
#private;
|
|
51
|
-
constructor(options?: TOptions, context?: TContext);
|
|
52
|
-
get options(): TOptions;
|
|
52
|
+
constructor(options?: TOptions$1, context?: TContext);
|
|
53
|
+
get options(): TOptions$1;
|
|
53
54
|
get context(): TContext;
|
|
54
|
-
set options(options: TOptions);
|
|
55
|
+
set options(options: TOptions$1);
|
|
55
56
|
abstract build(...params: unknown[]): unknown;
|
|
56
57
|
}
|
|
57
58
|
//#endregion
|
|
58
59
|
//#region ../core/src/fs/types.d.ts
|
|
59
|
-
type BasePath<T extends string = string> = `${T}/`;
|
|
60
|
+
type BasePath<T$1 extends string = string> = `${T$1}/`;
|
|
60
61
|
type Import = {
|
|
61
62
|
/**
|
|
62
63
|
* Import name to be used
|
|
@@ -130,7 +131,7 @@ type BaseName = `${string}.${string}`;
|
|
|
130
131
|
* Path will be full qualified path to a specified file
|
|
131
132
|
*/
|
|
132
133
|
type Path = string;
|
|
133
|
-
type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
|
|
134
|
+
type AdvancedPath<T$1 extends BaseName = BaseName> = `${BasePath}${T$1}`;
|
|
134
135
|
type OptionalPath = Path | undefined | null;
|
|
135
136
|
type File<TMeta extends object = object> = {
|
|
136
137
|
/**
|
|
@@ -219,9 +220,7 @@ type Logger = {
|
|
|
219
220
|
};
|
|
220
221
|
//#endregion
|
|
221
222
|
//#region ../core/src/utils/types.d.ts
|
|
222
|
-
type PossiblePromise<T> = Promise<T> | T;
|
|
223
|
-
type ArrayWithLength<T extends number, U extends any[] = []> = U['length'] extends T ? U : ArrayWithLength<T, [true, ...U]>;
|
|
224
|
-
type GreaterThan<T extends number, U extends number> = ArrayWithLength<U> extends [...ArrayWithLength<T>, ...infer _] ? false : true;
|
|
223
|
+
type PossiblePromise<T$1> = Promise<T$1> | T$1;
|
|
225
224
|
//#endregion
|
|
226
225
|
//#region ../core/src/types.d.ts
|
|
227
226
|
type InputPath = {
|
|
@@ -334,11 +333,11 @@ TName extends string = string,
|
|
|
334
333
|
/**
|
|
335
334
|
* Options of the plugin.
|
|
336
335
|
*/
|
|
337
|
-
TOptions extends object = object,
|
|
336
|
+
TOptions$1 extends object = object,
|
|
338
337
|
/**
|
|
339
338
|
* Options of the plugin that can be used later on, see `options` inside your plugin config.
|
|
340
339
|
*/
|
|
341
|
-
TResolvedOptions extends object = TOptions,
|
|
340
|
+
TResolvedOptions extends object = TOptions$1,
|
|
342
341
|
/**
|
|
343
342
|
* Context that you want to expose to other plugins.
|
|
344
343
|
*/
|
|
@@ -352,23 +351,23 @@ TResolvePathOptions extends object = object> = {
|
|
|
352
351
|
* Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
|
|
353
352
|
*/
|
|
354
353
|
key: PluginKey<TName | string>;
|
|
355
|
-
options: TOptions;
|
|
354
|
+
options: TOptions$1;
|
|
356
355
|
resolvedOptions: TResolvedOptions;
|
|
357
356
|
context: TContext;
|
|
358
357
|
resolvePathOptions: TResolvePathOptions;
|
|
359
358
|
};
|
|
360
359
|
type PluginKey<TName> = [name: TName, identifier?: string | number];
|
|
361
|
-
type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
360
|
+
type UserPlugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
362
361
|
/**
|
|
363
362
|
* Unique name used for the plugin
|
|
364
363
|
* The name of the plugin follows the format scope:foo-bar or foo-bar, adding scope: can avoid naming conflicts with other plugins.
|
|
365
364
|
* @example @kubb/typescript
|
|
366
365
|
*/
|
|
367
|
-
name: TOptions['name'];
|
|
366
|
+
name: TOptions$1['name'];
|
|
368
367
|
/**
|
|
369
368
|
* Options set for a specific plugin(see kubb.config.js), passthrough of options.
|
|
370
369
|
*/
|
|
371
|
-
options: TOptions['resolvedOptions'];
|
|
370
|
+
options: TOptions$1['resolvedOptions'];
|
|
372
371
|
/**
|
|
373
372
|
* 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.
|
|
374
373
|
* Can be used to validate dependent plugins.
|
|
@@ -378,23 +377,23 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
|
|
|
378
377
|
* 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.
|
|
379
378
|
*/
|
|
380
379
|
post?: Array<string>;
|
|
381
|
-
} & (TOptions['context'] extends never ? {
|
|
380
|
+
} & (TOptions$1['context'] extends never ? {
|
|
382
381
|
context?: never;
|
|
383
382
|
} : {
|
|
384
|
-
context: (this: TOptions['name'] extends 'core' ? null : Omit<PluginContext<TOptions>, 'addFile'>) => TOptions['context'];
|
|
383
|
+
context: (this: TOptions$1['name'] extends 'core' ? null : Omit<PluginContext<TOptions$1>, 'addFile'>) => TOptions$1['context'];
|
|
385
384
|
});
|
|
386
|
-
type UserPluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions> & PluginLifecycle<TOptions>;
|
|
387
|
-
type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
385
|
+
type UserPluginWithLifeCycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions$1> & PluginLifecycle<TOptions$1>;
|
|
386
|
+
type Plugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
388
387
|
/**
|
|
389
388
|
* Unique name used for the plugin
|
|
390
389
|
* @example @kubb/typescript
|
|
391
390
|
*/
|
|
392
|
-
name: TOptions['name'];
|
|
391
|
+
name: TOptions$1['name'];
|
|
393
392
|
/**
|
|
394
393
|
* Internal key used when a developer uses more than one of the same plugin
|
|
395
394
|
* @private
|
|
396
395
|
*/
|
|
397
|
-
key: TOptions['key'];
|
|
396
|
+
key: TOptions$1['key'];
|
|
398
397
|
/**
|
|
399
398
|
* 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.
|
|
400
399
|
* Can be used to validate dependent plugins.
|
|
@@ -407,49 +406,49 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
|
407
406
|
/**
|
|
408
407
|
* Options set for a specific plugin(see kubb.config.js), passthrough of options.
|
|
409
408
|
*/
|
|
410
|
-
options: TOptions['resolvedOptions'];
|
|
411
|
-
} & (TOptions['context'] extends never ? {
|
|
409
|
+
options: TOptions$1['resolvedOptions'];
|
|
410
|
+
} & (TOptions$1['context'] extends never ? {
|
|
412
411
|
context?: never;
|
|
413
412
|
} : {
|
|
414
|
-
context: TOptions['context'];
|
|
413
|
+
context: TOptions$1['context'];
|
|
415
414
|
});
|
|
416
|
-
type PluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions> & PluginLifecycle<TOptions>;
|
|
417
|
-
type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
415
|
+
type PluginWithLifeCycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions$1> & PluginLifecycle<TOptions$1>;
|
|
416
|
+
type PluginLifecycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
418
417
|
/**
|
|
419
418
|
* Start of the lifecycle of a plugin.
|
|
420
419
|
* @type hookParallel
|
|
421
420
|
*/
|
|
422
|
-
buildStart?: (this: PluginContext<TOptions>, Config: Config) => PossiblePromise<void>;
|
|
421
|
+
buildStart?: (this: PluginContext<TOptions$1>, Config: Config) => PossiblePromise<void>;
|
|
423
422
|
/**
|
|
424
423
|
* Resolve to a Path based on a baseName(example: `./Pet.ts`) and directory(example: `./models`).
|
|
425
424
|
* Options can als be included.
|
|
426
425
|
* @type hookFirst
|
|
427
426
|
* @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
|
|
428
427
|
*/
|
|
429
|
-
resolvePath?: (this: PluginContext<TOptions>, baseName: BaseName, mode?: Mode, options?: TOptions['resolvePathOptions']) => OptionalPath;
|
|
428
|
+
resolvePath?: (this: PluginContext<TOptions$1>, baseName: BaseName, mode?: Mode, options?: TOptions$1['resolvePathOptions']) => OptionalPath;
|
|
430
429
|
/**
|
|
431
430
|
* Resolve to a name based on a string.
|
|
432
431
|
* Useful when converting to PascalCase or camelCase.
|
|
433
432
|
* @type hookFirst
|
|
434
433
|
* @example ('pet') => 'Pet'
|
|
435
434
|
*/
|
|
436
|
-
resolveName?: (this: PluginContext<TOptions>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
435
|
+
resolveName?: (this: PluginContext<TOptions$1>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
437
436
|
/**
|
|
438
437
|
* End of the plugin lifecycle.
|
|
439
438
|
* @type hookParallel
|
|
440
439
|
*/
|
|
441
|
-
buildEnd?: (this: PluginContext<TOptions>) => PossiblePromise<void>;
|
|
440
|
+
buildEnd?: (this: PluginContext<TOptions$1>) => PossiblePromise<void>;
|
|
442
441
|
};
|
|
443
442
|
type PluginLifecycleHooks = keyof PluginLifecycle;
|
|
444
|
-
type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
|
|
445
|
-
type ResolvePathParams<TOptions = object> = {
|
|
443
|
+
type PluginParameter<H$1 extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H$1]>;
|
|
444
|
+
type ResolvePathParams<TOptions$1 = object> = {
|
|
446
445
|
pluginKey?: Plugin['key'];
|
|
447
446
|
baseName: BaseName;
|
|
448
447
|
mode?: Mode;
|
|
449
448
|
/**
|
|
450
449
|
* Options to be passed to 'resolvePath' 3th parameter
|
|
451
450
|
*/
|
|
452
|
-
options?: TOptions;
|
|
451
|
+
options?: TOptions$1;
|
|
453
452
|
};
|
|
454
453
|
type ResolveNameParams = {
|
|
455
454
|
name: string;
|
|
@@ -462,12 +461,15 @@ type ResolveNameParams = {
|
|
|
462
461
|
*/
|
|
463
462
|
type?: 'file' | 'function' | 'type' | 'const';
|
|
464
463
|
};
|
|
465
|
-
type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
464
|
+
type PluginContext<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
466
465
|
config: Config;
|
|
466
|
+
/**
|
|
467
|
+
* @deprecated
|
|
468
|
+
*/
|
|
467
469
|
fileManager: FileManager;
|
|
468
470
|
pluginManager: PluginManager;
|
|
469
471
|
addFile: (...file: Array<File>) => Promise<Array<ResolvedFile>>;
|
|
470
|
-
resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => OptionalPath;
|
|
472
|
+
resolvePath: (params: ResolvePathParams<TOptions$1['resolvePathOptions']>) => OptionalPath;
|
|
471
473
|
resolveName: (params: ResolveNameParams) => string;
|
|
472
474
|
logger: Logger;
|
|
473
475
|
/**
|
|
@@ -477,12 +479,12 @@ type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions>
|
|
|
477
479
|
/**
|
|
478
480
|
* Current plugin
|
|
479
481
|
*/
|
|
480
|
-
plugin: Plugin<TOptions>;
|
|
482
|
+
plugin: Plugin<TOptions$1>;
|
|
481
483
|
};
|
|
482
484
|
/**
|
|
483
485
|
* Specify the export location for the files and define the behavior of the output
|
|
484
486
|
*/
|
|
485
|
-
type Output<TOptions> = {
|
|
487
|
+
type Output<TOptions$1> = {
|
|
486
488
|
/**
|
|
487
489
|
* Path to the output folder or file that will contain the generated code
|
|
488
490
|
*/
|
|
@@ -495,11 +497,11 @@ type Output<TOptions> = {
|
|
|
495
497
|
/**
|
|
496
498
|
* Add a banner text in the beginning of every file
|
|
497
499
|
*/
|
|
498
|
-
banner?: string | ((options: TOptions) => string);
|
|
500
|
+
banner?: string | ((options: TOptions$1) => string);
|
|
499
501
|
/**
|
|
500
502
|
* Add a footer text in the beginning of every file
|
|
501
503
|
*/
|
|
502
|
-
footer?: string | ((options: TOptions) => string);
|
|
504
|
+
footer?: string | ((options: TOptions$1) => string);
|
|
503
505
|
};
|
|
504
506
|
type GroupContext = {
|
|
505
507
|
group: string;
|
|
@@ -515,73 +517,19 @@ type Group = {
|
|
|
515
517
|
name?: (context: GroupContext) => string;
|
|
516
518
|
};
|
|
517
519
|
//#endregion
|
|
518
|
-
//#region ../core/src/FileManager.d.ts
|
|
519
|
-
type FileMetaBase = {
|
|
520
|
-
pluginKey?: Plugin['key'];
|
|
521
|
-
};
|
|
522
|
-
type AddResult<T extends Array<File>> = Promise<Awaited<GreaterThan<T['length'], 1> extends true ? Promise<ResolvedFile[]> : Promise<ResolvedFile>>>;
|
|
523
|
-
type AddIndexesProps = {
|
|
524
|
-
type: BarrelType | false | undefined;
|
|
525
|
-
/**
|
|
526
|
-
* Root based on root and output.path specified in the config
|
|
527
|
-
*/
|
|
528
|
-
root: string;
|
|
529
|
-
/**
|
|
530
|
-
* Output for plugin
|
|
531
|
-
*/
|
|
532
|
-
output: {
|
|
533
|
-
path: string;
|
|
534
|
-
};
|
|
535
|
-
group?: {
|
|
536
|
-
output: string;
|
|
537
|
-
exportAs: string;
|
|
538
|
-
};
|
|
539
|
-
logger?: Logger;
|
|
540
|
-
meta?: FileMetaBase;
|
|
541
|
-
};
|
|
542
|
-
type WriteFilesProps = {
|
|
543
|
-
root: Config['root'];
|
|
544
|
-
extension?: Record<Extname, Extname | ''>;
|
|
545
|
-
logger?: Logger;
|
|
546
|
-
dryRun?: boolean;
|
|
547
|
-
};
|
|
548
|
-
declare class FileManager {
|
|
549
|
-
#private;
|
|
550
|
-
constructor();
|
|
551
|
-
add<T extends Array<File> = Array<File>>(...files: T): AddResult<T>;
|
|
552
|
-
getByPath(path: Path): Promise<ResolvedFile | null>;
|
|
553
|
-
deleteByPath(path: Path): Promise<void>;
|
|
554
|
-
clear(): Promise<void>;
|
|
555
|
-
getFiles(): Promise<Array<ResolvedFile>>;
|
|
556
|
-
processFiles({
|
|
557
|
-
dryRun,
|
|
558
|
-
root,
|
|
559
|
-
extension,
|
|
560
|
-
logger
|
|
561
|
-
}: WriteFilesProps): Promise<Array<ResolvedFile>>;
|
|
562
|
-
getBarrelFiles({
|
|
563
|
-
type,
|
|
564
|
-
meta,
|
|
565
|
-
root,
|
|
566
|
-
output,
|
|
567
|
-
logger
|
|
568
|
-
}: AddIndexesProps): Promise<File[]>;
|
|
569
|
-
static getMode(path: string | undefined | null): Mode;
|
|
570
|
-
}
|
|
571
|
-
//#endregion
|
|
572
520
|
//#region ../core/src/PluginManager.d.ts
|
|
573
521
|
type RequiredPluginLifecycle = Required<PluginLifecycle>;
|
|
574
522
|
type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
|
|
575
|
-
type Executer<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
523
|
+
type Executer<H$1 extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
576
524
|
message: string;
|
|
577
525
|
strategy: Strategy;
|
|
578
|
-
hookName: H;
|
|
526
|
+
hookName: H$1;
|
|
579
527
|
plugin: Plugin;
|
|
580
528
|
parameters?: unknown[] | undefined;
|
|
581
529
|
output?: unknown;
|
|
582
530
|
};
|
|
583
|
-
type ParseResult<H extends PluginLifecycleHooks> = RequiredPluginLifecycle[H];
|
|
584
|
-
type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H>>> = {
|
|
531
|
+
type ParseResult<H$1 extends PluginLifecycleHooks> = RequiredPluginLifecycle[H$1];
|
|
532
|
+
type SafeParseResult<H$1 extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H$1>>> = {
|
|
585
533
|
result: Result;
|
|
586
534
|
plugin: Plugin;
|
|
587
535
|
};
|
|
@@ -597,16 +545,19 @@ type Events = {
|
|
|
597
545
|
executed: [executer: Executer];
|
|
598
546
|
error: [error: Error];
|
|
599
547
|
};
|
|
600
|
-
type GetFileProps<TOptions = object> = {
|
|
548
|
+
type GetFileProps<TOptions$1 = object> = {
|
|
601
549
|
name: string;
|
|
602
550
|
mode?: Mode;
|
|
603
551
|
extname: Extname;
|
|
604
552
|
pluginKey: Plugin['key'];
|
|
605
|
-
options?: TOptions;
|
|
553
|
+
options?: TOptions$1;
|
|
606
554
|
};
|
|
607
555
|
declare class PluginManager {
|
|
608
556
|
#private;
|
|
609
557
|
readonly plugins: Set<Plugin<PluginFactoryOptions<string, object, object, any, object>>>;
|
|
558
|
+
/**
|
|
559
|
+
* @deprecated do not use from pluginManager
|
|
560
|
+
*/
|
|
610
561
|
readonly fileManager: FileManager;
|
|
611
562
|
readonly events: EventEmitter<Events>;
|
|
612
563
|
readonly config: Config;
|
|
@@ -715,12 +666,17 @@ declare class PluginManager {
|
|
|
715
666
|
static get hooks(): readonly ["buildStart", "resolvePath", "resolveName", "buildEnd"];
|
|
716
667
|
}
|
|
717
668
|
//#endregion
|
|
669
|
+
//#region ../core/src/FileManager.d.ts
|
|
670
|
+
type FileMetaBase = {
|
|
671
|
+
pluginKey?: Plugin['key'];
|
|
672
|
+
};
|
|
673
|
+
//#endregion
|
|
718
674
|
//#region ../plugin-oas/src/OperationGenerator.d.ts
|
|
719
|
-
type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
675
|
+
type Context$1<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
|
|
720
676
|
oas: Oas;
|
|
721
677
|
exclude: Array<Exclude$1> | undefined;
|
|
722
678
|
include: Array<Include> | undefined;
|
|
723
|
-
override: Array<Override<TOptions>> | undefined;
|
|
679
|
+
override: Array<Override<TOptions$1>> | undefined;
|
|
724
680
|
contentType: contentType | undefined;
|
|
725
681
|
pluginManager: PluginManager;
|
|
726
682
|
/**
|
|
@@ -954,7 +910,7 @@ type Schema = {
|
|
|
954
910
|
} | SchemaKeywordMapper[keyof SchemaKeywordMapper];
|
|
955
911
|
//#endregion
|
|
956
912
|
//#region ../plugin-oas/src/SchemaGenerator.d.ts
|
|
957
|
-
type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
913
|
+
type Context<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
|
|
958
914
|
oas: Oas;
|
|
959
915
|
pluginManager: PluginManager;
|
|
960
916
|
/**
|
|
@@ -963,7 +919,7 @@ type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
963
919
|
plugin: Plugin<TPluginOptions>;
|
|
964
920
|
mode: Mode;
|
|
965
921
|
include?: Array<'schemas' | 'responses' | 'requestBodies'>;
|
|
966
|
-
override: Array<Override<TOptions>> | undefined;
|
|
922
|
+
override: Array<Override<TOptions$1>> | undefined;
|
|
967
923
|
contentType?: contentType;
|
|
968
924
|
output?: string;
|
|
969
925
|
};
|
|
@@ -994,7 +950,7 @@ type SchemaProps$1 = {
|
|
|
994
950
|
name?: string;
|
|
995
951
|
parentName?: string;
|
|
996
952
|
};
|
|
997
|
-
declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context<TOptions, TPluginOptions>> {
|
|
953
|
+
declare class SchemaGenerator<TOptions$1 extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions$1, Context<TOptions$1, TPluginOptions>> {
|
|
998
954
|
#private;
|
|
999
955
|
refs: Refs;
|
|
1000
956
|
/**
|
|
@@ -1013,32 +969,32 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
|
|
|
1013
969
|
}
|
|
1014
970
|
//#endregion
|
|
1015
971
|
//#region ../plugin-oas/src/generator.d.ts
|
|
1016
|
-
type OperationsProps<TOptions extends PluginFactoryOptions> = {
|
|
1017
|
-
instance: Omit<OperationGenerator<TOptions>, 'build'>;
|
|
1018
|
-
options: TOptions['resolvedOptions'];
|
|
972
|
+
type OperationsProps<TOptions$1 extends PluginFactoryOptions> = {
|
|
973
|
+
instance: Omit<OperationGenerator<TOptions$1>, 'build'>;
|
|
974
|
+
options: TOptions$1['resolvedOptions'];
|
|
1019
975
|
operations: Array<Operation$1>;
|
|
1020
976
|
};
|
|
1021
|
-
type OperationProps<TOptions extends PluginFactoryOptions> = {
|
|
1022
|
-
instance: Omit<OperationGenerator<TOptions>, 'build'>;
|
|
1023
|
-
options: TOptions['resolvedOptions'];
|
|
977
|
+
type OperationProps<TOptions$1 extends PluginFactoryOptions> = {
|
|
978
|
+
instance: Omit<OperationGenerator<TOptions$1>, 'build'>;
|
|
979
|
+
options: TOptions$1['resolvedOptions'];
|
|
1024
980
|
operation: Operation$1;
|
|
1025
981
|
};
|
|
1026
|
-
type SchemaProps<TOptions extends PluginFactoryOptions> = {
|
|
1027
|
-
instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
|
|
1028
|
-
options: TOptions['resolvedOptions'];
|
|
982
|
+
type SchemaProps<TOptions$1 extends PluginFactoryOptions> = {
|
|
983
|
+
instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions$1>, 'build'>;
|
|
984
|
+
options: TOptions$1['resolvedOptions'];
|
|
1029
985
|
schema: {
|
|
1030
986
|
name: string;
|
|
1031
987
|
tree: Array<Schema>;
|
|
1032
988
|
value: SchemaObject$1;
|
|
1033
989
|
};
|
|
1034
990
|
};
|
|
1035
|
-
type GeneratorOptions<TOptions extends PluginFactoryOptions> = {
|
|
991
|
+
type GeneratorOptions<TOptions$1 extends PluginFactoryOptions> = {
|
|
1036
992
|
name: string;
|
|
1037
|
-
operations?: (this: GeneratorOptions<TOptions>, props: OperationsProps<TOptions>) => Promise<File[]>;
|
|
1038
|
-
operation?: (this: GeneratorOptions<TOptions>, props: OperationProps<TOptions>) => Promise<File[]>;
|
|
1039
|
-
schema?: (this: GeneratorOptions<TOptions>, props: SchemaProps<TOptions>) => Promise<File[]>;
|
|
993
|
+
operations?: (this: GeneratorOptions<TOptions$1>, props: OperationsProps<TOptions$1>) => Promise<File[]>;
|
|
994
|
+
operation?: (this: GeneratorOptions<TOptions$1>, props: OperationProps<TOptions$1>) => Promise<File[]>;
|
|
995
|
+
schema?: (this: GeneratorOptions<TOptions$1>, props: SchemaProps<TOptions$1>) => Promise<File[]>;
|
|
1040
996
|
};
|
|
1041
|
-
type Generator<TOptions extends PluginFactoryOptions> = GeneratorOptions<TOptions>;
|
|
997
|
+
type Generator<TOptions$1 extends PluginFactoryOptions> = GeneratorOptions<TOptions$1>;
|
|
1042
998
|
//#endregion
|
|
1043
999
|
//#region ../plugin-oas/src/types.d.ts
|
|
1044
1000
|
type ResolvePathOptions = {
|
|
@@ -1124,8 +1080,8 @@ type ByContentType = {
|
|
|
1124
1080
|
};
|
|
1125
1081
|
type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
1126
1082
|
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
1127
|
-
type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
1128
|
-
options: Partial<TOptions>;
|
|
1083
|
+
type Override<TOptions$1> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
1084
|
+
options: Partial<TOptions$1>;
|
|
1129
1085
|
};
|
|
1130
1086
|
//#endregion
|
|
1131
1087
|
//#region src/types.d.ts
|
|
@@ -1254,5 +1210,5 @@ type ResolvedOptions = {
|
|
|
1254
1210
|
};
|
|
1255
1211
|
type PluginZod = PluginFactoryOptions<'plugin-zod', Options$1, ResolvedOptions, never, ResolvePathOptions>;
|
|
1256
1212
|
//#endregion
|
|
1257
|
-
export {
|
|
1258
|
-
//# sourceMappingURL=types-
|
|
1213
|
+
export { UserPluginWithLifeCycle as a, Schema as i, PluginZod as n, Operation$1 as o, Generator as r, SchemaObject$1 as s, Options$1 as t };
|
|
1214
|
+
//# sourceMappingURL=types-QZU4k-_1.d.ts.map
|