@kubb/plugin-cypress 4.4.0 → 4.4.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.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{types-BOoil2LF.d.cts → types-bObu7JjR.d.cts} +21 -135
- package/dist/{types-D6SVPqai.d.ts → types-dtu1Ew7p.d.ts} +21 -135
- package/package.json +16 -12
package/dist/components.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as PluginCypress, o as HttpMethod, r as OperationSchemas } from "./types-
|
|
1
|
+
import { n as PluginCypress, o as HttpMethod, r as OperationSchemas } from "./types-bObu7JjR.cjs";
|
|
2
2
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Request.d.ts
|
package/dist/components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as PluginCypress, o as HttpMethod, r as OperationSchemas } from "./types-
|
|
1
|
+
import { n as PluginCypress, o as HttpMethod, r as OperationSchemas } from "./types-dtu1Ew7p.js";
|
|
2
2
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Request.d.ts
|
package/dist/generators.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ReactGenerator, n as PluginCypress } from "./types-
|
|
1
|
+
import { i as ReactGenerator, n as PluginCypress } from "./types-bObu7JjR.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/generators/cypressGenerator.d.ts
|
|
4
4
|
declare const cypressGenerator: ReactGenerator<PluginCypress>;
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ReactGenerator, n as PluginCypress } from "./types-
|
|
1
|
+
import { i as ReactGenerator, n as PluginCypress } from "./types-dtu1Ew7p.js";
|
|
2
2
|
|
|
3
3
|
//#region src/generators/cypressGenerator.d.ts
|
|
4
4
|
declare const cypressGenerator: ReactGenerator<PluginCypress>;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-
|
|
1
|
+
import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-bObu7JjR.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin.d.ts
|
|
4
4
|
declare const pluginCypressName = "plugin-cypress";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-
|
|
1
|
+
import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-dtu1Ew7p.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin.d.ts
|
|
4
4
|
declare const pluginCypressName = "plugin-cypress";
|
|
@@ -4,6 +4,7 @@ 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 { KubbFile } from "@kubb/fabric-core/types";
|
|
7
8
|
import { Fabric, FileManager } from "@kubb/react-fabric";
|
|
8
9
|
import { ConsolaInstance, LogLevel } from "consola";
|
|
9
10
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
@@ -57,121 +58,6 @@ declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
|
|
|
57
58
|
abstract build(...params: unknown[]): unknown;
|
|
58
59
|
}
|
|
59
60
|
//#endregion
|
|
60
|
-
//#region ../core/src/fs/types.d.ts
|
|
61
|
-
type BasePath<T extends string = string> = `${T}/`;
|
|
62
|
-
type Import = {
|
|
63
|
-
/**
|
|
64
|
-
* Import name to be used
|
|
65
|
-
* @example ["useState"]
|
|
66
|
-
* @example "React"
|
|
67
|
-
*/
|
|
68
|
-
name: string | Array<string | {
|
|
69
|
-
propertyName: string;
|
|
70
|
-
name?: string;
|
|
71
|
-
}>;
|
|
72
|
-
/**
|
|
73
|
-
* Path for the import
|
|
74
|
-
* @example '@kubb/core'
|
|
75
|
-
*/
|
|
76
|
-
path: string;
|
|
77
|
-
/**
|
|
78
|
-
* Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
|
|
79
|
-
*/
|
|
80
|
-
isTypeOnly?: boolean;
|
|
81
|
-
isNameSpace?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* When root is set it will get the path with relative getRelativePath(root, path).
|
|
84
|
-
*/
|
|
85
|
-
root?: string;
|
|
86
|
-
};
|
|
87
|
-
type Source = {
|
|
88
|
-
name?: string;
|
|
89
|
-
value?: string;
|
|
90
|
-
isTypeOnly?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Has const or type 'export'
|
|
93
|
-
* @default false
|
|
94
|
-
*/
|
|
95
|
-
isExportable?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* When set, barrel generation will add this
|
|
98
|
-
* @default false
|
|
99
|
-
*/
|
|
100
|
-
isIndexable?: boolean;
|
|
101
|
-
};
|
|
102
|
-
type Export = {
|
|
103
|
-
/**
|
|
104
|
-
* Export name to be used.
|
|
105
|
-
* @example ["useState"]
|
|
106
|
-
* @example "React"
|
|
107
|
-
*/
|
|
108
|
-
name?: string | Array<string>;
|
|
109
|
-
/**
|
|
110
|
-
* Path for the import.
|
|
111
|
-
* @example '@kubb/core'
|
|
112
|
-
*/
|
|
113
|
-
path: string;
|
|
114
|
-
/**
|
|
115
|
-
* Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
|
|
116
|
-
*/
|
|
117
|
-
isTypeOnly?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
|
|
120
|
-
*/
|
|
121
|
-
asAlias?: boolean;
|
|
122
|
-
};
|
|
123
|
-
type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
|
|
124
|
-
type Mode = 'single' | 'split';
|
|
125
|
-
/**
|
|
126
|
-
* Name to be used to dynamicly create the baseName(based on input.path)
|
|
127
|
-
* Based on UNIX basename
|
|
128
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
129
|
-
*/
|
|
130
|
-
type BaseName = `${string}.${string}`;
|
|
131
|
-
/**
|
|
132
|
-
* Path will be full qualified path to a specified file
|
|
133
|
-
*/
|
|
134
|
-
type Path = string;
|
|
135
|
-
type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
|
|
136
|
-
type OptionalPath = Path | undefined | null;
|
|
137
|
-
type File<TMeta extends object = object> = {
|
|
138
|
-
/**
|
|
139
|
-
* Name to be used to create the path
|
|
140
|
-
* Based on UNIX basename, `${name}.extname`
|
|
141
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
142
|
-
*/
|
|
143
|
-
baseName: BaseName;
|
|
144
|
-
/**
|
|
145
|
-
* Path will be full qualified path to a specified file
|
|
146
|
-
*/
|
|
147
|
-
path: AdvancedPath<BaseName> | Path;
|
|
148
|
-
sources: Array<Source>;
|
|
149
|
-
imports?: Array<Import>;
|
|
150
|
-
exports?: Array<Export>;
|
|
151
|
-
/**
|
|
152
|
-
* Use extra meta, this is getting used to generate the barrel/index files.
|
|
153
|
-
*/
|
|
154
|
-
meta?: TMeta;
|
|
155
|
-
banner?: string;
|
|
156
|
-
footer?: string;
|
|
157
|
-
};
|
|
158
|
-
type ResolvedImport = Import;
|
|
159
|
-
type ResolvedExport = Export;
|
|
160
|
-
type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
|
|
161
|
-
/**
|
|
162
|
-
* @default object-hash
|
|
163
|
-
*/
|
|
164
|
-
id: string;
|
|
165
|
-
/**
|
|
166
|
-
* Contains the first part of the baseName, generated based on baseName
|
|
167
|
-
* @link https://nodejs.org/api/path.html#pathformatpathobject
|
|
168
|
-
*/
|
|
169
|
-
name: string;
|
|
170
|
-
extname: Extname;
|
|
171
|
-
imports: Array<ResolvedImport>;
|
|
172
|
-
exports: Array<ResolvedExport>;
|
|
173
|
-
};
|
|
174
|
-
//#endregion
|
|
175
61
|
//#region ../core/src/utils/EventEmitter.d.ts
|
|
176
62
|
declare class EventEmitter<TEvents extends Record<string, any>> {
|
|
177
63
|
#private;
|
|
@@ -295,7 +181,7 @@ type Config<TInput = Input> = {
|
|
|
295
181
|
* Override the extension to the generated imports and exports, by default each plugin will add an extension
|
|
296
182
|
* @default { '.ts': '.ts'}
|
|
297
183
|
*/
|
|
298
|
-
extension?: Record<Extname, Extname | ''>;
|
|
184
|
+
extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
|
|
299
185
|
/**
|
|
300
186
|
* Specify how `index.ts` files should be created. You can also disable the generation of barrel files here. While each plugin has its own `barrelType` option, this setting controls the creation of the root barrel file, such as` src/gen/index.ts`.
|
|
301
187
|
* @default 'named'
|
|
@@ -426,7 +312,7 @@ type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOption
|
|
|
426
312
|
* @type hookFirst
|
|
427
313
|
* @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
|
|
428
314
|
*/
|
|
429
|
-
resolvePath?: (this: PluginContext<TOptions>, baseName: BaseName, mode?: Mode, options?: TOptions['resolvePathOptions']) => OptionalPath;
|
|
315
|
+
resolvePath?: (this: PluginContext<TOptions>, baseName: KubbFile.BaseName, mode?: KubbFile.Mode, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath;
|
|
430
316
|
/**
|
|
431
317
|
* Resolve to a name based on a string.
|
|
432
318
|
* Useful when converting to PascalCase or camelCase.
|
|
@@ -444,8 +330,8 @@ type PluginLifecycleHooks = keyof PluginLifecycle;
|
|
|
444
330
|
type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
|
|
445
331
|
type ResolvePathParams<TOptions = object> = {
|
|
446
332
|
pluginKey?: Plugin['key'];
|
|
447
|
-
baseName: BaseName;
|
|
448
|
-
mode?: Mode;
|
|
333
|
+
baseName: KubbFile.BaseName;
|
|
334
|
+
mode?: KubbFile.Mode;
|
|
449
335
|
/**
|
|
450
336
|
* Options to be passed to 'resolvePath' 3th parameter
|
|
451
337
|
*/
|
|
@@ -470,8 +356,8 @@ type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions>
|
|
|
470
356
|
*/
|
|
471
357
|
fileManager: FileManager;
|
|
472
358
|
pluginManager: PluginManager;
|
|
473
|
-
addFile: (...file: Array<File>) => Promise<Array<ResolvedFile>>;
|
|
474
|
-
resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => OptionalPath;
|
|
359
|
+
addFile: (...file: Array<KubbFile.File>) => Promise<Array<KubbFile.ResolvedFile>>;
|
|
360
|
+
resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => KubbFile.OptionalPath;
|
|
475
361
|
resolveName: (params: ResolveNameParams) => string;
|
|
476
362
|
logger: Logger;
|
|
477
363
|
/**
|
|
@@ -550,8 +436,8 @@ type Events = {
|
|
|
550
436
|
};
|
|
551
437
|
type GetFileProps<TOptions = object> = {
|
|
552
438
|
name: string;
|
|
553
|
-
mode?: Mode;
|
|
554
|
-
extname: Extname;
|
|
439
|
+
mode?: KubbFile.Mode;
|
|
440
|
+
extname: KubbFile.Extname;
|
|
555
441
|
pluginKey: Plugin['key'];
|
|
556
442
|
options?: TOptions;
|
|
557
443
|
};
|
|
@@ -570,10 +456,10 @@ declare class PluginManager {
|
|
|
570
456
|
extname,
|
|
571
457
|
pluginKey,
|
|
572
458
|
options
|
|
573
|
-
}: GetFileProps<TOptions>): File<{
|
|
459
|
+
}: GetFileProps<TOptions>): KubbFile.File<{
|
|
574
460
|
pluginKey: Plugin['key'];
|
|
575
461
|
}>;
|
|
576
|
-
resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => OptionalPath;
|
|
462
|
+
resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => KubbFile.OptionalPath;
|
|
577
463
|
resolveName: (params: ResolveNameParams) => string;
|
|
578
464
|
/**
|
|
579
465
|
* Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
|
|
@@ -711,9 +597,9 @@ type Generator<TOptions extends PluginFactoryOptions> = CoreGenerator<TOptions>
|
|
|
711
597
|
type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
712
598
|
name: string;
|
|
713
599
|
type: 'core';
|
|
714
|
-
operations: (props: OperationsProps<TOptions>) => Promise<File[]>;
|
|
715
|
-
operation: (props: OperationProps<TOptions>) => Promise<File[]>;
|
|
716
|
-
schema: (props: SchemaProps$1<TOptions>) => Promise<File[]>;
|
|
600
|
+
operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
601
|
+
operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
602
|
+
schema: (props: SchemaProps$1<TOptions>) => Promise<KubbFile.File[]>;
|
|
717
603
|
};
|
|
718
604
|
//#endregion
|
|
719
605
|
//#region ../plugin-oas/src/types.d.ts
|
|
@@ -737,7 +623,7 @@ type ResolvePathOptions = {
|
|
|
737
623
|
type Ref = {
|
|
738
624
|
propertyName: string;
|
|
739
625
|
originalName: string;
|
|
740
|
-
path: OptionalPath;
|
|
626
|
+
path: KubbFile.OptionalPath;
|
|
741
627
|
pluginKey?: Plugin['key'];
|
|
742
628
|
};
|
|
743
629
|
type Refs = Record<string, Ref>;
|
|
@@ -817,7 +703,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
817
703
|
* Current plugin
|
|
818
704
|
*/
|
|
819
705
|
plugin: Plugin<TPluginOptions>;
|
|
820
|
-
mode: Mode;
|
|
706
|
+
mode: KubbFile.Mode;
|
|
821
707
|
};
|
|
822
708
|
declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
|
|
823
709
|
#private;
|
|
@@ -831,7 +717,7 @@ declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = P
|
|
|
831
717
|
method: HttpMethod;
|
|
832
718
|
operation: Operation$1;
|
|
833
719
|
}>>;
|
|
834
|
-
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
|
|
720
|
+
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
835
721
|
}
|
|
836
722
|
//#endregion
|
|
837
723
|
//#region ../plugin-oas/src/SchemaMapper.d.ts
|
|
@@ -947,7 +833,7 @@ type SchemaKeywordMapper = {
|
|
|
947
833
|
/**
|
|
948
834
|
* Full qualified path.
|
|
949
835
|
*/
|
|
950
|
-
path: OptionalPath;
|
|
836
|
+
path: KubbFile.OptionalPath;
|
|
951
837
|
/**
|
|
952
838
|
* When true `File.Import` will be used.
|
|
953
839
|
* When false a reference will be used inside the current file.
|
|
@@ -1060,7 +946,7 @@ type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
1060
946
|
* Current plugin
|
|
1061
947
|
*/
|
|
1062
948
|
plugin: Plugin<TPluginOptions>;
|
|
1063
|
-
mode: Mode;
|
|
949
|
+
mode: KubbFile.Mode;
|
|
1064
950
|
include?: Array<'schemas' | 'responses' | 'requestBodies'>;
|
|
1065
951
|
override: Array<Override<TOptions>> | undefined;
|
|
1066
952
|
contentType?: contentType;
|
|
@@ -1108,7 +994,7 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
|
|
|
1108
994
|
static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
|
|
1109
995
|
static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
|
|
1110
996
|
static combineObjects(tree: Schema[] | undefined): Schema[];
|
|
1111
|
-
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
|
|
997
|
+
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
1112
998
|
}
|
|
1113
999
|
//#endregion
|
|
1114
1000
|
//#region src/types.d.ts
|
|
@@ -1167,4 +1053,4 @@ type ResolvedOptions = {
|
|
|
1167
1053
|
type PluginCypress = PluginFactoryOptions<'plugin-cypress', Options$1, ResolvedOptions, never, ResolvePathOptions>;
|
|
1168
1054
|
//#endregion
|
|
1169
1055
|
export { UserPluginWithLifeCycle as a, ReactGenerator as i, PluginCypress as n, HttpMethod as o, OperationSchemas as r, Options$1 as t };
|
|
1170
|
-
//# sourceMappingURL=types-
|
|
1056
|
+
//# sourceMappingURL=types-bObu7JjR.d.cts.map
|
|
@@ -5,6 +5,7 @@ import { Operation, Operation as Operation$1 } from "oas/operation";
|
|
|
5
5
|
import { OpenAPIV3 } from "openapi-types";
|
|
6
6
|
import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
|
|
7
7
|
import BaseOas from "oas";
|
|
8
|
+
import { KubbFile } from "@kubb/fabric-core/types";
|
|
8
9
|
import { ConsolaInstance, LogLevel } from "consola";
|
|
9
10
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
10
11
|
|
|
@@ -57,121 +58,6 @@ declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
|
|
|
57
58
|
abstract build(...params: unknown[]): unknown;
|
|
58
59
|
}
|
|
59
60
|
//#endregion
|
|
60
|
-
//#region ../core/src/fs/types.d.ts
|
|
61
|
-
type BasePath<T extends string = string> = `${T}/`;
|
|
62
|
-
type Import = {
|
|
63
|
-
/**
|
|
64
|
-
* Import name to be used
|
|
65
|
-
* @example ["useState"]
|
|
66
|
-
* @example "React"
|
|
67
|
-
*/
|
|
68
|
-
name: string | Array<string | {
|
|
69
|
-
propertyName: string;
|
|
70
|
-
name?: string;
|
|
71
|
-
}>;
|
|
72
|
-
/**
|
|
73
|
-
* Path for the import
|
|
74
|
-
* @example '@kubb/core'
|
|
75
|
-
*/
|
|
76
|
-
path: string;
|
|
77
|
-
/**
|
|
78
|
-
* Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
|
|
79
|
-
*/
|
|
80
|
-
isTypeOnly?: boolean;
|
|
81
|
-
isNameSpace?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* When root is set it will get the path with relative getRelativePath(root, path).
|
|
84
|
-
*/
|
|
85
|
-
root?: string;
|
|
86
|
-
};
|
|
87
|
-
type Source = {
|
|
88
|
-
name?: string;
|
|
89
|
-
value?: string;
|
|
90
|
-
isTypeOnly?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Has const or type 'export'
|
|
93
|
-
* @default false
|
|
94
|
-
*/
|
|
95
|
-
isExportable?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* When set, barrel generation will add this
|
|
98
|
-
* @default false
|
|
99
|
-
*/
|
|
100
|
-
isIndexable?: boolean;
|
|
101
|
-
};
|
|
102
|
-
type Export = {
|
|
103
|
-
/**
|
|
104
|
-
* Export name to be used.
|
|
105
|
-
* @example ["useState"]
|
|
106
|
-
* @example "React"
|
|
107
|
-
*/
|
|
108
|
-
name?: string | Array<string>;
|
|
109
|
-
/**
|
|
110
|
-
* Path for the import.
|
|
111
|
-
* @example '@kubb/core'
|
|
112
|
-
*/
|
|
113
|
-
path: string;
|
|
114
|
-
/**
|
|
115
|
-
* Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
|
|
116
|
-
*/
|
|
117
|
-
isTypeOnly?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
|
|
120
|
-
*/
|
|
121
|
-
asAlias?: boolean;
|
|
122
|
-
};
|
|
123
|
-
type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
|
|
124
|
-
type Mode = 'single' | 'split';
|
|
125
|
-
/**
|
|
126
|
-
* Name to be used to dynamicly create the baseName(based on input.path)
|
|
127
|
-
* Based on UNIX basename
|
|
128
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
129
|
-
*/
|
|
130
|
-
type BaseName = `${string}.${string}`;
|
|
131
|
-
/**
|
|
132
|
-
* Path will be full qualified path to a specified file
|
|
133
|
-
*/
|
|
134
|
-
type Path = string;
|
|
135
|
-
type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
|
|
136
|
-
type OptionalPath = Path | undefined | null;
|
|
137
|
-
type File$1<TMeta extends object = object> = {
|
|
138
|
-
/**
|
|
139
|
-
* Name to be used to create the path
|
|
140
|
-
* Based on UNIX basename, `${name}.extname`
|
|
141
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
142
|
-
*/
|
|
143
|
-
baseName: BaseName;
|
|
144
|
-
/**
|
|
145
|
-
* Path will be full qualified path to a specified file
|
|
146
|
-
*/
|
|
147
|
-
path: AdvancedPath<BaseName> | Path;
|
|
148
|
-
sources: Array<Source>;
|
|
149
|
-
imports?: Array<Import>;
|
|
150
|
-
exports?: Array<Export>;
|
|
151
|
-
/**
|
|
152
|
-
* Use extra meta, this is getting used to generate the barrel/index files.
|
|
153
|
-
*/
|
|
154
|
-
meta?: TMeta;
|
|
155
|
-
banner?: string;
|
|
156
|
-
footer?: string;
|
|
157
|
-
};
|
|
158
|
-
type ResolvedImport = Import;
|
|
159
|
-
type ResolvedExport = Export;
|
|
160
|
-
type ResolvedFile<TMeta extends object = object> = File$1<TMeta> & {
|
|
161
|
-
/**
|
|
162
|
-
* @default object-hash
|
|
163
|
-
*/
|
|
164
|
-
id: string;
|
|
165
|
-
/**
|
|
166
|
-
* Contains the first part of the baseName, generated based on baseName
|
|
167
|
-
* @link https://nodejs.org/api/path.html#pathformatpathobject
|
|
168
|
-
*/
|
|
169
|
-
name: string;
|
|
170
|
-
extname: Extname;
|
|
171
|
-
imports: Array<ResolvedImport>;
|
|
172
|
-
exports: Array<ResolvedExport>;
|
|
173
|
-
};
|
|
174
|
-
//#endregion
|
|
175
61
|
//#region ../core/src/utils/EventEmitter.d.ts
|
|
176
62
|
declare class EventEmitter<TEvents extends Record<string, any>> {
|
|
177
63
|
#private;
|
|
@@ -295,7 +181,7 @@ type Config<TInput = Input> = {
|
|
|
295
181
|
* Override the extension to the generated imports and exports, by default each plugin will add an extension
|
|
296
182
|
* @default { '.ts': '.ts'}
|
|
297
183
|
*/
|
|
298
|
-
extension?: Record<Extname, Extname | ''>;
|
|
184
|
+
extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
|
|
299
185
|
/**
|
|
300
186
|
* Specify how `index.ts` files should be created. You can also disable the generation of barrel files here. While each plugin has its own `barrelType` option, this setting controls the creation of the root barrel file, such as` src/gen/index.ts`.
|
|
301
187
|
* @default 'named'
|
|
@@ -426,7 +312,7 @@ type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOption
|
|
|
426
312
|
* @type hookFirst
|
|
427
313
|
* @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
|
|
428
314
|
*/
|
|
429
|
-
resolvePath?: (this: PluginContext<TOptions>, baseName: BaseName, mode?: Mode, options?: TOptions['resolvePathOptions']) => OptionalPath;
|
|
315
|
+
resolvePath?: (this: PluginContext<TOptions>, baseName: KubbFile.BaseName, mode?: KubbFile.Mode, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath;
|
|
430
316
|
/**
|
|
431
317
|
* Resolve to a name based on a string.
|
|
432
318
|
* Useful when converting to PascalCase or camelCase.
|
|
@@ -444,8 +330,8 @@ type PluginLifecycleHooks = keyof PluginLifecycle;
|
|
|
444
330
|
type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
|
|
445
331
|
type ResolvePathParams<TOptions = object> = {
|
|
446
332
|
pluginKey?: Plugin['key'];
|
|
447
|
-
baseName: BaseName;
|
|
448
|
-
mode?: Mode;
|
|
333
|
+
baseName: KubbFile.BaseName;
|
|
334
|
+
mode?: KubbFile.Mode;
|
|
449
335
|
/**
|
|
450
336
|
* Options to be passed to 'resolvePath' 3th parameter
|
|
451
337
|
*/
|
|
@@ -470,8 +356,8 @@ type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions>
|
|
|
470
356
|
*/
|
|
471
357
|
fileManager: FileManager;
|
|
472
358
|
pluginManager: PluginManager;
|
|
473
|
-
addFile: (...file: Array<File
|
|
474
|
-
resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => OptionalPath;
|
|
359
|
+
addFile: (...file: Array<KubbFile.File>) => Promise<Array<KubbFile.ResolvedFile>>;
|
|
360
|
+
resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => KubbFile.OptionalPath;
|
|
475
361
|
resolveName: (params: ResolveNameParams) => string;
|
|
476
362
|
logger: Logger;
|
|
477
363
|
/**
|
|
@@ -550,8 +436,8 @@ type Events = {
|
|
|
550
436
|
};
|
|
551
437
|
type GetFileProps<TOptions = object> = {
|
|
552
438
|
name: string;
|
|
553
|
-
mode?: Mode;
|
|
554
|
-
extname: Extname;
|
|
439
|
+
mode?: KubbFile.Mode;
|
|
440
|
+
extname: KubbFile.Extname;
|
|
555
441
|
pluginKey: Plugin['key'];
|
|
556
442
|
options?: TOptions;
|
|
557
443
|
};
|
|
@@ -570,10 +456,10 @@ declare class PluginManager {
|
|
|
570
456
|
extname,
|
|
571
457
|
pluginKey,
|
|
572
458
|
options
|
|
573
|
-
}: GetFileProps<TOptions>): File
|
|
459
|
+
}: GetFileProps<TOptions>): KubbFile.File<{
|
|
574
460
|
pluginKey: Plugin['key'];
|
|
575
461
|
}>;
|
|
576
|
-
resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => OptionalPath;
|
|
462
|
+
resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => KubbFile.OptionalPath;
|
|
577
463
|
resolveName: (params: ResolveNameParams) => string;
|
|
578
464
|
/**
|
|
579
465
|
* Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
|
|
@@ -711,9 +597,9 @@ type Generator<TOptions extends PluginFactoryOptions> = CoreGenerator<TOptions>
|
|
|
711
597
|
type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
712
598
|
name: string;
|
|
713
599
|
type: 'core';
|
|
714
|
-
operations: (props: OperationsProps<TOptions>) => Promise<File
|
|
715
|
-
operation: (props: OperationProps<TOptions>) => Promise<File
|
|
716
|
-
schema: (props: SchemaProps$1<TOptions>) => Promise<File
|
|
600
|
+
operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
601
|
+
operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
602
|
+
schema: (props: SchemaProps$1<TOptions>) => Promise<KubbFile.File[]>;
|
|
717
603
|
};
|
|
718
604
|
//#endregion
|
|
719
605
|
//#region ../plugin-oas/src/types.d.ts
|
|
@@ -737,7 +623,7 @@ type ResolvePathOptions = {
|
|
|
737
623
|
type Ref = {
|
|
738
624
|
propertyName: string;
|
|
739
625
|
originalName: string;
|
|
740
|
-
path: OptionalPath;
|
|
626
|
+
path: KubbFile.OptionalPath;
|
|
741
627
|
pluginKey?: Plugin['key'];
|
|
742
628
|
};
|
|
743
629
|
type Refs = Record<string, Ref>;
|
|
@@ -817,7 +703,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
817
703
|
* Current plugin
|
|
818
704
|
*/
|
|
819
705
|
plugin: Plugin<TPluginOptions>;
|
|
820
|
-
mode: Mode;
|
|
706
|
+
mode: KubbFile.Mode;
|
|
821
707
|
};
|
|
822
708
|
declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
|
|
823
709
|
#private;
|
|
@@ -831,7 +717,7 @@ declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = P
|
|
|
831
717
|
method: HttpMethod;
|
|
832
718
|
operation: Operation$1;
|
|
833
719
|
}>>;
|
|
834
|
-
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File
|
|
720
|
+
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
835
721
|
}
|
|
836
722
|
//#endregion
|
|
837
723
|
//#region ../plugin-oas/src/SchemaMapper.d.ts
|
|
@@ -947,7 +833,7 @@ type SchemaKeywordMapper = {
|
|
|
947
833
|
/**
|
|
948
834
|
* Full qualified path.
|
|
949
835
|
*/
|
|
950
|
-
path: OptionalPath;
|
|
836
|
+
path: KubbFile.OptionalPath;
|
|
951
837
|
/**
|
|
952
838
|
* When true `File.Import` will be used.
|
|
953
839
|
* When false a reference will be used inside the current file.
|
|
@@ -1060,7 +946,7 @@ type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
1060
946
|
* Current plugin
|
|
1061
947
|
*/
|
|
1062
948
|
plugin: Plugin<TPluginOptions>;
|
|
1063
|
-
mode: Mode;
|
|
949
|
+
mode: KubbFile.Mode;
|
|
1064
950
|
include?: Array<'schemas' | 'responses' | 'requestBodies'>;
|
|
1065
951
|
override: Array<Override<TOptions>> | undefined;
|
|
1066
952
|
contentType?: contentType;
|
|
@@ -1108,7 +994,7 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
|
|
|
1108
994
|
static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
|
|
1109
995
|
static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
|
|
1110
996
|
static combineObjects(tree: Schema[] | undefined): Schema[];
|
|
1111
|
-
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File
|
|
997
|
+
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
1112
998
|
}
|
|
1113
999
|
//#endregion
|
|
1114
1000
|
//#region src/types.d.ts
|
|
@@ -1167,4 +1053,4 @@ type ResolvedOptions = {
|
|
|
1167
1053
|
type PluginCypress = PluginFactoryOptions<'plugin-cypress', Options$1, ResolvedOptions, never, ResolvePathOptions>;
|
|
1168
1054
|
//#endregion
|
|
1169
1055
|
export { UserPluginWithLifeCycle as a, ReactGenerator as i, PluginCypress as n, HttpMethod as o, OperationSchemas as r, Options$1 as t };
|
|
1170
|
-
//# sourceMappingURL=types-
|
|
1056
|
+
//# sourceMappingURL=types-dtu1Ew7p.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-cypress",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.1",
|
|
4
4
|
"description": "Cypress test generator plugin for Kubb, creating end-to-end tests from OpenAPI specifications for automated API testing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cypress",
|
|
@@ -66,19 +66,23 @@
|
|
|
66
66
|
"!/**/**.test.**",
|
|
67
67
|
"!/**/__tests__/**"
|
|
68
68
|
],
|
|
69
|
+
"size-limit": [
|
|
70
|
+
{
|
|
71
|
+
"path": "./dist/*.js",
|
|
72
|
+
"limit": "510 KiB",
|
|
73
|
+
"gzip": true
|
|
74
|
+
}
|
|
75
|
+
],
|
|
69
76
|
"dependencies": {
|
|
70
|
-
"@kubb/react-fabric": "0.2.
|
|
71
|
-
"@kubb/core": "4.4.
|
|
72
|
-
"@kubb/oas": "4.4.
|
|
73
|
-
"@kubb/plugin-oas": "4.4.
|
|
74
|
-
"@kubb/plugin-ts": "4.4.
|
|
75
|
-
},
|
|
76
|
-
"devDependencies": {
|
|
77
|
-
"tsdown": "^0.15.11",
|
|
78
|
-
"typescript": "^5.9.3"
|
|
77
|
+
"@kubb/react-fabric": "0.2.10",
|
|
78
|
+
"@kubb/core": "4.4.1",
|
|
79
|
+
"@kubb/oas": "4.4.1",
|
|
80
|
+
"@kubb/plugin-oas": "4.4.1",
|
|
81
|
+
"@kubb/plugin-ts": "4.4.1"
|
|
79
82
|
},
|
|
83
|
+
"devDependencies": {},
|
|
80
84
|
"peerDependencies": {
|
|
81
|
-
"@kubb/react-fabric": "0.2.
|
|
85
|
+
"@kubb/react-fabric": "0.2.10"
|
|
82
86
|
},
|
|
83
87
|
"engines": {
|
|
84
88
|
"node": ">=20"
|
|
@@ -88,7 +92,7 @@
|
|
|
88
92
|
"registry": "https://registry.npmjs.org/"
|
|
89
93
|
},
|
|
90
94
|
"scripts": {
|
|
91
|
-
"build": "tsdown",
|
|
95
|
+
"build": "tsdown && size-limit",
|
|
92
96
|
"clean": "npx rimraf ./dist",
|
|
93
97
|
"lint": "bun biome lint .",
|
|
94
98
|
"lint:fix": "bun biome lint --fix --unsafe .",
|