@kubb/plugin-mcp 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/{OperationGenerator-C-JRX2db.d.ts → OperationGenerator-c8MWYsSI.d.ts} +78 -122
- package/dist/{OperationGenerator-BfGvlSM8.d.cts → OperationGenerator-unRLjMpQ.d.cts} +78 -122
- package/dist/{Server-BX80OVzu.js → Server-CKHk0vlR.js} +2 -2
- package/dist/{Server-BX80OVzu.js.map → Server-CKHk0vlR.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-C6GGdP_U.cjs → generators-naBCKi9F.cjs} +10 -7
- package/dist/generators-naBCKi9F.cjs.map +1 -0
- package/dist/{generators-CFdUB1k-.js → generators-zuKj-GtG.js} +10 -8
- package/dist/generators-zuKj-GtG.js.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.cts +2 -2
- package/dist/generators.d.ts +2 -2
- package/dist/generators.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/{types-kxPXUmDf.d.ts → types-7AZo3Q-6.d.ts} +3 -3
- package/dist/{types-BaQXdwM0.d.cts → types-DI32TxX9.d.cts} +3 -3
- package/package.json +9 -11
- package/src/generators/mcpGenerator.tsx +4 -5
- package/src/generators/serverGenerator.tsx +7 -4
- package/src/plugin.ts +6 -9
- package/dist/generators-C6GGdP_U.cjs.map +0 -1
- package/dist/generators-CFdUB1k-.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConsolaInstance, LogLevel } from "consola";
|
|
2
|
+
import { FileManager } from "@kubb/fabric-core";
|
|
2
3
|
import * as OasTypes from "oas/types";
|
|
3
4
|
import { HttpMethods as HttpMethod, OASDocument, SchemaObject, User } from "oas/types";
|
|
4
5
|
import { Operation, Operation as Operation$1 } from "oas/operation";
|
|
@@ -7,7 +8,7 @@ import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
|
|
|
7
8
|
import BaseOas from "oas";
|
|
8
9
|
|
|
9
10
|
//#region ../core/src/fs/types.d.ts
|
|
10
|
-
type BasePath<T extends string = string> = `${T}/`;
|
|
11
|
+
type BasePath<T$1 extends string = string> = `${T$1}/`;
|
|
11
12
|
type Import = {
|
|
12
13
|
/**
|
|
13
14
|
* Import name to be used
|
|
@@ -81,7 +82,7 @@ type BaseName = `${string}.${string}`;
|
|
|
81
82
|
* Path will be full qualified path to a specified file
|
|
82
83
|
*/
|
|
83
84
|
type Path = string;
|
|
84
|
-
type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
|
|
85
|
+
type AdvancedPath<T$1 extends BaseName = BaseName> = `${BasePath}${T$1}`;
|
|
85
86
|
type OptionalPath = Path | undefined | null;
|
|
86
87
|
type File<TMeta extends object = object> = {
|
|
87
88
|
/**
|
|
@@ -126,12 +127,12 @@ type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
|
|
|
126
127
|
* Abstract class that contains the building blocks for plugins to create their own Generator
|
|
127
128
|
* @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137
|
|
128
129
|
*/
|
|
129
|
-
declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
|
|
130
|
+
declare abstract class BaseGenerator<TOptions$1 = unknown, TContext = unknown> {
|
|
130
131
|
#private;
|
|
131
|
-
constructor(options?: TOptions, context?: TContext);
|
|
132
|
-
get options(): TOptions;
|
|
132
|
+
constructor(options?: TOptions$1, context?: TContext);
|
|
133
|
+
get options(): TOptions$1;
|
|
133
134
|
get context(): TContext;
|
|
134
|
-
set options(options: TOptions);
|
|
135
|
+
set options(options: TOptions$1);
|
|
135
136
|
abstract build(...params: unknown[]): unknown;
|
|
136
137
|
}
|
|
137
138
|
//#endregion
|
|
@@ -184,9 +185,7 @@ type Logger = {
|
|
|
184
185
|
};
|
|
185
186
|
//#endregion
|
|
186
187
|
//#region ../core/src/utils/types.d.ts
|
|
187
|
-
type PossiblePromise<T> = Promise<T> | T;
|
|
188
|
-
type ArrayWithLength<T extends number, U extends any[] = []> = U['length'] extends T ? U : ArrayWithLength<T, [true, ...U]>;
|
|
189
|
-
type GreaterThan<T extends number, U extends number> = ArrayWithLength<U> extends [...ArrayWithLength<T>, ...infer _] ? false : true;
|
|
188
|
+
type PossiblePromise<T$1> = Promise<T$1> | T$1;
|
|
190
189
|
//#endregion
|
|
191
190
|
//#region ../core/src/types.d.ts
|
|
192
191
|
type InputPath = {
|
|
@@ -299,11 +298,11 @@ TName extends string = string,
|
|
|
299
298
|
/**
|
|
300
299
|
* Options of the plugin.
|
|
301
300
|
*/
|
|
302
|
-
TOptions extends object = object,
|
|
301
|
+
TOptions$1 extends object = object,
|
|
303
302
|
/**
|
|
304
303
|
* Options of the plugin that can be used later on, see `options` inside your plugin config.
|
|
305
304
|
*/
|
|
306
|
-
TResolvedOptions extends object = TOptions,
|
|
305
|
+
TResolvedOptions extends object = TOptions$1,
|
|
307
306
|
/**
|
|
308
307
|
* Context that you want to expose to other plugins.
|
|
309
308
|
*/
|
|
@@ -317,23 +316,23 @@ TResolvePathOptions extends object = object> = {
|
|
|
317
316
|
* Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
|
|
318
317
|
*/
|
|
319
318
|
key: PluginKey<TName | string>;
|
|
320
|
-
options: TOptions;
|
|
319
|
+
options: TOptions$1;
|
|
321
320
|
resolvedOptions: TResolvedOptions;
|
|
322
321
|
context: TContext;
|
|
323
322
|
resolvePathOptions: TResolvePathOptions;
|
|
324
323
|
};
|
|
325
324
|
type PluginKey<TName> = [name: TName, identifier?: string | number];
|
|
326
|
-
type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
325
|
+
type UserPlugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
327
326
|
/**
|
|
328
327
|
* Unique name used for the plugin
|
|
329
328
|
* The name of the plugin follows the format scope:foo-bar or foo-bar, adding scope: can avoid naming conflicts with other plugins.
|
|
330
329
|
* @example @kubb/typescript
|
|
331
330
|
*/
|
|
332
|
-
name: TOptions['name'];
|
|
331
|
+
name: TOptions$1['name'];
|
|
333
332
|
/**
|
|
334
333
|
* Options set for a specific plugin(see kubb.config.js), passthrough of options.
|
|
335
334
|
*/
|
|
336
|
-
options: TOptions['resolvedOptions'];
|
|
335
|
+
options: TOptions$1['resolvedOptions'];
|
|
337
336
|
/**
|
|
338
337
|
* 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.
|
|
339
338
|
* Can be used to validate dependent plugins.
|
|
@@ -343,23 +342,23 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
|
|
|
343
342
|
* 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.
|
|
344
343
|
*/
|
|
345
344
|
post?: Array<string>;
|
|
346
|
-
} & (TOptions['context'] extends never ? {
|
|
345
|
+
} & (TOptions$1['context'] extends never ? {
|
|
347
346
|
context?: never;
|
|
348
347
|
} : {
|
|
349
|
-
context: (this: TOptions['name'] extends 'core' ? null : Omit<PluginContext<TOptions>, 'addFile'>) => TOptions['context'];
|
|
348
|
+
context: (this: TOptions$1['name'] extends 'core' ? null : Omit<PluginContext<TOptions$1>, 'addFile'>) => TOptions$1['context'];
|
|
350
349
|
});
|
|
351
|
-
type UserPluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions> & PluginLifecycle<TOptions>;
|
|
352
|
-
type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
350
|
+
type UserPluginWithLifeCycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions$1> & PluginLifecycle<TOptions$1>;
|
|
351
|
+
type Plugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
353
352
|
/**
|
|
354
353
|
* Unique name used for the plugin
|
|
355
354
|
* @example @kubb/typescript
|
|
356
355
|
*/
|
|
357
|
-
name: TOptions['name'];
|
|
356
|
+
name: TOptions$1['name'];
|
|
358
357
|
/**
|
|
359
358
|
* Internal key used when a developer uses more than one of the same plugin
|
|
360
359
|
* @private
|
|
361
360
|
*/
|
|
362
|
-
key: TOptions['key'];
|
|
361
|
+
key: TOptions$1['key'];
|
|
363
362
|
/**
|
|
364
363
|
* 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.
|
|
365
364
|
* Can be used to validate dependent plugins.
|
|
@@ -372,49 +371,49 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
|
372
371
|
/**
|
|
373
372
|
* Options set for a specific plugin(see kubb.config.js), passthrough of options.
|
|
374
373
|
*/
|
|
375
|
-
options: TOptions['resolvedOptions'];
|
|
376
|
-
} & (TOptions['context'] extends never ? {
|
|
374
|
+
options: TOptions$1['resolvedOptions'];
|
|
375
|
+
} & (TOptions$1['context'] extends never ? {
|
|
377
376
|
context?: never;
|
|
378
377
|
} : {
|
|
379
|
-
context: TOptions['context'];
|
|
378
|
+
context: TOptions$1['context'];
|
|
380
379
|
});
|
|
381
|
-
type PluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions> & PluginLifecycle<TOptions>;
|
|
382
|
-
type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
380
|
+
type PluginWithLifeCycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions$1> & PluginLifecycle<TOptions$1>;
|
|
381
|
+
type PluginLifecycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
383
382
|
/**
|
|
384
383
|
* Start of the lifecycle of a plugin.
|
|
385
384
|
* @type hookParallel
|
|
386
385
|
*/
|
|
387
|
-
buildStart?: (this: PluginContext<TOptions>, Config: Config) => PossiblePromise<void>;
|
|
386
|
+
buildStart?: (this: PluginContext<TOptions$1>, Config: Config) => PossiblePromise<void>;
|
|
388
387
|
/**
|
|
389
388
|
* Resolve to a Path based on a baseName(example: `./Pet.ts`) and directory(example: `./models`).
|
|
390
389
|
* Options can als be included.
|
|
391
390
|
* @type hookFirst
|
|
392
391
|
* @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
|
|
393
392
|
*/
|
|
394
|
-
resolvePath?: (this: PluginContext<TOptions>, baseName: BaseName, mode?: Mode, options?: TOptions['resolvePathOptions']) => OptionalPath;
|
|
393
|
+
resolvePath?: (this: PluginContext<TOptions$1>, baseName: BaseName, mode?: Mode, options?: TOptions$1['resolvePathOptions']) => OptionalPath;
|
|
395
394
|
/**
|
|
396
395
|
* Resolve to a name based on a string.
|
|
397
396
|
* Useful when converting to PascalCase or camelCase.
|
|
398
397
|
* @type hookFirst
|
|
399
398
|
* @example ('pet') => 'Pet'
|
|
400
399
|
*/
|
|
401
|
-
resolveName?: (this: PluginContext<TOptions>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
400
|
+
resolveName?: (this: PluginContext<TOptions$1>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
402
401
|
/**
|
|
403
402
|
* End of the plugin lifecycle.
|
|
404
403
|
* @type hookParallel
|
|
405
404
|
*/
|
|
406
|
-
buildEnd?: (this: PluginContext<TOptions>) => PossiblePromise<void>;
|
|
405
|
+
buildEnd?: (this: PluginContext<TOptions$1>) => PossiblePromise<void>;
|
|
407
406
|
};
|
|
408
407
|
type PluginLifecycleHooks = keyof PluginLifecycle;
|
|
409
|
-
type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
|
|
410
|
-
type ResolvePathParams<TOptions = object> = {
|
|
408
|
+
type PluginParameter<H$1 extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H$1]>;
|
|
409
|
+
type ResolvePathParams<TOptions$1 = object> = {
|
|
411
410
|
pluginKey?: Plugin['key'];
|
|
412
411
|
baseName: BaseName;
|
|
413
412
|
mode?: Mode;
|
|
414
413
|
/**
|
|
415
414
|
* Options to be passed to 'resolvePath' 3th parameter
|
|
416
415
|
*/
|
|
417
|
-
options?: TOptions;
|
|
416
|
+
options?: TOptions$1;
|
|
418
417
|
};
|
|
419
418
|
type ResolveNameParams = {
|
|
420
419
|
name: string;
|
|
@@ -427,12 +426,15 @@ type ResolveNameParams = {
|
|
|
427
426
|
*/
|
|
428
427
|
type?: 'file' | 'function' | 'type' | 'const';
|
|
429
428
|
};
|
|
430
|
-
type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
429
|
+
type PluginContext<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
431
430
|
config: Config;
|
|
431
|
+
/**
|
|
432
|
+
* @deprecated
|
|
433
|
+
*/
|
|
432
434
|
fileManager: FileManager;
|
|
433
435
|
pluginManager: PluginManager;
|
|
434
436
|
addFile: (...file: Array<File>) => Promise<Array<ResolvedFile>>;
|
|
435
|
-
resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => OptionalPath;
|
|
437
|
+
resolvePath: (params: ResolvePathParams<TOptions$1['resolvePathOptions']>) => OptionalPath;
|
|
436
438
|
resolveName: (params: ResolveNameParams) => string;
|
|
437
439
|
logger: Logger;
|
|
438
440
|
/**
|
|
@@ -442,12 +444,12 @@ type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions>
|
|
|
442
444
|
/**
|
|
443
445
|
* Current plugin
|
|
444
446
|
*/
|
|
445
|
-
plugin: Plugin<TOptions>;
|
|
447
|
+
plugin: Plugin<TOptions$1>;
|
|
446
448
|
};
|
|
447
449
|
/**
|
|
448
450
|
* Specify the export location for the files and define the behavior of the output
|
|
449
451
|
*/
|
|
450
|
-
type Output<TOptions> = {
|
|
452
|
+
type Output<TOptions$1> = {
|
|
451
453
|
/**
|
|
452
454
|
* Path to the output folder or file that will contain the generated code
|
|
453
455
|
*/
|
|
@@ -460,11 +462,11 @@ type Output<TOptions> = {
|
|
|
460
462
|
/**
|
|
461
463
|
* Add a banner text in the beginning of every file
|
|
462
464
|
*/
|
|
463
|
-
banner?: string | ((options: TOptions) => string);
|
|
465
|
+
banner?: string | ((options: TOptions$1) => string);
|
|
464
466
|
/**
|
|
465
467
|
* Add a footer text in the beginning of every file
|
|
466
468
|
*/
|
|
467
|
-
footer?: string | ((options: TOptions) => string);
|
|
469
|
+
footer?: string | ((options: TOptions$1) => string);
|
|
468
470
|
};
|
|
469
471
|
type GroupContext = {
|
|
470
472
|
group: string;
|
|
@@ -480,73 +482,19 @@ type Group = {
|
|
|
480
482
|
name?: (context: GroupContext) => string;
|
|
481
483
|
};
|
|
482
484
|
//#endregion
|
|
483
|
-
//#region ../core/src/FileManager.d.ts
|
|
484
|
-
type FileMetaBase = {
|
|
485
|
-
pluginKey?: Plugin['key'];
|
|
486
|
-
};
|
|
487
|
-
type AddResult<T extends Array<File>> = Promise<Awaited<GreaterThan<T['length'], 1> extends true ? Promise<ResolvedFile[]> : Promise<ResolvedFile>>>;
|
|
488
|
-
type AddIndexesProps = {
|
|
489
|
-
type: BarrelType | false | undefined;
|
|
490
|
-
/**
|
|
491
|
-
* Root based on root and output.path specified in the config
|
|
492
|
-
*/
|
|
493
|
-
root: string;
|
|
494
|
-
/**
|
|
495
|
-
* Output for plugin
|
|
496
|
-
*/
|
|
497
|
-
output: {
|
|
498
|
-
path: string;
|
|
499
|
-
};
|
|
500
|
-
group?: {
|
|
501
|
-
output: string;
|
|
502
|
-
exportAs: string;
|
|
503
|
-
};
|
|
504
|
-
logger?: Logger;
|
|
505
|
-
meta?: FileMetaBase;
|
|
506
|
-
};
|
|
507
|
-
type WriteFilesProps = {
|
|
508
|
-
root: Config['root'];
|
|
509
|
-
extension?: Record<Extname, Extname | ''>;
|
|
510
|
-
logger?: Logger;
|
|
511
|
-
dryRun?: boolean;
|
|
512
|
-
};
|
|
513
|
-
declare class FileManager {
|
|
514
|
-
#private;
|
|
515
|
-
constructor();
|
|
516
|
-
add<T extends Array<File> = Array<File>>(...files: T): AddResult<T>;
|
|
517
|
-
getByPath(path: Path): Promise<ResolvedFile | null>;
|
|
518
|
-
deleteByPath(path: Path): Promise<void>;
|
|
519
|
-
clear(): Promise<void>;
|
|
520
|
-
getFiles(): Promise<Array<ResolvedFile>>;
|
|
521
|
-
processFiles({
|
|
522
|
-
dryRun,
|
|
523
|
-
root,
|
|
524
|
-
extension,
|
|
525
|
-
logger
|
|
526
|
-
}: WriteFilesProps): Promise<Array<ResolvedFile>>;
|
|
527
|
-
getBarrelFiles({
|
|
528
|
-
type,
|
|
529
|
-
meta,
|
|
530
|
-
root,
|
|
531
|
-
output,
|
|
532
|
-
logger
|
|
533
|
-
}: AddIndexesProps): Promise<File[]>;
|
|
534
|
-
static getMode(path: string | undefined | null): Mode;
|
|
535
|
-
}
|
|
536
|
-
//#endregion
|
|
537
485
|
//#region ../core/src/PluginManager.d.ts
|
|
538
486
|
type RequiredPluginLifecycle = Required<PluginLifecycle>;
|
|
539
487
|
type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
|
|
540
|
-
type Executer<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
488
|
+
type Executer<H$1 extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
541
489
|
message: string;
|
|
542
490
|
strategy: Strategy;
|
|
543
|
-
hookName: H;
|
|
491
|
+
hookName: H$1;
|
|
544
492
|
plugin: Plugin;
|
|
545
493
|
parameters?: unknown[] | undefined;
|
|
546
494
|
output?: unknown;
|
|
547
495
|
};
|
|
548
|
-
type ParseResult<H extends PluginLifecycleHooks> = RequiredPluginLifecycle[H];
|
|
549
|
-
type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H>>> = {
|
|
496
|
+
type ParseResult<H$1 extends PluginLifecycleHooks> = RequiredPluginLifecycle[H$1];
|
|
497
|
+
type SafeParseResult<H$1 extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H$1>>> = {
|
|
550
498
|
result: Result;
|
|
551
499
|
plugin: Plugin;
|
|
552
500
|
};
|
|
@@ -562,16 +510,19 @@ type Events = {
|
|
|
562
510
|
executed: [executer: Executer];
|
|
563
511
|
error: [error: Error];
|
|
564
512
|
};
|
|
565
|
-
type GetFileProps<TOptions = object> = {
|
|
513
|
+
type GetFileProps<TOptions$1 = object> = {
|
|
566
514
|
name: string;
|
|
567
515
|
mode?: Mode;
|
|
568
516
|
extname: Extname;
|
|
569
517
|
pluginKey: Plugin['key'];
|
|
570
|
-
options?: TOptions;
|
|
518
|
+
options?: TOptions$1;
|
|
571
519
|
};
|
|
572
520
|
declare class PluginManager {
|
|
573
521
|
#private;
|
|
574
522
|
readonly plugins: Set<Plugin<PluginFactoryOptions<string, object, object, any, object>>>;
|
|
523
|
+
/**
|
|
524
|
+
* @deprecated do not use from pluginManager
|
|
525
|
+
*/
|
|
575
526
|
readonly fileManager: FileManager;
|
|
576
527
|
readonly events: EventEmitter<Events>;
|
|
577
528
|
readonly config: Config;
|
|
@@ -680,6 +631,11 @@ declare class PluginManager {
|
|
|
680
631
|
static get hooks(): readonly ["buildStart", "resolvePath", "resolveName", "buildEnd"];
|
|
681
632
|
}
|
|
682
633
|
//#endregion
|
|
634
|
+
//#region ../core/src/FileManager.d.ts
|
|
635
|
+
type FileMetaBase = {
|
|
636
|
+
pluginKey?: Plugin['key'];
|
|
637
|
+
};
|
|
638
|
+
//#endregion
|
|
683
639
|
//#region ../oas/src/types.d.ts
|
|
684
640
|
type contentType = 'application/json' | (string & {});
|
|
685
641
|
type SchemaObject$1 = OasTypes.SchemaObject & {
|
|
@@ -1008,12 +964,12 @@ type ByContentType = {
|
|
|
1008
964
|
};
|
|
1009
965
|
type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
1010
966
|
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
1011
|
-
type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
1012
|
-
options: Partial<TOptions>;
|
|
967
|
+
type Override<TOptions$1> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
968
|
+
options: Partial<TOptions$1>;
|
|
1013
969
|
};
|
|
1014
970
|
//#endregion
|
|
1015
971
|
//#region ../plugin-oas/src/SchemaGenerator.d.ts
|
|
1016
|
-
type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
972
|
+
type Context$1<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
|
|
1017
973
|
oas: Oas;
|
|
1018
974
|
pluginManager: PluginManager;
|
|
1019
975
|
/**
|
|
@@ -1022,7 +978,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
1022
978
|
plugin: Plugin<TPluginOptions>;
|
|
1023
979
|
mode: Mode;
|
|
1024
980
|
include?: Array<'schemas' | 'responses' | 'requestBodies'>;
|
|
1025
|
-
override: Array<Override<TOptions>> | undefined;
|
|
981
|
+
override: Array<Override<TOptions$1>> | undefined;
|
|
1026
982
|
contentType?: contentType;
|
|
1027
983
|
output?: string;
|
|
1028
984
|
};
|
|
@@ -1053,7 +1009,7 @@ type SchemaProps$1 = {
|
|
|
1053
1009
|
name?: string;
|
|
1054
1010
|
parentName?: string;
|
|
1055
1011
|
};
|
|
1056
|
-
declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context$1<TOptions, TPluginOptions>> {
|
|
1012
|
+
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>> {
|
|
1057
1013
|
#private;
|
|
1058
1014
|
refs: Refs;
|
|
1059
1015
|
/**
|
|
@@ -1072,39 +1028,39 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
|
|
|
1072
1028
|
}
|
|
1073
1029
|
//#endregion
|
|
1074
1030
|
//#region ../plugin-oas/src/generator.d.ts
|
|
1075
|
-
type OperationsProps<TOptions extends PluginFactoryOptions> = {
|
|
1076
|
-
instance: Omit<OperationGenerator<TOptions>, 'build'>;
|
|
1077
|
-
options: TOptions['resolvedOptions'];
|
|
1031
|
+
type OperationsProps<TOptions$1 extends PluginFactoryOptions> = {
|
|
1032
|
+
instance: Omit<OperationGenerator<TOptions$1>, 'build'>;
|
|
1033
|
+
options: TOptions$1['resolvedOptions'];
|
|
1078
1034
|
operations: Array<Operation$1>;
|
|
1079
1035
|
};
|
|
1080
|
-
type OperationProps<TOptions extends PluginFactoryOptions> = {
|
|
1081
|
-
instance: Omit<OperationGenerator<TOptions>, 'build'>;
|
|
1082
|
-
options: TOptions['resolvedOptions'];
|
|
1036
|
+
type OperationProps<TOptions$1 extends PluginFactoryOptions> = {
|
|
1037
|
+
instance: Omit<OperationGenerator<TOptions$1>, 'build'>;
|
|
1038
|
+
options: TOptions$1['resolvedOptions'];
|
|
1083
1039
|
operation: Operation$1;
|
|
1084
1040
|
};
|
|
1085
|
-
type SchemaProps<TOptions extends PluginFactoryOptions> = {
|
|
1086
|
-
instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
|
|
1087
|
-
options: TOptions['resolvedOptions'];
|
|
1041
|
+
type SchemaProps<TOptions$1 extends PluginFactoryOptions> = {
|
|
1042
|
+
instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions$1>, 'build'>;
|
|
1043
|
+
options: TOptions$1['resolvedOptions'];
|
|
1088
1044
|
schema: {
|
|
1089
1045
|
name: string;
|
|
1090
1046
|
tree: Array<Schema>;
|
|
1091
1047
|
value: SchemaObject$1;
|
|
1092
1048
|
};
|
|
1093
1049
|
};
|
|
1094
|
-
type GeneratorOptions<TOptions extends PluginFactoryOptions> = {
|
|
1050
|
+
type GeneratorOptions<TOptions$1 extends PluginFactoryOptions> = {
|
|
1095
1051
|
name: string;
|
|
1096
|
-
operations?: (this: GeneratorOptions<TOptions>, props: OperationsProps<TOptions>) => Promise<File[]>;
|
|
1097
|
-
operation?: (this: GeneratorOptions<TOptions>, props: OperationProps<TOptions>) => Promise<File[]>;
|
|
1098
|
-
schema?: (this: GeneratorOptions<TOptions>, props: SchemaProps<TOptions>) => Promise<File[]>;
|
|
1052
|
+
operations?: (this: GeneratorOptions<TOptions$1>, props: OperationsProps<TOptions$1>) => Promise<File[]>;
|
|
1053
|
+
operation?: (this: GeneratorOptions<TOptions$1>, props: OperationProps<TOptions$1>) => Promise<File[]>;
|
|
1054
|
+
schema?: (this: GeneratorOptions<TOptions$1>, props: SchemaProps<TOptions$1>) => Promise<File[]>;
|
|
1099
1055
|
};
|
|
1100
|
-
type Generator<TOptions extends PluginFactoryOptions> = GeneratorOptions<TOptions>;
|
|
1056
|
+
type Generator<TOptions$1 extends PluginFactoryOptions> = GeneratorOptions<TOptions$1>;
|
|
1101
1057
|
//#endregion
|
|
1102
1058
|
//#region ../plugin-oas/src/OperationGenerator.d.ts
|
|
1103
|
-
type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
1059
|
+
type Context<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
|
|
1104
1060
|
oas: Oas;
|
|
1105
1061
|
exclude: Array<Exclude$1> | undefined;
|
|
1106
1062
|
include: Array<Include> | undefined;
|
|
1107
|
-
override: Array<Override<TOptions>> | undefined;
|
|
1063
|
+
override: Array<Override<TOptions$1>> | undefined;
|
|
1108
1064
|
contentType: contentType | undefined;
|
|
1109
1065
|
pluginManager: PluginManager;
|
|
1110
1066
|
/**
|
|
@@ -1128,5 +1084,5 @@ declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = P
|
|
|
1128
1084
|
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
|
|
1129
1085
|
}
|
|
1130
1086
|
//#endregion
|
|
1131
|
-
export {
|
|
1132
|
-
//# sourceMappingURL=OperationGenerator-
|
|
1087
|
+
export { Override as a, contentType as c, PluginFactoryOptions as d, ResolveNameParams as f, OperationSchemas as i, Group as l, File as m, Exclude$1 as n, ResolvePathOptions as o, UserPluginWithLifeCycle as p, Include as r, Oas as s, Generator as t, Output as u };
|
|
1088
|
+
//# sourceMappingURL=OperationGenerator-c8MWYsSI.d.ts.map
|