@kubb/plugin-oas 4.18.3 → 4.18.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/{SchemaGenerator-tDDCI3wi.cjs → SchemaGenerator-B18-jWu7.cjs} +4 -5
  2. package/dist/SchemaGenerator-B18-jWu7.cjs.map +1 -0
  3. package/dist/{SchemaGenerator-CoV4zGpd.js → SchemaGenerator-DExEah4y.js} +4 -5
  4. package/dist/SchemaGenerator-DExEah4y.js.map +1 -0
  5. package/dist/{SchemaMapper-CIs2VKvf.d.cts → SchemaMapper-BWZ2ZjPQ.d.cts} +49 -46
  6. package/dist/SchemaMapper-CzH82C7C.cjs.map +1 -1
  7. package/dist/SchemaMapper-D-GETHNf.js.map +1 -1
  8. package/dist/{SchemaMapper-BBUBpcx-.d.ts → SchemaMapper-oZdVAbXF.d.ts} +49 -46
  9. package/dist/{createGenerator-CZi_gpit.d.ts → createGenerator-Bq76G0TY.d.ts} +9 -13
  10. package/dist/{createGenerator-Cj-sXgmn.d.cts → createGenerator-RL6jHKJ-.d.cts} +9 -13
  11. package/dist/generators.d.cts +2 -2
  12. package/dist/generators.d.ts +2 -2
  13. package/dist/hooks.cjs +3 -3
  14. package/dist/hooks.cjs.map +1 -1
  15. package/dist/hooks.d.cts +4 -4
  16. package/dist/hooks.d.ts +4 -4
  17. package/dist/hooks.js +3 -3
  18. package/dist/hooks.js.map +1 -1
  19. package/dist/index.cjs +2 -2
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +2 -2
  22. package/dist/index.d.ts +2 -2
  23. package/dist/index.js +2 -2
  24. package/dist/index.js.map +1 -1
  25. package/dist/mocks.d.cts +1 -1
  26. package/dist/mocks.d.ts +1 -1
  27. package/dist/utils.d.cts +2 -2
  28. package/dist/utils.d.ts +2 -2
  29. package/package.json +5 -5
  30. package/src/SchemaGenerator.ts +7 -12
  31. package/src/SchemaMapper.ts +3 -3
  32. package/src/hooks/useOperationManager.ts +1 -1
  33. package/src/hooks/useSchemaManager.ts +1 -1
  34. package/src/plugin.ts +1 -1
  35. package/src/types.ts +6 -10
  36. package/dist/SchemaGenerator-CoV4zGpd.js.map +0 -1
  37. package/dist/SchemaGenerator-tDDCI3wi.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 will be exported.
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
- * @default prettier
326
- *
327
- * Possible values:
328
- * - 'auto': Automatically detects and uses biome or prettier (in that order of preference).
329
- * - 'prettier': Uses Prettier for code formatting.
330
- * - 'biome': Uses Biome for code formatting.
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
- * The accepted values indicate different linting tools.
337
- *
338
- * Possible values:
339
- * - 'auto': Automatically detects and uses biome, oxlint, or eslint (in that order of preference).
340
- * - 'eslint': Represents the use of ESLint, a widely used JavaScript linter.
341
- * - 'biome': Represents the Biome linter, a modern tool for code scanning.
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
- * Override the extension to the generated imports and exports, by default each plugin will add an extension
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
- * 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`.
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
- * Add a default banner to the beginning of every generated file. This makes it clear that the file was generated by Kubb.
358
- * - 'simple': will only add banner with link to Kubb
359
- * - 'full': will add source, title, description and the OpenAPI version used
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 will be used in the generation.
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 will be returned if the required dependency is missing. See pre for more details.
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 that will be called when a specific action is triggered in Kubb.
376
+ * Hooks triggered when a specific action occurs in Kubb.
379
377
  */
380
378
  hooks?: {
381
379
  /**
382
- * Hook that will be triggered at the end of all executions.
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 behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
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 will be executed after these plugins.
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 will be executed before these plugins.
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 will be executed after these plugins.
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 will be executed before these plugins.
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
- * `file` will be used to customize the name of the created file(use of camelCase)
511
- * `function` can be used to customize the exported functions(use of camelCase)
512
- * `type` is a special type for TypeScript(use of PascalCase)
513
- * `const` can be used for variables(use of camelCase)
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
- * Define a type where to group the files on
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 will be used for the file and name generation
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
  };
@@ -641,7 +644,7 @@ declare class PluginManager {
641
644
  parameters: PluginParameter<H>;
642
645
  }): Array<ReturnType<ParseResult<H>>> | null;
643
646
  /**
644
- * First non-null result stops and will return it's value.
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
- * First non-null result stops and will return it's value.
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
- * Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
671
+ * Runs all plugins in parallel based on `this.plugin` order and `pre`/`post` settings.
669
672
  */
670
- hookParallel<H extends PluginLifecycleHooks, TOuput = void>({
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<TOuput>[]>;
679
+ }): Promise<Awaited<TOutput>[]>;
677
680
  /**
678
681
  * Chains plugins
679
682
  */
@@ -723,7 +726,7 @@ declare class Oas extends BaseOas {
723
726
  getResponseSchema(operation: Operation$1, statusCode: string | number): SchemaObject$1;
724
727
  getRequestSchema(operation: Operation$1): SchemaObject$1 | undefined;
725
728
  getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
726
- valdiate(): Promise<oas_normalize_lib_types0.ValidationResult>;
729
+ validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
727
730
  flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
728
731
  }
729
732
  //#endregion
@@ -846,8 +849,8 @@ type SchemaKeywordMapper = {
846
849
  */
847
850
  path: KubbFile.Path;
848
851
  /**
849
- * When true `File.Import` will be used.
850
- * When false a reference will be used inside the current file.
852
+ * When true `File.Import` is used.
853
+ * When false a reference is used inside the current file.
851
854
  */
852
855
  isImportable: boolean;
853
856
  };
@@ -1007,11 +1010,11 @@ type SchemaTree = {
1007
1010
  current: Schema;
1008
1011
  siblings: Schema[];
1009
1012
  /**
1010
- * this will be equal to the key of a property(object)
1013
+ * this is equal to the key of a property(object)
1011
1014
  */
1012
1015
  name?: string;
1013
1016
  };
1014
1017
  declare function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]>;
1015
1018
  //#endregion
1016
1019
  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-CIs2VKvf.d.cts.map
1020
+ //# sourceMappingURL=SchemaMapper-BWZ2ZjPQ.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaMapper-CzH82C7C.cjs","names":[],"sources":["../src/SchemaMapper.ts"],"sourcesContent":["import type { KubbFile } from '@kubb/fabric-core/types'\nimport type { SchemaObject } from '@kubb/oas'\n\nexport type SchemaKeywordMapper = {\n object: {\n keyword: 'object'\n args: {\n properties: { [x: string]: Schema[] }\n additionalProperties: Schema[]\n patternProperties?: Record<string, Schema[]>\n strict?: boolean\n }\n }\n url: { keyword: 'url' }\n readOnly: { keyword: 'readOnly' }\n writeOnly: { keyword: 'writeOnly' }\n uuid: { keyword: 'uuid' }\n email: { keyword: 'email' }\n firstName: { keyword: 'firstName' }\n lastName: { keyword: 'lastName' }\n phone: { keyword: 'phone' }\n password: { keyword: 'password' }\n date: { keyword: 'date'; args: { type?: 'date' | 'string' } }\n time: { keyword: 'time'; args: { type?: 'date' | 'string' } }\n datetime: { keyword: 'datetime'; args: { offset?: boolean; local?: boolean } }\n tuple: { keyword: 'tuple'; args: { items: Schema[]; min?: number; max?: number; rest?: Schema } }\n array: {\n keyword: 'array'\n args: { items: Schema[]; min?: number; max?: number; unique?: boolean }\n }\n enum: {\n keyword: 'enum'\n args: {\n name: string\n typeName: string\n asConst: boolean\n items: Array<{\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }>\n }\n }\n and: { keyword: 'and'; args: Schema[] }\n const: {\n keyword: 'const'\n args: {\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }\n }\n union: { keyword: 'union'; args: Schema[] }\n ref: {\n keyword: 'ref'\n args: {\n name: string\n $ref: string\n /**\n * Full qualified path.\n */\n path: KubbFile.Path\n /**\n * When true `File.Import` will be used.\n * When false a reference will be used inside the current file.\n */\n isImportable: boolean\n }\n }\n matches: { keyword: 'matches'; args?: string }\n boolean: { keyword: 'boolean' }\n default: { keyword: 'default'; args: string | number | boolean }\n string: { keyword: 'string' }\n integer: { keyword: 'integer' }\n number: { keyword: 'number' }\n max: { keyword: 'max'; args: number }\n min: { keyword: 'min'; args: number }\n exclusiveMaximum: { keyword: 'exclusiveMaximum'; args: number }\n exclusiveMinimum: { keyword: 'exclusiveMinimum'; args: number }\n describe: { keyword: 'describe'; args: string }\n example: { keyword: 'example'; args: string }\n deprecated: { keyword: 'deprecated' }\n optional: { keyword: 'optional' }\n undefined: { keyword: 'undefined' }\n nullish: { keyword: 'nullish' }\n nullable: { keyword: 'nullable' }\n null: { keyword: 'null' }\n any: { keyword: 'any' }\n unknown: { keyword: 'unknown' }\n void: { keyword: 'void' }\n blob: { keyword: 'blob' }\n schema: { keyword: 'schema'; args: { type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object'; format?: string } }\n name: { keyword: 'name'; args: string }\n catchall: { keyword: 'catchall' }\n interface: { keyword: 'interface' }\n}\n\nexport const schemaKeywords = {\n any: 'any',\n unknown: 'unknown',\n number: 'number',\n integer: 'integer',\n string: 'string',\n boolean: 'boolean',\n undefined: 'undefined',\n nullable: 'nullable',\n null: 'null',\n nullish: 'nullish',\n array: 'array',\n tuple: 'tuple',\n enum: 'enum',\n union: 'union',\n datetime: 'datetime',\n date: 'date',\n email: 'email',\n uuid: 'uuid',\n url: 'url',\n void: 'void',\n /* intersection */\n default: 'default',\n const: 'const',\n and: 'and',\n describe: 'describe',\n min: 'min',\n max: 'max',\n exclusiveMinimum: 'exclusiveMinimum',\n exclusiveMaximum: 'exclusiveMaximum',\n optional: 'optional',\n readOnly: 'readOnly',\n writeOnly: 'writeOnly',\n\n // custom ones\n object: 'object',\n ref: 'ref',\n matches: 'matches',\n firstName: 'firstName',\n lastName: 'lastName',\n password: 'password',\n phone: 'phone',\n blob: 'blob',\n deprecated: 'deprecated',\n example: 'example',\n schema: 'schema',\n catchall: 'catchall',\n time: 'time',\n name: 'name',\n interface: 'interface',\n} satisfies {\n [K in keyof SchemaKeywordMapper]: SchemaKeywordMapper[K]['keyword']\n}\n\nexport type SchemaKeyword = keyof SchemaKeywordMapper\n\nexport type SchemaMapper<T = string | null | undefined> = {\n [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined\n}\n\nexport type SchemaKeywordBase<T> = {\n keyword: SchemaKeyword\n args: T\n}\n\nexport type Schema = { keyword: string } | SchemaKeywordMapper[keyof SchemaKeywordMapper]\n\nexport type SchemaTree = {\n schema: SchemaObject\n parent: Schema | undefined\n current: Schema\n siblings: Schema[]\n /**\n * this will be equal to the key of a property(object)\n */\n name?: string\n}\n\nexport function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]> {\n return meta.keyword === keyword\n}\n"],"mappings":";;;AAiGA,MAAa,iBAAiB;CAC5B,KAAK;CACL,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;CACT,WAAW;CACX,UAAU;CACV,MAAM;CACN,SAAS;CACT,OAAO;CACP,OAAO;CACP,MAAM;CACN,OAAO;CACP,UAAU;CACV,MAAM;CACN,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CAEN,SAAS;CACT,OAAO;CACP,KAAK;CACL,UAAU;CACV,KAAK;CACL,KAAK;CACL,kBAAkB;CAClB,kBAAkB;CAClB,UAAU;CACV,UAAU;CACV,WAAW;CAGX,QAAQ;CACR,KAAK;CACL,SAAS;CACT,WAAW;CACX,UAAU;CACV,UAAU;CACV,OAAO;CACP,MAAM;CACN,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACN,MAAM;CACN,WAAW;CACZ;AA4BD,SAAgB,UAAiE,MAAS,SAAwD;AAChJ,QAAO,KAAK,YAAY"}
1
+ {"version":3,"file":"SchemaMapper-CzH82C7C.cjs","names":[],"sources":["../src/SchemaMapper.ts"],"sourcesContent":["import type { KubbFile } from '@kubb/fabric-core/types'\nimport type { SchemaObject } from '@kubb/oas'\n\nexport type SchemaKeywordMapper = {\n object: {\n keyword: 'object'\n args: {\n properties: { [x: string]: Schema[] }\n additionalProperties: Schema[]\n patternProperties?: Record<string, Schema[]>\n strict?: boolean\n }\n }\n url: { keyword: 'url' }\n readOnly: { keyword: 'readOnly' }\n writeOnly: { keyword: 'writeOnly' }\n uuid: { keyword: 'uuid' }\n email: { keyword: 'email' }\n firstName: { keyword: 'firstName' }\n lastName: { keyword: 'lastName' }\n phone: { keyword: 'phone' }\n password: { keyword: 'password' }\n date: { keyword: 'date'; args: { type?: 'date' | 'string' } }\n time: { keyword: 'time'; args: { type?: 'date' | 'string' } }\n datetime: { keyword: 'datetime'; args: { offset?: boolean; local?: boolean } }\n tuple: { keyword: 'tuple'; args: { items: Schema[]; min?: number; max?: number; rest?: Schema } }\n array: {\n keyword: 'array'\n args: { items: Schema[]; min?: number; max?: number; unique?: boolean }\n }\n enum: {\n keyword: 'enum'\n args: {\n name: string\n typeName: string\n asConst: boolean\n items: Array<{\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }>\n }\n }\n and: { keyword: 'and'; args: Schema[] }\n const: {\n keyword: 'const'\n args: {\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }\n }\n union: { keyword: 'union'; args: Schema[] }\n ref: {\n keyword: 'ref'\n args: {\n name: string\n $ref: string\n /**\n * Full qualified path.\n */\n path: KubbFile.Path\n /**\n * When true `File.Import` is used.\n * When false a reference is used inside the current file.\n */\n isImportable: boolean\n }\n }\n matches: { keyword: 'matches'; args?: string }\n boolean: { keyword: 'boolean' }\n default: { keyword: 'default'; args: string | number | boolean }\n string: { keyword: 'string' }\n integer: { keyword: 'integer' }\n number: { keyword: 'number' }\n max: { keyword: 'max'; args: number }\n min: { keyword: 'min'; args: number }\n exclusiveMaximum: { keyword: 'exclusiveMaximum'; args: number }\n exclusiveMinimum: { keyword: 'exclusiveMinimum'; args: number }\n describe: { keyword: 'describe'; args: string }\n example: { keyword: 'example'; args: string }\n deprecated: { keyword: 'deprecated' }\n optional: { keyword: 'optional' }\n undefined: { keyword: 'undefined' }\n nullish: { keyword: 'nullish' }\n nullable: { keyword: 'nullable' }\n null: { keyword: 'null' }\n any: { keyword: 'any' }\n unknown: { keyword: 'unknown' }\n void: { keyword: 'void' }\n blob: { keyword: 'blob' }\n schema: { keyword: 'schema'; args: { type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object'; format?: string } }\n name: { keyword: 'name'; args: string }\n catchall: { keyword: 'catchall' }\n interface: { keyword: 'interface' }\n}\n\nexport const schemaKeywords = {\n any: 'any',\n unknown: 'unknown',\n number: 'number',\n integer: 'integer',\n string: 'string',\n boolean: 'boolean',\n undefined: 'undefined',\n nullable: 'nullable',\n null: 'null',\n nullish: 'nullish',\n array: 'array',\n tuple: 'tuple',\n enum: 'enum',\n union: 'union',\n datetime: 'datetime',\n date: 'date',\n email: 'email',\n uuid: 'uuid',\n url: 'url',\n void: 'void',\n /* intersection */\n default: 'default',\n const: 'const',\n and: 'and',\n describe: 'describe',\n min: 'min',\n max: 'max',\n exclusiveMinimum: 'exclusiveMinimum',\n exclusiveMaximum: 'exclusiveMaximum',\n optional: 'optional',\n readOnly: 'readOnly',\n writeOnly: 'writeOnly',\n\n // custom ones\n object: 'object',\n ref: 'ref',\n matches: 'matches',\n firstName: 'firstName',\n lastName: 'lastName',\n password: 'password',\n phone: 'phone',\n blob: 'blob',\n deprecated: 'deprecated',\n example: 'example',\n schema: 'schema',\n catchall: 'catchall',\n time: 'time',\n name: 'name',\n interface: 'interface',\n} satisfies {\n [K in keyof SchemaKeywordMapper]: SchemaKeywordMapper[K]['keyword']\n}\n\nexport type SchemaKeyword = keyof SchemaKeywordMapper\n\nexport type SchemaMapper<T = string | null | undefined> = {\n [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined\n}\n\nexport type SchemaKeywordBase<T> = {\n keyword: SchemaKeyword\n args: T\n}\n\nexport type Schema = { keyword: string } | SchemaKeywordMapper[keyof SchemaKeywordMapper]\n\nexport type SchemaTree = {\n schema: SchemaObject\n parent: Schema | undefined\n current: Schema\n siblings: Schema[]\n /**\n * this is equal to the key of a property(object)\n */\n name?: string\n}\n\nexport function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]> {\n return meta.keyword === keyword\n}\n"],"mappings":";;;AAiGA,MAAa,iBAAiB;CAC5B,KAAK;CACL,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;CACT,WAAW;CACX,UAAU;CACV,MAAM;CACN,SAAS;CACT,OAAO;CACP,OAAO;CACP,MAAM;CACN,OAAO;CACP,UAAU;CACV,MAAM;CACN,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CAEN,SAAS;CACT,OAAO;CACP,KAAK;CACL,UAAU;CACV,KAAK;CACL,KAAK;CACL,kBAAkB;CAClB,kBAAkB;CAClB,UAAU;CACV,UAAU;CACV,WAAW;CAGX,QAAQ;CACR,KAAK;CACL,SAAS;CACT,WAAW;CACX,UAAU;CACV,UAAU;CACV,OAAO;CACP,MAAM;CACN,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACN,MAAM;CACN,WAAW;CACZ;AA4BD,SAAgB,UAAiE,MAAS,SAAwD;AAChJ,QAAO,KAAK,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaMapper-D-GETHNf.js","names":[],"sources":["../src/SchemaMapper.ts"],"sourcesContent":["import type { KubbFile } from '@kubb/fabric-core/types'\nimport type { SchemaObject } from '@kubb/oas'\n\nexport type SchemaKeywordMapper = {\n object: {\n keyword: 'object'\n args: {\n properties: { [x: string]: Schema[] }\n additionalProperties: Schema[]\n patternProperties?: Record<string, Schema[]>\n strict?: boolean\n }\n }\n url: { keyword: 'url' }\n readOnly: { keyword: 'readOnly' }\n writeOnly: { keyword: 'writeOnly' }\n uuid: { keyword: 'uuid' }\n email: { keyword: 'email' }\n firstName: { keyword: 'firstName' }\n lastName: { keyword: 'lastName' }\n phone: { keyword: 'phone' }\n password: { keyword: 'password' }\n date: { keyword: 'date'; args: { type?: 'date' | 'string' } }\n time: { keyword: 'time'; args: { type?: 'date' | 'string' } }\n datetime: { keyword: 'datetime'; args: { offset?: boolean; local?: boolean } }\n tuple: { keyword: 'tuple'; args: { items: Schema[]; min?: number; max?: number; rest?: Schema } }\n array: {\n keyword: 'array'\n args: { items: Schema[]; min?: number; max?: number; unique?: boolean }\n }\n enum: {\n keyword: 'enum'\n args: {\n name: string\n typeName: string\n asConst: boolean\n items: Array<{\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }>\n }\n }\n and: { keyword: 'and'; args: Schema[] }\n const: {\n keyword: 'const'\n args: {\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }\n }\n union: { keyword: 'union'; args: Schema[] }\n ref: {\n keyword: 'ref'\n args: {\n name: string\n $ref: string\n /**\n * Full qualified path.\n */\n path: KubbFile.Path\n /**\n * When true `File.Import` will be used.\n * When false a reference will be used inside the current file.\n */\n isImportable: boolean\n }\n }\n matches: { keyword: 'matches'; args?: string }\n boolean: { keyword: 'boolean' }\n default: { keyword: 'default'; args: string | number | boolean }\n string: { keyword: 'string' }\n integer: { keyword: 'integer' }\n number: { keyword: 'number' }\n max: { keyword: 'max'; args: number }\n min: { keyword: 'min'; args: number }\n exclusiveMaximum: { keyword: 'exclusiveMaximum'; args: number }\n exclusiveMinimum: { keyword: 'exclusiveMinimum'; args: number }\n describe: { keyword: 'describe'; args: string }\n example: { keyword: 'example'; args: string }\n deprecated: { keyword: 'deprecated' }\n optional: { keyword: 'optional' }\n undefined: { keyword: 'undefined' }\n nullish: { keyword: 'nullish' }\n nullable: { keyword: 'nullable' }\n null: { keyword: 'null' }\n any: { keyword: 'any' }\n unknown: { keyword: 'unknown' }\n void: { keyword: 'void' }\n blob: { keyword: 'blob' }\n schema: { keyword: 'schema'; args: { type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object'; format?: string } }\n name: { keyword: 'name'; args: string }\n catchall: { keyword: 'catchall' }\n interface: { keyword: 'interface' }\n}\n\nexport const schemaKeywords = {\n any: 'any',\n unknown: 'unknown',\n number: 'number',\n integer: 'integer',\n string: 'string',\n boolean: 'boolean',\n undefined: 'undefined',\n nullable: 'nullable',\n null: 'null',\n nullish: 'nullish',\n array: 'array',\n tuple: 'tuple',\n enum: 'enum',\n union: 'union',\n datetime: 'datetime',\n date: 'date',\n email: 'email',\n uuid: 'uuid',\n url: 'url',\n void: 'void',\n /* intersection */\n default: 'default',\n const: 'const',\n and: 'and',\n describe: 'describe',\n min: 'min',\n max: 'max',\n exclusiveMinimum: 'exclusiveMinimum',\n exclusiveMaximum: 'exclusiveMaximum',\n optional: 'optional',\n readOnly: 'readOnly',\n writeOnly: 'writeOnly',\n\n // custom ones\n object: 'object',\n ref: 'ref',\n matches: 'matches',\n firstName: 'firstName',\n lastName: 'lastName',\n password: 'password',\n phone: 'phone',\n blob: 'blob',\n deprecated: 'deprecated',\n example: 'example',\n schema: 'schema',\n catchall: 'catchall',\n time: 'time',\n name: 'name',\n interface: 'interface',\n} satisfies {\n [K in keyof SchemaKeywordMapper]: SchemaKeywordMapper[K]['keyword']\n}\n\nexport type SchemaKeyword = keyof SchemaKeywordMapper\n\nexport type SchemaMapper<T = string | null | undefined> = {\n [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined\n}\n\nexport type SchemaKeywordBase<T> = {\n keyword: SchemaKeyword\n args: T\n}\n\nexport type Schema = { keyword: string } | SchemaKeywordMapper[keyof SchemaKeywordMapper]\n\nexport type SchemaTree = {\n schema: SchemaObject\n parent: Schema | undefined\n current: Schema\n siblings: Schema[]\n /**\n * this will be equal to the key of a property(object)\n */\n name?: string\n}\n\nexport function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]> {\n return meta.keyword === keyword\n}\n"],"mappings":";;;AAiGA,MAAa,iBAAiB;CAC5B,KAAK;CACL,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;CACT,WAAW;CACX,UAAU;CACV,MAAM;CACN,SAAS;CACT,OAAO;CACP,OAAO;CACP,MAAM;CACN,OAAO;CACP,UAAU;CACV,MAAM;CACN,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CAEN,SAAS;CACT,OAAO;CACP,KAAK;CACL,UAAU;CACV,KAAK;CACL,KAAK;CACL,kBAAkB;CAClB,kBAAkB;CAClB,UAAU;CACV,UAAU;CACV,WAAW;CAGX,QAAQ;CACR,KAAK;CACL,SAAS;CACT,WAAW;CACX,UAAU;CACV,UAAU;CACV,OAAO;CACP,MAAM;CACN,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACN,MAAM;CACN,WAAW;CACZ;AA4BD,SAAgB,UAAiE,MAAS,SAAwD;AAChJ,QAAO,KAAK,YAAY"}
1
+ {"version":3,"file":"SchemaMapper-D-GETHNf.js","names":[],"sources":["../src/SchemaMapper.ts"],"sourcesContent":["import type { KubbFile } from '@kubb/fabric-core/types'\nimport type { SchemaObject } from '@kubb/oas'\n\nexport type SchemaKeywordMapper = {\n object: {\n keyword: 'object'\n args: {\n properties: { [x: string]: Schema[] }\n additionalProperties: Schema[]\n patternProperties?: Record<string, Schema[]>\n strict?: boolean\n }\n }\n url: { keyword: 'url' }\n readOnly: { keyword: 'readOnly' }\n writeOnly: { keyword: 'writeOnly' }\n uuid: { keyword: 'uuid' }\n email: { keyword: 'email' }\n firstName: { keyword: 'firstName' }\n lastName: { keyword: 'lastName' }\n phone: { keyword: 'phone' }\n password: { keyword: 'password' }\n date: { keyword: 'date'; args: { type?: 'date' | 'string' } }\n time: { keyword: 'time'; args: { type?: 'date' | 'string' } }\n datetime: { keyword: 'datetime'; args: { offset?: boolean; local?: boolean } }\n tuple: { keyword: 'tuple'; args: { items: Schema[]; min?: number; max?: number; rest?: Schema } }\n array: {\n keyword: 'array'\n args: { items: Schema[]; min?: number; max?: number; unique?: boolean }\n }\n enum: {\n keyword: 'enum'\n args: {\n name: string\n typeName: string\n asConst: boolean\n items: Array<{\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }>\n }\n }\n and: { keyword: 'and'; args: Schema[] }\n const: {\n keyword: 'const'\n args: {\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }\n }\n union: { keyword: 'union'; args: Schema[] }\n ref: {\n keyword: 'ref'\n args: {\n name: string\n $ref: string\n /**\n * Full qualified path.\n */\n path: KubbFile.Path\n /**\n * When true `File.Import` is used.\n * When false a reference is used inside the current file.\n */\n isImportable: boolean\n }\n }\n matches: { keyword: 'matches'; args?: string }\n boolean: { keyword: 'boolean' }\n default: { keyword: 'default'; args: string | number | boolean }\n string: { keyword: 'string' }\n integer: { keyword: 'integer' }\n number: { keyword: 'number' }\n max: { keyword: 'max'; args: number }\n min: { keyword: 'min'; args: number }\n exclusiveMaximum: { keyword: 'exclusiveMaximum'; args: number }\n exclusiveMinimum: { keyword: 'exclusiveMinimum'; args: number }\n describe: { keyword: 'describe'; args: string }\n example: { keyword: 'example'; args: string }\n deprecated: { keyword: 'deprecated' }\n optional: { keyword: 'optional' }\n undefined: { keyword: 'undefined' }\n nullish: { keyword: 'nullish' }\n nullable: { keyword: 'nullable' }\n null: { keyword: 'null' }\n any: { keyword: 'any' }\n unknown: { keyword: 'unknown' }\n void: { keyword: 'void' }\n blob: { keyword: 'blob' }\n schema: { keyword: 'schema'; args: { type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object'; format?: string } }\n name: { keyword: 'name'; args: string }\n catchall: { keyword: 'catchall' }\n interface: { keyword: 'interface' }\n}\n\nexport const schemaKeywords = {\n any: 'any',\n unknown: 'unknown',\n number: 'number',\n integer: 'integer',\n string: 'string',\n boolean: 'boolean',\n undefined: 'undefined',\n nullable: 'nullable',\n null: 'null',\n nullish: 'nullish',\n array: 'array',\n tuple: 'tuple',\n enum: 'enum',\n union: 'union',\n datetime: 'datetime',\n date: 'date',\n email: 'email',\n uuid: 'uuid',\n url: 'url',\n void: 'void',\n /* intersection */\n default: 'default',\n const: 'const',\n and: 'and',\n describe: 'describe',\n min: 'min',\n max: 'max',\n exclusiveMinimum: 'exclusiveMinimum',\n exclusiveMaximum: 'exclusiveMaximum',\n optional: 'optional',\n readOnly: 'readOnly',\n writeOnly: 'writeOnly',\n\n // custom ones\n object: 'object',\n ref: 'ref',\n matches: 'matches',\n firstName: 'firstName',\n lastName: 'lastName',\n password: 'password',\n phone: 'phone',\n blob: 'blob',\n deprecated: 'deprecated',\n example: 'example',\n schema: 'schema',\n catchall: 'catchall',\n time: 'time',\n name: 'name',\n interface: 'interface',\n} satisfies {\n [K in keyof SchemaKeywordMapper]: SchemaKeywordMapper[K]['keyword']\n}\n\nexport type SchemaKeyword = keyof SchemaKeywordMapper\n\nexport type SchemaMapper<T = string | null | undefined> = {\n [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined\n}\n\nexport type SchemaKeywordBase<T> = {\n keyword: SchemaKeyword\n args: T\n}\n\nexport type Schema = { keyword: string } | SchemaKeywordMapper[keyof SchemaKeywordMapper]\n\nexport type SchemaTree = {\n schema: SchemaObject\n parent: Schema | undefined\n current: Schema\n siblings: Schema[]\n /**\n * this is equal to the key of a property(object)\n */\n name?: string\n}\n\nexport function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]> {\n return meta.keyword === keyword\n}\n"],"mappings":";;;AAiGA,MAAa,iBAAiB;CAC5B,KAAK;CACL,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;CACT,WAAW;CACX,UAAU;CACV,MAAM;CACN,SAAS;CACT,OAAO;CACP,OAAO;CACP,MAAM;CACN,OAAO;CACP,UAAU;CACV,MAAM;CACN,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CAEN,SAAS;CACT,OAAO;CACP,KAAK;CACL,UAAU;CACV,KAAK;CACL,KAAK;CACL,kBAAkB;CAClB,kBAAkB;CAClB,UAAU;CACV,UAAU;CACV,WAAW;CAGX,QAAQ;CACR,KAAK;CACL,SAAS;CACT,WAAW;CACX,UAAU;CACV,UAAU;CACV,OAAO;CACP,MAAM;CACN,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACN,MAAM;CACN,WAAW;CACZ;AA4BD,SAAgB,UAAiE,MAAS,SAAwD;AAChJ,QAAO,KAAK,YAAY"}
@@ -306,7 +306,7 @@ type Config<TInput = Input> = {
306
306
  input: TInput;
307
307
  output: {
308
308
  /**
309
- * The path where all generated files will be exported.
309
+ * The path where all generated files receives exported.
310
310
  * This can be an absolute path or a path relative to the specified root option.
311
311
  */
312
312
  path: string;
@@ -321,41 +321,39 @@ type Config<TInput = Input> = {
321
321
  write?: boolean;
322
322
  /**
323
323
  * Specifies the formatting tool to be used.
324
- * @default prettier
325
- *
326
- * Possible values:
327
- * - 'auto': Automatically detects and uses biome or prettier (in that order of preference).
328
- * - 'prettier': Uses Prettier for code formatting.
329
- * - 'biome': Uses Biome for code formatting.
330
- *
324
+ * - 'auto' automatically detects and uses biome or prettier (in that order of preference).
325
+ * - 'prettier' uses Prettier for code formatting.
326
+ * - 'biome' uses Biome for code formatting.
327
+ * - 'oxfmt' uses Oxfmt for code formatting.
328
+ * - false disables code formatting.
329
+ * @default 'prettier'
331
330
  */
332
331
  format?: 'auto' | 'prettier' | 'biome' | 'oxfmt' | false;
333
332
  /**
334
333
  * Specifies the linter that should be used to analyze the code.
335
- * The accepted values indicate different linting tools.
336
- *
337
- * Possible values:
338
- * - 'auto': Automatically detects and uses biome, oxlint, or eslint (in that order of preference).
339
- * - 'eslint': Represents the use of ESLint, a widely used JavaScript linter.
340
- * - 'biome': Represents the Biome linter, a modern tool for code scanning.
341
- * - 'oxlint': Represents the Oxlint tool for linting purposes.
342
- *
334
+ * - 'auto' automatically detects and uses biome, oxlint, or eslint (in that order of preference).
335
+ * - 'eslint' uses ESLint for linting.
336
+ * - 'biome' uses Biome for linting.
337
+ * - 'oxlint' uses Oxlint for linting.
338
+ * - false disables linting.
339
+ * @default 'auto'
343
340
  */
344
341
  lint?: 'auto' | 'eslint' | 'biome' | 'oxlint' | false;
345
342
  /**
346
- * Override the extension to the generated imports and exports, by default each plugin will add an extension
343
+ * Overrides the extension for generated imports and exports. By default, each plugin adds an extension.
347
344
  * @default { '.ts': '.ts'}
348
345
  */
349
346
  extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
350
347
  /**
351
- * 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`.
348
+ * 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`).
352
349
  * @default 'named'
353
350
  */
354
351
  barrelType?: Exclude<BarrelType, 'propagate'> | false;
355
352
  /**
356
- * Add a default banner to the beginning of every generated file. This makes it clear that the file was generated by Kubb.
357
- * - 'simple': will only add banner with link to Kubb
358
- * - 'full': will add source, title, description and the OpenAPI version used
353
+ * Adds a default banner to the start of every generated file indicating it was generated by Kubb.
354
+ * - 'simple' adds banner with link to Kubb.
355
+ * - 'full' adds source, title, description, and OpenAPI version.
356
+ * - false disables banner generation.
359
357
  * @default 'simple'
360
358
  */
361
359
  defaultBanner?: 'simple' | 'full' | false;
@@ -368,17 +366,17 @@ type Config<TInput = Input> = {
368
366
  override?: boolean;
369
367
  };
370
368
  /**
371
- * An array of Kubb plugins that will be used in the generation.
369
+ * An array of Kubb plugins that used in the generation.
372
370
  * Each plugin may include additional configurable options(defined in the plugin itself).
373
- * If a plugin depends on another plugin, an error will be returned if the required dependency is missing. See pre for more details.
371
+ * If a plugin depends on another plugin, an error is returned if the required dependency is missing. See pre for more details.
374
372
  */
375
373
  plugins?: Array<Plugin>;
376
374
  /**
377
- * Hooks that will be called when a specific action is triggered in Kubb.
375
+ * Hooks triggered when a specific action occurs in Kubb.
378
376
  */
379
377
  hooks?: {
380
378
  /**
381
- * Hook that will be triggered at the end of all executions.
379
+ * Hook that triggers at the end of all executions.
382
380
  * Useful for running Prettier or ESLint to format/lint your code.
383
381
  */
384
382
  done?: string | Array<string>;
@@ -407,7 +405,7 @@ TContext = any,
407
405
  TResolvePathOptions extends object = object> = {
408
406
  name: TName;
409
407
  /**
410
- * Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
408
+ * Same behavior like what has been done with `QueryKey` in `@tanstack/react-query`
411
409
  */
412
410
  key: PluginKey<TName | string>;
413
411
  options: TOptions;
@@ -428,12 +426,12 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
428
426
  */
429
427
  options: TOptions['resolvedOptions'];
430
428
  /**
431
- * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
429
+ * 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.
432
430
  * Can be used to validate dependent plugins.
433
431
  */
434
432
  pre?: Array<string>;
435
433
  /**
436
- * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin will be executed before these plugins.
434
+ * 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.
437
435
  */
438
436
  post?: Array<string>;
439
437
  inject?: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => TOptions['context'];
@@ -451,12 +449,12 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
451
449
  */
452
450
  key: TOptions['key'];
453
451
  /**
454
- * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
452
+ * 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.
455
453
  * Can be used to validate dependent plugins.
456
454
  */
457
455
  pre?: Array<string>;
458
456
  /**
459
- * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin will be executed before these plugins.
457
+ * 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.
460
458
  */
461
459
  post?: Array<string>;
462
460
  /**
@@ -506,10 +504,12 @@ type ResolveNameParams = {
506
504
  name: string;
507
505
  pluginKey?: Plugin['key'];
508
506
  /**
509
- * `file` will be used to customize the name of the created file(use of camelCase)
510
- * `function` can be used to customize the exported functions(use of camelCase)
511
- * `type` is a special type for TypeScript(use of PascalCase)
512
- * `const` can be used for variables(use of camelCase)
507
+ * Specifies the type of entity being named.
508
+ * - 'file' customizes the name of the created file (uses camelCase).
509
+ * - 'function' customizes the exported function names (uses camelCase).
510
+ * - 'type' customizes TypeScript types (uses PascalCase).
511
+ * - 'const' customizes variable names (uses camelCase).
512
+ * @default undefined
513
513
  */
514
514
  type?: 'file' | 'function' | 'type' | 'const';
515
515
  };
@@ -564,11 +564,14 @@ type GroupContext = {
564
564
  };
565
565
  type Group = {
566
566
  /**
567
- * Define a type where to group the files on
567
+ * Defines the type where to group the files.
568
+ * - 'tag' groups files by OpenAPI tags.
569
+ * - 'path' groups files by OpenAPI paths.
570
+ * @default undefined
568
571
  */
569
572
  type: 'tag' | 'path';
570
573
  /**
571
- * Return the name of a group based on the group name, this will be used for the file and name generation
574
+ * Return the name of a group based on the group name, this used for the file and name generation
572
575
  */
573
576
  name?: (context: GroupContext) => string;
574
577
  };
@@ -640,7 +643,7 @@ declare class PluginManager {
640
643
  parameters: PluginParameter<H>;
641
644
  }): Array<ReturnType<ParseResult<H>>> | null;
642
645
  /**
643
- * First non-null result stops and will return it's value.
646
+ * Returns the first non-null result.
644
647
  */
645
648
  hookFirst<H extends PluginLifecycleHooks>({
646
649
  hookName,
@@ -652,7 +655,7 @@ declare class PluginManager {
652
655
  skipped?: ReadonlySet<Plugin> | null;
653
656
  }): Promise<SafeParseResult<H>>;
654
657
  /**
655
- * First non-null result stops and will return it's value.
658
+ * Returns the first non-null result.
656
659
  */
657
660
  hookFirstSync<H extends PluginLifecycleHooks>({
658
661
  hookName,
@@ -664,15 +667,15 @@ declare class PluginManager {
664
667
  skipped?: ReadonlySet<Plugin> | null;
665
668
  }): SafeParseResult<H>;
666
669
  /**
667
- * Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
670
+ * Runs all plugins in parallel based on `this.plugin` order and `pre`/`post` settings.
668
671
  */
669
- hookParallel<H extends PluginLifecycleHooks, TOuput = void>({
672
+ hookParallel<H extends PluginLifecycleHooks, TOutput = void>({
670
673
  hookName,
671
674
  parameters
672
675
  }: {
673
676
  hookName: H;
674
677
  parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
675
- }): Promise<Awaited<TOuput>[]>;
678
+ }): Promise<Awaited<TOutput>[]>;
676
679
  /**
677
680
  * Chains plugins
678
681
  */
@@ -722,7 +725,7 @@ declare class Oas extends BaseOas {
722
725
  getResponseSchema(operation: Operation$1, statusCode: string | number): SchemaObject$1;
723
726
  getRequestSchema(operation: Operation$1): SchemaObject$1 | undefined;
724
727
  getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
725
- valdiate(): Promise<oas_normalize_lib_types0.ValidationResult>;
728
+ validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
726
729
  flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
727
730
  }
728
731
  //#endregion
@@ -845,8 +848,8 @@ type SchemaKeywordMapper = {
845
848
  */
846
849
  path: KubbFile.Path;
847
850
  /**
848
- * When true `File.Import` will be used.
849
- * When false a reference will be used inside the current file.
851
+ * When true `File.Import` is used.
852
+ * When false a reference is used inside the current file.
850
853
  */
851
854
  isImportable: boolean;
852
855
  };
@@ -1006,11 +1009,11 @@ type SchemaTree = {
1006
1009
  current: Schema;
1007
1010
  siblings: Schema[];
1008
1011
  /**
1009
- * this will be equal to the key of a property(object)
1012
+ * this is equal to the key of a property(object)
1010
1013
  */
1011
1014
  name?: string;
1012
1015
  };
1013
1016
  declare function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]>;
1014
1017
  //#endregion
1015
1018
  export { 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 };
1016
- //# sourceMappingURL=SchemaMapper-BBUBpcx-.d.ts.map
1019
+ //# sourceMappingURL=SchemaMapper-oZdVAbXF.d.ts.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-BBUBpcx-.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-oZdVAbXF.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,29 +75,25 @@ type Options = {
75
75
  /**
76
76
  * Which server to use from the array of `servers.url[serverIndex]`
77
77
  * @example
78
- * - `0` will return `http://petstore.swagger.io/api`
79
- * - `1` will return `http://localhost:3000`
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 JSON valid mediaType will be used
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 behaviour of the Oas class instance, see '@kubb/oas'
96
+ * Override some behavior of the Oas class instance, see '@kubb/oas'
101
97
  */
102
98
  oasClass?: typeof Oas;
103
99
  /**
@@ -263,7 +259,7 @@ type SchemaGeneratorOptions = {
263
259
  */
264
260
  name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
265
261
  /**
266
- * Receive schema and name(propertName) and return FakerMeta array
262
+ * Receive schema and name(propertyName) and return FakerMeta array
267
263
  * TODO TODO add docs
268
264
  * @beta
269
265
  */
@@ -356,4 +352,4 @@ type CoreGenerator<TOptions extends PluginFactoryOptions> = {
356
352
  declare function createGenerator<TOptions extends PluginFactoryOptions>(generator: UserGenerator<TOptions>): CoreGenerator<TOptions>;
357
353
  //#endregion
358
354
  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-CZi_gpit.d.ts.map
355
+ //# sourceMappingURL=createGenerator-Bq76G0TY.d.ts.map