@kubb/plugin-client 5.0.0-alpha.1 → 5.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/StaticClassClient-By-aMAe4.cjs.map +1 -1
- package/dist/StaticClassClient-CCn9g9eF.js.map +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/{generators-DCnIY6RB.js → generators-BYUJaeZP.js} +43 -43
- package/dist/generators-BYUJaeZP.js.map +1 -0
- package/dist/{generators-Dmi0scNT.cjs → generators-DTxD9FDY.cjs} +42 -42
- package/dist/generators-DTxD9FDY.cjs.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.ts +59 -51
- package/dist/generators.js +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/{types-CdM4DK1M.d.ts → types-DBQdg-BV.d.ts} +3 -3
- package/package.json +10 -10
- package/src/generators/classClientGenerator.tsx +15 -15
- package/src/generators/clientGenerator.tsx +7 -7
- package/src/generators/groupedClientGenerator.tsx +6 -6
- package/src/generators/operationsGenerator.tsx +5 -5
- package/src/generators/staticClassClientGenerator.tsx +12 -12
- package/src/plugin.ts +4 -4
- package/dist/generators-DCnIY6RB.js.map +0 -1
- package/dist/generators-Dmi0scNT.cjs.map +0 -1
|
@@ -2,7 +2,7 @@ import "./chunk--u3MIqq1.js";
|
|
|
2
2
|
import { a as Url, i as Client, n as Operations, o as camelCase, r as ClassClient, s as pascalCase, t as StaticClassClient } from "./StaticClassClient-CCn9g9eF.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pluginZodName } from "@kubb/plugin-zod";
|
|
5
|
-
import {
|
|
5
|
+
import { usePluginDriver } from "@kubb/core/hooks";
|
|
6
6
|
import { createReactGenerator } from "@kubb/plugin-oas/generators";
|
|
7
7
|
import { useOas, useOperationManager } from "@kubb/plugin-oas/hooks";
|
|
8
8
|
import { getBanner, getFooter } from "@kubb/plugin-oas/utils";
|
|
@@ -30,22 +30,22 @@ ${classNames.map((className) => ` this.${camelCase(className)} = new ${classN
|
|
|
30
30
|
const classClientGenerator = createReactGenerator({
|
|
31
31
|
name: "classClient",
|
|
32
32
|
Operations({ operations, generator, plugin, config }) {
|
|
33
|
-
const { options,
|
|
34
|
-
const
|
|
33
|
+
const { options, name: pluginName } = plugin;
|
|
34
|
+
const driver = usePluginDriver();
|
|
35
35
|
const oas = useOas();
|
|
36
36
|
const { getName, getFile, getGroup, getSchemas } = useOperationManager(generator);
|
|
37
37
|
function buildOperationData(operation) {
|
|
38
38
|
const type = {
|
|
39
|
-
file: getFile(operation, {
|
|
39
|
+
file: getFile(operation, { pluginName: pluginTsName }),
|
|
40
40
|
schemas: getSchemas(operation, {
|
|
41
|
-
|
|
41
|
+
pluginName: pluginTsName,
|
|
42
42
|
type: "type"
|
|
43
43
|
})
|
|
44
44
|
};
|
|
45
45
|
const zod = {
|
|
46
|
-
file: getFile(operation, {
|
|
46
|
+
file: getFile(operation, { pluginName: pluginZodName }),
|
|
47
47
|
schemas: getSchemas(operation, {
|
|
48
|
-
|
|
48
|
+
pluginName: pluginZodName,
|
|
49
49
|
type: "function"
|
|
50
50
|
})
|
|
51
51
|
};
|
|
@@ -63,10 +63,10 @@ const classClientGenerator = createReactGenerator({
|
|
|
63
63
|
const groupName = group?.tag ? options.group?.name?.({ group: camelCase(group.tag) }) ?? pascalCase(group.tag) : "Client";
|
|
64
64
|
if (!group?.tag && !options.group) {
|
|
65
65
|
const name = "ApiClient";
|
|
66
|
-
const file =
|
|
66
|
+
const file = driver.getFile({
|
|
67
67
|
name,
|
|
68
68
|
extname: ".ts",
|
|
69
|
-
|
|
69
|
+
pluginName
|
|
70
70
|
});
|
|
71
71
|
const operationData = buildOperationData(operation);
|
|
72
72
|
const previousFile = acc.find((item) => item.file.path === file.path);
|
|
@@ -78,10 +78,10 @@ const classClientGenerator = createReactGenerator({
|
|
|
78
78
|
});
|
|
79
79
|
} else if (group?.tag) {
|
|
80
80
|
const name = groupName;
|
|
81
|
-
const file =
|
|
81
|
+
const file = driver.getFile({
|
|
82
82
|
name,
|
|
83
83
|
extname: ".ts",
|
|
84
|
-
|
|
84
|
+
pluginName,
|
|
85
85
|
options: { group }
|
|
86
86
|
});
|
|
87
87
|
const operationData = buildOperationData(operation);
|
|
@@ -147,7 +147,7 @@ const classClientGenerator = createReactGenerator({
|
|
|
147
147
|
banner: getBanner({
|
|
148
148
|
oas,
|
|
149
149
|
output: options.output,
|
|
150
|
-
config:
|
|
150
|
+
config: driver.config
|
|
151
151
|
}),
|
|
152
152
|
footer: getFooter({
|
|
153
153
|
oas,
|
|
@@ -236,10 +236,10 @@ const classClientGenerator = createReactGenerator({
|
|
|
236
236
|
}, file.path);
|
|
237
237
|
});
|
|
238
238
|
if (options.wrapper) {
|
|
239
|
-
const wrapperFile =
|
|
239
|
+
const wrapperFile = driver.getFile({
|
|
240
240
|
name: options.wrapper.className,
|
|
241
241
|
extname: ".ts",
|
|
242
|
-
|
|
242
|
+
pluginName
|
|
243
243
|
});
|
|
244
244
|
files.push(/* @__PURE__ */ jsxs(File, {
|
|
245
245
|
baseName: wrapperFile.baseName,
|
|
@@ -248,7 +248,7 @@ const classClientGenerator = createReactGenerator({
|
|
|
248
248
|
banner: getBanner({
|
|
249
249
|
oas,
|
|
250
250
|
output: options.output,
|
|
251
|
-
config:
|
|
251
|
+
config: driver.config
|
|
252
252
|
}),
|
|
253
253
|
footer: getFooter({
|
|
254
254
|
oas,
|
|
@@ -285,7 +285,7 @@ const classClientGenerator = createReactGenerator({
|
|
|
285
285
|
const clientGenerator = createReactGenerator({
|
|
286
286
|
name: "client",
|
|
287
287
|
Operation({ config, plugin, operation, generator }) {
|
|
288
|
-
const
|
|
288
|
+
const driver = usePluginDriver();
|
|
289
289
|
const { options, options: { output, urlType } } = plugin;
|
|
290
290
|
const oas = useOas();
|
|
291
291
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
@@ -302,16 +302,16 @@ const clientGenerator = createReactGenerator({
|
|
|
302
302
|
file: getFile(operation)
|
|
303
303
|
};
|
|
304
304
|
const type = {
|
|
305
|
-
file: getFile(operation, {
|
|
305
|
+
file: getFile(operation, { pluginName: pluginTsName }),
|
|
306
306
|
schemas: getSchemas(operation, {
|
|
307
|
-
|
|
307
|
+
pluginName: pluginTsName,
|
|
308
308
|
type: "type"
|
|
309
309
|
})
|
|
310
310
|
};
|
|
311
311
|
const zod = {
|
|
312
|
-
file: getFile(operation, {
|
|
312
|
+
file: getFile(operation, { pluginName: pluginZodName }),
|
|
313
313
|
schemas: getSchemas(operation, {
|
|
314
|
-
|
|
314
|
+
pluginName: pluginZodName,
|
|
315
315
|
type: "function"
|
|
316
316
|
})
|
|
317
317
|
};
|
|
@@ -323,7 +323,7 @@ const clientGenerator = createReactGenerator({
|
|
|
323
323
|
banner: getBanner({
|
|
324
324
|
oas,
|
|
325
325
|
output,
|
|
326
|
-
config:
|
|
326
|
+
config: driver.config
|
|
327
327
|
}),
|
|
328
328
|
footer: getFooter({
|
|
329
329
|
oas,
|
|
@@ -411,8 +411,8 @@ const clientGenerator = createReactGenerator({
|
|
|
411
411
|
const groupedClientGenerator = createReactGenerator({
|
|
412
412
|
name: "groupedClient",
|
|
413
413
|
Operations({ operations, generator, plugin }) {
|
|
414
|
-
const { options,
|
|
415
|
-
const
|
|
414
|
+
const { options, name: pluginName } = plugin;
|
|
415
|
+
const driver = usePluginDriver();
|
|
416
416
|
const oas = useOas();
|
|
417
417
|
const { getName, getFile, getGroup } = useOperationManager(generator);
|
|
418
418
|
return operations.reduce((acc, operation) => {
|
|
@@ -420,10 +420,10 @@ const groupedClientGenerator = createReactGenerator({
|
|
|
420
420
|
const group = getGroup(operation);
|
|
421
421
|
const name = group?.tag ? options.group?.name?.({ group: camelCase(group.tag) }) : void 0;
|
|
422
422
|
if (!group?.tag || !name) return acc;
|
|
423
|
-
const file =
|
|
423
|
+
const file = driver.getFile({
|
|
424
424
|
name,
|
|
425
425
|
extname: ".ts",
|
|
426
|
-
|
|
426
|
+
pluginName,
|
|
427
427
|
options: { group }
|
|
428
428
|
});
|
|
429
429
|
const client = {
|
|
@@ -447,7 +447,7 @@ const groupedClientGenerator = createReactGenerator({
|
|
|
447
447
|
banner: getBanner({
|
|
448
448
|
oas,
|
|
449
449
|
output: options.output,
|
|
450
|
-
config:
|
|
450
|
+
config: driver.config
|
|
451
451
|
}),
|
|
452
452
|
footer: getFooter({
|
|
453
453
|
oas,
|
|
@@ -476,14 +476,14 @@ const groupedClientGenerator = createReactGenerator({
|
|
|
476
476
|
const operationsGenerator = createReactGenerator({
|
|
477
477
|
name: "client",
|
|
478
478
|
Operations({ operations, plugin }) {
|
|
479
|
-
const {
|
|
480
|
-
const
|
|
479
|
+
const { name: pluginName, options: { output } } = plugin;
|
|
480
|
+
const driver = usePluginDriver();
|
|
481
481
|
const oas = useOas();
|
|
482
482
|
const name = "operations";
|
|
483
|
-
const file =
|
|
483
|
+
const file = driver.getFile({
|
|
484
484
|
name,
|
|
485
485
|
extname: ".ts",
|
|
486
|
-
|
|
486
|
+
pluginName
|
|
487
487
|
});
|
|
488
488
|
return /* @__PURE__ */ jsx(File, {
|
|
489
489
|
baseName: file.baseName,
|
|
@@ -492,7 +492,7 @@ const operationsGenerator = createReactGenerator({
|
|
|
492
492
|
banner: getBanner({
|
|
493
493
|
oas,
|
|
494
494
|
output,
|
|
495
|
-
config:
|
|
495
|
+
config: driver.config
|
|
496
496
|
}),
|
|
497
497
|
footer: getFooter({
|
|
498
498
|
oas,
|
|
@@ -510,22 +510,22 @@ const operationsGenerator = createReactGenerator({
|
|
|
510
510
|
const staticClassClientGenerator = createReactGenerator({
|
|
511
511
|
name: "staticClassClient",
|
|
512
512
|
Operations({ operations, generator, plugin, config }) {
|
|
513
|
-
const { options,
|
|
514
|
-
const
|
|
513
|
+
const { options, name: pluginName } = plugin;
|
|
514
|
+
const driver = usePluginDriver();
|
|
515
515
|
const oas = useOas();
|
|
516
516
|
const { getName, getFile, getGroup, getSchemas } = useOperationManager(generator);
|
|
517
517
|
function buildOperationData(operation) {
|
|
518
518
|
const type = {
|
|
519
|
-
file: getFile(operation, {
|
|
519
|
+
file: getFile(operation, { pluginName: pluginTsName }),
|
|
520
520
|
schemas: getSchemas(operation, {
|
|
521
|
-
|
|
521
|
+
pluginName: pluginTsName,
|
|
522
522
|
type: "type"
|
|
523
523
|
})
|
|
524
524
|
};
|
|
525
525
|
const zod = {
|
|
526
|
-
file: getFile(operation, {
|
|
526
|
+
file: getFile(operation, { pluginName: pluginZodName }),
|
|
527
527
|
schemas: getSchemas(operation, {
|
|
528
|
-
|
|
528
|
+
pluginName: pluginZodName,
|
|
529
529
|
type: "function"
|
|
530
530
|
})
|
|
531
531
|
};
|
|
@@ -543,10 +543,10 @@ const staticClassClientGenerator = createReactGenerator({
|
|
|
543
543
|
const groupName = group?.tag ? options.group?.name?.({ group: camelCase(group.tag) }) ?? pascalCase(group.tag) : "Client";
|
|
544
544
|
if (!group?.tag && !options.group) {
|
|
545
545
|
const name = "ApiClient";
|
|
546
|
-
const file =
|
|
546
|
+
const file = driver.getFile({
|
|
547
547
|
name,
|
|
548
548
|
extname: ".ts",
|
|
549
|
-
|
|
549
|
+
pluginName
|
|
550
550
|
});
|
|
551
551
|
const operationData = buildOperationData(operation);
|
|
552
552
|
const previousFile = acc.find((item) => item.file.path === file.path);
|
|
@@ -558,10 +558,10 @@ const staticClassClientGenerator = createReactGenerator({
|
|
|
558
558
|
});
|
|
559
559
|
} else if (group?.tag) {
|
|
560
560
|
const name = groupName;
|
|
561
|
-
const file =
|
|
561
|
+
const file = driver.getFile({
|
|
562
562
|
name,
|
|
563
563
|
extname: ".ts",
|
|
564
|
-
|
|
564
|
+
pluginName,
|
|
565
565
|
options: { group }
|
|
566
566
|
});
|
|
567
567
|
const operationData = buildOperationData(operation);
|
|
@@ -627,7 +627,7 @@ const staticClassClientGenerator = createReactGenerator({
|
|
|
627
627
|
banner: getBanner({
|
|
628
628
|
oas,
|
|
629
629
|
output: options.output,
|
|
630
|
-
config:
|
|
630
|
+
config: driver.config
|
|
631
631
|
}),
|
|
632
632
|
footer: getFooter({
|
|
633
633
|
oas,
|
|
@@ -720,4 +720,4 @@ const staticClassClientGenerator = createReactGenerator({
|
|
|
720
720
|
//#endregion
|
|
721
721
|
export { classClientGenerator as a, clientGenerator as i, operationsGenerator as n, groupedClientGenerator as r, staticClassClientGenerator as t };
|
|
722
722
|
|
|
723
|
-
//# sourceMappingURL=generators-
|
|
723
|
+
//# sourceMappingURL=generators-BYUJaeZP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators-BYUJaeZP.js","names":[],"sources":["../src/components/WrapperClient.tsx","../src/generators/classClientGenerator.tsx","../src/generators/clientGenerator.tsx","../src/generators/groupedClientGenerator.tsx","../src/generators/operationsGenerator.tsx","../src/generators/staticClassClientGenerator.tsx"],"sourcesContent":["import { camelCase } from '@internals/utils'\nimport { File } from '@kubb/react-fabric'\nimport type { FabricReactNode } from '@kubb/react-fabric/types'\n\ntype Props = {\n name: string\n classNames: Array<string>\n isExportable?: boolean\n isIndexable?: boolean\n}\n\nexport function WrapperClient({ name, classNames, isExportable = true, isIndexable = true }: Props): FabricReactNode {\n const properties = classNames.map((className) => ` readonly ${camelCase(className)}: ${className}`).join('\\n')\n const assignments = classNames.map((className) => ` this.${camelCase(className)} = new ${className}(config)`).join('\\n')\n\n const classCode = `export class ${name} {\n${properties}\n\n constructor(config: Partial<RequestConfig> & { client?: Client } = {}) {\n${assignments}\n }\n}`\n\n return (\n <File.Source name={name} isExportable={isExportable} isIndexable={isIndexable}>\n {classCode}\n </File.Source>\n )\n}\n","import path from 'node:path'\nimport { camelCase, pascalCase } from '@internals/utils'\nimport { usePluginDriver } from '@kubb/core/hooks'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { ClassClient } from '../components/ClassClient'\nimport { WrapperClient } from '../components/WrapperClient'\nimport type { PluginClient } from '../types'\n\ntype OperationData = {\n operation: Operation\n name: string\n typeSchemas: OperationSchemas\n zodSchemas: OperationSchemas | undefined\n typeFile: KubbFile.File\n zodFile: KubbFile.File\n}\n\ntype Controller = {\n name: string\n file: KubbFile.File\n operations: Array<OperationData>\n}\n\nexport const classClientGenerator = createReactGenerator<PluginClient>({\n name: 'classClient',\n Operations({ operations, generator, plugin, config }) {\n const { options, name: pluginName } = plugin\n const driver = usePluginDriver()\n\n const oas = useOas()\n const { getName, getFile, getGroup, getSchemas } = useOperationManager(generator)\n\n function buildOperationData(operation: Operation): OperationData {\n const type = {\n file: getFile(operation, { pluginName: pluginTsName }),\n schemas: getSchemas(operation, { pluginName: pluginTsName, type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginName: pluginZodName }),\n schemas: getSchemas(operation, { pluginName: pluginZodName, type: 'function' }),\n }\n\n return {\n operation,\n name: getName(operation, { type: 'function' }),\n typeSchemas: type.schemas,\n zodSchemas: zod.schemas,\n typeFile: type.file,\n zodFile: zod.file,\n }\n }\n\n // Group operations by tag\n const controllers = operations.reduce(\n (acc, operation) => {\n const group = getGroup(operation)\n const groupName = group?.tag ? (options.group?.name?.({ group: camelCase(group.tag) }) ?? pascalCase(group.tag)) : 'Client'\n\n if (!group?.tag && !options.group) {\n // If no grouping, put all operations in a single class\n const name = 'ApiClient'\n const file = driver.getFile({\n name,\n extname: '.ts',\n pluginName,\n })\n\n const operationData = buildOperationData(operation)\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.operations.push(operationData)\n } else {\n acc.push({ name, file, operations: [operationData] })\n }\n } else if (group?.tag) {\n // Group by tag\n const name = groupName\n const file = driver.getFile({\n name,\n extname: '.ts',\n pluginName,\n options: { group },\n })\n\n const operationData = buildOperationData(operation)\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.operations.push(operationData)\n } else {\n acc.push({ name, file, operations: [operationData] })\n }\n }\n\n return acc\n },\n [] as Array<Controller>,\n )\n\n function collectTypeImports(ops: Array<OperationData>) {\n const typeImportsByFile = new Map<string, Set<string>>()\n const typeFilesByPath = new Map<string, KubbFile.File>()\n\n ops.forEach((op) => {\n const { typeSchemas, typeFile } = op\n\n if (!typeImportsByFile.has(typeFile.path)) {\n typeImportsByFile.set(typeFile.path, new Set())\n }\n const typeImports = typeImportsByFile.get(typeFile.path)!\n\n if (typeSchemas.request?.name) typeImports.add(typeSchemas.request.name)\n if (typeSchemas.response?.name) typeImports.add(typeSchemas.response.name)\n if (typeSchemas.pathParams?.name) typeImports.add(typeSchemas.pathParams.name)\n if (typeSchemas.queryParams?.name) typeImports.add(typeSchemas.queryParams.name)\n if (typeSchemas.headerParams?.name) typeImports.add(typeSchemas.headerParams.name)\n typeSchemas.statusCodes?.forEach((item) => {\n if (item?.name) typeImports.add(item.name)\n })\n typeFilesByPath.set(typeFile.path, typeFile)\n })\n\n return { typeImportsByFile, typeFilesByPath }\n }\n\n function collectZodImports(ops: Array<OperationData>) {\n const zodImportsByFile = new Map<string, Set<string>>()\n const zodFilesByPath = new Map<string, KubbFile.File>()\n\n ops.forEach((op) => {\n const { zodSchemas, zodFile } = op\n\n if (!zodImportsByFile.has(zodFile.path)) {\n zodImportsByFile.set(zodFile.path, new Set())\n }\n const zodImports = zodImportsByFile.get(zodFile.path)!\n\n if (zodSchemas?.response?.name) zodImports.add(zodSchemas.response.name)\n if (zodSchemas?.request?.name) zodImports.add(zodSchemas.request.name)\n zodFilesByPath.set(zodFile.path, zodFile)\n })\n\n return { zodImportsByFile, zodFilesByPath }\n }\n\n const files = controllers.map(({ name, file, operations: ops }) => {\n const { typeImportsByFile, typeFilesByPath } = collectTypeImports(ops)\n const { zodImportsByFile, zodFilesByPath } =\n options.parser === 'zod'\n ? collectZodImports(ops)\n : { zodImportsByFile: new Map<string, Set<string>>(), zodFilesByPath: new Map<string, KubbFile.File>() }\n const hasFormData = ops.some((op) => op.operation.getContentType() === 'multipart/form-data')\n\n return (\n <File\n key={file.path}\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: options.output, config: driver.config })}\n footer={getFooter({ oas, output: options.output })}\n >\n {options.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.importPath} />\n <File.Import name={['mergeConfig']} path={options.importPath} />\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={options.importPath} isTypeOnly />\n </>\n ) : (\n <>\n <File.Import name={['fetch']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import name={['mergeConfig']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n </>\n )}\n\n {hasFormData && <File.Import name={['buildFormData']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/config.ts')} />}\n\n {Array.from(typeImportsByFile.entries()).map(([filePath, imports]) => {\n const typeFile = typeFilesByPath.get(filePath)\n if (!typeFile) {\n return null\n }\n const importNames = Array.from(imports).filter(Boolean)\n if (importNames.length === 0) {\n return null\n }\n return <File.Import key={filePath} name={importNames} root={file.path} path={typeFile.path} isTypeOnly />\n })}\n\n {options.parser === 'zod' &&\n Array.from(zodImportsByFile.entries()).map(([filePath, imports]) => {\n const zodFile = zodFilesByPath.get(filePath)\n if (!zodFile) {\n return null\n }\n const importNames = Array.from(imports).filter(Boolean)\n if (importNames.length === 0) {\n return null\n }\n\n return <File.Import key={filePath} name={importNames} root={file.path} path={zodFile.path} />\n })}\n\n <ClassClient\n name={name}\n operations={ops}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n parser={options.parser}\n />\n </File>\n )\n })\n\n if (options.wrapper) {\n const wrapperFile = driver.getFile({\n name: options.wrapper.className,\n extname: '.ts',\n pluginName,\n })\n\n files.push(\n <File\n key={wrapperFile.path}\n baseName={wrapperFile.baseName}\n path={wrapperFile.path}\n meta={wrapperFile.meta}\n banner={getBanner({ oas, output: options.output, config: driver.config })}\n footer={getFooter({ oas, output: options.output })}\n >\n {options.importPath ? (\n <File.Import name={['Client', 'RequestConfig']} path={options.importPath} isTypeOnly />\n ) : (\n <File.Import\n name={['Client', 'RequestConfig']}\n root={wrapperFile.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n )}\n\n {controllers.map(({ name, file }) => (\n <File.Import key={name} name={[name]} root={wrapperFile.path} path={file.path} />\n ))}\n\n <WrapperClient name={options.wrapper.className} classNames={controllers.map(({ name }) => name)} />\n </File>,\n )\n }\n\n return files\n },\n})\n","import path from 'node:path'\nimport { usePluginDriver } from '@kubb/core/hooks'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { Client } from '../components/Client'\nimport { Url } from '../components/Url.tsx'\nimport type { PluginClient } from '../types'\n\nexport const clientGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operation({ config, plugin, operation, generator }) {\n const driver = usePluginDriver()\n const {\n options,\n options: { output, urlType },\n } = plugin\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const url = {\n name: getName(operation, { type: 'function', suffix: 'url', prefix: 'get' }),\n file: getFile(operation),\n }\n\n const type = {\n file: getFile(operation, { pluginName: pluginTsName }),\n schemas: getSchemas(operation, { pluginName: pluginTsName, type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginName: pluginZodName }),\n schemas: getSchemas(operation, { pluginName: pluginZodName, type: 'function' }),\n }\n\n const isFormData = operation.getContentType() === 'multipart/form-data'\n\n return (\n <File\n baseName={client.file.baseName}\n path={client.file.path}\n meta={client.file.meta}\n banner={getBanner({ oas, output, config: driver.config })}\n footer={getFooter({ oas, output })}\n >\n {options.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.importPath} />\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={options.importPath} isTypeOnly />\n </>\n ) : (\n <>\n <File.Import name={['fetch']} root={client.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={client.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n </>\n )}\n\n {isFormData && type.schemas.request?.name && (\n <File.Import name={['buildFormData']} root={client.file.path} path={path.resolve(config.root, config.output.path, '.kubb/config.ts')} />\n )}\n\n {options.parser === 'zod' && (\n <File.Import\n name={[zod.schemas.response.name, zod.schemas.request?.name].filter((x): x is string => Boolean(x))}\n root={client.file.path}\n path={zod.file.path}\n />\n )}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter((x): x is string => Boolean(x))}\n root={client.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <Url\n name={url.name}\n baseURL={options.baseURL}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n isIndexable={urlType === 'export'}\n isExportable={urlType === 'export'}\n />\n\n <Client\n name={client.name}\n urlName={url.name}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n parser={options.parser}\n zodSchemas={zod.schemas}\n />\n </File>\n )\n },\n})\n","import { camelCase } from '@internals/utils'\nimport { usePluginDriver } from '@kubb/core/hooks'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, Function } from '@kubb/react-fabric'\nimport type { PluginClient } from '../types'\n\nexport const groupedClientGenerator = createReactGenerator<PluginClient>({\n name: 'groupedClient',\n Operations({ operations, generator, plugin }) {\n const { options, name: pluginName } = plugin\n const driver = usePluginDriver()\n\n const oas = useOas()\n const { getName, getFile, getGroup } = useOperationManager(generator)\n\n const controllers = operations.reduce(\n (acc, operation) => {\n if (options.group?.type === 'tag') {\n const group = getGroup(operation)\n const name = group?.tag ? options.group?.name?.({ group: camelCase(group.tag) }) : undefined\n\n if (!group?.tag || !name) {\n return acc\n }\n\n const file = driver.getFile({\n name,\n extname: '.ts',\n pluginName,\n options: { group },\n })\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.clients.push(client)\n } else {\n acc.push({ name, file, clients: [client] })\n }\n }\n\n return acc\n },\n [] as Array<{ name: string; file: KubbFile.File; clients: Array<{ name: string; file: KubbFile.File }> }>,\n )\n\n return controllers.map(({ name, file, clients }) => {\n return (\n <File\n key={file.path}\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: options.output, config: driver.config })}\n footer={getFooter({ oas, output: options.output })}\n >\n {clients.map((client) => (\n <File.Import key={client.name} name={[client.name]} root={file.path} path={client.file.path} />\n ))}\n\n <File.Source name={name} isExportable isIndexable>\n <Function export name={name}>\n {`return { ${clients.map((client) => client.name).join(', ')} }`}\n </Function>\n </File.Source>\n </File>\n )\n })\n },\n})\n","import { usePluginDriver } from '@kubb/core/hooks'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File } from '@kubb/react-fabric'\nimport { Operations } from '../components/Operations'\nimport type { PluginClient } from '../types'\n\nexport const operationsGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operations({ operations, plugin }) {\n const {\n name: pluginName,\n options: { output },\n } = plugin\n const driver = usePluginDriver()\n\n const oas = useOas()\n\n const name = 'operations'\n const file = driver.getFile({ name, extname: '.ts', pluginName })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: driver.config })}\n footer={getFooter({ oas, output })}\n >\n <Operations name={name} operations={operations} />\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { camelCase, pascalCase } from '@internals/utils'\nimport { usePluginDriver } from '@kubb/core/hooks'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { StaticClassClient } from '../components/StaticClassClient'\nimport type { PluginClient } from '../types'\n\ntype OperationData = {\n operation: Operation\n name: string\n typeSchemas: OperationSchemas\n zodSchemas: OperationSchemas | undefined\n typeFile: KubbFile.File\n zodFile: KubbFile.File\n}\n\ntype Controller = {\n name: string\n file: KubbFile.File\n operations: Array<OperationData>\n}\n\nexport const staticClassClientGenerator = createReactGenerator<PluginClient>({\n name: 'staticClassClient',\n Operations({ operations, generator, plugin, config }) {\n const { options, name: pluginName } = plugin\n const driver = usePluginDriver()\n\n const oas = useOas()\n const { getName, getFile, getGroup, getSchemas } = useOperationManager(generator)\n\n function buildOperationData(operation: Operation): OperationData {\n const type = {\n file: getFile(operation, { pluginName: pluginTsName }),\n schemas: getSchemas(operation, { pluginName: pluginTsName, type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginName: pluginZodName }),\n schemas: getSchemas(operation, { pluginName: pluginZodName, type: 'function' }),\n }\n\n return {\n operation,\n name: getName(operation, { type: 'function' }),\n typeSchemas: type.schemas,\n zodSchemas: zod.schemas,\n typeFile: type.file,\n zodFile: zod.file,\n }\n }\n\n // Group operations by tag\n const controllers = operations.reduce(\n (acc, operation) => {\n const group = getGroup(operation)\n const groupName = group?.tag ? (options.group?.name?.({ group: camelCase(group.tag) }) ?? pascalCase(group.tag)) : 'Client'\n\n if (!group?.tag && !options.group) {\n // If no grouping, put all operations in a single class\n const name = 'ApiClient'\n const file = driver.getFile({\n name,\n extname: '.ts',\n pluginName,\n })\n\n const operationData = buildOperationData(operation)\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.operations.push(operationData)\n } else {\n acc.push({ name, file, operations: [operationData] })\n }\n } else if (group?.tag) {\n // Group by tag\n const name = groupName\n const file = driver.getFile({\n name,\n extname: '.ts',\n pluginName,\n options: { group },\n })\n\n const operationData = buildOperationData(operation)\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.operations.push(operationData)\n } else {\n acc.push({ name, file, operations: [operationData] })\n }\n }\n\n return acc\n },\n [] as Array<Controller>,\n )\n\n function collectTypeImports(ops: Array<OperationData>) {\n const typeImportsByFile = new Map<string, Set<string>>()\n const typeFilesByPath = new Map<string, KubbFile.File>()\n\n ops.forEach((op) => {\n const { typeSchemas, typeFile } = op\n\n if (!typeImportsByFile.has(typeFile.path)) {\n typeImportsByFile.set(typeFile.path, new Set())\n }\n const typeImports = typeImportsByFile.get(typeFile.path)!\n\n if (typeSchemas.request?.name) typeImports.add(typeSchemas.request.name)\n if (typeSchemas.response?.name) typeImports.add(typeSchemas.response.name)\n if (typeSchemas.pathParams?.name) typeImports.add(typeSchemas.pathParams.name)\n if (typeSchemas.queryParams?.name) typeImports.add(typeSchemas.queryParams.name)\n if (typeSchemas.headerParams?.name) typeImports.add(typeSchemas.headerParams.name)\n typeSchemas.statusCodes?.forEach((item) => {\n if (item?.name) typeImports.add(item.name)\n })\n typeFilesByPath.set(typeFile.path, typeFile)\n })\n\n return { typeImportsByFile, typeFilesByPath }\n }\n\n function collectZodImports(ops: Array<OperationData>) {\n const zodImportsByFile = new Map<string, Set<string>>()\n const zodFilesByPath = new Map<string, KubbFile.File>()\n\n ops.forEach((op) => {\n const { zodSchemas, zodFile } = op\n\n if (!zodImportsByFile.has(zodFile.path)) {\n zodImportsByFile.set(zodFile.path, new Set())\n }\n const zodImports = zodImportsByFile.get(zodFile.path)!\n\n if (zodSchemas?.response?.name) zodImports.add(zodSchemas.response.name)\n if (zodSchemas?.request?.name) zodImports.add(zodSchemas.request.name)\n zodFilesByPath.set(zodFile.path, zodFile)\n })\n\n return { zodImportsByFile, zodFilesByPath }\n }\n\n return controllers.map(({ name, file, operations: ops }) => {\n const { typeImportsByFile, typeFilesByPath } = collectTypeImports(ops)\n const { zodImportsByFile, zodFilesByPath } =\n options.parser === 'zod'\n ? collectZodImports(ops)\n : { zodImportsByFile: new Map<string, Set<string>>(), zodFilesByPath: new Map<string, KubbFile.File>() }\n const hasFormData = ops.some((op) => op.operation.getContentType() === 'multipart/form-data')\n\n return (\n <File\n key={file.path}\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: options.output, config: driver.config })}\n footer={getFooter({ oas, output: options.output })}\n >\n {options.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.importPath} />\n <File.Import name={['mergeConfig']} path={options.importPath} />\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={options.importPath} isTypeOnly />\n </>\n ) : (\n <>\n <File.Import name={['fetch']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import name={['mergeConfig']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n </>\n )}\n\n {hasFormData && <File.Import name={['buildFormData']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/config.ts')} />}\n\n {Array.from(typeImportsByFile.entries()).map(([filePath, imports]) => {\n const typeFile = typeFilesByPath.get(filePath)\n if (!typeFile) {\n return null\n }\n const importNames = Array.from(imports).filter(Boolean)\n if (importNames.length === 0) {\n return null\n }\n return <File.Import key={filePath} name={importNames} root={file.path} path={typeFile.path} isTypeOnly />\n })}\n\n {options.parser === 'zod' &&\n Array.from(zodImportsByFile.entries()).map(([filePath, imports]) => {\n const zodFile = zodFilesByPath.get(filePath)\n if (!zodFile) {\n return null\n }\n const importNames = Array.from(imports).filter(Boolean)\n if (importNames.length === 0) {\n return null\n }\n\n return <File.Import key={filePath} name={importNames} root={file.path} path={zodFile.path} />\n })}\n\n <StaticClassClient\n name={name}\n operations={ops}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n parser={options.parser}\n />\n </File>\n )\n })\n },\n})\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,cAAc,EAAE,MAAM,YAAY,eAAe,MAAM,cAAc,QAAg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;MAClE,MAAM,UAAU,eAAe,IAAI,SAAS;AAC5C,UAAI,CAAC,QACH,QAAO;MAET,MAAM,cAAc,MAAM,KAAK,QAAQ,CAAC,OAAO,QAAQ;AACvD,UAAI,YAAY,WAAW,EACzB,QAAO;AAGT,aAAO,oBAAC,KAAK,QAAN;OAA4B,MAAM;OAAa,MAAM,KAAK;OAAM,MAAM,QAAQ;OAAQ,EAApE,SAAoE;OAC7F;KAEJ,oBAAC,mBAAD;MACQ;MACN,YAAY;MACZ,SAAS,QAAQ;MACjB,gBAAgB,QAAQ;MACxB,gBAAgB,QAAQ;MACxB,cAAc,QAAQ;MACtB,YAAY,QAAQ;MACpB,QAAQ,QAAQ;MAChB,CAAA;KACG;MAhEA,KAAK,KAgEL;IAET;;CAEL,CAAC"}
|
|
@@ -31,22 +31,22 @@ ${classNames.map((className) => ` this.${require_StaticClassClient.camelCase(
|
|
|
31
31
|
const classClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
32
32
|
name: "classClient",
|
|
33
33
|
Operations({ operations, generator, plugin, config }) {
|
|
34
|
-
const { options,
|
|
35
|
-
const
|
|
34
|
+
const { options, name: pluginName } = plugin;
|
|
35
|
+
const driver = (0, _kubb_core_hooks.usePluginDriver)();
|
|
36
36
|
const oas = (0, _kubb_plugin_oas_hooks.useOas)();
|
|
37
37
|
const { getName, getFile, getGroup, getSchemas } = (0, _kubb_plugin_oas_hooks.useOperationManager)(generator);
|
|
38
38
|
function buildOperationData(operation) {
|
|
39
39
|
const type = {
|
|
40
|
-
file: getFile(operation, {
|
|
40
|
+
file: getFile(operation, { pluginName: _kubb_plugin_ts.pluginTsName }),
|
|
41
41
|
schemas: getSchemas(operation, {
|
|
42
|
-
|
|
42
|
+
pluginName: _kubb_plugin_ts.pluginTsName,
|
|
43
43
|
type: "type"
|
|
44
44
|
})
|
|
45
45
|
};
|
|
46
46
|
const zod = {
|
|
47
|
-
file: getFile(operation, {
|
|
47
|
+
file: getFile(operation, { pluginName: _kubb_plugin_zod.pluginZodName }),
|
|
48
48
|
schemas: getSchemas(operation, {
|
|
49
|
-
|
|
49
|
+
pluginName: _kubb_plugin_zod.pluginZodName,
|
|
50
50
|
type: "function"
|
|
51
51
|
})
|
|
52
52
|
};
|
|
@@ -64,10 +64,10 @@ const classClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
64
64
|
const groupName = group?.tag ? options.group?.name?.({ group: require_StaticClassClient.camelCase(group.tag) }) ?? require_StaticClassClient.pascalCase(group.tag) : "Client";
|
|
65
65
|
if (!group?.tag && !options.group) {
|
|
66
66
|
const name = "ApiClient";
|
|
67
|
-
const file =
|
|
67
|
+
const file = driver.getFile({
|
|
68
68
|
name,
|
|
69
69
|
extname: ".ts",
|
|
70
|
-
|
|
70
|
+
pluginName
|
|
71
71
|
});
|
|
72
72
|
const operationData = buildOperationData(operation);
|
|
73
73
|
const previousFile = acc.find((item) => item.file.path === file.path);
|
|
@@ -79,10 +79,10 @@ const classClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
79
79
|
});
|
|
80
80
|
} else if (group?.tag) {
|
|
81
81
|
const name = groupName;
|
|
82
|
-
const file =
|
|
82
|
+
const file = driver.getFile({
|
|
83
83
|
name,
|
|
84
84
|
extname: ".ts",
|
|
85
|
-
|
|
85
|
+
pluginName,
|
|
86
86
|
options: { group }
|
|
87
87
|
});
|
|
88
88
|
const operationData = buildOperationData(operation);
|
|
@@ -148,7 +148,7 @@ const classClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
148
148
|
banner: (0, _kubb_plugin_oas_utils.getBanner)({
|
|
149
149
|
oas,
|
|
150
150
|
output: options.output,
|
|
151
|
-
config:
|
|
151
|
+
config: driver.config
|
|
152
152
|
}),
|
|
153
153
|
footer: (0, _kubb_plugin_oas_utils.getFooter)({
|
|
154
154
|
oas,
|
|
@@ -237,10 +237,10 @@ const classClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
237
237
|
}, file.path);
|
|
238
238
|
});
|
|
239
239
|
if (options.wrapper) {
|
|
240
|
-
const wrapperFile =
|
|
240
|
+
const wrapperFile = driver.getFile({
|
|
241
241
|
name: options.wrapper.className,
|
|
242
242
|
extname: ".ts",
|
|
243
|
-
|
|
243
|
+
pluginName
|
|
244
244
|
});
|
|
245
245
|
files.push(/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric.File, {
|
|
246
246
|
baseName: wrapperFile.baseName,
|
|
@@ -249,7 +249,7 @@ const classClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
249
249
|
banner: (0, _kubb_plugin_oas_utils.getBanner)({
|
|
250
250
|
oas,
|
|
251
251
|
output: options.output,
|
|
252
|
-
config:
|
|
252
|
+
config: driver.config
|
|
253
253
|
}),
|
|
254
254
|
footer: (0, _kubb_plugin_oas_utils.getFooter)({
|
|
255
255
|
oas,
|
|
@@ -286,7 +286,7 @@ const classClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
286
286
|
const clientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
287
287
|
name: "client",
|
|
288
288
|
Operation({ config, plugin, operation, generator }) {
|
|
289
|
-
const
|
|
289
|
+
const driver = (0, _kubb_core_hooks.usePluginDriver)();
|
|
290
290
|
const { options, options: { output, urlType } } = plugin;
|
|
291
291
|
const oas = (0, _kubb_plugin_oas_hooks.useOas)();
|
|
292
292
|
const { getSchemas, getName, getFile } = (0, _kubb_plugin_oas_hooks.useOperationManager)(generator);
|
|
@@ -303,16 +303,16 @@ const clientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
303
303
|
file: getFile(operation)
|
|
304
304
|
};
|
|
305
305
|
const type = {
|
|
306
|
-
file: getFile(operation, {
|
|
306
|
+
file: getFile(operation, { pluginName: _kubb_plugin_ts.pluginTsName }),
|
|
307
307
|
schemas: getSchemas(operation, {
|
|
308
|
-
|
|
308
|
+
pluginName: _kubb_plugin_ts.pluginTsName,
|
|
309
309
|
type: "type"
|
|
310
310
|
})
|
|
311
311
|
};
|
|
312
312
|
const zod = {
|
|
313
|
-
file: getFile(operation, {
|
|
313
|
+
file: getFile(operation, { pluginName: _kubb_plugin_zod.pluginZodName }),
|
|
314
314
|
schemas: getSchemas(operation, {
|
|
315
|
-
|
|
315
|
+
pluginName: _kubb_plugin_zod.pluginZodName,
|
|
316
316
|
type: "function"
|
|
317
317
|
})
|
|
318
318
|
};
|
|
@@ -324,7 +324,7 @@ const clientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
324
324
|
banner: (0, _kubb_plugin_oas_utils.getBanner)({
|
|
325
325
|
oas,
|
|
326
326
|
output,
|
|
327
|
-
config:
|
|
327
|
+
config: driver.config
|
|
328
328
|
}),
|
|
329
329
|
footer: (0, _kubb_plugin_oas_utils.getFooter)({
|
|
330
330
|
oas,
|
|
@@ -412,8 +412,8 @@ const clientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
412
412
|
const groupedClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
413
413
|
name: "groupedClient",
|
|
414
414
|
Operations({ operations, generator, plugin }) {
|
|
415
|
-
const { options,
|
|
416
|
-
const
|
|
415
|
+
const { options, name: pluginName } = plugin;
|
|
416
|
+
const driver = (0, _kubb_core_hooks.usePluginDriver)();
|
|
417
417
|
const oas = (0, _kubb_plugin_oas_hooks.useOas)();
|
|
418
418
|
const { getName, getFile, getGroup } = (0, _kubb_plugin_oas_hooks.useOperationManager)(generator);
|
|
419
419
|
return operations.reduce((acc, operation) => {
|
|
@@ -421,10 +421,10 @@ const groupedClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
421
421
|
const group = getGroup(operation);
|
|
422
422
|
const name = group?.tag ? options.group?.name?.({ group: require_StaticClassClient.camelCase(group.tag) }) : void 0;
|
|
423
423
|
if (!group?.tag || !name) return acc;
|
|
424
|
-
const file =
|
|
424
|
+
const file = driver.getFile({
|
|
425
425
|
name,
|
|
426
426
|
extname: ".ts",
|
|
427
|
-
|
|
427
|
+
pluginName,
|
|
428
428
|
options: { group }
|
|
429
429
|
});
|
|
430
430
|
const client = {
|
|
@@ -448,7 +448,7 @@ const groupedClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
448
448
|
banner: (0, _kubb_plugin_oas_utils.getBanner)({
|
|
449
449
|
oas,
|
|
450
450
|
output: options.output,
|
|
451
|
-
config:
|
|
451
|
+
config: driver.config
|
|
452
452
|
}),
|
|
453
453
|
footer: (0, _kubb_plugin_oas_utils.getFooter)({
|
|
454
454
|
oas,
|
|
@@ -477,14 +477,14 @@ const groupedClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
477
477
|
const operationsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
478
478
|
name: "client",
|
|
479
479
|
Operations({ operations, plugin }) {
|
|
480
|
-
const {
|
|
481
|
-
const
|
|
480
|
+
const { name: pluginName, options: { output } } = plugin;
|
|
481
|
+
const driver = (0, _kubb_core_hooks.usePluginDriver)();
|
|
482
482
|
const oas = (0, _kubb_plugin_oas_hooks.useOas)();
|
|
483
483
|
const name = "operations";
|
|
484
|
-
const file =
|
|
484
|
+
const file = driver.getFile({
|
|
485
485
|
name,
|
|
486
486
|
extname: ".ts",
|
|
487
|
-
|
|
487
|
+
pluginName
|
|
488
488
|
});
|
|
489
489
|
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File, {
|
|
490
490
|
baseName: file.baseName,
|
|
@@ -493,7 +493,7 @@ const operationsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator
|
|
|
493
493
|
banner: (0, _kubb_plugin_oas_utils.getBanner)({
|
|
494
494
|
oas,
|
|
495
495
|
output,
|
|
496
|
-
config:
|
|
496
|
+
config: driver.config
|
|
497
497
|
}),
|
|
498
498
|
footer: (0, _kubb_plugin_oas_utils.getFooter)({
|
|
499
499
|
oas,
|
|
@@ -511,22 +511,22 @@ const operationsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator
|
|
|
511
511
|
const staticClassClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
512
512
|
name: "staticClassClient",
|
|
513
513
|
Operations({ operations, generator, plugin, config }) {
|
|
514
|
-
const { options,
|
|
515
|
-
const
|
|
514
|
+
const { options, name: pluginName } = plugin;
|
|
515
|
+
const driver = (0, _kubb_core_hooks.usePluginDriver)();
|
|
516
516
|
const oas = (0, _kubb_plugin_oas_hooks.useOas)();
|
|
517
517
|
const { getName, getFile, getGroup, getSchemas } = (0, _kubb_plugin_oas_hooks.useOperationManager)(generator);
|
|
518
518
|
function buildOperationData(operation) {
|
|
519
519
|
const type = {
|
|
520
|
-
file: getFile(operation, {
|
|
520
|
+
file: getFile(operation, { pluginName: _kubb_plugin_ts.pluginTsName }),
|
|
521
521
|
schemas: getSchemas(operation, {
|
|
522
|
-
|
|
522
|
+
pluginName: _kubb_plugin_ts.pluginTsName,
|
|
523
523
|
type: "type"
|
|
524
524
|
})
|
|
525
525
|
};
|
|
526
526
|
const zod = {
|
|
527
|
-
file: getFile(operation, {
|
|
527
|
+
file: getFile(operation, { pluginName: _kubb_plugin_zod.pluginZodName }),
|
|
528
528
|
schemas: getSchemas(operation, {
|
|
529
|
-
|
|
529
|
+
pluginName: _kubb_plugin_zod.pluginZodName,
|
|
530
530
|
type: "function"
|
|
531
531
|
})
|
|
532
532
|
};
|
|
@@ -544,10 +544,10 @@ const staticClassClientGenerator = (0, _kubb_plugin_oas_generators.createReactGe
|
|
|
544
544
|
const groupName = group?.tag ? options.group?.name?.({ group: require_StaticClassClient.camelCase(group.tag) }) ?? require_StaticClassClient.pascalCase(group.tag) : "Client";
|
|
545
545
|
if (!group?.tag && !options.group) {
|
|
546
546
|
const name = "ApiClient";
|
|
547
|
-
const file =
|
|
547
|
+
const file = driver.getFile({
|
|
548
548
|
name,
|
|
549
549
|
extname: ".ts",
|
|
550
|
-
|
|
550
|
+
pluginName
|
|
551
551
|
});
|
|
552
552
|
const operationData = buildOperationData(operation);
|
|
553
553
|
const previousFile = acc.find((item) => item.file.path === file.path);
|
|
@@ -559,10 +559,10 @@ const staticClassClientGenerator = (0, _kubb_plugin_oas_generators.createReactGe
|
|
|
559
559
|
});
|
|
560
560
|
} else if (group?.tag) {
|
|
561
561
|
const name = groupName;
|
|
562
|
-
const file =
|
|
562
|
+
const file = driver.getFile({
|
|
563
563
|
name,
|
|
564
564
|
extname: ".ts",
|
|
565
|
-
|
|
565
|
+
pluginName,
|
|
566
566
|
options: { group }
|
|
567
567
|
});
|
|
568
568
|
const operationData = buildOperationData(operation);
|
|
@@ -628,7 +628,7 @@ const staticClassClientGenerator = (0, _kubb_plugin_oas_generators.createReactGe
|
|
|
628
628
|
banner: (0, _kubb_plugin_oas_utils.getBanner)({
|
|
629
629
|
oas,
|
|
630
630
|
output: options.output,
|
|
631
|
-
config:
|
|
631
|
+
config: driver.config
|
|
632
632
|
}),
|
|
633
633
|
footer: (0, _kubb_plugin_oas_utils.getFooter)({
|
|
634
634
|
oas,
|
|
@@ -750,4 +750,4 @@ Object.defineProperty(exports, "staticClassClientGenerator", {
|
|
|
750
750
|
}
|
|
751
751
|
});
|
|
752
752
|
|
|
753
|
-
//# sourceMappingURL=generators-
|
|
753
|
+
//# sourceMappingURL=generators-DTxD9FDY.cjs.map
|