@kubb/plugin-redoc 4.18.3 → 4.18.5
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/index.d.cts +40 -40
- package/dist/index.d.ts +40 -40
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -291,7 +291,7 @@ type Config<TInput = Input> = {
|
|
|
291
291
|
input: TInput;
|
|
292
292
|
output: {
|
|
293
293
|
/**
|
|
294
|
-
* The path where all generated files
|
|
294
|
+
* The path where all generated files receives exported.
|
|
295
295
|
* This can be an absolute path or a path relative to the specified root option.
|
|
296
296
|
*/
|
|
297
297
|
path: string;
|
|
@@ -306,41 +306,39 @@ type Config<TInput = Input> = {
|
|
|
306
306
|
write?: boolean;
|
|
307
307
|
/**
|
|
308
308
|
* Specifies the formatting tool to be used.
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
* - '
|
|
313
|
-
* -
|
|
314
|
-
*
|
|
315
|
-
*
|
|
309
|
+
* - 'auto' automatically detects and uses biome or prettier (in that order of preference).
|
|
310
|
+
* - 'prettier' uses Prettier for code formatting.
|
|
311
|
+
* - 'biome' uses Biome for code formatting.
|
|
312
|
+
* - 'oxfmt' uses Oxfmt for code formatting.
|
|
313
|
+
* - false disables code formatting.
|
|
314
|
+
* @default 'prettier'
|
|
316
315
|
*/
|
|
317
316
|
format?: 'auto' | 'prettier' | 'biome' | 'oxfmt' | false;
|
|
318
317
|
/**
|
|
319
318
|
* Specifies the linter that should be used to analyze the code.
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
* - '
|
|
324
|
-
* -
|
|
325
|
-
*
|
|
326
|
-
* - 'oxlint': Represents the Oxlint tool for linting purposes.
|
|
327
|
-
*
|
|
319
|
+
* - 'auto' automatically detects and uses biome, oxlint, or eslint (in that order of preference).
|
|
320
|
+
* - 'eslint' uses ESLint for linting.
|
|
321
|
+
* - 'biome' uses Biome for linting.
|
|
322
|
+
* - 'oxlint' uses Oxlint for linting.
|
|
323
|
+
* - false disables linting.
|
|
324
|
+
* @default 'auto'
|
|
328
325
|
*/
|
|
329
326
|
lint?: 'auto' | 'eslint' | 'biome' | 'oxlint' | false;
|
|
330
327
|
/**
|
|
331
|
-
*
|
|
328
|
+
* Overrides the extension for generated imports and exports. By default, each plugin adds an extension.
|
|
332
329
|
* @default { '.ts': '.ts'}
|
|
333
330
|
*/
|
|
334
331
|
extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
|
|
335
332
|
/**
|
|
336
|
-
*
|
|
333
|
+
* Configures how `index.ts` files are created, including disabling barrel file generation. Each plugin has its own `barrelType` option; this setting controls the root barrel file (e.g., `src/gen/index.ts`).
|
|
337
334
|
* @default 'named'
|
|
338
335
|
*/
|
|
339
336
|
barrelType?: Exclude<BarrelType, 'propagate'> | false;
|
|
340
337
|
/**
|
|
341
|
-
*
|
|
342
|
-
* - 'simple'
|
|
343
|
-
* - 'full'
|
|
338
|
+
* Adds a default banner to the start of every generated file indicating it was generated by Kubb.
|
|
339
|
+
* - 'simple' adds banner with link to Kubb.
|
|
340
|
+
* - 'full' adds source, title, description, and OpenAPI version.
|
|
341
|
+
* - false disables banner generation.
|
|
344
342
|
* @default 'simple'
|
|
345
343
|
*/
|
|
346
344
|
defaultBanner?: 'simple' | 'full' | false;
|
|
@@ -353,17 +351,17 @@ type Config<TInput = Input> = {
|
|
|
353
351
|
override?: boolean;
|
|
354
352
|
};
|
|
355
353
|
/**
|
|
356
|
-
* An array of Kubb plugins that
|
|
354
|
+
* An array of Kubb plugins that used in the generation.
|
|
357
355
|
* Each plugin may include additional configurable options(defined in the plugin itself).
|
|
358
|
-
* If a plugin depends on another plugin, an error
|
|
356
|
+
* If a plugin depends on another plugin, an error is returned if the required dependency is missing. See pre for more details.
|
|
359
357
|
*/
|
|
360
358
|
plugins?: Array<Plugin>;
|
|
361
359
|
/**
|
|
362
|
-
* Hooks
|
|
360
|
+
* Hooks triggered when a specific action occurs in Kubb.
|
|
363
361
|
*/
|
|
364
362
|
hooks?: {
|
|
365
363
|
/**
|
|
366
|
-
* Hook that
|
|
364
|
+
* Hook that triggers at the end of all executions.
|
|
367
365
|
* Useful for running Prettier or ESLint to format/lint your code.
|
|
368
366
|
*/
|
|
369
367
|
done?: string | Array<string>;
|
|
@@ -392,7 +390,7 @@ TContext = any,
|
|
|
392
390
|
TResolvePathOptions extends object = object> = {
|
|
393
391
|
name: TName;
|
|
394
392
|
/**
|
|
395
|
-
* Same
|
|
393
|
+
* Same behavior like what has been done with `QueryKey` in `@tanstack/react-query`
|
|
396
394
|
*/
|
|
397
395
|
key: PluginKey<TName | string>;
|
|
398
396
|
options: TOptions;
|
|
@@ -413,12 +411,12 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
|
|
|
413
411
|
*/
|
|
414
412
|
options: TOptions['resolvedOptions'];
|
|
415
413
|
/**
|
|
416
|
-
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin
|
|
414
|
+
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin is executed after these plugins.
|
|
417
415
|
* Can be used to validate dependent plugins.
|
|
418
416
|
*/
|
|
419
417
|
pre?: Array<string>;
|
|
420
418
|
/**
|
|
421
|
-
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin
|
|
419
|
+
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin is executed before these plugins.
|
|
422
420
|
*/
|
|
423
421
|
post?: Array<string>;
|
|
424
422
|
inject?: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => TOptions['context'];
|
|
@@ -436,12 +434,12 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
|
436
434
|
*/
|
|
437
435
|
key: TOptions['key'];
|
|
438
436
|
/**
|
|
439
|
-
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin
|
|
437
|
+
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin is executed after these plugins.
|
|
440
438
|
* Can be used to validate dependent plugins.
|
|
441
439
|
*/
|
|
442
440
|
pre?: Array<string>;
|
|
443
441
|
/**
|
|
444
|
-
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin
|
|
442
|
+
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin is executed before these plugins.
|
|
445
443
|
*/
|
|
446
444
|
post?: Array<string>;
|
|
447
445
|
/**
|
|
@@ -491,10 +489,12 @@ type ResolveNameParams = {
|
|
|
491
489
|
name: string;
|
|
492
490
|
pluginKey?: Plugin['key'];
|
|
493
491
|
/**
|
|
494
|
-
*
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
492
|
+
* Specifies the type of entity being named.
|
|
493
|
+
* - 'file' customizes the name of the created file (uses camelCase).
|
|
494
|
+
* - 'function' customizes the exported function names (uses camelCase).
|
|
495
|
+
* - 'type' customizes TypeScript types (uses PascalCase).
|
|
496
|
+
* - 'const' customizes variable names (uses camelCase).
|
|
497
|
+
* @default undefined
|
|
498
498
|
*/
|
|
499
499
|
type?: 'file' | 'function' | 'type' | 'const';
|
|
500
500
|
};
|
|
@@ -612,7 +612,7 @@ declare class PluginManager {
|
|
|
612
612
|
parameters: PluginParameter<H>;
|
|
613
613
|
}): Array<ReturnType<ParseResult<H>>> | null;
|
|
614
614
|
/**
|
|
615
|
-
*
|
|
615
|
+
* Returns the first non-null result.
|
|
616
616
|
*/
|
|
617
617
|
hookFirst<H extends PluginLifecycleHooks>({
|
|
618
618
|
hookName,
|
|
@@ -624,7 +624,7 @@ declare class PluginManager {
|
|
|
624
624
|
skipped?: ReadonlySet<Plugin> | null;
|
|
625
625
|
}): Promise<SafeParseResult<H>>;
|
|
626
626
|
/**
|
|
627
|
-
*
|
|
627
|
+
* Returns the first non-null result.
|
|
628
628
|
*/
|
|
629
629
|
hookFirstSync<H extends PluginLifecycleHooks>({
|
|
630
630
|
hookName,
|
|
@@ -636,15 +636,15 @@ declare class PluginManager {
|
|
|
636
636
|
skipped?: ReadonlySet<Plugin> | null;
|
|
637
637
|
}): SafeParseResult<H>;
|
|
638
638
|
/**
|
|
639
|
-
*
|
|
639
|
+
* Runs all plugins in parallel based on `this.plugin` order and `pre`/`post` settings.
|
|
640
640
|
*/
|
|
641
|
-
hookParallel<H extends PluginLifecycleHooks,
|
|
641
|
+
hookParallel<H extends PluginLifecycleHooks, TOutput = void>({
|
|
642
642
|
hookName,
|
|
643
643
|
parameters
|
|
644
644
|
}: {
|
|
645
645
|
hookName: H;
|
|
646
646
|
parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
|
|
647
|
-
}): Promise<Awaited<
|
|
647
|
+
}): Promise<Awaited<TOutput>[]>;
|
|
648
648
|
/**
|
|
649
649
|
* Chains plugins
|
|
650
650
|
*/
|
|
@@ -688,7 +688,7 @@ declare class Oas extends BaseOas {
|
|
|
688
688
|
getResponseSchema(operation: Operation$1, statusCode: string | number): SchemaObject$1;
|
|
689
689
|
getRequestSchema(operation: Operation$1): SchemaObject$1 | undefined;
|
|
690
690
|
getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
|
|
691
|
-
|
|
691
|
+
validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
|
|
692
692
|
flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
|
|
693
693
|
}
|
|
694
694
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -290,7 +290,7 @@ type Config<TInput = Input> = {
|
|
|
290
290
|
input: TInput;
|
|
291
291
|
output: {
|
|
292
292
|
/**
|
|
293
|
-
* The path where all generated files
|
|
293
|
+
* The path where all generated files receives exported.
|
|
294
294
|
* This can be an absolute path or a path relative to the specified root option.
|
|
295
295
|
*/
|
|
296
296
|
path: string;
|
|
@@ -305,41 +305,39 @@ type Config<TInput = Input> = {
|
|
|
305
305
|
write?: boolean;
|
|
306
306
|
/**
|
|
307
307
|
* Specifies the formatting tool to be used.
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
* - '
|
|
312
|
-
* -
|
|
313
|
-
*
|
|
314
|
-
*
|
|
308
|
+
* - 'auto' automatically detects and uses biome or prettier (in that order of preference).
|
|
309
|
+
* - 'prettier' uses Prettier for code formatting.
|
|
310
|
+
* - 'biome' uses Biome for code formatting.
|
|
311
|
+
* - 'oxfmt' uses Oxfmt for code formatting.
|
|
312
|
+
* - false disables code formatting.
|
|
313
|
+
* @default 'prettier'
|
|
315
314
|
*/
|
|
316
315
|
format?: 'auto' | 'prettier' | 'biome' | 'oxfmt' | false;
|
|
317
316
|
/**
|
|
318
317
|
* Specifies the linter that should be used to analyze the code.
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
* - '
|
|
323
|
-
* -
|
|
324
|
-
*
|
|
325
|
-
* - 'oxlint': Represents the Oxlint tool for linting purposes.
|
|
326
|
-
*
|
|
318
|
+
* - 'auto' automatically detects and uses biome, oxlint, or eslint (in that order of preference).
|
|
319
|
+
* - 'eslint' uses ESLint for linting.
|
|
320
|
+
* - 'biome' uses Biome for linting.
|
|
321
|
+
* - 'oxlint' uses Oxlint for linting.
|
|
322
|
+
* - false disables linting.
|
|
323
|
+
* @default 'auto'
|
|
327
324
|
*/
|
|
328
325
|
lint?: 'auto' | 'eslint' | 'biome' | 'oxlint' | false;
|
|
329
326
|
/**
|
|
330
|
-
*
|
|
327
|
+
* Overrides the extension for generated imports and exports. By default, each plugin adds an extension.
|
|
331
328
|
* @default { '.ts': '.ts'}
|
|
332
329
|
*/
|
|
333
330
|
extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
|
|
334
331
|
/**
|
|
335
|
-
*
|
|
332
|
+
* Configures how `index.ts` files are created, including disabling barrel file generation. Each plugin has its own `barrelType` option; this setting controls the root barrel file (e.g., `src/gen/index.ts`).
|
|
336
333
|
* @default 'named'
|
|
337
334
|
*/
|
|
338
335
|
barrelType?: Exclude<BarrelType, 'propagate'> | false;
|
|
339
336
|
/**
|
|
340
|
-
*
|
|
341
|
-
* - 'simple'
|
|
342
|
-
* - 'full'
|
|
337
|
+
* Adds a default banner to the start of every generated file indicating it was generated by Kubb.
|
|
338
|
+
* - 'simple' adds banner with link to Kubb.
|
|
339
|
+
* - 'full' adds source, title, description, and OpenAPI version.
|
|
340
|
+
* - false disables banner generation.
|
|
343
341
|
* @default 'simple'
|
|
344
342
|
*/
|
|
345
343
|
defaultBanner?: 'simple' | 'full' | false;
|
|
@@ -352,17 +350,17 @@ type Config<TInput = Input> = {
|
|
|
352
350
|
override?: boolean;
|
|
353
351
|
};
|
|
354
352
|
/**
|
|
355
|
-
* An array of Kubb plugins that
|
|
353
|
+
* An array of Kubb plugins that used in the generation.
|
|
356
354
|
* Each plugin may include additional configurable options(defined in the plugin itself).
|
|
357
|
-
* If a plugin depends on another plugin, an error
|
|
355
|
+
* If a plugin depends on another plugin, an error is returned if the required dependency is missing. See pre for more details.
|
|
358
356
|
*/
|
|
359
357
|
plugins?: Array<Plugin>;
|
|
360
358
|
/**
|
|
361
|
-
* Hooks
|
|
359
|
+
* Hooks triggered when a specific action occurs in Kubb.
|
|
362
360
|
*/
|
|
363
361
|
hooks?: {
|
|
364
362
|
/**
|
|
365
|
-
* Hook that
|
|
363
|
+
* Hook that triggers at the end of all executions.
|
|
366
364
|
* Useful for running Prettier or ESLint to format/lint your code.
|
|
367
365
|
*/
|
|
368
366
|
done?: string | Array<string>;
|
|
@@ -391,7 +389,7 @@ TContext = any,
|
|
|
391
389
|
TResolvePathOptions extends object = object> = {
|
|
392
390
|
name: TName;
|
|
393
391
|
/**
|
|
394
|
-
* Same
|
|
392
|
+
* Same behavior like what has been done with `QueryKey` in `@tanstack/react-query`
|
|
395
393
|
*/
|
|
396
394
|
key: PluginKey<TName | string>;
|
|
397
395
|
options: TOptions;
|
|
@@ -412,12 +410,12 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
|
|
|
412
410
|
*/
|
|
413
411
|
options: TOptions['resolvedOptions'];
|
|
414
412
|
/**
|
|
415
|
-
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin
|
|
413
|
+
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin is executed after these plugins.
|
|
416
414
|
* Can be used to validate dependent plugins.
|
|
417
415
|
*/
|
|
418
416
|
pre?: Array<string>;
|
|
419
417
|
/**
|
|
420
|
-
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin
|
|
418
|
+
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin is executed before these plugins.
|
|
421
419
|
*/
|
|
422
420
|
post?: Array<string>;
|
|
423
421
|
inject?: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => TOptions['context'];
|
|
@@ -435,12 +433,12 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
|
435
433
|
*/
|
|
436
434
|
key: TOptions['key'];
|
|
437
435
|
/**
|
|
438
|
-
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin
|
|
436
|
+
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin is executed after these plugins.
|
|
439
437
|
* Can be used to validate dependent plugins.
|
|
440
438
|
*/
|
|
441
439
|
pre?: Array<string>;
|
|
442
440
|
/**
|
|
443
|
-
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin
|
|
441
|
+
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin is executed before these plugins.
|
|
444
442
|
*/
|
|
445
443
|
post?: Array<string>;
|
|
446
444
|
/**
|
|
@@ -490,10 +488,12 @@ type ResolveNameParams = {
|
|
|
490
488
|
name: string;
|
|
491
489
|
pluginKey?: Plugin['key'];
|
|
492
490
|
/**
|
|
493
|
-
*
|
|
494
|
-
*
|
|
495
|
-
*
|
|
496
|
-
*
|
|
491
|
+
* Specifies the type of entity being named.
|
|
492
|
+
* - 'file' customizes the name of the created file (uses camelCase).
|
|
493
|
+
* - 'function' customizes the exported function names (uses camelCase).
|
|
494
|
+
* - 'type' customizes TypeScript types (uses PascalCase).
|
|
495
|
+
* - 'const' customizes variable names (uses camelCase).
|
|
496
|
+
* @default undefined
|
|
497
497
|
*/
|
|
498
498
|
type?: 'file' | 'function' | 'type' | 'const';
|
|
499
499
|
};
|
|
@@ -611,7 +611,7 @@ declare class PluginManager {
|
|
|
611
611
|
parameters: PluginParameter<H>;
|
|
612
612
|
}): Array<ReturnType<ParseResult<H>>> | null;
|
|
613
613
|
/**
|
|
614
|
-
*
|
|
614
|
+
* Returns the first non-null result.
|
|
615
615
|
*/
|
|
616
616
|
hookFirst<H extends PluginLifecycleHooks>({
|
|
617
617
|
hookName,
|
|
@@ -623,7 +623,7 @@ declare class PluginManager {
|
|
|
623
623
|
skipped?: ReadonlySet<Plugin> | null;
|
|
624
624
|
}): Promise<SafeParseResult<H>>;
|
|
625
625
|
/**
|
|
626
|
-
*
|
|
626
|
+
* Returns the first non-null result.
|
|
627
627
|
*/
|
|
628
628
|
hookFirstSync<H extends PluginLifecycleHooks>({
|
|
629
629
|
hookName,
|
|
@@ -635,15 +635,15 @@ declare class PluginManager {
|
|
|
635
635
|
skipped?: ReadonlySet<Plugin> | null;
|
|
636
636
|
}): SafeParseResult<H>;
|
|
637
637
|
/**
|
|
638
|
-
*
|
|
638
|
+
* Runs all plugins in parallel based on `this.plugin` order and `pre`/`post` settings.
|
|
639
639
|
*/
|
|
640
|
-
hookParallel<H extends PluginLifecycleHooks,
|
|
640
|
+
hookParallel<H extends PluginLifecycleHooks, TOutput = void>({
|
|
641
641
|
hookName,
|
|
642
642
|
parameters
|
|
643
643
|
}: {
|
|
644
644
|
hookName: H;
|
|
645
645
|
parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
|
|
646
|
-
}): Promise<Awaited<
|
|
646
|
+
}): Promise<Awaited<TOutput>[]>;
|
|
647
647
|
/**
|
|
648
648
|
* Chains plugins
|
|
649
649
|
*/
|
|
@@ -687,7 +687,7 @@ declare class Oas extends BaseOas {
|
|
|
687
687
|
getResponseSchema(operation: Operation$1, statusCode: string | number): SchemaObject$1;
|
|
688
688
|
getRequestSchema(operation: Operation$1): SchemaObject$1 | undefined;
|
|
689
689
|
getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
|
|
690
|
-
|
|
690
|
+
validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
|
|
691
691
|
flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
|
|
692
692
|
}
|
|
693
693
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-redoc",
|
|
3
|
-
"version": "4.18.
|
|
3
|
+
"version": "4.18.5",
|
|
4
4
|
"description": "Beautiful docs with Redoc",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
}
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@kubb/react-fabric": "0.
|
|
49
|
+
"@kubb/react-fabric": "0.12.4",
|
|
50
50
|
"handlebars": "^4.7.8",
|
|
51
|
-
"@kubb/
|
|
52
|
-
"@kubb/oas": "4.18.
|
|
53
|
-
"@kubb/
|
|
51
|
+
"@kubb/oas": "4.18.5",
|
|
52
|
+
"@kubb/plugin-oas": "4.18.5",
|
|
53
|
+
"@kubb/core": "4.18.5"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@kubb/react-fabric": "0.
|
|
56
|
+
"@kubb/react-fabric": "0.12.4"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=20"
|