@kubb/plugin-redoc 4.2.0 → 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/index.d.cts +10 -59
- package/dist/index.d.ts +10 -59
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -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 { OASDocument, SchemaObject, User } from "oas/types";
|
|
4
5
|
import { Operation } 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
|
|
11
|
+
type BasePath<T extends string = string> = `${T}/`;
|
|
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
|
|
85
|
+
type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
|
|
85
86
|
type OptionalPath = Path | undefined | null;
|
|
86
87
|
type File<TMeta extends object = object> = {
|
|
87
88
|
/**
|
|
@@ -170,9 +171,7 @@ type Logger = {
|
|
|
170
171
|
};
|
|
171
172
|
//#endregion
|
|
172
173
|
//#region ../core/src/utils/types.d.ts
|
|
173
|
-
type PossiblePromise<T
|
|
174
|
-
type ArrayWithLength<T$1 extends number, U extends any[] = []> = U['length'] extends T$1 ? U : ArrayWithLength<T$1, [true, ...U]>;
|
|
175
|
-
type GreaterThan<T$1 extends number, U extends number> = ArrayWithLength<U> extends [...ArrayWithLength<T$1>, ...infer _] ? false : true;
|
|
174
|
+
type PossiblePromise<T> = Promise<T> | T;
|
|
176
175
|
//#endregion
|
|
177
176
|
//#region ../core/src/types.d.ts
|
|
178
177
|
type InputPath = {
|
|
@@ -415,6 +414,9 @@ type ResolveNameParams = {
|
|
|
415
414
|
};
|
|
416
415
|
type PluginContext<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
417
416
|
config: Config;
|
|
417
|
+
/**
|
|
418
|
+
* @deprecated
|
|
419
|
+
*/
|
|
418
420
|
fileManager: FileManager;
|
|
419
421
|
pluginManager: PluginManager;
|
|
420
422
|
addFile: (...file: Array<File>) => Promise<Array<ResolvedFile>>;
|
|
@@ -453,60 +455,6 @@ type Output<TOptions$1> = {
|
|
|
453
455
|
footer?: string | ((options: TOptions$1) => string);
|
|
454
456
|
};
|
|
455
457
|
//#endregion
|
|
456
|
-
//#region ../core/src/FileManager.d.ts
|
|
457
|
-
type FileMetaBase = {
|
|
458
|
-
pluginKey?: Plugin['key'];
|
|
459
|
-
};
|
|
460
|
-
type AddResult<T$1 extends Array<File>> = Promise<Awaited<GreaterThan<T$1['length'], 1> extends true ? Promise<ResolvedFile[]> : Promise<ResolvedFile>>>;
|
|
461
|
-
type AddIndexesProps = {
|
|
462
|
-
type: BarrelType | false | undefined;
|
|
463
|
-
/**
|
|
464
|
-
* Root based on root and output.path specified in the config
|
|
465
|
-
*/
|
|
466
|
-
root: string;
|
|
467
|
-
/**
|
|
468
|
-
* Output for plugin
|
|
469
|
-
*/
|
|
470
|
-
output: {
|
|
471
|
-
path: string;
|
|
472
|
-
};
|
|
473
|
-
group?: {
|
|
474
|
-
output: string;
|
|
475
|
-
exportAs: string;
|
|
476
|
-
};
|
|
477
|
-
logger?: Logger;
|
|
478
|
-
meta?: FileMetaBase;
|
|
479
|
-
};
|
|
480
|
-
type WriteFilesProps = {
|
|
481
|
-
root: Config['root'];
|
|
482
|
-
extension?: Record<Extname, Extname | ''>;
|
|
483
|
-
logger?: Logger;
|
|
484
|
-
dryRun?: boolean;
|
|
485
|
-
};
|
|
486
|
-
declare class FileManager {
|
|
487
|
-
#private;
|
|
488
|
-
constructor();
|
|
489
|
-
add<T extends Array<File> = Array<File>>(...files: T): AddResult<T>;
|
|
490
|
-
getByPath(path: Path): Promise<ResolvedFile | null>;
|
|
491
|
-
deleteByPath(path: Path): Promise<void>;
|
|
492
|
-
clear(): Promise<void>;
|
|
493
|
-
getFiles(): Promise<Array<ResolvedFile>>;
|
|
494
|
-
processFiles({
|
|
495
|
-
dryRun,
|
|
496
|
-
root,
|
|
497
|
-
extension,
|
|
498
|
-
logger
|
|
499
|
-
}: WriteFilesProps): Promise<Array<ResolvedFile>>;
|
|
500
|
-
getBarrelFiles({
|
|
501
|
-
type,
|
|
502
|
-
meta,
|
|
503
|
-
root,
|
|
504
|
-
output,
|
|
505
|
-
logger
|
|
506
|
-
}: AddIndexesProps): Promise<File[]>;
|
|
507
|
-
static getMode(path: string | undefined | null): Mode;
|
|
508
|
-
}
|
|
509
|
-
//#endregion
|
|
510
458
|
//#region ../core/src/PluginManager.d.ts
|
|
511
459
|
type RequiredPluginLifecycle = Required<PluginLifecycle>;
|
|
512
460
|
type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
|
|
@@ -545,6 +493,9 @@ type GetFileProps<TOptions$1 = object> = {
|
|
|
545
493
|
declare class PluginManager {
|
|
546
494
|
#private;
|
|
547
495
|
readonly plugins: Set<Plugin<PluginFactoryOptions<string, object, object, any, object>>>;
|
|
496
|
+
/**
|
|
497
|
+
* @deprecated do not use from pluginManager
|
|
498
|
+
*/
|
|
548
499
|
readonly fileManager: FileManager;
|
|
549
500
|
readonly events: EventEmitter<Events>;
|
|
550
501
|
readonly config: Config;
|
package/dist/index.d.ts
CHANGED
|
@@ -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 { OASDocument, SchemaObject, User } from "oas/types";
|
|
4
5
|
import { Operation } 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
|
|
11
|
+
type BasePath<T extends string = string> = `${T}/`;
|
|
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
|
|
85
|
+
type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
|
|
85
86
|
type OptionalPath = Path | undefined | null;
|
|
86
87
|
type File<TMeta extends object = object> = {
|
|
87
88
|
/**
|
|
@@ -170,9 +171,7 @@ type Logger = {
|
|
|
170
171
|
};
|
|
171
172
|
//#endregion
|
|
172
173
|
//#region ../core/src/utils/types.d.ts
|
|
173
|
-
type PossiblePromise<T
|
|
174
|
-
type ArrayWithLength<T$1 extends number, U extends any[] = []> = U['length'] extends T$1 ? U : ArrayWithLength<T$1, [true, ...U]>;
|
|
175
|
-
type GreaterThan<T$1 extends number, U extends number> = ArrayWithLength<U> extends [...ArrayWithLength<T$1>, ...infer _] ? false : true;
|
|
174
|
+
type PossiblePromise<T> = Promise<T> | T;
|
|
176
175
|
//#endregion
|
|
177
176
|
//#region ../core/src/types.d.ts
|
|
178
177
|
type InputPath = {
|
|
@@ -415,6 +414,9 @@ type ResolveNameParams = {
|
|
|
415
414
|
};
|
|
416
415
|
type PluginContext<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
417
416
|
config: Config;
|
|
417
|
+
/**
|
|
418
|
+
* @deprecated
|
|
419
|
+
*/
|
|
418
420
|
fileManager: FileManager;
|
|
419
421
|
pluginManager: PluginManager;
|
|
420
422
|
addFile: (...file: Array<File>) => Promise<Array<ResolvedFile>>;
|
|
@@ -453,60 +455,6 @@ type Output<TOptions$1> = {
|
|
|
453
455
|
footer?: string | ((options: TOptions$1) => string);
|
|
454
456
|
};
|
|
455
457
|
//#endregion
|
|
456
|
-
//#region ../core/src/FileManager.d.ts
|
|
457
|
-
type FileMetaBase = {
|
|
458
|
-
pluginKey?: Plugin['key'];
|
|
459
|
-
};
|
|
460
|
-
type AddResult<T$1 extends Array<File>> = Promise<Awaited<GreaterThan<T$1['length'], 1> extends true ? Promise<ResolvedFile[]> : Promise<ResolvedFile>>>;
|
|
461
|
-
type AddIndexesProps = {
|
|
462
|
-
type: BarrelType | false | undefined;
|
|
463
|
-
/**
|
|
464
|
-
* Root based on root and output.path specified in the config
|
|
465
|
-
*/
|
|
466
|
-
root: string;
|
|
467
|
-
/**
|
|
468
|
-
* Output for plugin
|
|
469
|
-
*/
|
|
470
|
-
output: {
|
|
471
|
-
path: string;
|
|
472
|
-
};
|
|
473
|
-
group?: {
|
|
474
|
-
output: string;
|
|
475
|
-
exportAs: string;
|
|
476
|
-
};
|
|
477
|
-
logger?: Logger;
|
|
478
|
-
meta?: FileMetaBase;
|
|
479
|
-
};
|
|
480
|
-
type WriteFilesProps = {
|
|
481
|
-
root: Config['root'];
|
|
482
|
-
extension?: Record<Extname, Extname | ''>;
|
|
483
|
-
logger?: Logger;
|
|
484
|
-
dryRun?: boolean;
|
|
485
|
-
};
|
|
486
|
-
declare class FileManager {
|
|
487
|
-
#private;
|
|
488
|
-
constructor();
|
|
489
|
-
add<T extends Array<File> = Array<File>>(...files: T): AddResult<T>;
|
|
490
|
-
getByPath(path: Path): Promise<ResolvedFile | null>;
|
|
491
|
-
deleteByPath(path: Path): Promise<void>;
|
|
492
|
-
clear(): Promise<void>;
|
|
493
|
-
getFiles(): Promise<Array<ResolvedFile>>;
|
|
494
|
-
processFiles({
|
|
495
|
-
dryRun,
|
|
496
|
-
root,
|
|
497
|
-
extension,
|
|
498
|
-
logger
|
|
499
|
-
}: WriteFilesProps): Promise<Array<ResolvedFile>>;
|
|
500
|
-
getBarrelFiles({
|
|
501
|
-
type,
|
|
502
|
-
meta,
|
|
503
|
-
root,
|
|
504
|
-
output,
|
|
505
|
-
logger
|
|
506
|
-
}: AddIndexesProps): Promise<File[]>;
|
|
507
|
-
static getMode(path: string | undefined | null): Mode;
|
|
508
|
-
}
|
|
509
|
-
//#endregion
|
|
510
458
|
//#region ../core/src/PluginManager.d.ts
|
|
511
459
|
type RequiredPluginLifecycle = Required<PluginLifecycle>;
|
|
512
460
|
type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
|
|
@@ -545,6 +493,9 @@ type GetFileProps<TOptions$1 = object> = {
|
|
|
545
493
|
declare class PluginManager {
|
|
546
494
|
#private;
|
|
547
495
|
readonly plugins: Set<Plugin<PluginFactoryOptions<string, object, object, any, object>>>;
|
|
496
|
+
/**
|
|
497
|
+
* @deprecated do not use from pluginManager
|
|
498
|
+
*/
|
|
548
499
|
readonly fileManager: FileManager;
|
|
549
500
|
readonly events: EventEmitter<Events>;
|
|
550
501
|
readonly config: Config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-redoc",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "Beautiful docs with Redoc",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"handlebars": "^4.7.8",
|
|
43
|
-
"@kubb/
|
|
44
|
-
"@kubb/
|
|
45
|
-
"@kubb/
|
|
43
|
+
"@kubb/core": "4.2.1",
|
|
44
|
+
"@kubb/oas": "4.2.1",
|
|
45
|
+
"@kubb/plugin-oas": "4.2.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"tsdown": "^0.15.9",
|