@kubb/plugin-client 4.18.4 → 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.
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-DlpkT3g-.cjs";
2
- import { i as OperationSchemas, n as PluginClient, o as Operation } from "./types-Chp-emXk.cjs";
2
+ import { i as OperationSchemas, n as PluginClient, o as Operation } from "./types-BvQ8zSDH.cjs";
3
3
  import { FunctionParams } from "@kubb/react-fabric";
4
4
  import { KubbNode } from "@kubb/react-fabric/types";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-iVr_oF3V.js";
2
- import { i as OperationSchemas, n as PluginClient, o as Operation } from "./types-aqsuGVmg.js";
2
+ import { i as OperationSchemas, n as PluginClient, o as Operation } from "./types-fnIF5Tde.js";
3
3
  import { FunctionParams } from "@kubb/react-fabric";
4
4
  import { KubbNode } from "@kubb/react-fabric/types";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-DlpkT3g-.cjs";
2
- import { n as PluginClient, r as ReactGenerator } from "./types-Chp-emXk.cjs";
2
+ import { n as PluginClient, r as ReactGenerator } from "./types-BvQ8zSDH.cjs";
3
3
 
4
4
  //#region src/generators/classClientGenerator.d.ts
5
5
  declare const classClientGenerator: ReactGenerator<PluginClient>;
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-iVr_oF3V.js";
2
- import { n as PluginClient, r as ReactGenerator } from "./types-aqsuGVmg.js";
2
+ import { n as PluginClient, r as ReactGenerator } from "./types-fnIF5Tde.js";
3
3
 
4
4
  //#region src/generators/classClientGenerator.d.ts
5
5
  declare const classClientGenerator: ReactGenerator<PluginClient>;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-DlpkT3g-.cjs";
2
- import { a as UserPluginWithLifeCycle, n as PluginClient, t as Options } from "./types-Chp-emXk.cjs";
2
+ import { a as UserPluginWithLifeCycle, n as PluginClient, t as Options } from "./types-BvQ8zSDH.cjs";
3
3
 
4
4
  //#region src/plugin.d.ts
5
5
  declare const pluginClientName = "plugin-client";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-iVr_oF3V.js";
2
- import { a as UserPluginWithLifeCycle, n as PluginClient, t as Options } from "./types-aqsuGVmg.js";
2
+ import { a as UserPluginWithLifeCycle, n as PluginClient, t as Options } from "./types-fnIF5Tde.js";
3
3
 
4
4
  //#region src/plugin.d.ts
5
5
  declare const pluginClientName = "plugin-client";
@@ -37,7 +37,7 @@ declare class Oas extends BaseOas {
37
37
  getResponseSchema(operation: Operation$1, statusCode: string | number): SchemaObject$1;
38
38
  getRequestSchema(operation: Operation$1): SchemaObject$1 | undefined;
39
39
  getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
40
- valdiate(): Promise<oas_normalize_lib_types0.ValidationResult>;
40
+ validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
41
41
  flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
42
42
  }
43
43
  //#endregion
@@ -339,7 +339,7 @@ type Config<TInput = Input> = {
339
339
  input: TInput;
340
340
  output: {
341
341
  /**
342
- * The path where all generated files will be exported.
342
+ * The path where all generated files receives exported.
343
343
  * This can be an absolute path or a path relative to the specified root option.
344
344
  */
345
345
  path: string;
@@ -354,41 +354,39 @@ type Config<TInput = Input> = {
354
354
  write?: boolean;
355
355
  /**
356
356
  * Specifies the formatting tool to be used.
357
- * @default prettier
358
- *
359
- * Possible values:
360
- * - 'auto': Automatically detects and uses biome or prettier (in that order of preference).
361
- * - 'prettier': Uses Prettier for code formatting.
362
- * - 'biome': Uses Biome for code formatting.
363
- *
357
+ * - 'auto' automatically detects and uses biome or prettier (in that order of preference).
358
+ * - 'prettier' uses Prettier for code formatting.
359
+ * - 'biome' uses Biome for code formatting.
360
+ * - 'oxfmt' uses Oxfmt for code formatting.
361
+ * - false disables code formatting.
362
+ * @default 'prettier'
364
363
  */
365
364
  format?: 'auto' | 'prettier' | 'biome' | 'oxfmt' | false;
366
365
  /**
367
366
  * Specifies the linter that should be used to analyze the code.
368
- * The accepted values indicate different linting tools.
369
- *
370
- * Possible values:
371
- * - 'auto': Automatically detects and uses biome, oxlint, or eslint (in that order of preference).
372
- * - 'eslint': Represents the use of ESLint, a widely used JavaScript linter.
373
- * - 'biome': Represents the Biome linter, a modern tool for code scanning.
374
- * - 'oxlint': Represents the Oxlint tool for linting purposes.
375
- *
367
+ * - 'auto' automatically detects and uses biome, oxlint, or eslint (in that order of preference).
368
+ * - 'eslint' uses ESLint for linting.
369
+ * - 'biome' uses Biome for linting.
370
+ * - 'oxlint' uses Oxlint for linting.
371
+ * - false disables linting.
372
+ * @default 'auto'
376
373
  */
377
374
  lint?: 'auto' | 'eslint' | 'biome' | 'oxlint' | false;
378
375
  /**
379
- * Override the extension to the generated imports and exports, by default each plugin will add an extension
376
+ * Overrides the extension for generated imports and exports. By default, each plugin adds an extension.
380
377
  * @default { '.ts': '.ts'}
381
378
  */
382
379
  extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
383
380
  /**
384
- * 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`.
381
+ * Configures how `index.ts` files are created, including disabling barrel file generation. Each plugin has its own `barrelType` option; this setting controls the root barrel file (e.g., `src/gen/index.ts`).
385
382
  * @default 'named'
386
383
  */
387
384
  barrelType?: Exclude<BarrelType, 'propagate'> | false;
388
385
  /**
389
- * Add a default banner to the beginning of every generated file. This makes it clear that the file was generated by Kubb.
390
- * - 'simple': will only add banner with link to Kubb
391
- * - 'full': will add source, title, description and the OpenAPI version used
386
+ * Adds a default banner to the start of every generated file indicating it was generated by Kubb.
387
+ * - 'simple' adds banner with link to Kubb.
388
+ * - 'full' adds source, title, description, and OpenAPI version.
389
+ * - false disables banner generation.
392
390
  * @default 'simple'
393
391
  */
394
392
  defaultBanner?: 'simple' | 'full' | false;
@@ -401,17 +399,17 @@ type Config<TInput = Input> = {
401
399
  override?: boolean;
402
400
  };
403
401
  /**
404
- * An array of Kubb plugins that will be used in the generation.
402
+ * An array of Kubb plugins that used in the generation.
405
403
  * Each plugin may include additional configurable options(defined in the plugin itself).
406
- * If a plugin depends on another plugin, an error will be returned if the required dependency is missing. See pre for more details.
404
+ * If a plugin depends on another plugin, an error is returned if the required dependency is missing. See pre for more details.
407
405
  */
408
406
  plugins?: Array<Plugin>;
409
407
  /**
410
- * Hooks that will be called when a specific action is triggered in Kubb.
408
+ * Hooks triggered when a specific action occurs in Kubb.
411
409
  */
412
410
  hooks?: {
413
411
  /**
414
- * Hook that will be triggered at the end of all executions.
412
+ * Hook that triggers at the end of all executions.
415
413
  * Useful for running Prettier or ESLint to format/lint your code.
416
414
  */
417
415
  done?: string | Array<string>;
@@ -440,7 +438,7 @@ TContext = any,
440
438
  TResolvePathOptions extends object = object> = {
441
439
  name: TName;
442
440
  /**
443
- * Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
441
+ * Same behavior like what has been done with `QueryKey` in `@tanstack/react-query`
444
442
  */
445
443
  key: PluginKey<TName | string>;
446
444
  options: TOptions;
@@ -461,12 +459,12 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
461
459
  */
462
460
  options: TOptions['resolvedOptions'];
463
461
  /**
464
- * 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.
462
+ * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin is executed after these plugins.
465
463
  * Can be used to validate dependent plugins.
466
464
  */
467
465
  pre?: Array<string>;
468
466
  /**
469
- * 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.
467
+ * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin is executed before these plugins.
470
468
  */
471
469
  post?: Array<string>;
472
470
  inject?: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => TOptions['context'];
@@ -484,12 +482,12 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
484
482
  */
485
483
  key: TOptions['key'];
486
484
  /**
487
- * 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.
485
+ * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin is executed after these plugins.
488
486
  * Can be used to validate dependent plugins.
489
487
  */
490
488
  pre?: Array<string>;
491
489
  /**
492
- * 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.
490
+ * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin is executed before these plugins.
493
491
  */
494
492
  post?: Array<string>;
495
493
  /**
@@ -539,10 +537,12 @@ type ResolveNameParams = {
539
537
  name: string;
540
538
  pluginKey?: Plugin['key'];
541
539
  /**
542
- * `file` will be used to customize the name of the created file(use of camelCase)
543
- * `function` can be used to customize the exported functions(use of camelCase)
544
- * `type` is a special type for TypeScript(use of PascalCase)
545
- * `const` can be used for variables(use of camelCase)
540
+ * Specifies the type of entity being named.
541
+ * - 'file' customizes the name of the created file (uses camelCase).
542
+ * - 'function' customizes the exported function names (uses camelCase).
543
+ * - 'type' customizes TypeScript types (uses PascalCase).
544
+ * - 'const' customizes variable names (uses camelCase).
545
+ * @default undefined
546
546
  */
547
547
  type?: 'file' | 'function' | 'type' | 'const';
548
548
  };
@@ -597,11 +597,14 @@ type GroupContext = {
597
597
  };
598
598
  type Group = {
599
599
  /**
600
- * Define a type where to group the files on
600
+ * Defines the type where to group the files.
601
+ * - 'tag' groups files by OpenAPI tags.
602
+ * - 'path' groups files by OpenAPI paths.
603
+ * @default undefined
601
604
  */
602
605
  type: 'tag' | 'path';
603
606
  /**
604
- * Return the name of a group based on the group name, this will be used for the file and name generation
607
+ * Return the name of a group based on the group name, this used for the file and name generation
605
608
  */
606
609
  name?: (context: GroupContext) => string;
607
610
  };
@@ -673,7 +676,7 @@ declare class PluginManager {
673
676
  parameters: PluginParameter<H>;
674
677
  }): Array<ReturnType<ParseResult<H>>> | null;
675
678
  /**
676
- * First non-null result stops and will return it's value.
679
+ * Returns the first non-null result.
677
680
  */
678
681
  hookFirst<H extends PluginLifecycleHooks>({
679
682
  hookName,
@@ -685,7 +688,7 @@ declare class PluginManager {
685
688
  skipped?: ReadonlySet<Plugin> | null;
686
689
  }): Promise<SafeParseResult<H>>;
687
690
  /**
688
- * First non-null result stops and will return it's value.
691
+ * Returns the first non-null result.
689
692
  */
690
693
  hookFirstSync<H extends PluginLifecycleHooks>({
691
694
  hookName,
@@ -697,15 +700,15 @@ declare class PluginManager {
697
700
  skipped?: ReadonlySet<Plugin> | null;
698
701
  }): SafeParseResult<H>;
699
702
  /**
700
- * Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
703
+ * Runs all plugins in parallel based on `this.plugin` order and `pre`/`post` settings.
701
704
  */
702
- hookParallel<H extends PluginLifecycleHooks, TOuput = void>({
705
+ hookParallel<H extends PluginLifecycleHooks, TOutput = void>({
703
706
  hookName,
704
707
  parameters
705
708
  }: {
706
709
  hookName: H;
707
710
  parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
708
- }): Promise<Awaited<TOuput>[]>;
711
+ }): Promise<Awaited<TOutput>[]>;
709
712
  /**
710
713
  * Chains plugins
711
714
  */
@@ -974,8 +977,8 @@ type SchemaKeywordMapper = {
974
977
  */
975
978
  path: KubbFile.Path;
976
979
  /**
977
- * When true `File.Import` will be used.
978
- * When false a reference will be used inside the current file.
980
+ * When true `File.Import` is used.
981
+ * When false a reference is used inside the current file.
979
982
  */
980
983
  isImportable: boolean;
981
984
  };
@@ -1107,7 +1110,7 @@ type SchemaGeneratorOptions = {
1107
1110
  */
1108
1111
  name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
1109
1112
  /**
1110
- * Receive schema and name(propertName) and return FakerMeta array
1113
+ * Receive schema and name(propertyName) and return FakerMeta array
1111
1114
  * TODO TODO add docs
1112
1115
  * @beta
1113
1116
  */
@@ -1186,7 +1189,7 @@ type Options = {
1186
1189
  output?: Output<Oas>;
1187
1190
  /**
1188
1191
  * Define which contentType should be used.
1189
- * By default, the first JSON valid mediaType will be used
1192
+ * By default, the first JSON valid mediaType is used
1190
1193
  */
1191
1194
  contentType?: contentType;
1192
1195
  /**
@@ -1211,16 +1214,17 @@ type Options = {
1211
1214
  */
1212
1215
  operations?: boolean;
1213
1216
  /**
1214
- * Export urls that are used by operation x
1215
- * `export` will make them part of your barrel file
1216
- * false will not make them exportable
1217
+ * Export urls that are used by operation x.
1218
+ * - 'export' makes them part of your barrel file.
1219
+ * - false does not make them exportable.
1220
+ * @default false
1217
1221
  * @example getGetPetByIdUrl
1218
1222
  */
1219
1223
  urlType?: 'export' | false;
1220
1224
  /**
1221
- * Path to the client import path that will be used to do the API calls.
1222
- * It will be used as `import client from '${client.importPath}'`.
1223
- * It allows both relative and absolute path but be aware that we will not change the path.
1225
+ * Client import path for API calls.
1226
+ * Used as `import client from '${client.importPath}'`.
1227
+ * Accepts relative and absolute paths; path changes are not performed.
1224
1228
  */
1225
1229
  importPath?: string;
1226
1230
  /**
@@ -1228,49 +1232,50 @@ type Options = {
1228
1232
  */
1229
1233
  baseURL?: string;
1230
1234
  /**
1231
- * ReturnType that will be used when calling the client.
1232
- * - 'data' will return ResponseConfig[data].
1233
- * - 'full' will return ResponseConfig.
1235
+ * ReturnType that is used when calling the client.
1236
+ * - 'data' returns ResponseConfig[data].
1237
+ * - 'full' returns ResponseConfig.
1234
1238
  * @default 'data'
1235
1239
  */
1236
1240
  dataReturnType?: 'data' | 'full';
1237
1241
  /**
1238
1242
  * How to style your params, by default no casing is applied
1239
- * - 'camelcase' will use camelcase for the params names
1243
+ * - 'camelcase' uses camelcase for the params names
1240
1244
  */
1241
1245
  paramsCasing?: 'camelcase';
1242
1246
  /**
1243
- * How to pass your params
1244
- * - 'object' will return the params and pathParams as an object.
1245
- * - 'inline' will return the params as comma separated params.
1247
+ * How to pass your params.
1248
+ * - 'object' returns the params and pathParams as an object.
1249
+ * - 'inline' returns the params as comma separated params.
1246
1250
  * @default 'inline'
1247
1251
  */
1248
1252
  paramsType?: 'object' | 'inline';
1249
1253
  /**
1250
1254
  * How to pass your pathParams.
1251
- * - 'object' will return the pathParams as an object.
1252
- * - 'inline' will return the pathParams as comma separated params.
1255
+ * - 'object' returns the pathParams as an object.
1256
+ * - 'inline' returns the pathParams as comma separated params.
1253
1257
  * @default 'inline'
1254
1258
  */
1255
1259
  pathParamsType?: 'object' | 'inline';
1256
1260
  /**
1257
- * Which parser can be used before returning the data
1258
- * - 'zod' will use `@kubb/plugin-zod` to parse the data.
1261
+ * Which parser can be used before returning the data.
1262
+ * - 'client' returns the data as-is from the client.
1263
+ * - 'zod' uses @kubb/plugin-zod to parse the data.
1259
1264
  * @default 'client'
1260
1265
  */
1261
1266
  parser?: 'client' | 'zod';
1262
1267
  /**
1263
- * Which client should be used to do the HTTP calls
1264
- * - 'axios' will use `@kubb/plugin-client/templates/axios` to fetch data.
1265
- * - 'fetch' will use `@kubb/plugin-client/templates/fetch` to fetch data.
1268
+ * Which client should be used to do the HTTP calls.
1269
+ * - 'axios' uses axios client for HTTP requests.
1270
+ * - 'fetch' uses native fetch API for HTTP requests.
1266
1271
  * @default 'axios'
1267
1272
  */
1268
1273
  client?: 'axios' | 'fetch';
1269
1274
  /**
1270
- * How to generate the client code
1271
- * - 'function' will generate standalone functions for each operation.
1272
- * - 'class' will generate a class with methods for each operation.
1273
- * - 'staticClass' will generate a class with static methods for each operation.
1275
+ * How to generate the client code.
1276
+ * - 'function' generates standalone functions for each operation.
1277
+ * - 'class' generates a class with methods for each operation.
1278
+ * - 'staticClass' generates a class with static methods for each operation.
1274
1279
  * @default 'function'
1275
1280
  */
1276
1281
  clientType?: 'function' | 'class' | 'staticClass';
@@ -1278,7 +1283,7 @@ type Options = {
1278
1283
  * Bundle the selected client into the generated `.kubb` directory.
1279
1284
  * When disabled the generated clients will import the shared runtime from `@kubb/plugin-client/clients/*`.
1280
1285
  * @default false
1281
- * In version 5 of Kubb this will be by default true
1286
+ * In version 5 of Kubb this is by default true
1282
1287
  */
1283
1288
  bundle?: boolean;
1284
1289
  transformers?: {
@@ -1310,4 +1315,4 @@ type ResolvedOptions = {
1310
1315
  type PluginClient = PluginFactoryOptions<'plugin-client', Options, ResolvedOptions, never, ResolvePathOptions>;
1311
1316
  //#endregion
1312
1317
  export { UserPluginWithLifeCycle as a, OperationSchemas as i, PluginClient as n, Operation$1 as o, ReactGenerator as r, Options as t };
1313
- //# sourceMappingURL=types-Chp-emXk.d.cts.map
1318
+ //# sourceMappingURL=types-BvQ8zSDH.d.cts.map
@@ -37,7 +37,7 @@ declare class Oas extends BaseOas {
37
37
  getResponseSchema(operation: Operation$1, statusCode: string | number): SchemaObject$1;
38
38
  getRequestSchema(operation: Operation$1): SchemaObject$1 | undefined;
39
39
  getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
40
- valdiate(): Promise<oas_normalize_lib_types0.ValidationResult>;
40
+ validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
41
41
  flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
42
42
  }
43
43
  //#endregion
@@ -339,7 +339,7 @@ type Config<TInput = Input> = {
339
339
  input: TInput;
340
340
  output: {
341
341
  /**
342
- * The path where all generated files will be exported.
342
+ * The path where all generated files receives exported.
343
343
  * This can be an absolute path or a path relative to the specified root option.
344
344
  */
345
345
  path: string;
@@ -354,41 +354,39 @@ type Config<TInput = Input> = {
354
354
  write?: boolean;
355
355
  /**
356
356
  * Specifies the formatting tool to be used.
357
- * @default prettier
358
- *
359
- * Possible values:
360
- * - 'auto': Automatically detects and uses biome or prettier (in that order of preference).
361
- * - 'prettier': Uses Prettier for code formatting.
362
- * - 'biome': Uses Biome for code formatting.
363
- *
357
+ * - 'auto' automatically detects and uses biome or prettier (in that order of preference).
358
+ * - 'prettier' uses Prettier for code formatting.
359
+ * - 'biome' uses Biome for code formatting.
360
+ * - 'oxfmt' uses Oxfmt for code formatting.
361
+ * - false disables code formatting.
362
+ * @default 'prettier'
364
363
  */
365
364
  format?: 'auto' | 'prettier' | 'biome' | 'oxfmt' | false;
366
365
  /**
367
366
  * Specifies the linter that should be used to analyze the code.
368
- * The accepted values indicate different linting tools.
369
- *
370
- * Possible values:
371
- * - 'auto': Automatically detects and uses biome, oxlint, or eslint (in that order of preference).
372
- * - 'eslint': Represents the use of ESLint, a widely used JavaScript linter.
373
- * - 'biome': Represents the Biome linter, a modern tool for code scanning.
374
- * - 'oxlint': Represents the Oxlint tool for linting purposes.
375
- *
367
+ * - 'auto' automatically detects and uses biome, oxlint, or eslint (in that order of preference).
368
+ * - 'eslint' uses ESLint for linting.
369
+ * - 'biome' uses Biome for linting.
370
+ * - 'oxlint' uses Oxlint for linting.
371
+ * - false disables linting.
372
+ * @default 'auto'
376
373
  */
377
374
  lint?: 'auto' | 'eslint' | 'biome' | 'oxlint' | false;
378
375
  /**
379
- * Override the extension to the generated imports and exports, by default each plugin will add an extension
376
+ * Overrides the extension for generated imports and exports. By default, each plugin adds an extension.
380
377
  * @default { '.ts': '.ts'}
381
378
  */
382
379
  extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
383
380
  /**
384
- * 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`.
381
+ * Configures how `index.ts` files are created, including disabling barrel file generation. Each plugin has its own `barrelType` option; this setting controls the root barrel file (e.g., `src/gen/index.ts`).
385
382
  * @default 'named'
386
383
  */
387
384
  barrelType?: Exclude<BarrelType, 'propagate'> | false;
388
385
  /**
389
- * Add a default banner to the beginning of every generated file. This makes it clear that the file was generated by Kubb.
390
- * - 'simple': will only add banner with link to Kubb
391
- * - 'full': will add source, title, description and the OpenAPI version used
386
+ * Adds a default banner to the start of every generated file indicating it was generated by Kubb.
387
+ * - 'simple' adds banner with link to Kubb.
388
+ * - 'full' adds source, title, description, and OpenAPI version.
389
+ * - false disables banner generation.
392
390
  * @default 'simple'
393
391
  */
394
392
  defaultBanner?: 'simple' | 'full' | false;
@@ -401,17 +399,17 @@ type Config<TInput = Input> = {
401
399
  override?: boolean;
402
400
  };
403
401
  /**
404
- * An array of Kubb plugins that will be used in the generation.
402
+ * An array of Kubb plugins that used in the generation.
405
403
  * Each plugin may include additional configurable options(defined in the plugin itself).
406
- * If a plugin depends on another plugin, an error will be returned if the required dependency is missing. See pre for more details.
404
+ * If a plugin depends on another plugin, an error is returned if the required dependency is missing. See pre for more details.
407
405
  */
408
406
  plugins?: Array<Plugin>;
409
407
  /**
410
- * Hooks that will be called when a specific action is triggered in Kubb.
408
+ * Hooks triggered when a specific action occurs in Kubb.
411
409
  */
412
410
  hooks?: {
413
411
  /**
414
- * Hook that will be triggered at the end of all executions.
412
+ * Hook that triggers at the end of all executions.
415
413
  * Useful for running Prettier or ESLint to format/lint your code.
416
414
  */
417
415
  done?: string | Array<string>;
@@ -440,7 +438,7 @@ TContext = any,
440
438
  TResolvePathOptions extends object = object> = {
441
439
  name: TName;
442
440
  /**
443
- * Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
441
+ * Same behavior like what has been done with `QueryKey` in `@tanstack/react-query`
444
442
  */
445
443
  key: PluginKey<TName | string>;
446
444
  options: TOptions;
@@ -461,12 +459,12 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
461
459
  */
462
460
  options: TOptions['resolvedOptions'];
463
461
  /**
464
- * 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.
462
+ * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin is executed after these plugins.
465
463
  * Can be used to validate dependent plugins.
466
464
  */
467
465
  pre?: Array<string>;
468
466
  /**
469
- * 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.
467
+ * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin is executed before these plugins.
470
468
  */
471
469
  post?: Array<string>;
472
470
  inject?: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => TOptions['context'];
@@ -484,12 +482,12 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
484
482
  */
485
483
  key: TOptions['key'];
486
484
  /**
487
- * 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.
485
+ * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin is executed after these plugins.
488
486
  * Can be used to validate dependent plugins.
489
487
  */
490
488
  pre?: Array<string>;
491
489
  /**
492
- * 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.
490
+ * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin is executed before these plugins.
493
491
  */
494
492
  post?: Array<string>;
495
493
  /**
@@ -539,10 +537,12 @@ type ResolveNameParams = {
539
537
  name: string;
540
538
  pluginKey?: Plugin['key'];
541
539
  /**
542
- * `file` will be used to customize the name of the created file(use of camelCase)
543
- * `function` can be used to customize the exported functions(use of camelCase)
544
- * `type` is a special type for TypeScript(use of PascalCase)
545
- * `const` can be used for variables(use of camelCase)
540
+ * Specifies the type of entity being named.
541
+ * - 'file' customizes the name of the created file (uses camelCase).
542
+ * - 'function' customizes the exported function names (uses camelCase).
543
+ * - 'type' customizes TypeScript types (uses PascalCase).
544
+ * - 'const' customizes variable names (uses camelCase).
545
+ * @default undefined
546
546
  */
547
547
  type?: 'file' | 'function' | 'type' | 'const';
548
548
  };
@@ -597,11 +597,14 @@ type GroupContext = {
597
597
  };
598
598
  type Group = {
599
599
  /**
600
- * Define a type where to group the files on
600
+ * Defines the type where to group the files.
601
+ * - 'tag' groups files by OpenAPI tags.
602
+ * - 'path' groups files by OpenAPI paths.
603
+ * @default undefined
601
604
  */
602
605
  type: 'tag' | 'path';
603
606
  /**
604
- * Return the name of a group based on the group name, this will be used for the file and name generation
607
+ * Return the name of a group based on the group name, this used for the file and name generation
605
608
  */
606
609
  name?: (context: GroupContext) => string;
607
610
  };
@@ -673,7 +676,7 @@ declare class PluginManager {
673
676
  parameters: PluginParameter<H>;
674
677
  }): Array<ReturnType<ParseResult<H>>> | null;
675
678
  /**
676
- * First non-null result stops and will return it's value.
679
+ * Returns the first non-null result.
677
680
  */
678
681
  hookFirst<H extends PluginLifecycleHooks>({
679
682
  hookName,
@@ -685,7 +688,7 @@ declare class PluginManager {
685
688
  skipped?: ReadonlySet<Plugin> | null;
686
689
  }): Promise<SafeParseResult<H>>;
687
690
  /**
688
- * First non-null result stops and will return it's value.
691
+ * Returns the first non-null result.
689
692
  */
690
693
  hookFirstSync<H extends PluginLifecycleHooks>({
691
694
  hookName,
@@ -697,15 +700,15 @@ declare class PluginManager {
697
700
  skipped?: ReadonlySet<Plugin> | null;
698
701
  }): SafeParseResult<H>;
699
702
  /**
700
- * Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
703
+ * Runs all plugins in parallel based on `this.plugin` order and `pre`/`post` settings.
701
704
  */
702
- hookParallel<H extends PluginLifecycleHooks, TOuput = void>({
705
+ hookParallel<H extends PluginLifecycleHooks, TOutput = void>({
703
706
  hookName,
704
707
  parameters
705
708
  }: {
706
709
  hookName: H;
707
710
  parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
708
- }): Promise<Awaited<TOuput>[]>;
711
+ }): Promise<Awaited<TOutput>[]>;
709
712
  /**
710
713
  * Chains plugins
711
714
  */
@@ -974,8 +977,8 @@ type SchemaKeywordMapper = {
974
977
  */
975
978
  path: KubbFile.Path;
976
979
  /**
977
- * When true `File.Import` will be used.
978
- * When false a reference will be used inside the current file.
980
+ * When true `File.Import` is used.
981
+ * When false a reference is used inside the current file.
979
982
  */
980
983
  isImportable: boolean;
981
984
  };
@@ -1107,7 +1110,7 @@ type SchemaGeneratorOptions = {
1107
1110
  */
1108
1111
  name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
1109
1112
  /**
1110
- * Receive schema and name(propertName) and return FakerMeta array
1113
+ * Receive schema and name(propertyName) and return FakerMeta array
1111
1114
  * TODO TODO add docs
1112
1115
  * @beta
1113
1116
  */
@@ -1186,7 +1189,7 @@ type Options = {
1186
1189
  output?: Output<Oas>;
1187
1190
  /**
1188
1191
  * Define which contentType should be used.
1189
- * By default, the first JSON valid mediaType will be used
1192
+ * By default, the first JSON valid mediaType is used
1190
1193
  */
1191
1194
  contentType?: contentType;
1192
1195
  /**
@@ -1211,16 +1214,17 @@ type Options = {
1211
1214
  */
1212
1215
  operations?: boolean;
1213
1216
  /**
1214
- * Export urls that are used by operation x
1215
- * `export` will make them part of your barrel file
1216
- * false will not make them exportable
1217
+ * Export urls that are used by operation x.
1218
+ * - 'export' makes them part of your barrel file.
1219
+ * - false does not make them exportable.
1220
+ * @default false
1217
1221
  * @example getGetPetByIdUrl
1218
1222
  */
1219
1223
  urlType?: 'export' | false;
1220
1224
  /**
1221
- * Path to the client import path that will be used to do the API calls.
1222
- * It will be used as `import client from '${client.importPath}'`.
1223
- * It allows both relative and absolute path but be aware that we will not change the path.
1225
+ * Client import path for API calls.
1226
+ * Used as `import client from '${client.importPath}'`.
1227
+ * Accepts relative and absolute paths; path changes are not performed.
1224
1228
  */
1225
1229
  importPath?: string;
1226
1230
  /**
@@ -1228,49 +1232,50 @@ type Options = {
1228
1232
  */
1229
1233
  baseURL?: string;
1230
1234
  /**
1231
- * ReturnType that will be used when calling the client.
1232
- * - 'data' will return ResponseConfig[data].
1233
- * - 'full' will return ResponseConfig.
1235
+ * ReturnType that is used when calling the client.
1236
+ * - 'data' returns ResponseConfig[data].
1237
+ * - 'full' returns ResponseConfig.
1234
1238
  * @default 'data'
1235
1239
  */
1236
1240
  dataReturnType?: 'data' | 'full';
1237
1241
  /**
1238
1242
  * How to style your params, by default no casing is applied
1239
- * - 'camelcase' will use camelcase for the params names
1243
+ * - 'camelcase' uses camelcase for the params names
1240
1244
  */
1241
1245
  paramsCasing?: 'camelcase';
1242
1246
  /**
1243
- * How to pass your params
1244
- * - 'object' will return the params and pathParams as an object.
1245
- * - 'inline' will return the params as comma separated params.
1247
+ * How to pass your params.
1248
+ * - 'object' returns the params and pathParams as an object.
1249
+ * - 'inline' returns the params as comma separated params.
1246
1250
  * @default 'inline'
1247
1251
  */
1248
1252
  paramsType?: 'object' | 'inline';
1249
1253
  /**
1250
1254
  * How to pass your pathParams.
1251
- * - 'object' will return the pathParams as an object.
1252
- * - 'inline' will return the pathParams as comma separated params.
1255
+ * - 'object' returns the pathParams as an object.
1256
+ * - 'inline' returns the pathParams as comma separated params.
1253
1257
  * @default 'inline'
1254
1258
  */
1255
1259
  pathParamsType?: 'object' | 'inline';
1256
1260
  /**
1257
- * Which parser can be used before returning the data
1258
- * - 'zod' will use `@kubb/plugin-zod` to parse the data.
1261
+ * Which parser can be used before returning the data.
1262
+ * - 'client' returns the data as-is from the client.
1263
+ * - 'zod' uses @kubb/plugin-zod to parse the data.
1259
1264
  * @default 'client'
1260
1265
  */
1261
1266
  parser?: 'client' | 'zod';
1262
1267
  /**
1263
- * Which client should be used to do the HTTP calls
1264
- * - 'axios' will use `@kubb/plugin-client/templates/axios` to fetch data.
1265
- * - 'fetch' will use `@kubb/plugin-client/templates/fetch` to fetch data.
1268
+ * Which client should be used to do the HTTP calls.
1269
+ * - 'axios' uses axios client for HTTP requests.
1270
+ * - 'fetch' uses native fetch API for HTTP requests.
1266
1271
  * @default 'axios'
1267
1272
  */
1268
1273
  client?: 'axios' | 'fetch';
1269
1274
  /**
1270
- * How to generate the client code
1271
- * - 'function' will generate standalone functions for each operation.
1272
- * - 'class' will generate a class with methods for each operation.
1273
- * - 'staticClass' will generate a class with static methods for each operation.
1275
+ * How to generate the client code.
1276
+ * - 'function' generates standalone functions for each operation.
1277
+ * - 'class' generates a class with methods for each operation.
1278
+ * - 'staticClass' generates a class with static methods for each operation.
1274
1279
  * @default 'function'
1275
1280
  */
1276
1281
  clientType?: 'function' | 'class' | 'staticClass';
@@ -1278,7 +1283,7 @@ type Options = {
1278
1283
  * Bundle the selected client into the generated `.kubb` directory.
1279
1284
  * When disabled the generated clients will import the shared runtime from `@kubb/plugin-client/clients/*`.
1280
1285
  * @default false
1281
- * In version 5 of Kubb this will be by default true
1286
+ * In version 5 of Kubb this is by default true
1282
1287
  */
1283
1288
  bundle?: boolean;
1284
1289
  transformers?: {
@@ -1310,4 +1315,4 @@ type ResolvedOptions = {
1310
1315
  type PluginClient = PluginFactoryOptions<'plugin-client', Options, ResolvedOptions, never, ResolvePathOptions>;
1311
1316
  //#endregion
1312
1317
  export { UserPluginWithLifeCycle as a, OperationSchemas as i, PluginClient as n, Operation$1 as o, ReactGenerator as r, Options as t };
1313
- //# sourceMappingURL=types-aqsuGVmg.d.ts.map
1318
+ //# sourceMappingURL=types-fnIF5Tde.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-client",
3
- "version": "4.18.4",
3
+ "version": "4.18.5",
4
4
  "description": "API client generator plugin for Kubb, creating type-safe HTTP clients (Axios, Fetch) from OpenAPI specifications for making API requests.",
5
5
  "keywords": [
6
6
  "api-client",
@@ -87,11 +87,11 @@
87
87
  ],
88
88
  "dependencies": {
89
89
  "@kubb/react-fabric": "0.12.4",
90
- "@kubb/core": "4.18.4",
91
- "@kubb/oas": "4.18.4",
92
- "@kubb/plugin-oas": "4.18.4",
93
- "@kubb/plugin-ts": "4.18.4",
94
- "@kubb/plugin-zod": "4.18.4"
90
+ "@kubb/core": "4.18.5",
91
+ "@kubb/oas": "4.18.5",
92
+ "@kubb/plugin-oas": "4.18.5",
93
+ "@kubb/plugin-ts": "4.18.5",
94
+ "@kubb/plugin-zod": "4.18.5"
95
95
  },
96
96
  "devDependencies": {
97
97
  "axios": "^1.13.2"
package/src/types.ts CHANGED
@@ -12,7 +12,7 @@ export type Options = {
12
12
  output?: Output<Oas>
13
13
  /**
14
14
  * Define which contentType should be used.
15
- * By default, the first JSON valid mediaType will be used
15
+ * By default, the first JSON valid mediaType is used
16
16
  */
17
17
  contentType?: contentType
18
18
  /**
@@ -37,16 +37,17 @@ export type Options = {
37
37
  */
38
38
  operations?: boolean
39
39
  /**
40
- * Export urls that are used by operation x
41
- * `export` will make them part of your barrel file
42
- * false will not make them exportable
40
+ * Export urls that are used by operation x.
41
+ * - 'export' makes them part of your barrel file.
42
+ * - false does not make them exportable.
43
+ * @default false
43
44
  * @example getGetPetByIdUrl
44
45
  */
45
46
  urlType?: 'export' | false
46
47
  /**
47
- * Path to the client import path that will be used to do the API calls.
48
- * It will be used as `import client from '${client.importPath}'`.
49
- * It allows both relative and absolute path but be aware that we will not change the path.
48
+ * Client import path for API calls.
49
+ * Used as `import client from '${client.importPath}'`.
50
+ * Accepts relative and absolute paths; path changes are not performed.
50
51
  */
51
52
  importPath?: string
52
53
  /**
@@ -54,49 +55,50 @@ export type Options = {
54
55
  */
55
56
  baseURL?: string
56
57
  /**
57
- * ReturnType that will be used when calling the client.
58
- * - 'data' will return ResponseConfig[data].
59
- * - 'full' will return ResponseConfig.
58
+ * ReturnType that is used when calling the client.
59
+ * - 'data' returns ResponseConfig[data].
60
+ * - 'full' returns ResponseConfig.
60
61
  * @default 'data'
61
62
  */
62
63
  dataReturnType?: 'data' | 'full'
63
64
  /**
64
65
  * How to style your params, by default no casing is applied
65
- * - 'camelcase' will use camelcase for the params names
66
+ * - 'camelcase' uses camelcase for the params names
66
67
  */
67
68
  paramsCasing?: 'camelcase'
68
69
  /**
69
- * How to pass your params
70
- * - 'object' will return the params and pathParams as an object.
71
- * - 'inline' will return the params as comma separated params.
70
+ * How to pass your params.
71
+ * - 'object' returns the params and pathParams as an object.
72
+ * - 'inline' returns the params as comma separated params.
72
73
  * @default 'inline'
73
74
  */
74
75
  paramsType?: 'object' | 'inline'
75
76
  /**
76
77
  * How to pass your pathParams.
77
- * - 'object' will return the pathParams as an object.
78
- * - 'inline' will return the pathParams as comma separated params.
78
+ * - 'object' returns the pathParams as an object.
79
+ * - 'inline' returns the pathParams as comma separated params.
79
80
  * @default 'inline'
80
81
  */
81
82
  pathParamsType?: 'object' | 'inline'
82
83
  /**
83
- * Which parser can be used before returning the data
84
- * - 'zod' will use `@kubb/plugin-zod` to parse the data.
84
+ * Which parser can be used before returning the data.
85
+ * - 'client' returns the data as-is from the client.
86
+ * - 'zod' uses @kubb/plugin-zod to parse the data.
85
87
  * @default 'client'
86
88
  */
87
89
  parser?: 'client' | 'zod'
88
90
  /**
89
- * Which client should be used to do the HTTP calls
90
- * - 'axios' will use `@kubb/plugin-client/templates/axios` to fetch data.
91
- * - 'fetch' will use `@kubb/plugin-client/templates/fetch` to fetch data.
91
+ * Which client should be used to do the HTTP calls.
92
+ * - 'axios' uses axios client for HTTP requests.
93
+ * - 'fetch' uses native fetch API for HTTP requests.
92
94
  * @default 'axios'
93
95
  */
94
96
  client?: 'axios' | 'fetch'
95
97
  /**
96
- * How to generate the client code
97
- * - 'function' will generate standalone functions for each operation.
98
- * - 'class' will generate a class with methods for each operation.
99
- * - 'staticClass' will generate a class with static methods for each operation.
98
+ * How to generate the client code.
99
+ * - 'function' generates standalone functions for each operation.
100
+ * - 'class' generates a class with methods for each operation.
101
+ * - 'staticClass' generates a class with static methods for each operation.
100
102
  * @default 'function'
101
103
  */
102
104
  clientType?: 'function' | 'class' | 'staticClass'
@@ -104,7 +106,7 @@ export type Options = {
104
106
  * Bundle the selected client into the generated `.kubb` directory.
105
107
  * When disabled the generated clients will import the shared runtime from `@kubb/plugin-client/clients/*`.
106
108
  * @default false
107
- * In version 5 of Kubb this will be by default true
109
+ * In version 5 of Kubb this is by default true
108
110
  */
109
111
  bundle?: boolean
110
112
  transformers?: {