@kubb/plugin-client 5.0.0-beta.33 → 5.0.0-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -12
- package/dist/clients/axios.cjs +1 -1
- package/dist/clients/axios.cjs.map +1 -1
- package/dist/clients/axios.d.ts +2 -3
- package/dist/clients/axios.js +1 -1
- package/dist/clients/axios.js.map +1 -1
- package/dist/clients/fetch.cjs +1 -1
- package/dist/clients/fetch.cjs.map +1 -1
- package/dist/clients/fetch.d.ts +1 -1
- package/dist/clients/fetch.js +1 -1
- package/dist/clients/fetch.js.map +1 -1
- package/dist/index.cjs +8 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -8
- package/dist/index.js +8 -11
- package/dist/index.js.map +1 -1
- package/dist/templates/clients/axios.source.d.ts +1 -1
- package/dist/templates/clients/fetch.source.d.ts +1 -1
- package/dist/templates/config.source.d.ts +1 -1
- package/package.json +7 -6
- package/src/plugin.ts +1 -1
- /package/dist/{chunk-ByKO4r7w.cjs → chunk-Bx3C2hgW.cjs} +0 -0
- /package/dist/{chunk--u3MIqq1.js → chunk-C0LytTxp.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as __name } from "./chunk
|
|
2
|
-
import * as _$_kubb_core0 from "@kubb/core";
|
|
1
|
+
import { t as __name } from "./chunk-C0LytTxp.js";
|
|
3
2
|
import { Exclude, Generator, Group, Include, Output, Override, PluginFactoryOptions, Resolver, ast } from "@kubb/core";
|
|
4
3
|
import { ResolverTs } from "@kubb/plugin-ts";
|
|
5
4
|
import { ResolverZod } from "@kubb/plugin-zod";
|
|
@@ -306,7 +305,7 @@ declare function Client({
|
|
|
306
305
|
* `clientType: 'class'`. Emits one class per tag, with one instance method
|
|
307
306
|
* per operation and a shared constructor for request configuration.
|
|
308
307
|
*/
|
|
309
|
-
declare const classClientGenerator:
|
|
308
|
+
declare const classClientGenerator: import("@kubb/core").Generator<PluginClient, unknown>;
|
|
310
309
|
//#endregion
|
|
311
310
|
//#region src/generators/clientGenerator.d.ts
|
|
312
311
|
/**
|
|
@@ -314,7 +313,7 @@ declare const classClientGenerator: _$_kubb_core0.Generator<PluginClient, unknow
|
|
|
314
313
|
* function per OpenAPI operation, plus the matching URL helper. Used when
|
|
315
314
|
* `clientType: 'function'` (the default).
|
|
316
315
|
*/
|
|
317
|
-
declare const clientGenerator:
|
|
316
|
+
declare const clientGenerator: import("@kubb/core").Generator<PluginClient, unknown>;
|
|
318
317
|
//#endregion
|
|
319
318
|
//#region src/generators/groupedClientGenerator.d.ts
|
|
320
319
|
/**
|
|
@@ -323,7 +322,7 @@ declare const clientGenerator: _$_kubb_core0.Generator<PluginClient, unknown>;
|
|
|
323
322
|
* `import { petController } from './gen/clients'` instead of importing
|
|
324
323
|
* each operation individually.
|
|
325
324
|
*/
|
|
326
|
-
declare const groupedClientGenerator:
|
|
325
|
+
declare const groupedClientGenerator: import("@kubb/core").Generator<PluginClient, unknown>;
|
|
327
326
|
//#endregion
|
|
328
327
|
//#region src/generators/operationsGenerator.d.ts
|
|
329
328
|
/**
|
|
@@ -332,7 +331,7 @@ declare const groupedClientGenerator: _$_kubb_core0.Generator<PluginClient, unkn
|
|
|
332
331
|
* for building meta-tooling on top of the generated client (route
|
|
333
332
|
* registries, API explorers).
|
|
334
333
|
*/
|
|
335
|
-
declare const operationsGenerator:
|
|
334
|
+
declare const operationsGenerator: import("@kubb/core").Generator<PluginClient, unknown>;
|
|
336
335
|
//#endregion
|
|
337
336
|
//#region src/generators/staticClassClientGenerator.d.ts
|
|
338
337
|
/**
|
|
@@ -341,7 +340,7 @@ declare const operationsGenerator: _$_kubb_core0.Generator<PluginClient, unknown
|
|
|
341
340
|
* per operation so callers can use `Pet.getPetById(...)` without
|
|
342
341
|
* instantiating the class.
|
|
343
342
|
*/
|
|
344
|
-
declare const staticClassClientGenerator:
|
|
343
|
+
declare const staticClassClientGenerator: import("@kubb/core").Generator<PluginClient, unknown>;
|
|
345
344
|
//#endregion
|
|
346
345
|
//#region src/plugin.d.ts
|
|
347
346
|
/**
|
|
@@ -374,7 +373,7 @@ declare const pluginClientName = "plugin-client";
|
|
|
374
373
|
* })
|
|
375
374
|
* ```
|
|
376
375
|
*/
|
|
377
|
-
declare const pluginClient: (options?: Options | undefined) =>
|
|
376
|
+
declare const pluginClient: (options?: Options | undefined) => import("@kubb/core").Plugin<PluginClient>;
|
|
378
377
|
//#endregion
|
|
379
378
|
//#region src/resolvers/resolverClient.d.ts
|
|
380
379
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __name } from "./chunk
|
|
1
|
+
import { t as __name } from "./chunk-C0LytTxp.js";
|
|
2
2
|
import { source } from "./templates/clients/axios.source.js";
|
|
3
3
|
import { source as source$1 } from "./templates/clients/fetch.source.js";
|
|
4
4
|
import { source as source$2 } from "./templates/config.source.js";
|
|
@@ -508,17 +508,17 @@ function resolveOperationTypeNames(node, resolver, options = {}) {
|
|
|
508
508
|
* - `path` groups use the second path segment (`/pet/findByStatus` → `pet`).
|
|
509
509
|
* - other groups use `${camelCase(group)}${suffix}` (e.g. `petController`).
|
|
510
510
|
*
|
|
511
|
-
*
|
|
511
|
+
* A user-provided `group.name` always wins over the default namer, so callers stay in
|
|
512
|
+
* control of their output folders. Returns `null` when grouping is disabled, matching the
|
|
513
|
+
* per-plugin convention.
|
|
512
514
|
*
|
|
513
515
|
* @param group - The user-supplied group option, or `undefined` to disable grouping.
|
|
514
516
|
* @param options.suffix - Appended to non-`path` group names, e.g. `'Controller'` or `'Requests'`.
|
|
515
|
-
* @param options.honorName - When `true`, a user-provided `group.name` overrides the default namer.
|
|
516
517
|
*
|
|
517
518
|
* @example
|
|
518
519
|
* ```ts
|
|
519
|
-
* createGroupConfig(group, { suffix: 'Controller' })
|
|
520
|
-
* createGroupConfig(group, { suffix: '
|
|
521
|
-
* createGroupConfig(group, { suffix: 'Requests', honorName: true }) // plugin-cypress, plugin-mcp
|
|
520
|
+
* createGroupConfig(group, { suffix: 'Controller' }) // plugin-ts, plugin-client, …
|
|
521
|
+
* createGroupConfig(group, { suffix: 'Requests' }) // plugin-cypress, plugin-mcp
|
|
522
522
|
* ```
|
|
523
523
|
*/
|
|
524
524
|
function createGroupConfig(group, options) {
|
|
@@ -529,7 +529,7 @@ function createGroupConfig(group, options) {
|
|
|
529
529
|
};
|
|
530
530
|
return {
|
|
531
531
|
...group,
|
|
532
|
-
name:
|
|
532
|
+
name: group.name ? group.name : defaultName
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
535
|
//#endregion
|
|
@@ -1958,10 +1958,7 @@ const pluginClient = definePlugin((options) => {
|
|
|
1958
1958
|
group && clientType === "function" ? groupedClientGenerator : null,
|
|
1959
1959
|
operations ? operationsGenerator : null
|
|
1960
1960
|
].filter((x) => Boolean(x));
|
|
1961
|
-
const groupConfig = createGroupConfig(group, {
|
|
1962
|
-
suffix: "Controller",
|
|
1963
|
-
honorName: true
|
|
1964
|
-
});
|
|
1961
|
+
const groupConfig = createGroupConfig(group, { suffix: "Controller" });
|
|
1965
1962
|
return {
|
|
1966
1963
|
name: pluginClientName,
|
|
1967
1964
|
options,
|