@kubb/plugin-client 4.17.0 → 4.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Operations-DZrmy4LE.cjs → StaticClassClient-Doy7nyLp.cjs} +140 -20
- package/dist/StaticClassClient-Doy7nyLp.cjs.map +1 -0
- package/dist/{Operations-CKIsAPFo.js → StaticClassClient-yRrX6THy.js} +136 -21
- package/dist/StaticClassClient-yRrX6THy.js.map +1 -0
- package/dist/{chunk-CbDLau6x.cjs → chunk-C1_xRkKa.cjs} +10 -0
- package/dist/chunk-iVr_oF3V.js +9 -0
- package/dist/clients/axios.cjs +1 -1
- package/dist/clients/axios.cjs.map +1 -1
- package/dist/clients/axios.d.cts +1 -0
- package/dist/clients/axios.d.ts +1 -0
- package/dist/clients/axios.js +1 -0
- package/dist/clients/axios.js.map +1 -1
- package/dist/clients/fetch.cjs +1 -0
- package/dist/clients/fetch.cjs.map +1 -1
- package/dist/clients/fetch.d.cts +2 -0
- package/dist/clients/fetch.d.ts +2 -0
- package/dist/clients/fetch.js +2 -0
- package/dist/clients/fetch.js.map +1 -1
- package/dist/components.cjs +6 -5
- package/dist/components.d.cts +55 -6
- package/dist/components.d.ts +55 -6
- package/dist/components.js +2 -2
- package/dist/{generators-DLZfbw6J.cjs → generators-BPQFq13R.cjs} +203 -7
- package/dist/generators-BPQFq13R.cjs.map +1 -0
- package/dist/{generators-B0pg5PUA.js → generators-CtXa-3Fh.js} +194 -3
- package/dist/generators-CtXa-3Fh.js.map +1 -0
- package/dist/generators.cjs +3 -2
- package/dist/generators.d.cts +6 -2
- package/dist/generators.d.ts +6 -2
- package/dist/generators.js +2 -2
- package/dist/index.cjs +10 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/{types-Bw1u7Glb.d.ts → types-Chp-emXk.d.cts} +5 -3
- package/dist/{types-CLOc9nuD.d.cts → types-aqsuGVmg.d.ts} +5 -3
- package/package.json +8 -8
- package/src/components/Client.tsx +33 -29
- package/src/components/StaticClassClient.tsx +224 -0
- package/src/components/Url.tsx +2 -2
- package/src/components/index.ts +1 -0
- package/src/generators/__snapshots__/static/Pet.ts +186 -0
- package/src/generators/__snapshots__/static/Store.ts +105 -0
- package/src/generators/__snapshots__/static/User.ts +143 -0
- package/src/generators/index.ts +1 -0
- package/src/generators/staticClassClientGenerator.tsx +231 -0
- package/src/plugin.ts +8 -2
- package/src/types.ts +2 -1
- package/dist/Operations-CKIsAPFo.js.map +0 -1
- package/dist/Operations-DZrmy4LE.cjs.map +0 -1
- package/dist/generators-B0pg5PUA.js.map +0 -1
- package/dist/generators-DLZfbw6J.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-
|
|
2
|
-
const
|
|
1
|
+
const require_chunk = require('./chunk-C1_xRkKa.cjs');
|
|
2
|
+
const require_StaticClassClient = require('./StaticClassClient-Doy7nyLp.cjs');
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
node_path = require_chunk.__toESM(node_path);
|
|
5
5
|
let _kubb_core_transformers = require("@kubb/core/transformers");
|
|
@@ -185,7 +185,7 @@ const classClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
185
185
|
path: zodFile.path
|
|
186
186
|
}, filePath);
|
|
187
187
|
}),
|
|
188
|
-
/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(
|
|
188
|
+
/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(require_StaticClassClient.ClassClient, {
|
|
189
189
|
name,
|
|
190
190
|
operations: ops,
|
|
191
191
|
baseURL: options.baseURL,
|
|
@@ -291,7 +291,7 @@ const clientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
291
291
|
path: type.file.path,
|
|
292
292
|
isTypeOnly: true
|
|
293
293
|
}),
|
|
294
|
-
/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(
|
|
294
|
+
/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(require_StaticClassClient.Url, {
|
|
295
295
|
name: url.name,
|
|
296
296
|
baseURL: options.baseURL,
|
|
297
297
|
pathParamsType: options.pathParamsType,
|
|
@@ -302,7 +302,7 @@ const clientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
302
302
|
isIndexable: urlType === "export",
|
|
303
303
|
isExportable: urlType === "export"
|
|
304
304
|
}),
|
|
305
|
-
/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(
|
|
305
|
+
/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(require_StaticClassClient.Client, {
|
|
306
306
|
name: client.name,
|
|
307
307
|
urlName: url.name,
|
|
308
308
|
baseURL: options.baseURL,
|
|
@@ -413,7 +413,7 @@ const operationsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator
|
|
|
413
413
|
oas,
|
|
414
414
|
output
|
|
415
415
|
}),
|
|
416
|
-
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(
|
|
416
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(require_StaticClassClient.Operations, {
|
|
417
417
|
name,
|
|
418
418
|
operations
|
|
419
419
|
})
|
|
@@ -421,6 +421,196 @@ const operationsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator
|
|
|
421
421
|
}
|
|
422
422
|
});
|
|
423
423
|
|
|
424
|
+
//#endregion
|
|
425
|
+
//#region src/generators/staticClassClientGenerator.tsx
|
|
426
|
+
const staticClassClientGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
427
|
+
name: "staticClassClient",
|
|
428
|
+
Operations({ operations, generator, plugin, config }) {
|
|
429
|
+
const { options, key: pluginKey } = plugin;
|
|
430
|
+
const pluginManager = (0, _kubb_core_hooks.usePluginManager)();
|
|
431
|
+
const oas = (0, _kubb_plugin_oas_hooks.useOas)();
|
|
432
|
+
const { getName, getFile, getGroup, getSchemas } = (0, _kubb_plugin_oas_hooks.useOperationManager)(generator);
|
|
433
|
+
function buildOperationData(operation) {
|
|
434
|
+
const type = {
|
|
435
|
+
file: getFile(operation, { pluginKey: [_kubb_plugin_ts.pluginTsName] }),
|
|
436
|
+
schemas: getSchemas(operation, {
|
|
437
|
+
pluginKey: [_kubb_plugin_ts.pluginTsName],
|
|
438
|
+
type: "type"
|
|
439
|
+
})
|
|
440
|
+
};
|
|
441
|
+
const zod = {
|
|
442
|
+
file: getFile(operation, { pluginKey: [_kubb_plugin_zod.pluginZodName] }),
|
|
443
|
+
schemas: getSchemas(operation, {
|
|
444
|
+
pluginKey: [_kubb_plugin_zod.pluginZodName],
|
|
445
|
+
type: "function"
|
|
446
|
+
})
|
|
447
|
+
};
|
|
448
|
+
return {
|
|
449
|
+
operation,
|
|
450
|
+
name: getName(operation, { type: "function" }),
|
|
451
|
+
typeSchemas: type.schemas,
|
|
452
|
+
zodSchemas: zod.schemas,
|
|
453
|
+
typeFile: type.file,
|
|
454
|
+
zodFile: zod.file
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
const controllers = operations.reduce((acc, operation) => {
|
|
458
|
+
const group = getGroup(operation);
|
|
459
|
+
const groupName = group?.tag ? options.group?.name?.({ group: (0, _kubb_core_transformers.camelCase)(group.tag) }) ?? (0, _kubb_core_transformers.pascalCase)(group.tag) : "Client";
|
|
460
|
+
if (!group?.tag && !options.group) {
|
|
461
|
+
const name = "ApiClient";
|
|
462
|
+
const file = pluginManager.getFile({
|
|
463
|
+
name,
|
|
464
|
+
extname: ".ts",
|
|
465
|
+
pluginKey
|
|
466
|
+
});
|
|
467
|
+
const operationData = buildOperationData(operation);
|
|
468
|
+
const previousFile = acc.find((item) => item.file.path === file.path);
|
|
469
|
+
if (previousFile) previousFile.operations.push(operationData);
|
|
470
|
+
else acc.push({
|
|
471
|
+
name,
|
|
472
|
+
file,
|
|
473
|
+
operations: [operationData]
|
|
474
|
+
});
|
|
475
|
+
} else if (group?.tag) {
|
|
476
|
+
const name = groupName;
|
|
477
|
+
const file = pluginManager.getFile({
|
|
478
|
+
name,
|
|
479
|
+
extname: ".ts",
|
|
480
|
+
pluginKey,
|
|
481
|
+
options: { group }
|
|
482
|
+
});
|
|
483
|
+
const operationData = buildOperationData(operation);
|
|
484
|
+
const previousFile = acc.find((item) => item.file.path === file.path);
|
|
485
|
+
if (previousFile) previousFile.operations.push(operationData);
|
|
486
|
+
else acc.push({
|
|
487
|
+
name,
|
|
488
|
+
file,
|
|
489
|
+
operations: [operationData]
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
return acc;
|
|
493
|
+
}, []);
|
|
494
|
+
function collectTypeImports(ops) {
|
|
495
|
+
const typeImportsByFile = /* @__PURE__ */ new Map();
|
|
496
|
+
const typeFilesByPath = /* @__PURE__ */ new Map();
|
|
497
|
+
ops.forEach((op) => {
|
|
498
|
+
const { typeSchemas, typeFile } = op;
|
|
499
|
+
if (!typeImportsByFile.has(typeFile.path)) typeImportsByFile.set(typeFile.path, /* @__PURE__ */ new Set());
|
|
500
|
+
const typeImports = typeImportsByFile.get(typeFile.path);
|
|
501
|
+
if (typeSchemas.request?.name) typeImports.add(typeSchemas.request.name);
|
|
502
|
+
if (typeSchemas.response?.name) typeImports.add(typeSchemas.response.name);
|
|
503
|
+
if (typeSchemas.pathParams?.name) typeImports.add(typeSchemas.pathParams.name);
|
|
504
|
+
if (typeSchemas.queryParams?.name) typeImports.add(typeSchemas.queryParams.name);
|
|
505
|
+
if (typeSchemas.headerParams?.name) typeImports.add(typeSchemas.headerParams.name);
|
|
506
|
+
typeSchemas.statusCodes?.forEach((item) => {
|
|
507
|
+
if (item?.name) typeImports.add(item.name);
|
|
508
|
+
});
|
|
509
|
+
typeFilesByPath.set(typeFile.path, typeFile);
|
|
510
|
+
});
|
|
511
|
+
return {
|
|
512
|
+
typeImportsByFile,
|
|
513
|
+
typeFilesByPath
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
function collectZodImports(ops) {
|
|
517
|
+
const zodImportsByFile = /* @__PURE__ */ new Map();
|
|
518
|
+
const zodFilesByPath = /* @__PURE__ */ new Map();
|
|
519
|
+
ops.forEach((op) => {
|
|
520
|
+
const { zodSchemas, zodFile } = op;
|
|
521
|
+
if (!zodImportsByFile.has(zodFile.path)) zodImportsByFile.set(zodFile.path, /* @__PURE__ */ new Set());
|
|
522
|
+
const zodImports = zodImportsByFile.get(zodFile.path);
|
|
523
|
+
if (zodSchemas?.response?.name) zodImports.add(zodSchemas.response.name);
|
|
524
|
+
if (zodSchemas?.request?.name) zodImports.add(zodSchemas.request.name);
|
|
525
|
+
zodFilesByPath.set(zodFile.path, zodFile);
|
|
526
|
+
});
|
|
527
|
+
return {
|
|
528
|
+
zodImportsByFile,
|
|
529
|
+
zodFilesByPath
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
return controllers.map(({ name, file, operations: ops }) => {
|
|
533
|
+
const { typeImportsByFile, typeFilesByPath } = collectTypeImports(ops);
|
|
534
|
+
const { zodImportsByFile, zodFilesByPath } = options.parser === "zod" ? collectZodImports(ops) : {
|
|
535
|
+
zodImportsByFile: /* @__PURE__ */ new Map(),
|
|
536
|
+
zodFilesByPath: /* @__PURE__ */ new Map()
|
|
537
|
+
};
|
|
538
|
+
const hasFormData = ops.some((op) => op.operation.getContentType() === "multipart/form-data");
|
|
539
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric.File, {
|
|
540
|
+
baseName: file.baseName,
|
|
541
|
+
path: file.path,
|
|
542
|
+
meta: file.meta,
|
|
543
|
+
banner: (0, _kubb_plugin_oas_utils.getBanner)({
|
|
544
|
+
oas,
|
|
545
|
+
output: options.output,
|
|
546
|
+
config: pluginManager.config
|
|
547
|
+
}),
|
|
548
|
+
footer: (0, _kubb_plugin_oas_utils.getFooter)({
|
|
549
|
+
oas,
|
|
550
|
+
output: options.output
|
|
551
|
+
}),
|
|
552
|
+
children: [
|
|
553
|
+
options.importPath ? /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
|
|
554
|
+
name: "fetch",
|
|
555
|
+
path: options.importPath
|
|
556
|
+
}), /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
|
|
557
|
+
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
558
|
+
path: options.importPath,
|
|
559
|
+
isTypeOnly: true
|
|
560
|
+
})] }) : /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
|
|
561
|
+
name: ["fetch"],
|
|
562
|
+
root: file.path,
|
|
563
|
+
path: node_path.default.resolve(config.root, config.output.path, ".kubb/fetch.ts")
|
|
564
|
+
}), /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
|
|
565
|
+
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
566
|
+
root: file.path,
|
|
567
|
+
path: node_path.default.resolve(config.root, config.output.path, ".kubb/fetch.ts"),
|
|
568
|
+
isTypeOnly: true
|
|
569
|
+
})] }),
|
|
570
|
+
hasFormData && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
|
|
571
|
+
name: ["buildFormData"],
|
|
572
|
+
root: file.path,
|
|
573
|
+
path: node_path.default.resolve(config.root, config.output.path, ".kubb/config.ts")
|
|
574
|
+
}),
|
|
575
|
+
Array.from(typeImportsByFile.entries()).map(([filePath, imports]) => {
|
|
576
|
+
const typeFile = typeFilesByPath.get(filePath);
|
|
577
|
+
if (!typeFile) return null;
|
|
578
|
+
const importNames = Array.from(imports).filter(Boolean);
|
|
579
|
+
if (importNames.length === 0) return null;
|
|
580
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
|
|
581
|
+
name: importNames,
|
|
582
|
+
root: file.path,
|
|
583
|
+
path: typeFile.path,
|
|
584
|
+
isTypeOnly: true
|
|
585
|
+
}, filePath);
|
|
586
|
+
}),
|
|
587
|
+
options.parser === "zod" && Array.from(zodImportsByFile.entries()).map(([filePath, imports]) => {
|
|
588
|
+
const zodFile = zodFilesByPath.get(filePath);
|
|
589
|
+
if (!zodFile) return null;
|
|
590
|
+
const importNames = Array.from(imports).filter(Boolean);
|
|
591
|
+
if (importNames.length === 0) return null;
|
|
592
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
|
|
593
|
+
name: importNames,
|
|
594
|
+
root: file.path,
|
|
595
|
+
path: zodFile.path
|
|
596
|
+
}, filePath);
|
|
597
|
+
}),
|
|
598
|
+
/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(require_StaticClassClient.StaticClassClient, {
|
|
599
|
+
name,
|
|
600
|
+
operations: ops,
|
|
601
|
+
baseURL: options.baseURL,
|
|
602
|
+
dataReturnType: options.dataReturnType,
|
|
603
|
+
pathParamsType: options.pathParamsType,
|
|
604
|
+
paramsCasing: options.paramsCasing,
|
|
605
|
+
paramsType: options.paramsType,
|
|
606
|
+
parser: options.parser
|
|
607
|
+
})
|
|
608
|
+
]
|
|
609
|
+
}, file.path);
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
|
|
424
614
|
//#endregion
|
|
425
615
|
Object.defineProperty(exports, 'classClientGenerator', {
|
|
426
616
|
enumerable: true,
|
|
@@ -446,4 +636,10 @@ Object.defineProperty(exports, 'operationsGenerator', {
|
|
|
446
636
|
return operationsGenerator;
|
|
447
637
|
}
|
|
448
638
|
});
|
|
449
|
-
|
|
639
|
+
Object.defineProperty(exports, 'staticClassClientGenerator', {
|
|
640
|
+
enumerable: true,
|
|
641
|
+
get: function () {
|
|
642
|
+
return staticClassClientGenerator;
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
//# sourceMappingURL=generators-BPQFq13R.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators-BPQFq13R.cjs","names":["pluginTsName","pluginZodName","File","path","ClassClient","pluginTsName","pluginZodName","File","path","Url","Client","File","Function","File","Operations","pluginTsName","pluginZodName","File","path","StaticClassClient"],"sources":["../src/generators/classClientGenerator.tsx","../src/generators/clientGenerator.tsx","../src/generators/groupedClientGenerator.tsx","../src/generators/operationsGenerator.tsx","../src/generators/staticClassClientGenerator.tsx"],"sourcesContent":["import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\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 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, key: pluginKey } = plugin\n const pluginManager = usePluginManager()\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, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [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 = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\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 = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\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: pluginManager.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={['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\n name={['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})\n","import path from 'node:path'\nimport { usePluginManager } 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 pluginManager = usePluginManager()\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, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [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: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.importPath} />\n <File.Import name={['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={['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 name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={client.file.path} path={zod.file.path} />\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(Boolean)}\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 { usePluginManager } from '@kubb/core/hooks'\nimport { camelCase } from '@kubb/core/transformers'\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, key: pluginKey } = plugin\n const pluginManager = usePluginManager()\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 = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\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: pluginManager.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 { usePluginManager } 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 key: pluginKey,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n\n const name = 'operations'\n const file = pluginManager.getFile({ name, extname: '.ts', pluginKey })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: pluginManager.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 { usePluginManager } from '@kubb/core/hooks'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\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, key: pluginKey } = plugin\n const pluginManager = usePluginManager()\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, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [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 = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\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 = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\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: pluginManager.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={['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\n name={['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":";;;;;;;;;;;;;;;AA8BA,MAAa,6EAA0D;CACrE,MAAM;CACN,WAAW,EAAE,YAAY,WAAW,QAAQ,UAAU;EACpD,MA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AM,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,wDAACA,wBAAK;OAAsB,MAAM;OAAa,MAAM,KAAK;OAAM,MAAM,QAAQ;SAA5D,SAAoE;OAC7F;KAEJ,wDAACE;MACO;MACN,YAAY;MACZ,SAAS,QAAQ;MACjB,gBAAgB,QAAQ;MACxB,gBAAgB,QAAQ;MACxB,cAAc,QAAQ;MACtB,YAAY,QAAQ;MACpB,QAAQ,QAAQ;OAChB;;MA7DG,KAAK,KA8DL;IAET;;CAEL,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as __name } from "./chunk-iVr_oF3V.js";
|
|
2
|
+
import { a as Url, i as Client, n as Operations, r as ClassClient, t as StaticClassClient } from "./StaticClassClient-yRrX6THy.js";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { camelCase, pascalCase } from "@kubb/core/transformers";
|
|
4
5
|
import { pluginZodName } from "@kubb/plugin-zod";
|
|
@@ -420,5 +421,195 @@ const operationsGenerator = createReactGenerator({
|
|
|
420
421
|
});
|
|
421
422
|
|
|
422
423
|
//#endregion
|
|
423
|
-
|
|
424
|
-
|
|
424
|
+
//#region src/generators/staticClassClientGenerator.tsx
|
|
425
|
+
const staticClassClientGenerator = createReactGenerator({
|
|
426
|
+
name: "staticClassClient",
|
|
427
|
+
Operations({ operations, generator, plugin, config }) {
|
|
428
|
+
const { options, key: pluginKey } = plugin;
|
|
429
|
+
const pluginManager = usePluginManager();
|
|
430
|
+
const oas = useOas();
|
|
431
|
+
const { getName, getFile, getGroup, getSchemas } = useOperationManager(generator);
|
|
432
|
+
function buildOperationData(operation) {
|
|
433
|
+
const type = {
|
|
434
|
+
file: getFile(operation, { pluginKey: [pluginTsName] }),
|
|
435
|
+
schemas: getSchemas(operation, {
|
|
436
|
+
pluginKey: [pluginTsName],
|
|
437
|
+
type: "type"
|
|
438
|
+
})
|
|
439
|
+
};
|
|
440
|
+
const zod = {
|
|
441
|
+
file: getFile(operation, { pluginKey: [pluginZodName] }),
|
|
442
|
+
schemas: getSchemas(operation, {
|
|
443
|
+
pluginKey: [pluginZodName],
|
|
444
|
+
type: "function"
|
|
445
|
+
})
|
|
446
|
+
};
|
|
447
|
+
return {
|
|
448
|
+
operation,
|
|
449
|
+
name: getName(operation, { type: "function" }),
|
|
450
|
+
typeSchemas: type.schemas,
|
|
451
|
+
zodSchemas: zod.schemas,
|
|
452
|
+
typeFile: type.file,
|
|
453
|
+
zodFile: zod.file
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
const controllers = operations.reduce((acc, operation) => {
|
|
457
|
+
const group = getGroup(operation);
|
|
458
|
+
const groupName = group?.tag ? options.group?.name?.({ group: camelCase(group.tag) }) ?? pascalCase(group.tag) : "Client";
|
|
459
|
+
if (!group?.tag && !options.group) {
|
|
460
|
+
const name = "ApiClient";
|
|
461
|
+
const file = pluginManager.getFile({
|
|
462
|
+
name,
|
|
463
|
+
extname: ".ts",
|
|
464
|
+
pluginKey
|
|
465
|
+
});
|
|
466
|
+
const operationData = buildOperationData(operation);
|
|
467
|
+
const previousFile = acc.find((item) => item.file.path === file.path);
|
|
468
|
+
if (previousFile) previousFile.operations.push(operationData);
|
|
469
|
+
else acc.push({
|
|
470
|
+
name,
|
|
471
|
+
file,
|
|
472
|
+
operations: [operationData]
|
|
473
|
+
});
|
|
474
|
+
} else if (group?.tag) {
|
|
475
|
+
const name = groupName;
|
|
476
|
+
const file = pluginManager.getFile({
|
|
477
|
+
name,
|
|
478
|
+
extname: ".ts",
|
|
479
|
+
pluginKey,
|
|
480
|
+
options: { group }
|
|
481
|
+
});
|
|
482
|
+
const operationData = buildOperationData(operation);
|
|
483
|
+
const previousFile = acc.find((item) => item.file.path === file.path);
|
|
484
|
+
if (previousFile) previousFile.operations.push(operationData);
|
|
485
|
+
else acc.push({
|
|
486
|
+
name,
|
|
487
|
+
file,
|
|
488
|
+
operations: [operationData]
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
return acc;
|
|
492
|
+
}, []);
|
|
493
|
+
function collectTypeImports(ops) {
|
|
494
|
+
const typeImportsByFile = /* @__PURE__ */ new Map();
|
|
495
|
+
const typeFilesByPath = /* @__PURE__ */ new Map();
|
|
496
|
+
ops.forEach((op) => {
|
|
497
|
+
const { typeSchemas, typeFile } = op;
|
|
498
|
+
if (!typeImportsByFile.has(typeFile.path)) typeImportsByFile.set(typeFile.path, /* @__PURE__ */ new Set());
|
|
499
|
+
const typeImports = typeImportsByFile.get(typeFile.path);
|
|
500
|
+
if (typeSchemas.request?.name) typeImports.add(typeSchemas.request.name);
|
|
501
|
+
if (typeSchemas.response?.name) typeImports.add(typeSchemas.response.name);
|
|
502
|
+
if (typeSchemas.pathParams?.name) typeImports.add(typeSchemas.pathParams.name);
|
|
503
|
+
if (typeSchemas.queryParams?.name) typeImports.add(typeSchemas.queryParams.name);
|
|
504
|
+
if (typeSchemas.headerParams?.name) typeImports.add(typeSchemas.headerParams.name);
|
|
505
|
+
typeSchemas.statusCodes?.forEach((item) => {
|
|
506
|
+
if (item?.name) typeImports.add(item.name);
|
|
507
|
+
});
|
|
508
|
+
typeFilesByPath.set(typeFile.path, typeFile);
|
|
509
|
+
});
|
|
510
|
+
return {
|
|
511
|
+
typeImportsByFile,
|
|
512
|
+
typeFilesByPath
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
function collectZodImports(ops) {
|
|
516
|
+
const zodImportsByFile = /* @__PURE__ */ new Map();
|
|
517
|
+
const zodFilesByPath = /* @__PURE__ */ new Map();
|
|
518
|
+
ops.forEach((op) => {
|
|
519
|
+
const { zodSchemas, zodFile } = op;
|
|
520
|
+
if (!zodImportsByFile.has(zodFile.path)) zodImportsByFile.set(zodFile.path, /* @__PURE__ */ new Set());
|
|
521
|
+
const zodImports = zodImportsByFile.get(zodFile.path);
|
|
522
|
+
if (zodSchemas?.response?.name) zodImports.add(zodSchemas.response.name);
|
|
523
|
+
if (zodSchemas?.request?.name) zodImports.add(zodSchemas.request.name);
|
|
524
|
+
zodFilesByPath.set(zodFile.path, zodFile);
|
|
525
|
+
});
|
|
526
|
+
return {
|
|
527
|
+
zodImportsByFile,
|
|
528
|
+
zodFilesByPath
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
return controllers.map(({ name, file, operations: ops }) => {
|
|
532
|
+
const { typeImportsByFile, typeFilesByPath } = collectTypeImports(ops);
|
|
533
|
+
const { zodImportsByFile, zodFilesByPath } = options.parser === "zod" ? collectZodImports(ops) : {
|
|
534
|
+
zodImportsByFile: /* @__PURE__ */ new Map(),
|
|
535
|
+
zodFilesByPath: /* @__PURE__ */ new Map()
|
|
536
|
+
};
|
|
537
|
+
const hasFormData = ops.some((op) => op.operation.getContentType() === "multipart/form-data");
|
|
538
|
+
return /* @__PURE__ */ jsxs(File, {
|
|
539
|
+
baseName: file.baseName,
|
|
540
|
+
path: file.path,
|
|
541
|
+
meta: file.meta,
|
|
542
|
+
banner: getBanner({
|
|
543
|
+
oas,
|
|
544
|
+
output: options.output,
|
|
545
|
+
config: pluginManager.config
|
|
546
|
+
}),
|
|
547
|
+
footer: getFooter({
|
|
548
|
+
oas,
|
|
549
|
+
output: options.output
|
|
550
|
+
}),
|
|
551
|
+
children: [
|
|
552
|
+
options.importPath ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(File.Import, {
|
|
553
|
+
name: "fetch",
|
|
554
|
+
path: options.importPath
|
|
555
|
+
}), /* @__PURE__ */ jsx(File.Import, {
|
|
556
|
+
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
557
|
+
path: options.importPath,
|
|
558
|
+
isTypeOnly: true
|
|
559
|
+
})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(File.Import, {
|
|
560
|
+
name: ["fetch"],
|
|
561
|
+
root: file.path,
|
|
562
|
+
path: path.resolve(config.root, config.output.path, ".kubb/fetch.ts")
|
|
563
|
+
}), /* @__PURE__ */ jsx(File.Import, {
|
|
564
|
+
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
565
|
+
root: file.path,
|
|
566
|
+
path: path.resolve(config.root, config.output.path, ".kubb/fetch.ts"),
|
|
567
|
+
isTypeOnly: true
|
|
568
|
+
})] }),
|
|
569
|
+
hasFormData && /* @__PURE__ */ jsx(File.Import, {
|
|
570
|
+
name: ["buildFormData"],
|
|
571
|
+
root: file.path,
|
|
572
|
+
path: path.resolve(config.root, config.output.path, ".kubb/config.ts")
|
|
573
|
+
}),
|
|
574
|
+
Array.from(typeImportsByFile.entries()).map(([filePath, imports]) => {
|
|
575
|
+
const typeFile = typeFilesByPath.get(filePath);
|
|
576
|
+
if (!typeFile) return null;
|
|
577
|
+
const importNames = Array.from(imports).filter(Boolean);
|
|
578
|
+
if (importNames.length === 0) return null;
|
|
579
|
+
return /* @__PURE__ */ jsx(File.Import, {
|
|
580
|
+
name: importNames,
|
|
581
|
+
root: file.path,
|
|
582
|
+
path: typeFile.path,
|
|
583
|
+
isTypeOnly: true
|
|
584
|
+
}, filePath);
|
|
585
|
+
}),
|
|
586
|
+
options.parser === "zod" && Array.from(zodImportsByFile.entries()).map(([filePath, imports]) => {
|
|
587
|
+
const zodFile = zodFilesByPath.get(filePath);
|
|
588
|
+
if (!zodFile) return null;
|
|
589
|
+
const importNames = Array.from(imports).filter(Boolean);
|
|
590
|
+
if (importNames.length === 0) return null;
|
|
591
|
+
return /* @__PURE__ */ jsx(File.Import, {
|
|
592
|
+
name: importNames,
|
|
593
|
+
root: file.path,
|
|
594
|
+
path: zodFile.path
|
|
595
|
+
}, filePath);
|
|
596
|
+
}),
|
|
597
|
+
/* @__PURE__ */ jsx(StaticClassClient, {
|
|
598
|
+
name,
|
|
599
|
+
operations: ops,
|
|
600
|
+
baseURL: options.baseURL,
|
|
601
|
+
dataReturnType: options.dataReturnType,
|
|
602
|
+
pathParamsType: options.pathParamsType,
|
|
603
|
+
paramsCasing: options.paramsCasing,
|
|
604
|
+
paramsType: options.paramsType,
|
|
605
|
+
parser: options.parser
|
|
606
|
+
})
|
|
607
|
+
]
|
|
608
|
+
}, file.path);
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
//#endregion
|
|
614
|
+
export { classClientGenerator as a, clientGenerator as i, operationsGenerator as n, groupedClientGenerator as r, staticClassClientGenerator as t };
|
|
615
|
+
//# sourceMappingURL=generators-CtXa-3Fh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators-CtXa-3Fh.js","names":[],"sources":["../src/generators/classClientGenerator.tsx","../src/generators/clientGenerator.tsx","../src/generators/groupedClientGenerator.tsx","../src/generators/operationsGenerator.tsx","../src/generators/staticClassClientGenerator.tsx"],"sourcesContent":["import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\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 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, key: pluginKey } = plugin\n const pluginManager = usePluginManager()\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, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [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 = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\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 = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\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: pluginManager.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={['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\n name={['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})\n","import path from 'node:path'\nimport { usePluginManager } 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 pluginManager = usePluginManager()\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, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [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: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.importPath} />\n <File.Import name={['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={['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 name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={client.file.path} path={zod.file.path} />\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(Boolean)}\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 { usePluginManager } from '@kubb/core/hooks'\nimport { camelCase } from '@kubb/core/transformers'\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, key: pluginKey } = plugin\n const pluginManager = usePluginManager()\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 = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\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: pluginManager.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 { usePluginManager } 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 key: pluginKey,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n\n const name = 'operations'\n const file = pluginManager.getFile({ name, extname: '.ts', pluginKey })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: pluginManager.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 { usePluginManager } from '@kubb/core/hooks'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\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, key: pluginKey } = plugin\n const pluginManager = usePluginManager()\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, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [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 = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\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 = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\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: pluginManager.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={['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\n name={['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":";;;;;;;;;;;;;;AA8BA,MAAa,uBAAuB,qBAAmC;CACrE,MAAM;CACN,WAAW,EAAE,YA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sB,MAAM;OAAa,MAAM,KAAK;OAAM,MAAM,SAAS;OAAM;SAAnE,SAAgF;OACzG;KAED,QAAQ,WAAW,SAClB,MAAM,KAAK,iBAAiB,SAAS,CAAC,CAAC,KAAK,CAAC,UAAU,aAAa;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;OAAsB,MAAM;OAAa,MAAM,KAAK;OAAM,MAAM,QAAQ;SAA5D,SAAoE;OAC7F;KAEJ,oBAAC;MACO;MACN,YAAY;MACZ,SAAS,QAAQ;MACjB,gBAAgB,QAAQ;MACxB,gBAAgB,QAAQ;MACxB,cAAc,QAAQ;MACtB,YAAY,QAAQ;MACpB,QAAQ,QAAQ;OAChB;;MA7DG,KAAK,KA8DL;IAET;;CAEL,CAAC"}
|
package/dist/generators.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const require_generators = require('./generators-
|
|
1
|
+
const require_generators = require('./generators-BPQFq13R.cjs');
|
|
2
2
|
|
|
3
3
|
exports.classClientGenerator = require_generators.classClientGenerator;
|
|
4
4
|
exports.clientGenerator = require_generators.clientGenerator;
|
|
5
5
|
exports.groupedClientGenerator = require_generators.groupedClientGenerator;
|
|
6
|
-
exports.operationsGenerator = require_generators.operationsGenerator;
|
|
6
|
+
exports.operationsGenerator = require_generators.operationsGenerator;
|
|
7
|
+
exports.staticClassClientGenerator = require_generators.staticClassClientGenerator;
|