@kubb/plugin-oas 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/{SchemaGenerator-CoV4zGpd.js → SchemaGenerator-D8GP-AGi.js} +48 -21
- package/dist/SchemaGenerator-D8GP-AGi.js.map +1 -0
- package/dist/{SchemaGenerator-tDDCI3wi.cjs → SchemaGenerator-DO3rrt_U.cjs} +49 -22
- package/dist/SchemaGenerator-DO3rrt_U.cjs.map +1 -0
- package/dist/SchemaMapper-CzH82C7C.cjs.map +1 -1
- package/dist/SchemaMapper-D-GETHNf.js.map +1 -1
- package/dist/{SchemaMapper-BBUBpcx-.d.ts → SchemaMapper-DI2vHHE0.d.ts} +72 -52
- package/dist/{SchemaMapper-CIs2VKvf.d.cts → SchemaMapper-DmB5NyNo.d.cts} +72 -52
- package/dist/{createGenerator-Cj-sXgmn.d.cts → createGenerator-BF26dp_h.d.cts} +33 -13
- package/dist/{createGenerator-CZi_gpit.d.ts → createGenerator-DhGg_jH6.d.ts} +33 -13
- package/dist/generators.d.cts +2 -2
- package/dist/generators.d.ts +2 -2
- package/dist/getSchemaFactory-CBp1me72.cjs +29 -0
- package/dist/getSchemaFactory-CBp1me72.cjs.map +1 -0
- package/dist/getSchemaFactory-DsoVRgxV.js +24 -0
- package/dist/getSchemaFactory-DsoVRgxV.js.map +1 -0
- package/dist/hooks.cjs +3 -3
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +4 -4
- package/dist/hooks.d.ts +4 -4
- package/dist/hooks.js +3 -3
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +5 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/mocks.d.cts +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/utils.cjs +26 -3
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +25 -5
- package/dist/utils.d.ts +25 -5
- package/dist/utils.js +24 -1
- package/dist/utils.js.map +1 -1
- package/package.json +3 -3
- package/src/SchemaGenerator.ts +60 -26
- package/src/SchemaMapper.ts +3 -3
- package/src/hooks/useOperationManager.ts +1 -1
- package/src/hooks/useSchemaManager.ts +1 -1
- package/src/plugin.ts +3 -1
- package/src/types.ts +30 -10
- package/src/utils/getSchemas.ts +27 -105
- package/dist/SchemaGenerator-CoV4zGpd.js.map +0 -1
- package/dist/SchemaGenerator-tDDCI3wi.cjs.map +0 -1
- package/dist/getSchemas-BUXPwm-5.js +0 -101
- package/dist/getSchemas-BUXPwm-5.js.map +0 -1
- package/dist/getSchemas-D3YweIFO.cjs +0 -112
- package/dist/getSchemas-D3YweIFO.cjs.map +0 -1
|
@@ -307,7 +307,7 @@ type Config<TInput = Input> = {
|
|
|
307
307
|
input: TInput;
|
|
308
308
|
output: {
|
|
309
309
|
/**
|
|
310
|
-
* The path where all generated files
|
|
310
|
+
* The path where all generated files receives exported.
|
|
311
311
|
* This can be an absolute path or a path relative to the specified root option.
|
|
312
312
|
*/
|
|
313
313
|
path: string;
|
|
@@ -322,41 +322,39 @@ type Config<TInput = Input> = {
|
|
|
322
322
|
write?: boolean;
|
|
323
323
|
/**
|
|
324
324
|
* Specifies the formatting tool to be used.
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
* - '
|
|
329
|
-
* -
|
|
330
|
-
*
|
|
331
|
-
*
|
|
325
|
+
* - 'auto' automatically detects and uses biome or prettier (in that order of preference).
|
|
326
|
+
* - 'prettier' uses Prettier for code formatting.
|
|
327
|
+
* - 'biome' uses Biome for code formatting.
|
|
328
|
+
* - 'oxfmt' uses Oxfmt for code formatting.
|
|
329
|
+
* - false disables code formatting.
|
|
330
|
+
* @default 'prettier'
|
|
332
331
|
*/
|
|
333
332
|
format?: 'auto' | 'prettier' | 'biome' | 'oxfmt' | false;
|
|
334
333
|
/**
|
|
335
334
|
* Specifies the linter that should be used to analyze the code.
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
* - '
|
|
340
|
-
* -
|
|
341
|
-
*
|
|
342
|
-
* - 'oxlint': Represents the Oxlint tool for linting purposes.
|
|
343
|
-
*
|
|
335
|
+
* - 'auto' automatically detects and uses biome, oxlint, or eslint (in that order of preference).
|
|
336
|
+
* - 'eslint' uses ESLint for linting.
|
|
337
|
+
* - 'biome' uses Biome for linting.
|
|
338
|
+
* - 'oxlint' uses Oxlint for linting.
|
|
339
|
+
* - false disables linting.
|
|
340
|
+
* @default 'auto'
|
|
344
341
|
*/
|
|
345
342
|
lint?: 'auto' | 'eslint' | 'biome' | 'oxlint' | false;
|
|
346
343
|
/**
|
|
347
|
-
*
|
|
344
|
+
* Overrides the extension for generated imports and exports. By default, each plugin adds an extension.
|
|
348
345
|
* @default { '.ts': '.ts'}
|
|
349
346
|
*/
|
|
350
347
|
extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
|
|
351
348
|
/**
|
|
352
|
-
*
|
|
349
|
+
* 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`).
|
|
353
350
|
* @default 'named'
|
|
354
351
|
*/
|
|
355
352
|
barrelType?: Exclude<BarrelType, 'propagate'> | false;
|
|
356
353
|
/**
|
|
357
|
-
*
|
|
358
|
-
* - 'simple'
|
|
359
|
-
* - 'full'
|
|
354
|
+
* Adds a default banner to the start of every generated file indicating it was generated by Kubb.
|
|
355
|
+
* - 'simple' adds banner with link to Kubb.
|
|
356
|
+
* - 'full' adds source, title, description, and OpenAPI version.
|
|
357
|
+
* - false disables banner generation.
|
|
360
358
|
* @default 'simple'
|
|
361
359
|
*/
|
|
362
360
|
defaultBanner?: 'simple' | 'full' | false;
|
|
@@ -369,17 +367,17 @@ type Config<TInput = Input> = {
|
|
|
369
367
|
override?: boolean;
|
|
370
368
|
};
|
|
371
369
|
/**
|
|
372
|
-
* An array of Kubb plugins that
|
|
370
|
+
* An array of Kubb plugins that used in the generation.
|
|
373
371
|
* Each plugin may include additional configurable options(defined in the plugin itself).
|
|
374
|
-
* If a plugin depends on another plugin, an error
|
|
372
|
+
* If a plugin depends on another plugin, an error is returned if the required dependency is missing. See pre for more details.
|
|
375
373
|
*/
|
|
376
374
|
plugins?: Array<Plugin>;
|
|
377
375
|
/**
|
|
378
|
-
* Hooks
|
|
376
|
+
* Hooks triggered when a specific action occurs in Kubb.
|
|
379
377
|
*/
|
|
380
378
|
hooks?: {
|
|
381
379
|
/**
|
|
382
|
-
* Hook that
|
|
380
|
+
* Hook that triggers at the end of all executions.
|
|
383
381
|
* Useful for running Prettier or ESLint to format/lint your code.
|
|
384
382
|
*/
|
|
385
383
|
done?: string | Array<string>;
|
|
@@ -408,7 +406,7 @@ TContext = any,
|
|
|
408
406
|
TResolvePathOptions extends object = object> = {
|
|
409
407
|
name: TName;
|
|
410
408
|
/**
|
|
411
|
-
* Same
|
|
409
|
+
* Same behavior like what has been done with `QueryKey` in `@tanstack/react-query`
|
|
412
410
|
*/
|
|
413
411
|
key: PluginKey<TName | string>;
|
|
414
412
|
options: TOptions;
|
|
@@ -429,12 +427,12 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
|
|
|
429
427
|
*/
|
|
430
428
|
options: TOptions['resolvedOptions'];
|
|
431
429
|
/**
|
|
432
|
-
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin
|
|
430
|
+
* 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.
|
|
433
431
|
* Can be used to validate dependent plugins.
|
|
434
432
|
*/
|
|
435
433
|
pre?: Array<string>;
|
|
436
434
|
/**
|
|
437
|
-
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin
|
|
435
|
+
* 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.
|
|
438
436
|
*/
|
|
439
437
|
post?: Array<string>;
|
|
440
438
|
inject?: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => TOptions['context'];
|
|
@@ -452,12 +450,12 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
|
452
450
|
*/
|
|
453
451
|
key: TOptions['key'];
|
|
454
452
|
/**
|
|
455
|
-
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin
|
|
453
|
+
* 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.
|
|
456
454
|
* Can be used to validate dependent plugins.
|
|
457
455
|
*/
|
|
458
456
|
pre?: Array<string>;
|
|
459
457
|
/**
|
|
460
|
-
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin
|
|
458
|
+
* 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.
|
|
461
459
|
*/
|
|
462
460
|
post?: Array<string>;
|
|
463
461
|
/**
|
|
@@ -507,10 +505,12 @@ type ResolveNameParams = {
|
|
|
507
505
|
name: string;
|
|
508
506
|
pluginKey?: Plugin['key'];
|
|
509
507
|
/**
|
|
510
|
-
*
|
|
511
|
-
*
|
|
512
|
-
*
|
|
513
|
-
*
|
|
508
|
+
* Specifies the type of entity being named.
|
|
509
|
+
* - 'file' customizes the name of the created file (uses camelCase).
|
|
510
|
+
* - 'function' customizes the exported function names (uses camelCase).
|
|
511
|
+
* - 'type' customizes TypeScript types (uses PascalCase).
|
|
512
|
+
* - 'const' customizes variable names (uses camelCase).
|
|
513
|
+
* @default undefined
|
|
514
514
|
*/
|
|
515
515
|
type?: 'file' | 'function' | 'type' | 'const';
|
|
516
516
|
};
|
|
@@ -565,11 +565,14 @@ type GroupContext = {
|
|
|
565
565
|
};
|
|
566
566
|
type Group = {
|
|
567
567
|
/**
|
|
568
|
-
*
|
|
568
|
+
* Defines the type where to group the files.
|
|
569
|
+
* - 'tag' groups files by OpenAPI tags.
|
|
570
|
+
* - 'path' groups files by OpenAPI paths.
|
|
571
|
+
* @default undefined
|
|
569
572
|
*/
|
|
570
573
|
type: 'tag' | 'path';
|
|
571
574
|
/**
|
|
572
|
-
* Return the name of a group based on the group name, this
|
|
575
|
+
* Return the name of a group based on the group name, this used for the file and name generation
|
|
573
576
|
*/
|
|
574
577
|
name?: (context: GroupContext) => string;
|
|
575
578
|
};
|
|
@@ -582,7 +585,7 @@ type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseRe
|
|
|
582
585
|
result: Result;
|
|
583
586
|
plugin: Plugin;
|
|
584
587
|
};
|
|
585
|
-
type Options
|
|
588
|
+
type Options = {
|
|
586
589
|
fabric: Fabric;
|
|
587
590
|
events: AsyncEventEmitter<KubbEvents>;
|
|
588
591
|
/**
|
|
@@ -600,8 +603,8 @@ type GetFileProps<TOptions = object> = {
|
|
|
600
603
|
declare class PluginManager {
|
|
601
604
|
#private;
|
|
602
605
|
readonly config: Config;
|
|
603
|
-
readonly options: Options
|
|
604
|
-
constructor(config: Config, options: Options
|
|
606
|
+
readonly options: Options;
|
|
607
|
+
constructor(config: Config, options: Options);
|
|
605
608
|
get events(): AsyncEventEmitter<KubbEvents>;
|
|
606
609
|
getContext<TOptions extends PluginFactoryOptions>(plugin: Plugin<TOptions>): PluginContext<TOptions> & Record<string, any>;
|
|
607
610
|
get plugins(): Array<Plugin>;
|
|
@@ -641,7 +644,7 @@ declare class PluginManager {
|
|
|
641
644
|
parameters: PluginParameter<H>;
|
|
642
645
|
}): Array<ReturnType<ParseResult<H>>> | null;
|
|
643
646
|
/**
|
|
644
|
-
*
|
|
647
|
+
* Returns the first non-null result.
|
|
645
648
|
*/
|
|
646
649
|
hookFirst<H extends PluginLifecycleHooks>({
|
|
647
650
|
hookName,
|
|
@@ -653,7 +656,7 @@ declare class PluginManager {
|
|
|
653
656
|
skipped?: ReadonlySet<Plugin> | null;
|
|
654
657
|
}): Promise<SafeParseResult<H>>;
|
|
655
658
|
/**
|
|
656
|
-
*
|
|
659
|
+
* Returns the first non-null result.
|
|
657
660
|
*/
|
|
658
661
|
hookFirstSync<H extends PluginLifecycleHooks>({
|
|
659
662
|
hookName,
|
|
@@ -665,15 +668,15 @@ declare class PluginManager {
|
|
|
665
668
|
skipped?: ReadonlySet<Plugin> | null;
|
|
666
669
|
}): SafeParseResult<H>;
|
|
667
670
|
/**
|
|
668
|
-
*
|
|
671
|
+
* Runs all plugins in parallel based on `this.plugin` order and `pre`/`post` settings.
|
|
669
672
|
*/
|
|
670
|
-
hookParallel<H extends PluginLifecycleHooks,
|
|
673
|
+
hookParallel<H extends PluginLifecycleHooks, TOutput = void>({
|
|
671
674
|
hookName,
|
|
672
675
|
parameters
|
|
673
676
|
}: {
|
|
674
677
|
hookName: H;
|
|
675
678
|
parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
|
|
676
|
-
}): Promise<Awaited<
|
|
679
|
+
}): Promise<Awaited<TOutput>[]>;
|
|
677
680
|
/**
|
|
678
681
|
* Chains plugins
|
|
679
682
|
*/
|
|
@@ -705,16 +708,21 @@ type Operation$1 = Operation;
|
|
|
705
708
|
type DiscriminatorObject$1 = DiscriminatorObject;
|
|
706
709
|
//#endregion
|
|
707
710
|
//#region ../oas/src/Oas.d.ts
|
|
708
|
-
type
|
|
711
|
+
type OasOptions = {
|
|
709
712
|
contentType?: contentType;
|
|
710
713
|
discriminator?: 'strict' | 'inherit';
|
|
714
|
+
/**
|
|
715
|
+
* Resolve name collisions when schemas from different components share the same name (case-insensitive).
|
|
716
|
+
* @default false
|
|
717
|
+
*/
|
|
718
|
+
collisionDetection?: boolean;
|
|
711
719
|
};
|
|
712
720
|
declare class Oas extends BaseOas {
|
|
713
721
|
#private;
|
|
714
722
|
document: Document;
|
|
715
723
|
constructor(document: Document);
|
|
716
|
-
setOptions(options:
|
|
717
|
-
get options():
|
|
724
|
+
setOptions(options: OasOptions): void;
|
|
725
|
+
get options(): OasOptions;
|
|
718
726
|
get<T = unknown>($ref: string): T | null;
|
|
719
727
|
getKey($ref: string): string | undefined;
|
|
720
728
|
set($ref: string, value: unknown): false | undefined;
|
|
@@ -723,8 +731,20 @@ declare class Oas extends BaseOas {
|
|
|
723
731
|
getResponseSchema(operation: Operation$1, statusCode: string | number): SchemaObject$1;
|
|
724
732
|
getRequestSchema(operation: Operation$1): SchemaObject$1 | undefined;
|
|
725
733
|
getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
|
|
726
|
-
|
|
734
|
+
validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
|
|
727
735
|
flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
|
|
736
|
+
/**
|
|
737
|
+
* Get schemas from OpenAPI components (schemas, responses, requestBodies).
|
|
738
|
+
* Returns schemas in dependency order along with name mapping for collision resolution.
|
|
739
|
+
*/
|
|
740
|
+
getSchemas(options?: {
|
|
741
|
+
contentType?: contentType;
|
|
742
|
+
includes?: Array<'schemas' | 'responses' | 'requestBodies'>;
|
|
743
|
+
collisionDetection?: boolean;
|
|
744
|
+
}): {
|
|
745
|
+
schemas: Record<string, SchemaObject$1>;
|
|
746
|
+
nameMapping: Map<string, string>;
|
|
747
|
+
};
|
|
728
748
|
}
|
|
729
749
|
//#endregion
|
|
730
750
|
//#region ../oas/src/utils.d.ts
|
|
@@ -846,8 +866,8 @@ type SchemaKeywordMapper = {
|
|
|
846
866
|
*/
|
|
847
867
|
path: KubbFile.Path;
|
|
848
868
|
/**
|
|
849
|
-
* When true `File.Import`
|
|
850
|
-
* When false a reference
|
|
869
|
+
* When true `File.Import` is used.
|
|
870
|
+
* When false a reference is used inside the current file.
|
|
851
871
|
*/
|
|
852
872
|
isImportable: boolean;
|
|
853
873
|
};
|
|
@@ -1007,11 +1027,11 @@ type SchemaTree = {
|
|
|
1007
1027
|
current: Schema;
|
|
1008
1028
|
siblings: Schema[];
|
|
1009
1029
|
/**
|
|
1010
|
-
* this
|
|
1030
|
+
* this is equal to the key of a property(object)
|
|
1011
1031
|
*/
|
|
1012
1032
|
name?: string;
|
|
1013
1033
|
};
|
|
1014
1034
|
declare function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]>;
|
|
1015
1035
|
//#endregion
|
|
1016
1036
|
export { __name as A, Plugin as C, AsyncEventEmitter as D, UserPluginWithLifeCycle as E, KubbEvents as O, Output as S, ResolveNameParams as T, contentType as _, SchemaMapper as a, Config as b, schemaKeywords as c, HttpMethod as d, OasTypes as f, SchemaObject$1 as g, Operation$1 as h, SchemaKeywordMapper as i, BaseGenerator as k, isOptional as l, OpenAPIV3_1 as m, SchemaKeyword as n, SchemaTree as o, OpenAPIV3 as p, SchemaKeywordBase as r, isKeyword as s, Schema as t, Oas as u, FileMetaBase as v, PluginFactoryOptions as w, Group as x, PluginManager as y };
|
|
1017
|
-
//# sourceMappingURL=SchemaMapper-
|
|
1037
|
+
//# sourceMappingURL=SchemaMapper-DmB5NyNo.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as __name, C as Plugin, D as AsyncEventEmitter, O as KubbEvents, S as Output, T as ResolveNameParams, _ as contentType, b as Config, d as HttpMethod, g as SchemaObject, h as Operation, i as SchemaKeywordMapper, k as BaseGenerator, t as Schema, u as Oas, v as FileMetaBase, w as PluginFactoryOptions, x as Group, y as PluginManager } from "./SchemaMapper-
|
|
1
|
+
import { A as __name, C as Plugin, D as AsyncEventEmitter, O as KubbEvents, S as Output, T as ResolveNameParams, _ as contentType, b as Config, d as HttpMethod, g as SchemaObject, h as Operation, i as SchemaKeywordMapper, k as BaseGenerator, t as Schema, u as Oas, v as FileMetaBase, w as PluginFactoryOptions, x as Group, y as PluginManager } from "./SchemaMapper-DmB5NyNo.cjs";
|
|
2
2
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
3
3
|
import { Fabric } from "@kubb/react-fabric";
|
|
4
4
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
@@ -74,35 +74,55 @@ type Options = {
|
|
|
74
74
|
/**
|
|
75
75
|
* Which server to use from the array of `servers.url[serverIndex]`
|
|
76
76
|
* @example
|
|
77
|
-
* - `0`
|
|
78
|
-
* - `1`
|
|
77
|
+
* - `0` returns `http://petstore.swagger.io/api`
|
|
78
|
+
* - `1` returns `http://localhost:3000`
|
|
79
79
|
*/
|
|
80
80
|
serverIndex?: number;
|
|
81
81
|
/**
|
|
82
82
|
* Define which contentType should be used.
|
|
83
|
-
* By default, the first
|
|
83
|
+
* By default, uses the first valid JSON media type.
|
|
84
84
|
*/
|
|
85
85
|
contentType?: contentType;
|
|
86
86
|
/**
|
|
87
87
|
* Defines how the discriminator value should be interpreted during processing.
|
|
88
|
-
*
|
|
88
|
+
* - 'strict' uses the oneOf schemas as defined, without modification.
|
|
89
|
+
* - 'inherit' replaces the oneOf schema with the schema referenced by discriminator.mapping[key].
|
|
89
90
|
* @default 'strict'
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* - `inherit`: Replaces the `oneOf` schema with the schema referenced by `discriminator.mapping[key]`.
|
|
93
|
-
* - `strict`: Uses the `oneOf` schemas as defined, without modification.
|
|
94
|
-
*
|
|
95
91
|
* @see https://github.com/kubb-labs/kubb/issues/1736
|
|
96
92
|
*/
|
|
97
93
|
discriminator?: 'strict' | 'inherit';
|
|
98
94
|
/**
|
|
99
|
-
* Override some
|
|
95
|
+
* Override some behavior of the Oas class instance, see '@kubb/oas'
|
|
100
96
|
*/
|
|
101
97
|
oasClass?: typeof Oas;
|
|
102
98
|
/**
|
|
103
99
|
* Define some generators next to the JSON generation
|
|
104
100
|
*/
|
|
105
101
|
generators?: Array<Generator<PluginOas>>;
|
|
102
|
+
/**
|
|
103
|
+
* Resolve name collisions when schemas from different components share the same name (case-insensitive).
|
|
104
|
+
*
|
|
105
|
+
* When enabled, Kubb automatically detects and resolves collisions using intelligent suffixes:
|
|
106
|
+
* - Cross-component collisions: Adds semantic suffixes based on the component type (Schema/Response/Request)
|
|
107
|
+
* - Same-component collisions: Adds numeric suffixes (2, 3, ...) for case-insensitive duplicates
|
|
108
|
+
*
|
|
109
|
+
* When disabled (legacy behavior), collisions may result in duplicate files or overwrite issues.
|
|
110
|
+
*
|
|
111
|
+
* **Cross-component collision example:**
|
|
112
|
+
* If you have "Order" in both schemas and requestBodies:
|
|
113
|
+
* - With `collisionDetection: true`: Generates `OrderSchema.ts`, `OrderRequest.ts`
|
|
114
|
+
* - With `collisionDetection: false`: May generate duplicate `Order.ts` files
|
|
115
|
+
*
|
|
116
|
+
* **Same-component collision example:**
|
|
117
|
+
* If you have "Variant" and "variant" in schemas:
|
|
118
|
+
* - With `collisionDetection: true`: Generates `Variant.ts`, `Variant2.ts`
|
|
119
|
+
* - With `collisionDetection: false`: May overwrite or create duplicates
|
|
120
|
+
*
|
|
121
|
+
* @default false
|
|
122
|
+
* @see https://github.com/kubb-labs/kubb/issues/1999
|
|
123
|
+
* @note this will be the default in Kubb v5
|
|
124
|
+
*/
|
|
125
|
+
collisionDetection?: boolean;
|
|
106
126
|
};
|
|
107
127
|
/**
|
|
108
128
|
* `propertyName` is the ref name + resolved with the nameResolver
|
|
@@ -262,7 +282,7 @@ type SchemaGeneratorOptions = {
|
|
|
262
282
|
*/
|
|
263
283
|
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
264
284
|
/**
|
|
265
|
-
* Receive schema and name(
|
|
285
|
+
* Receive schema and name(propertyName) and return FakerMeta array
|
|
266
286
|
* TODO TODO add docs
|
|
267
287
|
* @beta
|
|
268
288
|
*/
|
|
@@ -355,4 +375,4 @@ type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
|
355
375
|
declare function createGenerator<TOptions extends PluginFactoryOptions>(generator: UserGenerator<TOptions>): CoreGenerator<TOptions>;
|
|
356
376
|
//#endregion
|
|
357
377
|
export { Resolver as C, ResolvePathOptions as S, Options as _, createReactGenerator as a, Ref as b, SchemaGeneratorBuildOptions as c, OperationGenerator as d, OperationMethodResult as f, OperationSchemas as g, OperationSchema as h, ReactGenerator as i, SchemaGeneratorOptions as l, Include as m, createGenerator as n, GetSchemaGeneratorOptions as o, Exclude as p, Generator as r, SchemaGenerator as s, CoreGenerator as t, SchemaMethodResult as u, Override as v, FunctionParamsAST as w, Refs as x, PluginOas as y };
|
|
358
|
-
//# sourceMappingURL=createGenerator-
|
|
378
|
+
//# sourceMappingURL=createGenerator-BF26dp_h.d.cts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-iVr_oF3V.js";
|
|
2
|
-
import { C as Plugin, D as AsyncEventEmitter, O as KubbEvents, S as Output, T as ResolveNameParams, _ as contentType, b as Config, d as HttpMethod, g as SchemaObject, h as Operation, i as SchemaKeywordMapper, k as BaseGenerator, t as Schema, u as Oas, v as FileMetaBase, w as PluginFactoryOptions, x as Group, y as PluginManager } from "./SchemaMapper-
|
|
2
|
+
import { C as Plugin, D as AsyncEventEmitter, O as KubbEvents, S as Output, T as ResolveNameParams, _ as contentType, b as Config, d as HttpMethod, g as SchemaObject, h as Operation, i as SchemaKeywordMapper, k as BaseGenerator, t as Schema, u as Oas, v as FileMetaBase, w as PluginFactoryOptions, x as Group, y as PluginManager } from "./SchemaMapper-DI2vHHE0.js";
|
|
3
3
|
import { Fabric } from "@kubb/react-fabric";
|
|
4
4
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
5
5
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
@@ -75,35 +75,55 @@ type Options = {
|
|
|
75
75
|
/**
|
|
76
76
|
* Which server to use from the array of `servers.url[serverIndex]`
|
|
77
77
|
* @example
|
|
78
|
-
* - `0`
|
|
79
|
-
* - `1`
|
|
78
|
+
* - `0` returns `http://petstore.swagger.io/api`
|
|
79
|
+
* - `1` returns `http://localhost:3000`
|
|
80
80
|
*/
|
|
81
81
|
serverIndex?: number;
|
|
82
82
|
/**
|
|
83
83
|
* Define which contentType should be used.
|
|
84
|
-
* By default, the first
|
|
84
|
+
* By default, uses the first valid JSON media type.
|
|
85
85
|
*/
|
|
86
86
|
contentType?: contentType;
|
|
87
87
|
/**
|
|
88
88
|
* Defines how the discriminator value should be interpreted during processing.
|
|
89
|
-
*
|
|
89
|
+
* - 'strict' uses the oneOf schemas as defined, without modification.
|
|
90
|
+
* - 'inherit' replaces the oneOf schema with the schema referenced by discriminator.mapping[key].
|
|
90
91
|
* @default 'strict'
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* - `inherit`: Replaces the `oneOf` schema with the schema referenced by `discriminator.mapping[key]`.
|
|
94
|
-
* - `strict`: Uses the `oneOf` schemas as defined, without modification.
|
|
95
|
-
*
|
|
96
92
|
* @see https://github.com/kubb-labs/kubb/issues/1736
|
|
97
93
|
*/
|
|
98
94
|
discriminator?: 'strict' | 'inherit';
|
|
99
95
|
/**
|
|
100
|
-
* Override some
|
|
96
|
+
* Override some behavior of the Oas class instance, see '@kubb/oas'
|
|
101
97
|
*/
|
|
102
98
|
oasClass?: typeof Oas;
|
|
103
99
|
/**
|
|
104
100
|
* Define some generators next to the JSON generation
|
|
105
101
|
*/
|
|
106
102
|
generators?: Array<Generator<PluginOas>>;
|
|
103
|
+
/**
|
|
104
|
+
* Resolve name collisions when schemas from different components share the same name (case-insensitive).
|
|
105
|
+
*
|
|
106
|
+
* When enabled, Kubb automatically detects and resolves collisions using intelligent suffixes:
|
|
107
|
+
* - Cross-component collisions: Adds semantic suffixes based on the component type (Schema/Response/Request)
|
|
108
|
+
* - Same-component collisions: Adds numeric suffixes (2, 3, ...) for case-insensitive duplicates
|
|
109
|
+
*
|
|
110
|
+
* When disabled (legacy behavior), collisions may result in duplicate files or overwrite issues.
|
|
111
|
+
*
|
|
112
|
+
* **Cross-component collision example:**
|
|
113
|
+
* If you have "Order" in both schemas and requestBodies:
|
|
114
|
+
* - With `collisionDetection: true`: Generates `OrderSchema.ts`, `OrderRequest.ts`
|
|
115
|
+
* - With `collisionDetection: false`: May generate duplicate `Order.ts` files
|
|
116
|
+
*
|
|
117
|
+
* **Same-component collision example:**
|
|
118
|
+
* If you have "Variant" and "variant" in schemas:
|
|
119
|
+
* - With `collisionDetection: true`: Generates `Variant.ts`, `Variant2.ts`
|
|
120
|
+
* - With `collisionDetection: false`: May overwrite or create duplicates
|
|
121
|
+
*
|
|
122
|
+
* @default false
|
|
123
|
+
* @see https://github.com/kubb-labs/kubb/issues/1999
|
|
124
|
+
* @note this will be the default in Kubb v5
|
|
125
|
+
*/
|
|
126
|
+
collisionDetection?: boolean;
|
|
107
127
|
};
|
|
108
128
|
/**
|
|
109
129
|
* `propertyName` is the ref name + resolved with the nameResolver
|
|
@@ -263,7 +283,7 @@ type SchemaGeneratorOptions = {
|
|
|
263
283
|
*/
|
|
264
284
|
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
265
285
|
/**
|
|
266
|
-
* Receive schema and name(
|
|
286
|
+
* Receive schema and name(propertyName) and return FakerMeta array
|
|
267
287
|
* TODO TODO add docs
|
|
268
288
|
* @beta
|
|
269
289
|
*/
|
|
@@ -356,4 +376,4 @@ type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
|
356
376
|
declare function createGenerator<TOptions extends PluginFactoryOptions>(generator: UserGenerator<TOptions>): CoreGenerator<TOptions>;
|
|
357
377
|
//#endregion
|
|
358
378
|
export { Resolver as C, ResolvePathOptions as S, Options as _, createReactGenerator as a, Ref as b, SchemaGeneratorBuildOptions as c, OperationGenerator as d, OperationMethodResult as f, OperationSchemas as g, OperationSchema as h, ReactGenerator as i, SchemaGeneratorOptions as l, Include as m, createGenerator as n, GetSchemaGeneratorOptions as o, Exclude as p, Generator as r, SchemaGenerator as s, CoreGenerator as t, SchemaMethodResult as u, Override as v, FunctionParamsAST as w, Refs as x, PluginOas as y };
|
|
359
|
-
//# sourceMappingURL=createGenerator-
|
|
379
|
+
//# sourceMappingURL=createGenerator-DhGg_jH6.d.ts.map
|
package/dist/generators.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as __name } from "./SchemaMapper-
|
|
2
|
-
import { a as createReactGenerator, n as createGenerator, r as Generator, t as CoreGenerator, y as PluginOas } from "./createGenerator-
|
|
1
|
+
import { A as __name } from "./SchemaMapper-DmB5NyNo.cjs";
|
|
2
|
+
import { a as createReactGenerator, n as createGenerator, r as Generator, t as CoreGenerator, y as PluginOas } from "./createGenerator-BF26dp_h.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/generators/jsonGenerator.d.ts
|
|
5
5
|
declare const jsonGenerator: CoreGenerator<PluginOas>;
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-iVr_oF3V.js";
|
|
2
|
-
import "./SchemaMapper-
|
|
3
|
-
import { a as createReactGenerator, n as createGenerator, r as Generator, t as CoreGenerator, y as PluginOas } from "./createGenerator-
|
|
2
|
+
import "./SchemaMapper-DI2vHHE0.js";
|
|
3
|
+
import { a as createReactGenerator, n as createGenerator, r as Generator, t as CoreGenerator, y as PluginOas } from "./createGenerator-DhGg_jH6.js";
|
|
4
4
|
|
|
5
5
|
//#region src/generators/jsonGenerator.d.ts
|
|
6
6
|
declare const jsonGenerator: CoreGenerator<PluginOas>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-C1_xRkKa.cjs');
|
|
2
|
+
let _kubb_oas = require("@kubb/oas");
|
|
3
|
+
|
|
4
|
+
//#region src/utils/getSchemaFactory.ts
|
|
5
|
+
/**
|
|
6
|
+
* Creates a factory function that generates a versioned OpenAPI schema result.
|
|
7
|
+
*
|
|
8
|
+
* The returned function accepts an optional schema object and produces a {@link SchemaResult} containing the dereferenced schema and the OpenAPI version ('3.0' or '3.1').
|
|
9
|
+
*
|
|
10
|
+
* @returns A function that takes an optional schema and returns a versioned schema result.
|
|
11
|
+
*/
|
|
12
|
+
function getSchemaFactory(oas) {
|
|
13
|
+
return (schema) => {
|
|
14
|
+
const version = (0, _kubb_oas.isOpenApiV3_1Document)(oas.api) ? "3.1" : "3.0";
|
|
15
|
+
return {
|
|
16
|
+
schemaObject: oas.dereferenceWithRef(schema),
|
|
17
|
+
version
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
Object.defineProperty(exports, 'getSchemaFactory', {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () {
|
|
26
|
+
return getSchemaFactory;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=getSchemaFactory-CBp1me72.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSchemaFactory-CBp1me72.cjs","names":[],"sources":["../src/utils/getSchemaFactory.ts"],"sourcesContent":["import type { Oas, OpenAPIV3, OpenAPIV3_1, SchemaObject } from '@kubb/oas'\nimport { isOpenApiV3_1Document } from '@kubb/oas'\n\n/**\n * Make it possible to narrow down the schema based on a specific version(3 or 3.1)\n */\ntype SchemaResult<TWithRef extends boolean = false> =\n | {\n schemaObject:\n | ((TWithRef extends true ? OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject : OpenAPIV3.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n })\n | null\n version: '3.0'\n }\n | {\n schemaObject:\n | ((TWithRef extends true ? OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject : OpenAPIV3_1.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n })\n | null\n version: '3.1'\n }\n\n/**\n * Creates a factory function that generates a versioned OpenAPI schema result.\n *\n * The returned function accepts an optional schema object and produces a {@link SchemaResult} containing the dereferenced schema and the OpenAPI version ('3.0' or '3.1').\n *\n * @returns A function that takes an optional schema and returns a versioned schema result.\n */\nexport function getSchemaFactory<TWithRef extends boolean = false>(oas: Oas): (schema: SchemaObject | null) => SchemaResult<TWithRef> {\n return (schema: SchemaObject | null) => {\n const version = isOpenApiV3_1Document(oas.api) ? '3.1' : '3.0'\n\n return {\n schemaObject: oas.dereferenceWithRef(schema),\n version,\n } as SchemaResult<TWithRef>\n }\n}\n"],"mappings":";;;;;;;;;;;AAiCA,SAAgB,iBAAmD,KAAmE;AACpI,SAAQ,WAAgC;EACtC,MAAM,+CAAgC,IAAI,IAAI,GAAG,QAAQ;AAEzD,SAAO;GACL,cAAc,IAAI,mBAAmB,OAAO;GAC5C;GACD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { t as __name } from "./chunk-iVr_oF3V.js";
|
|
2
|
+
import { isOpenApiV3_1Document } from "@kubb/oas";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/getSchemaFactory.ts
|
|
5
|
+
/**
|
|
6
|
+
* Creates a factory function that generates a versioned OpenAPI schema result.
|
|
7
|
+
*
|
|
8
|
+
* The returned function accepts an optional schema object and produces a {@link SchemaResult} containing the dereferenced schema and the OpenAPI version ('3.0' or '3.1').
|
|
9
|
+
*
|
|
10
|
+
* @returns A function that takes an optional schema and returns a versioned schema result.
|
|
11
|
+
*/
|
|
12
|
+
function getSchemaFactory(oas) {
|
|
13
|
+
return (schema) => {
|
|
14
|
+
const version = isOpenApiV3_1Document(oas.api) ? "3.1" : "3.0";
|
|
15
|
+
return {
|
|
16
|
+
schemaObject: oas.dereferenceWithRef(schema),
|
|
17
|
+
version
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { getSchemaFactory as t };
|
|
24
|
+
//# sourceMappingURL=getSchemaFactory-DsoVRgxV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSchemaFactory-DsoVRgxV.js","names":[],"sources":["../src/utils/getSchemaFactory.ts"],"sourcesContent":["import type { Oas, OpenAPIV3, OpenAPIV3_1, SchemaObject } from '@kubb/oas'\nimport { isOpenApiV3_1Document } from '@kubb/oas'\n\n/**\n * Make it possible to narrow down the schema based on a specific version(3 or 3.1)\n */\ntype SchemaResult<TWithRef extends boolean = false> =\n | {\n schemaObject:\n | ((TWithRef extends true ? OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject : OpenAPIV3.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n })\n | null\n version: '3.0'\n }\n | {\n schemaObject:\n | ((TWithRef extends true ? OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject : OpenAPIV3_1.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n })\n | null\n version: '3.1'\n }\n\n/**\n * Creates a factory function that generates a versioned OpenAPI schema result.\n *\n * The returned function accepts an optional schema object and produces a {@link SchemaResult} containing the dereferenced schema and the OpenAPI version ('3.0' or '3.1').\n *\n * @returns A function that takes an optional schema and returns a versioned schema result.\n */\nexport function getSchemaFactory<TWithRef extends boolean = false>(oas: Oas): (schema: SchemaObject | null) => SchemaResult<TWithRef> {\n return (schema: SchemaObject | null) => {\n const version = isOpenApiV3_1Document(oas.api) ? '3.1' : '3.0'\n\n return {\n schemaObject: oas.dereferenceWithRef(schema),\n version,\n } as SchemaResult<TWithRef>\n }\n}\n"],"mappings":";;;;;;;;;;;AAiCA,SAAgB,iBAAmD,KAAmE;AACpI,SAAQ,WAAgC;EACtC,MAAM,UAAU,sBAAsB,IAAI,IAAI,GAAG,QAAQ;AAEzD,SAAO;GACL,cAAc,IAAI,mBAAmB,OAAO;GAC5C;GACD"}
|
package/dist/hooks.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-C1_xRkKa.cjs');
|
|
2
|
-
const require_SchemaGenerator = require('./SchemaGenerator-
|
|
2
|
+
const require_SchemaGenerator = require('./SchemaGenerator-DO3rrt_U.cjs');
|
|
3
3
|
const require_SchemaMapper = require('./SchemaMapper-CzH82C7C.cjs');
|
|
4
4
|
let _kubb_react_fabric = require("@kubb/react-fabric");
|
|
5
5
|
let _kubb_core_hooks = require("@kubb/core/hooks");
|
|
@@ -13,7 +13,7 @@ function useOas() {
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/hooks/useOperationManager.ts
|
|
15
15
|
/**
|
|
16
|
-
* `useOperationManager`
|
|
16
|
+
* `useOperationManager` returns helper functions to get the operation file and operation name.
|
|
17
17
|
*/
|
|
18
18
|
function useOperationManager(generator) {
|
|
19
19
|
const plugin = (0, _kubb_core_hooks.usePlugin)();
|
|
@@ -135,7 +135,7 @@ function useOperationManager(generator) {
|
|
|
135
135
|
//#endregion
|
|
136
136
|
//#region src/hooks/useSchemaManager.ts
|
|
137
137
|
/**
|
|
138
|
-
* `useSchemaManager`
|
|
138
|
+
* `useSchemaManager` returns helper functions to get the schema file and schema name.
|
|
139
139
|
*/
|
|
140
140
|
function useSchemaManager() {
|
|
141
141
|
const plugin = (0, _kubb_core_hooks.usePlugin)();
|
package/dist/hooks.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.cjs","names":["SchemaGenerator","schemaKeywords"],"sources":["../src/hooks/useOas.ts","../src/hooks/useOperationManager.ts","../src/hooks/useSchemaManager.ts"],"sourcesContent":["import type { Oas } from '@kubb/oas'\n\nimport { useApp } from '@kubb/react-fabric'\n\nexport function useOas(): Oas {\n const { meta } = useApp<{ oas: Oas }>()\n\n return meta.oas\n}\n","import type { FileMetaBase, Plugin, PluginFactoryOptions, ResolveNameParams } from '@kubb/core'\nimport { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { Operation, Operation as OperationType } from '@kubb/oas'\nimport type { OperationGenerator } from '../OperationGenerator.ts'\nimport type { OperationSchemas } from '../types.ts'\n\ntype FileMeta = FileMetaBase & {\n pluginKey: Plugin['key']\n name: string\n group?: {\n tag?: string\n path?: string\n }\n}\n\nexport type SchemaNames = {\n request: string | undefined\n parameters: {\n path: string | undefined\n query: string | undefined\n header: string | undefined\n }\n responses: { default?: string } & Record<number | string, string>\n errors: Record<number | string, string>\n}\n\ntype UseOperationManagerResult = {\n getName: (\n operation: OperationType,\n params: {\n prefix?: string\n suffix?: string\n pluginKey?: Plugin['key']\n type: ResolveNameParams['type']\n },\n ) => string\n getFile: (\n operation: OperationType,\n params?: {\n prefix?: string\n suffix?: string\n pluginKey?: Plugin['key']\n extname?: KubbFile.Extname\n group?: {\n tag?: string\n path?: string\n }\n },\n ) => KubbFile.File<FileMeta>\n groupSchemasByName: (\n operation: OperationType,\n params: {\n pluginKey?: Plugin['key']\n type: ResolveNameParams['type']\n },\n ) => SchemaNames\n getSchemas: (operation: Operation, params?: { pluginKey?: Plugin['key']; type?: ResolveNameParams['type'] }) => OperationSchemas\n getGroup: (operation: Operation) => FileMeta['group'] | undefined\n}\n\n/**\n * `useOperationManager` will return some helper functions that can be used to get the operation file, get the operation name.\n */\nexport function useOperationManager<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions>(\n generator: Omit<OperationGenerator<TPluginOptions>, 'build'>,\n): UseOperationManagerResult {\n const plugin = usePlugin()\n const pluginManager = usePluginManager()\n\n const getName: UseOperationManagerResult['getName'] = (operation, { prefix = '', suffix = '', pluginKey = plugin.key, type }) => {\n return pluginManager.resolveName({\n name: `${prefix} ${operation.getOperationId()} ${suffix}`,\n pluginKey,\n type,\n })\n }\n\n const getGroup: UseOperationManagerResult['getGroup'] = (operation) => {\n return {\n tag: operation.getTags().at(0)?.name,\n path: operation.path,\n }\n }\n\n const getSchemas: UseOperationManagerResult['getSchemas'] = (operation, params) => {\n if (!generator) {\n throw new Error(`'generator' is not defined`)\n }\n\n return generator.getSchemas(operation, {\n resolveName: (name) =>\n pluginManager.resolveName({\n name,\n pluginKey: params?.pluginKey,\n type: params?.type,\n }),\n })\n }\n\n const getFile: UseOperationManagerResult['getFile'] = (operation, { prefix, suffix, pluginKey = plugin.key, extname = '.ts' } = {}) => {\n const name = getName(operation, { type: 'file', pluginKey, prefix, suffix })\n const group = getGroup(operation)\n\n const file = pluginManager.getFile({\n name,\n extname,\n pluginKey,\n options: { type: 'file', pluginKey, group },\n })\n\n return {\n ...file,\n meta: {\n ...file.meta,\n name,\n pluginKey,\n group,\n },\n }\n }\n\n const groupSchemasByName: UseOperationManagerResult['groupSchemasByName'] = (operation, { pluginKey = plugin.key, type }) => {\n if (!generator) {\n throw new Error(`'generator' is not defined`)\n }\n\n const schemas = generator.getSchemas(operation)\n\n const errors = (schemas.errors || []).reduce(\n (prev, acc) => {\n if (!acc.statusCode) {\n return prev\n }\n\n prev[acc.statusCode] = pluginManager.resolveName({\n name: acc.name,\n pluginKey,\n type,\n })\n\n return prev\n },\n {} as Record<number, string>,\n )\n\n const responses = (schemas.responses || []).reduce(\n (prev, acc) => {\n if (!acc.statusCode) {\n return prev\n }\n\n prev[acc.statusCode] = pluginManager.resolveName({\n name: acc.name,\n pluginKey,\n type,\n })\n\n return prev\n },\n {} as Record<number, string>,\n )\n\n return {\n request: schemas.request?.name\n ? pluginManager.resolveName({\n name: schemas.request.name,\n pluginKey,\n type,\n })\n : undefined,\n parameters: {\n path: schemas.pathParams?.name\n ? pluginManager.resolveName({\n name: schemas.pathParams.name,\n pluginKey,\n type,\n })\n : undefined,\n query: schemas.queryParams?.name\n ? pluginManager.resolveName({\n name: schemas.queryParams.name,\n pluginKey,\n type,\n })\n : undefined,\n header: schemas.headerParams?.name\n ? pluginManager.resolveName({\n name: schemas.headerParams.name,\n pluginKey,\n type,\n })\n : undefined,\n },\n responses: {\n ...responses,\n ['default']: pluginManager.resolveName({\n name: schemas.response.name,\n pluginKey,\n type,\n }),\n ...errors,\n },\n errors,\n }\n }\n\n return {\n getName,\n getFile,\n getSchemas,\n groupSchemasByName,\n getGroup,\n }\n}\n","import type { FileMetaBase, Plugin, ResolveNameParams } from '@kubb/core'\nimport { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport { SchemaGenerator } from '../SchemaGenerator.ts'\nimport { type Schema, schemaKeywords } from '../SchemaMapper'\n\ntype FileMeta = FileMetaBase & {\n pluginKey: Plugin['key']\n name: string\n group?: {\n tag?: string\n path?: string\n }\n}\n\ntype UseSchemaManagerResult = {\n getName: (name: string, params: { pluginKey?: Plugin['key']; type: ResolveNameParams['type'] }) => string\n getFile: (\n name: string,\n params?: {\n pluginKey?: Plugin['key']\n mode?: KubbFile.Mode\n extname?: KubbFile.Extname\n group?: {\n tag?: string\n path?: string\n }\n },\n ) => KubbFile.File<FileMeta>\n getImports: (tree: Array<Schema>) => Array<KubbFile.Import>\n}\n\n/**\n * `useSchemaManager` will return some helper functions that can be used to get the schema file, get the schema name.\n */\nexport function useSchemaManager(): UseSchemaManagerResult {\n const plugin = usePlugin()\n const pluginManager = usePluginManager()\n\n const getName: UseSchemaManagerResult['getName'] = (name, { pluginKey = plugin.key, type }) => {\n return pluginManager.resolveName({\n name,\n pluginKey,\n type,\n })\n }\n\n const getFile: UseSchemaManagerResult['getFile'] = (name, { mode = 'split', pluginKey = plugin.key, extname = '.ts', group } = {}) => {\n const resolvedName = mode === 'single' ? '' : getName(name, { type: 'file', pluginKey })\n\n const file = pluginManager.getFile({\n name: resolvedName,\n extname,\n pluginKey,\n options: { type: 'file', pluginKey, group },\n })\n\n return {\n ...file,\n meta: {\n ...file.meta,\n name: resolvedName,\n pluginKey,\n },\n }\n }\n\n const getImports: UseSchemaManagerResult['getImports'] = (tree) => {\n const refs = SchemaGenerator.deepSearch(tree, schemaKeywords.ref)\n\n return refs\n ?.map((item) => {\n if (!item.args.path || !item.args.isImportable) {\n return undefined\n }\n\n return {\n name: [item.args.name],\n path: item.args.path,\n }\n })\n .filter(Boolean)\n }\n\n return {\n getName,\n getFile,\n getImports,\n }\n}\n"],"mappings":";;;;;;;AAIA,SAAgB,SAAc;CAC5B,MAAM,EAAE,yCAA+B;AAEvC,QAAO,KAAK;;;;;;;;ACyDd,SAAgB,oBACd,WAC2B;CAC3B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M;IAAQ;IAAW;IAAO;GAC5C,CAAC;AAEF,SAAO;GACL,GAAG;GACH,MAAM;IACJ,GAAG,KAAK;IACR,MAAM;IACN;IACD;GACF;;CAGH,MAAM,cAAoD,SAAS;AAGjE,SAFaA,wCAAgB,WAAW,MAAMC,oCAAe,IAAI,EAG7D,KAAK,SAAS;AACd,OAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,KAAK,aAChC;AAGF,UAAO;IACL,MAAM,CAAC,KAAK,KAAK,KAAK;IACtB,MAAM,KAAK,KAAK;IACjB;IACD,CACD,OAAO,QAAQ;;AAGpB,QAAO;EACL;EACA;EACA;EACD"}
|
|
1
|
+
{"version":3,"file":"hooks.cjs","names":["SchemaGenerator","schemaKeywords"],"sources":["../src/hooks/useOas.ts","../src/hooks/useOperationManager.ts","../src/hooks/useSchemaManager.ts"],"sourcesContent":["import type { Oas } from '@kubb/oas'\n\nimport { useApp } from '@kubb/react-fabric'\n\nexport function useOas(): Oas {\n const { meta } = useApp<{ oas: Oas }>()\n\n return meta.oas\n}\n","import type { FileMetaBase, Plugin, PluginFactoryOptions, ResolveNameParams } from '@kubb/core'\nimport { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { Operation, Operation as OperationType } from '@kubb/oas'\nimport type { OperationGenerator } from '../OperationGenerator.ts'\nimport type { OperationSchemas } from '../types.ts'\n\ntype FileMeta = FileMetaBase & {\n pluginKey: Plugin['key']\n name: string\n group?: {\n tag?: string\n path?: string\n }\n}\n\nexport type SchemaNames = {\n request: string | undefined\n parameters: {\n path: string | undefined\n query: string | undefined\n header: string | undefined\n }\n responses: { default?: string } & Record<number | string, string>\n errors: Record<number | string, string>\n}\n\ntype UseOperationManagerResult = {\n getName: (\n operation: OperationType,\n params: {\n prefix?: string\n suffix?: string\n pluginKey?: Plugin['key']\n type: ResolveNameParams['type']\n },\n ) => string\n getFile: (\n operation: OperationType,\n params?: {\n prefix?: string\n suffix?: string\n pluginKey?: Plugin['key']\n extname?: KubbFile.Extname\n group?: {\n tag?: string\n path?: string\n }\n },\n ) => KubbFile.File<FileMeta>\n groupSchemasByName: (\n operation: OperationType,\n params: {\n pluginKey?: Plugin['key']\n type: ResolveNameParams['type']\n },\n ) => SchemaNames\n getSchemas: (operation: Operation, params?: { pluginKey?: Plugin['key']; type?: ResolveNameParams['type'] }) => OperationSchemas\n getGroup: (operation: Operation) => FileMeta['group'] | undefined\n}\n\n/**\n * `useOperationManager` returns helper functions to get the operation file and operation name.\n */\nexport function useOperationManager<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions>(\n generator: Omit<OperationGenerator<TPluginOptions>, 'build'>,\n): UseOperationManagerResult {\n const plugin = usePlugin()\n const pluginManager = usePluginManager()\n\n const getName: UseOperationManagerResult['getName'] = (operation, { prefix = '', suffix = '', pluginKey = plugin.key, type }) => {\n return pluginManager.resolveName({\n name: `${prefix} ${operation.getOperationId()} ${suffix}`,\n pluginKey,\n type,\n })\n }\n\n const getGroup: UseOperationManagerResult['getGroup'] = (operation) => {\n return {\n tag: operation.getTags().at(0)?.name,\n path: operation.path,\n }\n }\n\n const getSchemas: UseOperationManagerResult['getSchemas'] = (operation, params) => {\n if (!generator) {\n throw new Error(`'generator' is not defined`)\n }\n\n return generator.getSchemas(operation, {\n resolveName: (name) =>\n pluginManager.resolveName({\n name,\n pluginKey: params?.pluginKey,\n type: params?.type,\n }),\n })\n }\n\n const getFile: UseOperationManagerResult['getFile'] = (operation, { prefix, suffix, pluginKey = plugin.key, extname = '.ts' } = {}) => {\n const name = getName(operation, { type: 'file', pluginKey, prefix, suffix })\n const group = getGroup(operation)\n\n const file = pluginManager.getFile({\n name,\n extname,\n pluginKey,\n options: { type: 'file', pluginKey, group },\n })\n\n return {\n ...file,\n meta: {\n ...file.meta,\n name,\n pluginKey,\n group,\n },\n }\n }\n\n const groupSchemasByName: UseOperationManagerResult['groupSchemasByName'] = (operation, { pluginKey = plugin.key, type }) => {\n if (!generator) {\n throw new Error(`'generator' is not defined`)\n }\n\n const schemas = generator.getSchemas(operation)\n\n const errors = (schemas.errors || []).reduce(\n (prev, acc) => {\n if (!acc.statusCode) {\n return prev\n }\n\n prev[acc.statusCode] = pluginManager.resolveName({\n name: acc.name,\n pluginKey,\n type,\n })\n\n return prev\n },\n {} as Record<number, string>,\n )\n\n const responses = (schemas.responses || []).reduce(\n (prev, acc) => {\n if (!acc.statusCode) {\n return prev\n }\n\n prev[acc.statusCode] = pluginManager.resolveName({\n name: acc.name,\n pluginKey,\n type,\n })\n\n return prev\n },\n {} as Record<number, string>,\n )\n\n return {\n request: schemas.request?.name\n ? pluginManager.resolveName({\n name: schemas.request.name,\n pluginKey,\n type,\n })\n : undefined,\n parameters: {\n path: schemas.pathParams?.name\n ? pluginManager.resolveName({\n name: schemas.pathParams.name,\n pluginKey,\n type,\n })\n : undefined,\n query: schemas.queryParams?.name\n ? pluginManager.resolveName({\n name: schemas.queryParams.name,\n pluginKey,\n type,\n })\n : undefined,\n header: schemas.headerParams?.name\n ? pluginManager.resolveName({\n name: schemas.headerParams.name,\n pluginKey,\n type,\n })\n : undefined,\n },\n responses: {\n ...responses,\n ['default']: pluginManager.resolveName({\n name: schemas.response.name,\n pluginKey,\n type,\n }),\n ...errors,\n },\n errors,\n }\n }\n\n return {\n getName,\n getFile,\n getSchemas,\n groupSchemasByName,\n getGroup,\n }\n}\n","import type { FileMetaBase, Plugin, ResolveNameParams } from '@kubb/core'\nimport { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport { SchemaGenerator } from '../SchemaGenerator.ts'\nimport { type Schema, schemaKeywords } from '../SchemaMapper'\n\ntype FileMeta = FileMetaBase & {\n pluginKey: Plugin['key']\n name: string\n group?: {\n tag?: string\n path?: string\n }\n}\n\ntype UseSchemaManagerResult = {\n getName: (name: string, params: { pluginKey?: Plugin['key']; type: ResolveNameParams['type'] }) => string\n getFile: (\n name: string,\n params?: {\n pluginKey?: Plugin['key']\n mode?: KubbFile.Mode\n extname?: KubbFile.Extname\n group?: {\n tag?: string\n path?: string\n }\n },\n ) => KubbFile.File<FileMeta>\n getImports: (tree: Array<Schema>) => Array<KubbFile.Import>\n}\n\n/**\n * `useSchemaManager` returns helper functions to get the schema file and schema name.\n */\nexport function useSchemaManager(): UseSchemaManagerResult {\n const plugin = usePlugin()\n const pluginManager = usePluginManager()\n\n const getName: UseSchemaManagerResult['getName'] = (name, { pluginKey = plugin.key, type }) => {\n return pluginManager.resolveName({\n name,\n pluginKey,\n type,\n })\n }\n\n const getFile: UseSchemaManagerResult['getFile'] = (name, { mode = 'split', pluginKey = plugin.key, extname = '.ts', group } = {}) => {\n const resolvedName = mode === 'single' ? '' : getName(name, { type: 'file', pluginKey })\n\n const file = pluginManager.getFile({\n name: resolvedName,\n extname,\n pluginKey,\n options: { type: 'file', pluginKey, group },\n })\n\n return {\n ...file,\n meta: {\n ...file.meta,\n name: resolvedName,\n pluginKey,\n },\n }\n }\n\n const getImports: UseSchemaManagerResult['getImports'] = (tree) => {\n const refs = SchemaGenerator.deepSearch(tree, schemaKeywords.ref)\n\n return refs\n ?.map((item) => {\n if (!item.args.path || !item.args.isImportable) {\n return undefined\n }\n\n return {\n name: [item.args.name],\n path: item.args.path,\n }\n })\n .filter(Boolean)\n }\n\n return {\n getName,\n getFile,\n getImports,\n }\n}\n"],"mappings":";;;;;;;AAIA,SAAgB,SAAc;CAC5B,MAAM,EAAE,yCAA+B;AAEvC,QAAO,KAAK;;;;;;;;ACyDd,SAAgB,oBACd,WAC2B;CAC3B,MAAM,0CAAoB;CAC1B,MAAM,wDAAkC;CAExC,MAAM,WAAiD,WAAW,EAAE,SAAS,IAAI,SAAS,IAAI,YAAY,OAAO,KAAK,WAAW;AAC/H,SAAO,cAAc,YAAY;GAC/B,MAAM,GAAG,OAAO,GAAG,UAAU,gBAAgB,CAAC,GAAG;GACjD;GACA;GACD,CAAC;;CAGJ,MAAM,YAAmD,cAAc;AAC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