@kubb/plugin-cypress 4.18.4 → 4.19.0
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-BHI6cjsX.d.cts → types-Dx-_3jKd.d.cts} +79 -59
- package/dist/{types-B12J_QwU.d.ts → types-wYAshYRF.d.ts} +79 -59
- package/package.json +5 -5
- package/src/types.ts +10 -10
package/dist/components.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as OperationSchemas, n as PluginCypress, o as HttpMethod, s as __name } from "./types-
|
|
1
|
+
import { i as OperationSchemas, n as PluginCypress, o as HttpMethod, s as __name } from "./types-Dx-_3jKd.cjs";
|
|
2
2
|
import { FunctionParams } from "@kubb/react-fabric";
|
|
3
3
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
4
4
|
|
package/dist/components.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-eQyhnF5A.js";
|
|
2
|
-
import { i as OperationSchemas, n as PluginCypress, o as HttpMethod } from "./types-
|
|
2
|
+
import { i as OperationSchemas, n as PluginCypress, o as HttpMethod } from "./types-wYAshYRF.js";
|
|
3
3
|
import { FunctionParams } from "@kubb/react-fabric";
|
|
4
4
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
5
5
|
|
package/dist/generators.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as PluginCypress, r as ReactGenerator, s as __name } from "./types-
|
|
1
|
+
import { n as PluginCypress, r as ReactGenerator, s as __name } from "./types-Dx-_3jKd.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,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-eQyhnF5A.js";
|
|
2
|
-
import { n as PluginCypress, r as ReactGenerator } from "./types-
|
|
2
|
+
import { n as PluginCypress, r as ReactGenerator } from "./types-wYAshYRF.js";
|
|
3
3
|
|
|
4
4
|
//#region src/generators/cypressGenerator.d.ts
|
|
5
5
|
declare const cypressGenerator: ReactGenerator<PluginCypress>;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as UserPluginWithLifeCycle, n as PluginCypress, s as __name, t as Options } from "./types-
|
|
1
|
+
import { a as UserPluginWithLifeCycle, n as PluginCypress, s as __name, t as Options } from "./types-Dx-_3jKd.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin.d.ts
|
|
4
4
|
declare const pluginCypressName = "plugin-cypress";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-eQyhnF5A.js";
|
|
2
|
-
import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-
|
|
2
|
+
import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-wYAshYRF.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin.d.ts
|
|
5
5
|
declare const pluginCypressName = "plugin-cypress";
|
|
@@ -20,16 +20,21 @@ type Operation$1 = Operation;
|
|
|
20
20
|
type DiscriminatorObject$1 = DiscriminatorObject;
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region ../oas/src/Oas.d.ts
|
|
23
|
-
type
|
|
23
|
+
type OasOptions = {
|
|
24
24
|
contentType?: contentType;
|
|
25
25
|
discriminator?: 'strict' | 'inherit';
|
|
26
|
+
/**
|
|
27
|
+
* Resolve name collisions when schemas from different components share the same name (case-insensitive).
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
collisionDetection?: boolean;
|
|
26
31
|
};
|
|
27
32
|
declare class Oas extends BaseOas {
|
|
28
33
|
#private;
|
|
29
34
|
document: Document;
|
|
30
35
|
constructor(document: Document);
|
|
31
|
-
setOptions(options:
|
|
32
|
-
get options():
|
|
36
|
+
setOptions(options: OasOptions): void;
|
|
37
|
+
get options(): OasOptions;
|
|
33
38
|
get<T = unknown>($ref: string): T | null;
|
|
34
39
|
getKey($ref: string): string | undefined;
|
|
35
40
|
set($ref: string, value: unknown): false | undefined;
|
|
@@ -38,8 +43,20 @@ declare class Oas extends BaseOas {
|
|
|
38
43
|
getResponseSchema(operation: Operation$1, statusCode: string | number): SchemaObject$1;
|
|
39
44
|
getRequestSchema(operation: Operation$1): SchemaObject$1 | undefined;
|
|
40
45
|
getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
|
|
41
|
-
|
|
46
|
+
validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
|
|
42
47
|
flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
|
|
48
|
+
/**
|
|
49
|
+
* Get schemas from OpenAPI components (schemas, responses, requestBodies).
|
|
50
|
+
* Returns schemas in dependency order along with name mapping for collision resolution.
|
|
51
|
+
*/
|
|
52
|
+
getSchemas(options?: {
|
|
53
|
+
contentType?: contentType;
|
|
54
|
+
includes?: Array<'schemas' | 'responses' | 'requestBodies'>;
|
|
55
|
+
collisionDetection?: boolean;
|
|
56
|
+
}): {
|
|
57
|
+
schemas: Record<string, SchemaObject$1>;
|
|
58
|
+
nameMapping: Map<string, string>;
|
|
59
|
+
};
|
|
43
60
|
}
|
|
44
61
|
//#endregion
|
|
45
62
|
//#region ../core/src/BaseGenerator.d.ts
|
|
@@ -340,7 +357,7 @@ type Config<TInput = Input> = {
|
|
|
340
357
|
input: TInput;
|
|
341
358
|
output: {
|
|
342
359
|
/**
|
|
343
|
-
* The path where all generated files
|
|
360
|
+
* The path where all generated files receives exported.
|
|
344
361
|
* This can be an absolute path or a path relative to the specified root option.
|
|
345
362
|
*/
|
|
346
363
|
path: string;
|
|
@@ -355,41 +372,39 @@ type Config<TInput = Input> = {
|
|
|
355
372
|
write?: boolean;
|
|
356
373
|
/**
|
|
357
374
|
* Specifies the formatting tool to be used.
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
* - '
|
|
362
|
-
* -
|
|
363
|
-
*
|
|
364
|
-
*
|
|
375
|
+
* - 'auto' automatically detects and uses biome or prettier (in that order of preference).
|
|
376
|
+
* - 'prettier' uses Prettier for code formatting.
|
|
377
|
+
* - 'biome' uses Biome for code formatting.
|
|
378
|
+
* - 'oxfmt' uses Oxfmt for code formatting.
|
|
379
|
+
* - false disables code formatting.
|
|
380
|
+
* @default 'prettier'
|
|
365
381
|
*/
|
|
366
382
|
format?: 'auto' | 'prettier' | 'biome' | 'oxfmt' | false;
|
|
367
383
|
/**
|
|
368
384
|
* Specifies the linter that should be used to analyze the code.
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
* - '
|
|
373
|
-
* -
|
|
374
|
-
*
|
|
375
|
-
* - 'oxlint': Represents the Oxlint tool for linting purposes.
|
|
376
|
-
*
|
|
385
|
+
* - 'auto' automatically detects and uses biome, oxlint, or eslint (in that order of preference).
|
|
386
|
+
* - 'eslint' uses ESLint for linting.
|
|
387
|
+
* - 'biome' uses Biome for linting.
|
|
388
|
+
* - 'oxlint' uses Oxlint for linting.
|
|
389
|
+
* - false disables linting.
|
|
390
|
+
* @default 'auto'
|
|
377
391
|
*/
|
|
378
392
|
lint?: 'auto' | 'eslint' | 'biome' | 'oxlint' | false;
|
|
379
393
|
/**
|
|
380
|
-
*
|
|
394
|
+
* Overrides the extension for generated imports and exports. By default, each plugin adds an extension.
|
|
381
395
|
* @default { '.ts': '.ts'}
|
|
382
396
|
*/
|
|
383
397
|
extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
|
|
384
398
|
/**
|
|
385
|
-
*
|
|
399
|
+
* 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`).
|
|
386
400
|
* @default 'named'
|
|
387
401
|
*/
|
|
388
402
|
barrelType?: Exclude<BarrelType, 'propagate'> | false;
|
|
389
403
|
/**
|
|
390
|
-
*
|
|
391
|
-
* - 'simple'
|
|
392
|
-
* - 'full'
|
|
404
|
+
* Adds a default banner to the start of every generated file indicating it was generated by Kubb.
|
|
405
|
+
* - 'simple' adds banner with link to Kubb.
|
|
406
|
+
* - 'full' adds source, title, description, and OpenAPI version.
|
|
407
|
+
* - false disables banner generation.
|
|
393
408
|
* @default 'simple'
|
|
394
409
|
*/
|
|
395
410
|
defaultBanner?: 'simple' | 'full' | false;
|
|
@@ -402,17 +417,17 @@ type Config<TInput = Input> = {
|
|
|
402
417
|
override?: boolean;
|
|
403
418
|
};
|
|
404
419
|
/**
|
|
405
|
-
* An array of Kubb plugins that
|
|
420
|
+
* An array of Kubb plugins that used in the generation.
|
|
406
421
|
* Each plugin may include additional configurable options(defined in the plugin itself).
|
|
407
|
-
* If a plugin depends on another plugin, an error
|
|
422
|
+
* If a plugin depends on another plugin, an error is returned if the required dependency is missing. See pre for more details.
|
|
408
423
|
*/
|
|
409
424
|
plugins?: Array<Plugin>;
|
|
410
425
|
/**
|
|
411
|
-
* Hooks
|
|
426
|
+
* Hooks triggered when a specific action occurs in Kubb.
|
|
412
427
|
*/
|
|
413
428
|
hooks?: {
|
|
414
429
|
/**
|
|
415
|
-
* Hook that
|
|
430
|
+
* Hook that triggers at the end of all executions.
|
|
416
431
|
* Useful for running Prettier or ESLint to format/lint your code.
|
|
417
432
|
*/
|
|
418
433
|
done?: string | Array<string>;
|
|
@@ -441,7 +456,7 @@ TContext = any,
|
|
|
441
456
|
TResolvePathOptions extends object = object> = {
|
|
442
457
|
name: TName;
|
|
443
458
|
/**
|
|
444
|
-
* Same
|
|
459
|
+
* Same behavior like what has been done with `QueryKey` in `@tanstack/react-query`
|
|
445
460
|
*/
|
|
446
461
|
key: PluginKey<TName | string>;
|
|
447
462
|
options: TOptions;
|
|
@@ -462,12 +477,12 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
|
|
|
462
477
|
*/
|
|
463
478
|
options: TOptions['resolvedOptions'];
|
|
464
479
|
/**
|
|
465
|
-
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin
|
|
480
|
+
* 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.
|
|
466
481
|
* Can be used to validate dependent plugins.
|
|
467
482
|
*/
|
|
468
483
|
pre?: Array<string>;
|
|
469
484
|
/**
|
|
470
|
-
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin
|
|
485
|
+
* 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.
|
|
471
486
|
*/
|
|
472
487
|
post?: Array<string>;
|
|
473
488
|
inject?: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => TOptions['context'];
|
|
@@ -485,12 +500,12 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
|
485
500
|
*/
|
|
486
501
|
key: TOptions['key'];
|
|
487
502
|
/**
|
|
488
|
-
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin
|
|
503
|
+
* 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.
|
|
489
504
|
* Can be used to validate dependent plugins.
|
|
490
505
|
*/
|
|
491
506
|
pre?: Array<string>;
|
|
492
507
|
/**
|
|
493
|
-
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin
|
|
508
|
+
* 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.
|
|
494
509
|
*/
|
|
495
510
|
post?: Array<string>;
|
|
496
511
|
/**
|
|
@@ -540,10 +555,12 @@ type ResolveNameParams = {
|
|
|
540
555
|
name: string;
|
|
541
556
|
pluginKey?: Plugin['key'];
|
|
542
557
|
/**
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
*
|
|
546
|
-
*
|
|
558
|
+
* Specifies the type of entity being named.
|
|
559
|
+
* - 'file' customizes the name of the created file (uses camelCase).
|
|
560
|
+
* - 'function' customizes the exported function names (uses camelCase).
|
|
561
|
+
* - 'type' customizes TypeScript types (uses PascalCase).
|
|
562
|
+
* - 'const' customizes variable names (uses camelCase).
|
|
563
|
+
* @default undefined
|
|
547
564
|
*/
|
|
548
565
|
type?: 'file' | 'function' | 'type' | 'const';
|
|
549
566
|
};
|
|
@@ -598,11 +615,14 @@ type GroupContext = {
|
|
|
598
615
|
};
|
|
599
616
|
type Group = {
|
|
600
617
|
/**
|
|
601
|
-
*
|
|
618
|
+
* Defines the type where to group the files.
|
|
619
|
+
* - 'tag' groups files by OpenAPI tags.
|
|
620
|
+
* - 'path' groups files by OpenAPI paths.
|
|
621
|
+
* @default undefined
|
|
602
622
|
*/
|
|
603
623
|
type: 'tag' | 'path';
|
|
604
624
|
/**
|
|
605
|
-
* Return the name of a group based on the group name, this
|
|
625
|
+
* Return the name of a group based on the group name, this used for the file and name generation
|
|
606
626
|
*/
|
|
607
627
|
name?: (context: GroupContext) => string;
|
|
608
628
|
};
|
|
@@ -674,7 +694,7 @@ declare class PluginManager {
|
|
|
674
694
|
parameters: PluginParameter<H>;
|
|
675
695
|
}): Array<ReturnType<ParseResult<H>>> | null;
|
|
676
696
|
/**
|
|
677
|
-
*
|
|
697
|
+
* Returns the first non-null result.
|
|
678
698
|
*/
|
|
679
699
|
hookFirst<H extends PluginLifecycleHooks>({
|
|
680
700
|
hookName,
|
|
@@ -686,7 +706,7 @@ declare class PluginManager {
|
|
|
686
706
|
skipped?: ReadonlySet<Plugin> | null;
|
|
687
707
|
}): Promise<SafeParseResult<H>>;
|
|
688
708
|
/**
|
|
689
|
-
*
|
|
709
|
+
* Returns the first non-null result.
|
|
690
710
|
*/
|
|
691
711
|
hookFirstSync<H extends PluginLifecycleHooks>({
|
|
692
712
|
hookName,
|
|
@@ -698,15 +718,15 @@ declare class PluginManager {
|
|
|
698
718
|
skipped?: ReadonlySet<Plugin> | null;
|
|
699
719
|
}): SafeParseResult<H>;
|
|
700
720
|
/**
|
|
701
|
-
*
|
|
721
|
+
* Runs all plugins in parallel based on `this.plugin` order and `pre`/`post` settings.
|
|
702
722
|
*/
|
|
703
|
-
hookParallel<H extends PluginLifecycleHooks,
|
|
723
|
+
hookParallel<H extends PluginLifecycleHooks, TOutput = void>({
|
|
704
724
|
hookName,
|
|
705
725
|
parameters
|
|
706
726
|
}: {
|
|
707
727
|
hookName: H;
|
|
708
728
|
parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
|
|
709
|
-
}): Promise<Awaited<
|
|
729
|
+
}): Promise<Awaited<TOutput>[]>;
|
|
710
730
|
/**
|
|
711
731
|
* Chains plugins
|
|
712
732
|
*/
|
|
@@ -975,8 +995,8 @@ type SchemaKeywordMapper = {
|
|
|
975
995
|
*/
|
|
976
996
|
path: KubbFile.Path;
|
|
977
997
|
/**
|
|
978
|
-
* When true `File.Import`
|
|
979
|
-
* When false a reference
|
|
998
|
+
* When true `File.Import` is used.
|
|
999
|
+
* When false a reference is used inside the current file.
|
|
980
1000
|
*/
|
|
981
1001
|
isImportable: boolean;
|
|
982
1002
|
};
|
|
@@ -1108,7 +1128,7 @@ type SchemaGeneratorOptions = {
|
|
|
1108
1128
|
*/
|
|
1109
1129
|
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
1110
1130
|
/**
|
|
1111
|
-
* Receive schema and name(
|
|
1131
|
+
* Receive schema and name(propertyName) and return FakerMeta array
|
|
1112
1132
|
* TODO TODO add docs
|
|
1113
1133
|
* @beta
|
|
1114
1134
|
*/
|
|
@@ -1187,32 +1207,32 @@ type Options = {
|
|
|
1187
1207
|
output?: Output<Oas>;
|
|
1188
1208
|
/**
|
|
1189
1209
|
* Define which contentType should be used.
|
|
1190
|
-
* By default, the first JSON valid mediaType
|
|
1210
|
+
* By default, the first JSON valid mediaType is used
|
|
1191
1211
|
*/
|
|
1192
1212
|
contentType?: contentType;
|
|
1193
1213
|
/**
|
|
1194
|
-
*
|
|
1195
|
-
* - 'data'
|
|
1196
|
-
* - 'full'
|
|
1214
|
+
* Return type when calling cy.request.
|
|
1215
|
+
* - 'data' returns ResponseConfig[data].
|
|
1216
|
+
* - 'full' returns ResponseConfig.
|
|
1197
1217
|
* @default 'data'
|
|
1198
1218
|
*/
|
|
1199
1219
|
dataReturnType?: 'data' | 'full';
|
|
1200
1220
|
/**
|
|
1201
1221
|
* How to style your params, by default no casing is applied
|
|
1202
|
-
* - 'camelcase'
|
|
1222
|
+
* - 'camelcase' uses camelcase for the params names
|
|
1203
1223
|
*/
|
|
1204
1224
|
paramsCasing?: 'camelcase';
|
|
1205
1225
|
/**
|
|
1206
|
-
* How to pass your params
|
|
1207
|
-
* - 'object'
|
|
1208
|
-
* - 'inline'
|
|
1226
|
+
* How to pass your params.
|
|
1227
|
+
* - 'object' returns the params and pathParams as an object.
|
|
1228
|
+
* - 'inline' returns the params as comma separated params.
|
|
1209
1229
|
* @default 'inline'
|
|
1210
1230
|
*/
|
|
1211
1231
|
paramsType?: 'object' | 'inline';
|
|
1212
1232
|
/**
|
|
1213
1233
|
* How to pass your pathParams.
|
|
1214
|
-
* - 'object'
|
|
1215
|
-
* - 'inline'
|
|
1234
|
+
* - 'object' returns the pathParams as an object.
|
|
1235
|
+
* - 'inline' returns the pathParams as comma separated params.
|
|
1216
1236
|
* @default 'inline'
|
|
1217
1237
|
*/
|
|
1218
1238
|
pathParamsType?: 'object' | 'inline';
|
|
@@ -1256,4 +1276,4 @@ type ResolvedOptions = {
|
|
|
1256
1276
|
type PluginCypress = PluginFactoryOptions<'plugin-cypress', Options, ResolvedOptions, never, ResolvePathOptions>;
|
|
1257
1277
|
//#endregion
|
|
1258
1278
|
export { UserPluginWithLifeCycle as a, OperationSchemas as i, PluginCypress as n, HttpMethod as o, ReactGenerator as r, __name as s, Options as t };
|
|
1259
|
-
//# sourceMappingURL=types-
|
|
1279
|
+
//# sourceMappingURL=types-Dx-_3jKd.d.cts.map
|
|
@@ -19,16 +19,21 @@ type Operation$1 = Operation;
|
|
|
19
19
|
type DiscriminatorObject$1 = DiscriminatorObject;
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region ../oas/src/Oas.d.ts
|
|
22
|
-
type
|
|
22
|
+
type OasOptions = {
|
|
23
23
|
contentType?: contentType;
|
|
24
24
|
discriminator?: 'strict' | 'inherit';
|
|
25
|
+
/**
|
|
26
|
+
* Resolve name collisions when schemas from different components share the same name (case-insensitive).
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
collisionDetection?: boolean;
|
|
25
30
|
};
|
|
26
31
|
declare class Oas extends BaseOas {
|
|
27
32
|
#private;
|
|
28
33
|
document: Document;
|
|
29
34
|
constructor(document: Document);
|
|
30
|
-
setOptions(options:
|
|
31
|
-
get options():
|
|
35
|
+
setOptions(options: OasOptions): void;
|
|
36
|
+
get options(): OasOptions;
|
|
32
37
|
get<T = unknown>($ref: string): T | null;
|
|
33
38
|
getKey($ref: string): string | undefined;
|
|
34
39
|
set($ref: string, value: unknown): false | undefined;
|
|
@@ -37,8 +42,20 @@ declare class Oas extends BaseOas {
|
|
|
37
42
|
getResponseSchema(operation: Operation$1, statusCode: string | number): SchemaObject$1;
|
|
38
43
|
getRequestSchema(operation: Operation$1): SchemaObject$1 | undefined;
|
|
39
44
|
getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
|
|
40
|
-
|
|
45
|
+
validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
|
|
41
46
|
flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
|
|
47
|
+
/**
|
|
48
|
+
* Get schemas from OpenAPI components (schemas, responses, requestBodies).
|
|
49
|
+
* Returns schemas in dependency order along with name mapping for collision resolution.
|
|
50
|
+
*/
|
|
51
|
+
getSchemas(options?: {
|
|
52
|
+
contentType?: contentType;
|
|
53
|
+
includes?: Array<'schemas' | 'responses' | 'requestBodies'>;
|
|
54
|
+
collisionDetection?: boolean;
|
|
55
|
+
}): {
|
|
56
|
+
schemas: Record<string, SchemaObject$1>;
|
|
57
|
+
nameMapping: Map<string, string>;
|
|
58
|
+
};
|
|
42
59
|
}
|
|
43
60
|
//#endregion
|
|
44
61
|
//#region ../core/src/BaseGenerator.d.ts
|
|
@@ -339,7 +356,7 @@ type Config<TInput = Input> = {
|
|
|
339
356
|
input: TInput;
|
|
340
357
|
output: {
|
|
341
358
|
/**
|
|
342
|
-
* The path where all generated files
|
|
359
|
+
* The path where all generated files receives exported.
|
|
343
360
|
* This can be an absolute path or a path relative to the specified root option.
|
|
344
361
|
*/
|
|
345
362
|
path: string;
|
|
@@ -354,41 +371,39 @@ type Config<TInput = Input> = {
|
|
|
354
371
|
write?: boolean;
|
|
355
372
|
/**
|
|
356
373
|
* Specifies the formatting tool to be used.
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
* - '
|
|
361
|
-
* -
|
|
362
|
-
*
|
|
363
|
-
*
|
|
374
|
+
* - 'auto' automatically detects and uses biome or prettier (in that order of preference).
|
|
375
|
+
* - 'prettier' uses Prettier for code formatting.
|
|
376
|
+
* - 'biome' uses Biome for code formatting.
|
|
377
|
+
* - 'oxfmt' uses Oxfmt for code formatting.
|
|
378
|
+
* - false disables code formatting.
|
|
379
|
+
* @default 'prettier'
|
|
364
380
|
*/
|
|
365
381
|
format?: 'auto' | 'prettier' | 'biome' | 'oxfmt' | false;
|
|
366
382
|
/**
|
|
367
383
|
* Specifies the linter that should be used to analyze the code.
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
* - '
|
|
372
|
-
* -
|
|
373
|
-
*
|
|
374
|
-
* - 'oxlint': Represents the Oxlint tool for linting purposes.
|
|
375
|
-
*
|
|
384
|
+
* - 'auto' automatically detects and uses biome, oxlint, or eslint (in that order of preference).
|
|
385
|
+
* - 'eslint' uses ESLint for linting.
|
|
386
|
+
* - 'biome' uses Biome for linting.
|
|
387
|
+
* - 'oxlint' uses Oxlint for linting.
|
|
388
|
+
* - false disables linting.
|
|
389
|
+
* @default 'auto'
|
|
376
390
|
*/
|
|
377
391
|
lint?: 'auto' | 'eslint' | 'biome' | 'oxlint' | false;
|
|
378
392
|
/**
|
|
379
|
-
*
|
|
393
|
+
* Overrides the extension for generated imports and exports. By default, each plugin adds an extension.
|
|
380
394
|
* @default { '.ts': '.ts'}
|
|
381
395
|
*/
|
|
382
396
|
extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
|
|
383
397
|
/**
|
|
384
|
-
*
|
|
398
|
+
* 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`).
|
|
385
399
|
* @default 'named'
|
|
386
400
|
*/
|
|
387
401
|
barrelType?: Exclude<BarrelType, 'propagate'> | false;
|
|
388
402
|
/**
|
|
389
|
-
*
|
|
390
|
-
* - 'simple'
|
|
391
|
-
* - 'full'
|
|
403
|
+
* Adds a default banner to the start of every generated file indicating it was generated by Kubb.
|
|
404
|
+
* - 'simple' adds banner with link to Kubb.
|
|
405
|
+
* - 'full' adds source, title, description, and OpenAPI version.
|
|
406
|
+
* - false disables banner generation.
|
|
392
407
|
* @default 'simple'
|
|
393
408
|
*/
|
|
394
409
|
defaultBanner?: 'simple' | 'full' | false;
|
|
@@ -401,17 +416,17 @@ type Config<TInput = Input> = {
|
|
|
401
416
|
override?: boolean;
|
|
402
417
|
};
|
|
403
418
|
/**
|
|
404
|
-
* An array of Kubb plugins that
|
|
419
|
+
* An array of Kubb plugins that used in the generation.
|
|
405
420
|
* Each plugin may include additional configurable options(defined in the plugin itself).
|
|
406
|
-
* If a plugin depends on another plugin, an error
|
|
421
|
+
* If a plugin depends on another plugin, an error is returned if the required dependency is missing. See pre for more details.
|
|
407
422
|
*/
|
|
408
423
|
plugins?: Array<Plugin>;
|
|
409
424
|
/**
|
|
410
|
-
* Hooks
|
|
425
|
+
* Hooks triggered when a specific action occurs in Kubb.
|
|
411
426
|
*/
|
|
412
427
|
hooks?: {
|
|
413
428
|
/**
|
|
414
|
-
* Hook that
|
|
429
|
+
* Hook that triggers at the end of all executions.
|
|
415
430
|
* Useful for running Prettier or ESLint to format/lint your code.
|
|
416
431
|
*/
|
|
417
432
|
done?: string | Array<string>;
|
|
@@ -440,7 +455,7 @@ TContext = any,
|
|
|
440
455
|
TResolvePathOptions extends object = object> = {
|
|
441
456
|
name: TName;
|
|
442
457
|
/**
|
|
443
|
-
* Same
|
|
458
|
+
* Same behavior like what has been done with `QueryKey` in `@tanstack/react-query`
|
|
444
459
|
*/
|
|
445
460
|
key: PluginKey<TName | string>;
|
|
446
461
|
options: TOptions;
|
|
@@ -461,12 +476,12 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
|
|
|
461
476
|
*/
|
|
462
477
|
options: TOptions['resolvedOptions'];
|
|
463
478
|
/**
|
|
464
|
-
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin
|
|
479
|
+
* 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.
|
|
465
480
|
* Can be used to validate dependent plugins.
|
|
466
481
|
*/
|
|
467
482
|
pre?: Array<string>;
|
|
468
483
|
/**
|
|
469
|
-
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin
|
|
484
|
+
* 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.
|
|
470
485
|
*/
|
|
471
486
|
post?: Array<string>;
|
|
472
487
|
inject?: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => TOptions['context'];
|
|
@@ -484,12 +499,12 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
|
484
499
|
*/
|
|
485
500
|
key: TOptions['key'];
|
|
486
501
|
/**
|
|
487
|
-
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin
|
|
502
|
+
* 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.
|
|
488
503
|
* Can be used to validate dependent plugins.
|
|
489
504
|
*/
|
|
490
505
|
pre?: Array<string>;
|
|
491
506
|
/**
|
|
492
|
-
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin
|
|
507
|
+
* 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.
|
|
493
508
|
*/
|
|
494
509
|
post?: Array<string>;
|
|
495
510
|
/**
|
|
@@ -539,10 +554,12 @@ type ResolveNameParams = {
|
|
|
539
554
|
name: string;
|
|
540
555
|
pluginKey?: Plugin['key'];
|
|
541
556
|
/**
|
|
542
|
-
*
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
*
|
|
557
|
+
* Specifies the type of entity being named.
|
|
558
|
+
* - 'file' customizes the name of the created file (uses camelCase).
|
|
559
|
+
* - 'function' customizes the exported function names (uses camelCase).
|
|
560
|
+
* - 'type' customizes TypeScript types (uses PascalCase).
|
|
561
|
+
* - 'const' customizes variable names (uses camelCase).
|
|
562
|
+
* @default undefined
|
|
546
563
|
*/
|
|
547
564
|
type?: 'file' | 'function' | 'type' | 'const';
|
|
548
565
|
};
|
|
@@ -597,11 +614,14 @@ type GroupContext = {
|
|
|
597
614
|
};
|
|
598
615
|
type Group = {
|
|
599
616
|
/**
|
|
600
|
-
*
|
|
617
|
+
* Defines the type where to group the files.
|
|
618
|
+
* - 'tag' groups files by OpenAPI tags.
|
|
619
|
+
* - 'path' groups files by OpenAPI paths.
|
|
620
|
+
* @default undefined
|
|
601
621
|
*/
|
|
602
622
|
type: 'tag' | 'path';
|
|
603
623
|
/**
|
|
604
|
-
* Return the name of a group based on the group name, this
|
|
624
|
+
* Return the name of a group based on the group name, this used for the file and name generation
|
|
605
625
|
*/
|
|
606
626
|
name?: (context: GroupContext) => string;
|
|
607
627
|
};
|
|
@@ -673,7 +693,7 @@ declare class PluginManager {
|
|
|
673
693
|
parameters: PluginParameter<H>;
|
|
674
694
|
}): Array<ReturnType<ParseResult<H>>> | null;
|
|
675
695
|
/**
|
|
676
|
-
*
|
|
696
|
+
* Returns the first non-null result.
|
|
677
697
|
*/
|
|
678
698
|
hookFirst<H extends PluginLifecycleHooks>({
|
|
679
699
|
hookName,
|
|
@@ -685,7 +705,7 @@ declare class PluginManager {
|
|
|
685
705
|
skipped?: ReadonlySet<Plugin> | null;
|
|
686
706
|
}): Promise<SafeParseResult<H>>;
|
|
687
707
|
/**
|
|
688
|
-
*
|
|
708
|
+
* Returns the first non-null result.
|
|
689
709
|
*/
|
|
690
710
|
hookFirstSync<H extends PluginLifecycleHooks>({
|
|
691
711
|
hookName,
|
|
@@ -697,15 +717,15 @@ declare class PluginManager {
|
|
|
697
717
|
skipped?: ReadonlySet<Plugin> | null;
|
|
698
718
|
}): SafeParseResult<H>;
|
|
699
719
|
/**
|
|
700
|
-
*
|
|
720
|
+
* Runs all plugins in parallel based on `this.plugin` order and `pre`/`post` settings.
|
|
701
721
|
*/
|
|
702
|
-
hookParallel<H extends PluginLifecycleHooks,
|
|
722
|
+
hookParallel<H extends PluginLifecycleHooks, TOutput = void>({
|
|
703
723
|
hookName,
|
|
704
724
|
parameters
|
|
705
725
|
}: {
|
|
706
726
|
hookName: H;
|
|
707
727
|
parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
|
|
708
|
-
}): Promise<Awaited<
|
|
728
|
+
}): Promise<Awaited<TOutput>[]>;
|
|
709
729
|
/**
|
|
710
730
|
* Chains plugins
|
|
711
731
|
*/
|
|
@@ -974,8 +994,8 @@ type SchemaKeywordMapper = {
|
|
|
974
994
|
*/
|
|
975
995
|
path: KubbFile.Path;
|
|
976
996
|
/**
|
|
977
|
-
* When true `File.Import`
|
|
978
|
-
* When false a reference
|
|
997
|
+
* When true `File.Import` is used.
|
|
998
|
+
* When false a reference is used inside the current file.
|
|
979
999
|
*/
|
|
980
1000
|
isImportable: boolean;
|
|
981
1001
|
};
|
|
@@ -1107,7 +1127,7 @@ type SchemaGeneratorOptions = {
|
|
|
1107
1127
|
*/
|
|
1108
1128
|
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
1109
1129
|
/**
|
|
1110
|
-
* Receive schema and name(
|
|
1130
|
+
* Receive schema and name(propertyName) and return FakerMeta array
|
|
1111
1131
|
* TODO TODO add docs
|
|
1112
1132
|
* @beta
|
|
1113
1133
|
*/
|
|
@@ -1186,32 +1206,32 @@ type Options = {
|
|
|
1186
1206
|
output?: Output<Oas>;
|
|
1187
1207
|
/**
|
|
1188
1208
|
* Define which contentType should be used.
|
|
1189
|
-
* By default, the first JSON valid mediaType
|
|
1209
|
+
* By default, the first JSON valid mediaType is used
|
|
1190
1210
|
*/
|
|
1191
1211
|
contentType?: contentType;
|
|
1192
1212
|
/**
|
|
1193
|
-
*
|
|
1194
|
-
* - 'data'
|
|
1195
|
-
* - 'full'
|
|
1213
|
+
* Return type when calling cy.request.
|
|
1214
|
+
* - 'data' returns ResponseConfig[data].
|
|
1215
|
+
* - 'full' returns ResponseConfig.
|
|
1196
1216
|
* @default 'data'
|
|
1197
1217
|
*/
|
|
1198
1218
|
dataReturnType?: 'data' | 'full';
|
|
1199
1219
|
/**
|
|
1200
1220
|
* How to style your params, by default no casing is applied
|
|
1201
|
-
* - 'camelcase'
|
|
1221
|
+
* - 'camelcase' uses camelcase for the params names
|
|
1202
1222
|
*/
|
|
1203
1223
|
paramsCasing?: 'camelcase';
|
|
1204
1224
|
/**
|
|
1205
|
-
* How to pass your params
|
|
1206
|
-
* - 'object'
|
|
1207
|
-
* - 'inline'
|
|
1225
|
+
* How to pass your params.
|
|
1226
|
+
* - 'object' returns the params and pathParams as an object.
|
|
1227
|
+
* - 'inline' returns the params as comma separated params.
|
|
1208
1228
|
* @default 'inline'
|
|
1209
1229
|
*/
|
|
1210
1230
|
paramsType?: 'object' | 'inline';
|
|
1211
1231
|
/**
|
|
1212
1232
|
* How to pass your pathParams.
|
|
1213
|
-
* - 'object'
|
|
1214
|
-
* - 'inline'
|
|
1233
|
+
* - 'object' returns the pathParams as an object.
|
|
1234
|
+
* - 'inline' returns the pathParams as comma separated params.
|
|
1215
1235
|
* @default 'inline'
|
|
1216
1236
|
*/
|
|
1217
1237
|
pathParamsType?: 'object' | 'inline';
|
|
@@ -1255,4 +1275,4 @@ type ResolvedOptions = {
|
|
|
1255
1275
|
type PluginCypress = PluginFactoryOptions<'plugin-cypress', Options, ResolvedOptions, never, ResolvePathOptions>;
|
|
1256
1276
|
//#endregion
|
|
1257
1277
|
export { UserPluginWithLifeCycle as a, OperationSchemas as i, PluginCypress as n, HttpMethod as o, ReactGenerator as r, Options as t };
|
|
1258
|
-
//# sourceMappingURL=types-
|
|
1278
|
+
//# sourceMappingURL=types-wYAshYRF.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-cypress",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.0",
|
|
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",
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
],
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@kubb/react-fabric": "0.12.4",
|
|
78
|
-
"@kubb/core": "4.
|
|
79
|
-
"@kubb/oas": "4.
|
|
80
|
-
"@kubb/plugin-oas": "4.
|
|
81
|
-
"@kubb/plugin-ts": "4.
|
|
78
|
+
"@kubb/core": "4.19.0",
|
|
79
|
+
"@kubb/oas": "4.19.0",
|
|
80
|
+
"@kubb/plugin-oas": "4.19.0",
|
|
81
|
+
"@kubb/plugin-ts": "4.19.0"
|
|
82
82
|
},
|
|
83
83
|
"engines": {
|
|
84
84
|
"node": ">=20"
|
package/src/types.ts
CHANGED
|
@@ -12,32 +12,32 @@ export type Options = {
|
|
|
12
12
|
output?: Output<Oas>
|
|
13
13
|
/**
|
|
14
14
|
* Define which contentType should be used.
|
|
15
|
-
* By default, the first JSON valid mediaType
|
|
15
|
+
* By default, the first JSON valid mediaType is used
|
|
16
16
|
*/
|
|
17
17
|
contentType?: contentType
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
* - 'data'
|
|
21
|
-
* - 'full'
|
|
19
|
+
* Return type when calling cy.request.
|
|
20
|
+
* - 'data' returns ResponseConfig[data].
|
|
21
|
+
* - 'full' returns ResponseConfig.
|
|
22
22
|
* @default 'data'
|
|
23
23
|
*/
|
|
24
24
|
dataReturnType?: 'data' | 'full'
|
|
25
25
|
/**
|
|
26
26
|
* How to style your params, by default no casing is applied
|
|
27
|
-
* - 'camelcase'
|
|
27
|
+
* - 'camelcase' uses camelcase for the params names
|
|
28
28
|
*/
|
|
29
29
|
paramsCasing?: 'camelcase'
|
|
30
30
|
/**
|
|
31
|
-
* How to pass your params
|
|
32
|
-
* - 'object'
|
|
33
|
-
* - 'inline'
|
|
31
|
+
* How to pass your params.
|
|
32
|
+
* - 'object' returns the params and pathParams as an object.
|
|
33
|
+
* - 'inline' returns the params as comma separated params.
|
|
34
34
|
* @default 'inline'
|
|
35
35
|
*/
|
|
36
36
|
paramsType?: 'object' | 'inline'
|
|
37
37
|
/**
|
|
38
38
|
* How to pass your pathParams.
|
|
39
|
-
* - 'object'
|
|
40
|
-
* - 'inline'
|
|
39
|
+
* - 'object' returns the pathParams as an object.
|
|
40
|
+
* - 'inline' returns the pathParams as comma separated params.
|
|
41
41
|
* @default 'inline'
|
|
42
42
|
*/
|
|
43
43
|
pathParamsType?: 'object' | 'inline'
|