@kubb/plugin-vue-query 3.0.0-alpha.29 → 3.0.0-alpha.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
  import { Client, Operations, QueryKey, QueryOptions, Query, MutationKey, Mutation, InfiniteQueryOptions, InfiniteQuery } from './chunk-V6YETPDM.js';
2
- import transformers, { camelCase } from '@kubb/core/transformers';
2
+ import { camelCase } from '@kubb/core/transformers';
3
3
  import path from 'node:path';
4
4
  import { createPlugin, FileManager, PluginManager } from '@kubb/core';
5
- import { renderTemplate } from '@kubb/core/utils';
5
+ import '@kubb/core/utils';
6
6
  import { createReactGenerator, pluginOasName, OperationGenerator } from '@kubb/plugin-oas';
7
7
  import { pluginZodName } from '@kubb/plugin-zod';
8
8
  import { useOperationManager } from '@kubb/plugin-oas/hooks';
9
9
  import { pluginTsName } from '@kubb/plugin-ts';
10
- import { useApp, File } from '@kubb/react';
10
+ import { useApp, File, Function } from '@kubb/react';
11
11
  import { jsxs, jsx } from '@kubb/react/jsx-runtime';
12
12
 
13
13
  var clientGenerator = createReactGenerator({
@@ -34,11 +34,10 @@ var clientGenerator = createReactGenerator({
34
34
  return /* @__PURE__ */ jsxs(File, { baseName: client.file.baseName, path: client.file.path, meta: client.file.meta, banner: output?.banner, footer: output?.footer, children: [
35
35
  /* @__PURE__ */ jsx(File.Import, { name: "client", path: options.importPath }),
36
36
  /* @__PURE__ */ jsx(File.Import, { name: ["RequestConfig"], path: options.importPath, isTypeOnly: true }),
37
- options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { extName: output?.extName, name: [zod.schemas.response.name], root: client.file.path, path: zod.file.path }),
37
+ options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name], root: client.file.path, path: zod.file.path }),
38
38
  /* @__PURE__ */ jsx(
39
39
  File.Import,
40
40
  {
41
- extName: output?.extName,
42
41
  name: [
43
42
  type.schemas.request?.name,
44
43
  type.schemas.response.name,
@@ -78,16 +77,61 @@ var operationsGenerator = createReactGenerator({
78
77
  }
79
78
  } = useApp();
80
79
  const name = "operations";
81
- const file = pluginManager.getFile({ name, extName: ".ts", pluginKey: [pluginClientName] });
80
+ const file = pluginManager.getFile({ name, extname: ".ts", pluginKey: [pluginClientName] });
82
81
  return /* @__PURE__ */ jsx(File, { baseName: file.baseName, path: file.path, meta: file.meta, banner: output?.banner, footer: output?.footer, children: /* @__PURE__ */ jsx(Operations, { name, operations }) });
83
82
  }
84
83
  });
84
+ var groupedClientGenerator = createReactGenerator({
85
+ name: "groupedClient",
86
+ Operations({ operations }) {
87
+ const {
88
+ pluginManager,
89
+ plugin: { options }
90
+ } = useApp();
91
+ const { getName, getFile } = useOperationManager();
92
+ const controllers = operations.reduce(
93
+ (acc, operation) => {
94
+ if (options.group?.type === "tag") {
95
+ const tag = operation.getTags().at(0)?.name;
96
+ const name = tag ? options.group?.name?.({ group: camelCase(tag) }) : void 0;
97
+ if (!tag || !name) {
98
+ return acc;
99
+ }
100
+ const file = pluginManager.getFile({
101
+ name,
102
+ extname: ".ts",
103
+ pluginKey: [pluginClientName],
104
+ options: { tag }
105
+ });
106
+ const client = {
107
+ name: getName(operation, { type: "function" }),
108
+ file: getFile(operation)
109
+ };
110
+ const previousFile = acc.find((item) => item.file.path === file.path);
111
+ if (previousFile) {
112
+ previousFile.clients.push(client);
113
+ } else {
114
+ acc.push({ name, file, clients: [client] });
115
+ }
116
+ }
117
+ return acc;
118
+ },
119
+ []
120
+ );
121
+ return controllers.map(({ name, file, clients }) => {
122
+ return /* @__PURE__ */ jsxs(File, { baseName: file.baseName, path: file.path, meta: file.meta, banner: options.output?.banner, footer: options.output?.footer, children: [
123
+ clients.map((client) => /* @__PURE__ */ jsx(File.Import, { name: [client.name], root: file.path, path: client.file.path }, client.name)),
124
+ /* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Function, { export: true, name, children: `return { ${clients.map((client) => client.name).join(", ")} }` }) })
125
+ ] }, file.path);
126
+ });
127
+ }
128
+ });
85
129
 
86
130
  // ../plugin-client/src/plugin.ts
87
131
  var pluginClientName = "plugin-client";
88
132
  createPlugin((options) => {
89
133
  const {
90
- output = { path: "clients" },
134
+ output = { path: "clients", barrelType: "named" },
91
135
  group,
92
136
  exclude = [],
93
137
  include,
@@ -96,18 +140,15 @@ createPlugin((options) => {
96
140
  dataReturnType = "data",
97
141
  pathParamsType = "inline",
98
142
  operations = false,
99
- generators = [clientGenerator, operations ? operationsGenerator : void 0].filter(Boolean),
143
+ generators = [clientGenerator, group ? groupedClientGenerator : void 0, operations ? operationsGenerator : void 0].filter(Boolean),
100
144
  importPath = "@kubb/plugin-client/client",
101
145
  parser = "client"
102
146
  } = options;
103
- const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`;
104
147
  return {
105
148
  name: pluginClientName,
106
149
  options: {
107
- output: {
108
- exportType: "barrelNamed",
109
- ...output
110
- },
150
+ output,
151
+ group,
111
152
  parser,
112
153
  dataReturnType,
113
154
  importPath,
@@ -118,13 +159,13 @@ createPlugin((options) => {
118
159
  resolvePath(baseName, pathMode, options2) {
119
160
  const root = path.resolve(this.config.root, this.config.output.path);
120
161
  const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path));
162
+ if (options2?.tag && group?.type === "tag") {
163
+ const groupName = group?.name ? group.name : (ctx) => `${ctx.group}Controller`;
164
+ return path.resolve(root, output.path, groupName({ group: camelCase(options2.tag) }), baseName);
165
+ }
121
166
  if (mode === "single") {
122
167
  return path.resolve(root, output.path);
123
168
  }
124
- if (options2?.tag && group?.type === "tag") {
125
- const tag = camelCase(options2.tag);
126
- return path.resolve(root, renderTemplate(template, { tag }), baseName);
127
- }
128
169
  return path.resolve(root, output.path, baseName);
129
170
  },
130
171
  resolveName(name, type) {
@@ -158,18 +199,17 @@ createPlugin((options) => {
158
199
  );
159
200
  const files = await operationGenerator.build(...generators);
160
201
  await this.addFile(...files);
161
- if (this.config.output.exportType) {
162
- const barrelFiles = await this.fileManager.getBarrelFiles({
163
- root,
164
- output,
165
- files: this.fileManager.files,
166
- meta: {
167
- pluginKey: this.plugin.key
168
- },
169
- logger: this.logger
170
- });
171
- await this.addFile(...barrelFiles);
172
- }
202
+ const barrelFiles = await this.fileManager.getBarrelFiles({
203
+ type: output.barrelType ?? "named",
204
+ root,
205
+ output,
206
+ files: this.fileManager.files,
207
+ meta: {
208
+ pluginKey: this.plugin.key
209
+ },
210
+ logger: this.logger
211
+ });
212
+ await this.addFile(...barrelFiles);
173
213
  }
174
214
  };
175
215
  });
@@ -193,11 +233,11 @@ var queryGenerator = createReactGenerator({
193
233
  name: getName(operation, { type: "function", pluginKey: [pluginClientName] })
194
234
  };
195
235
  const queryOptions = {
196
- name: transformers.camelCase(`${operation.getOperationId()} QueryOptions`)
236
+ name: getName(operation, { type: "function", suffix: "QueryOptions" })
197
237
  };
198
238
  const queryKey = {
199
- name: transformers.camelCase(`${operation.getOperationId()} QueryKey`),
200
- typeName: transformers.pascalCase(`${operation.getOperationId()} QueryKey`)
239
+ name: getName(operation, { type: "const", suffix: "QueryKey" }),
240
+ typeName: getName(operation, { type: "type", suffix: "QueryKey" })
201
241
  };
202
242
  const type = {
203
243
  file: getFile(operation, { pluginKey: [pluginTsName] }),
@@ -212,7 +252,7 @@ var queryGenerator = createReactGenerator({
212
252
  return null;
213
253
  }
214
254
  return /* @__PURE__ */ jsxs(File, { baseName: query.file.baseName, path: query.file.path, meta: query.file.meta, banner: output?.banner, footer: output?.footer, children: [
215
- options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { extName: output?.extName, name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
255
+ options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
216
256
  /* @__PURE__ */ jsx(File.Import, { name: ["useQuery", "queryOptions"], path: options.query.importPath }),
217
257
  /* @__PURE__ */ jsx(File.Import, { name: ["QueryKey", "WithRequired", "QueryObserverOptions", "UseQueryReturnType"], path: options.query.importPath, isTypeOnly: true }),
218
258
  /* @__PURE__ */ jsx(File.Import, { name: ["unref"], path: "vue" }),
@@ -223,7 +263,6 @@ var queryGenerator = createReactGenerator({
223
263
  /* @__PURE__ */ jsx(
224
264
  File.Import,
225
265
  {
226
- extName: output?.extName,
227
266
  name: [
228
267
  type.schemas.request?.name,
229
268
  type.schemas.response.name,
@@ -318,14 +357,14 @@ var mutationGenerator = createReactGenerator({
318
357
  name: getName(operation, { type: "function", pluginKey: [pluginClientName] })
319
358
  };
320
359
  const mutationKey = {
321
- name: transformers.camelCase(`${operation.getOperationId()} MutationKey`),
322
- typeName: transformers.pascalCase(`${operation.getOperationId()} MutationKey`)
360
+ name: getName(operation, { type: "const", suffix: "MutationKey" }),
361
+ typeName: getName(operation, { type: "type", suffix: "MutationKey" })
323
362
  };
324
363
  if (!isMutation || typeof options.mutation === "boolean") {
325
364
  return null;
326
365
  }
327
366
  return /* @__PURE__ */ jsxs(File, { baseName: mutation.file.baseName, path: mutation.file.path, meta: mutation.file.meta, banner: output?.banner, footer: output?.footer, children: [
328
- options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { extName: output?.extName, name: [zod.schemas.response.name], root: mutation.file.path, path: zod.file.path }),
367
+ options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name], root: mutation.file.path, path: zod.file.path }),
329
368
  /* @__PURE__ */ jsx(File.Import, { name: ["useMutation"], path: options.mutation.importPath }),
330
369
  /* @__PURE__ */ jsx(File.Import, { name: ["MutationObserverOptions"], path: options.mutation.importPath, isTypeOnly: true }),
331
370
  /* @__PURE__ */ jsx(File.Import, { name: ["MaybeRef"], path: "vue", isTypeOnly: true }),
@@ -334,7 +373,6 @@ var mutationGenerator = createReactGenerator({
334
373
  /* @__PURE__ */ jsx(
335
374
  File.Import,
336
375
  {
337
- extName: output?.extName,
338
376
  name: [
339
377
  type.schemas.request?.name,
340
378
  type.schemas.response.name,
@@ -410,11 +448,11 @@ var infiniteQueryGenerator = createReactGenerator({
410
448
  name: getName(operation, { type: "function", pluginKey: [pluginClientName] })
411
449
  };
412
450
  const queryOptions = {
413
- name: transformers.camelCase(`${operation.getOperationId()} InfiniteQueryOptions`)
451
+ name: getName(operation, { type: "function", suffix: "InfiniteQueryOptions" })
414
452
  };
415
453
  const queryKey = {
416
- name: transformers.camelCase(`${operation.getOperationId()} InfiniteQueryKey`),
417
- typeName: transformers.pascalCase(`${operation.getOperationId()} InfiniteQueryKey`)
454
+ name: getName(operation, { type: "const", suffix: "InfiniteQueryKey" }),
455
+ typeName: getName(operation, { type: "type", suffix: "InfiniteQueryKey" })
418
456
  };
419
457
  const type = {
420
458
  file: getFile(operation, { pluginKey: [pluginTsName] }),
@@ -429,7 +467,7 @@ var infiniteQueryGenerator = createReactGenerator({
429
467
  return null;
430
468
  }
431
469
  return /* @__PURE__ */ jsxs(File, { baseName: query.file.baseName, path: query.file.path, meta: query.file.meta, banner: output?.banner, footer: output?.footer, children: [
432
- options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { extName: output?.extName, name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
470
+ options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
433
471
  /* @__PURE__ */ jsx(File.Import, { name: ["useInfiniteQuery", "infiniteQueryOptions"], path: options.query.importPath }),
434
472
  /* @__PURE__ */ jsx(
435
473
  File.Import,
@@ -447,7 +485,6 @@ var infiniteQueryGenerator = createReactGenerator({
447
485
  /* @__PURE__ */ jsx(
448
486
  File.Import,
449
487
  {
450
- extName: output?.extName,
451
488
  name: [
452
489
  type.schemas.request?.name,
453
490
  type.schemas.response.name,
@@ -519,5 +556,5 @@ var infiniteQueryGenerator = createReactGenerator({
519
556
  });
520
557
 
521
558
  export { infiniteQueryGenerator, mutationGenerator, queryGenerator };
522
- //# sourceMappingURL=chunk-JI524ZTZ.js.map
523
- //# sourceMappingURL=chunk-JI524ZTZ.js.map
559
+ //# sourceMappingURL=chunk-CTBTK7UQ.js.map
560
+ //# sourceMappingURL=chunk-CTBTK7UQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../plugin-client/src/generators/clientGenerator.tsx","../../plugin-client/src/generators/operationsGenerator.tsx","../../plugin-client/src/generators/groupedClientGenerator.tsx","../../plugin-client/src/plugin.ts","../src/generators/queryGenerator.tsx","../src/generators/mutationGenerator.tsx","../src/generators/infiniteQueryGenerator.tsx"],"names":["createReactGenerator","useApp","jsx","File","useOperationManager","jsxs","transformers","pluginZodName","options","camelCase","pluginTsName"],"mappings":";;;;;;;;;;;;AAQO,IAAM,kBAAkB,oBAAmC,CAAA;AAAA,EAChE,IAAM,EAAA,QAAA;AAAA,EACN,SAAU,CAAA,EAAE,OAAS,EAAA,SAAA,EAAa,EAAA;AAChC,IAAM,MAAA;AAAA,MACJ,MAAQ,EAAA;AAAA,QACN,OAAA,EAAS,EAAE,MAAO,EAAA;AAAA,OACpB;AAAA,QACE,MAAqB,EAAA,CAAA;AACzB,IAAA,MAAM,EAAE,UAAA,EAAY,OAAS,EAAA,OAAA,KAAY,mBAAoB,EAAA,CAAA;AAE7D,IAAA,MAAM,MAAS,GAAA;AAAA,MACb,MAAM,OAAQ,CAAA,SAAA,EAAW,EAAE,IAAA,EAAM,YAAY,CAAA;AAAA,MAC7C,IAAA,EAAM,QAAQ,SAAS,CAAA;AAAA,KACzB,CAAA;AAEA,IAAA,MAAM,IAAO,GAAA;AAAA,MACX,IAAA,EAAM,QAAQ,SAAW,EAAA,EAAE,WAAW,CAAC,YAAY,GAAG,CAAA;AAAA,MACtD,OAAA,EAAS,UAAW,CAAA,SAAA,EAAW,EAAE,SAAA,EAAW,CAAC,YAAY,CAAA,EAAG,IAAM,EAAA,MAAA,EAAQ,CAAA;AAAA,KAC5E,CAAA;AAEA,IAAA,MAAM,GAAM,GAAA;AAAA,MACV,IAAA,E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;AAAA,UAC/B,aAAa,IAAK,CAAA,OAAA;AAAA,UAClB,gBAAgB,OAAQ,CAAA,cAAA;AAAA,UACxB,SAAA;AAAA,UACA,cAAA,EAAgB,QAAQ,MAAO,CAAA,cAAA;AAAA,UAC/B,cAAc,QAAS,CAAA,IAAA;AAAA,UACvB,kBAAkB,QAAS,CAAA,QAAA;AAAA,SAAA;AAAA,OAC7B;AAAA,KACF,EAAA,CAAA,CAAA;AAAA,GAEJ;AACF,CAAC","file":"chunk-CTBTK7UQ.js","sourcesContent":["import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { Client } from '../components/Client'\nimport type { PluginClient } from '../types'\n\nexport const clientGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n } = useApp<PluginClient>()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const client = {\n name: getName(operation, { type: 'function' }),\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 return (\n <File baseName={client.file.baseName} path={client.file.path} meta={client.file.meta} banner={output?.banner} footer={output?.footer}>\n <File.Import name={'client'} path={options.importPath} />\n <File.Import name={['RequestConfig']} path={options.importPath} isTypeOnly />\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={client.file.path} path={zod.file.path} />}\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 <Client\n name={client.name}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n operation={operation}\n parser={options.parser}\n zodSchemas={zod.schemas}\n />\n </File>\n )\n },\n})\n","import { pluginClientName } from '@kubb/plugin-client'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { File, useApp } from '@kubb/react'\nimport { Operations } from '../components/Operations'\nimport type { PluginClient } from '../types'\n\nexport const operationsGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operations({ operations }) {\n const {\n pluginManager,\n plugin: {\n options: { output },\n },\n } = useApp<PluginClient>()\n\n const name = 'operations'\n const file = pluginManager.getFile({ name, extname: '.ts', pluginKey: [pluginClientName] })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta} banner={output?.banner} footer={output?.footer}>\n <Operations name={name} operations={operations} />\n </File>\n )\n },\n})\n","import { camelCase } from '@kubb/core/transformers'\nimport type * as KubbFile from '@kubb/fs/types'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { File, Function, useApp } from '@kubb/react'\nimport type { PluginClient } from '../types'\n\nexport const groupedClientGenerator = createReactGenerator<PluginClient>({\n name: 'groupedClient',\n Operations({ operations }) {\n const {\n pluginManager,\n plugin: { options },\n } = useApp<PluginClient>()\n const { getName, getFile } = useOperationManager()\n\n const controllers = operations.reduce(\n (acc, operation) => {\n if (options.group?.type === 'tag') {\n const tag = operation.getTags().at(0)?.name\n const name = tag ? options.group?.name?.({ group: camelCase(tag) }) : undefined\n\n if (!tag || !name) {\n return acc\n }\n\n const file = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey: [pluginClientName],\n options: { tag },\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 key={file.path} baseName={file.baseName} path={file.path} meta={file.meta} banner={options.output?.banner} footer={options.output?.footer}>\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 path from 'node:path'\n\nimport { FileManager, type Group, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { operationsGenerator } from './generators'\nimport { clientGenerator } from './generators/clientGenerator.tsx'\nimport { groupedClientGenerator } from './generators/groupedClientGenerator.tsx'\nimport type { PluginClient } from './types.ts'\n\nexport const pluginClientName = 'plugin-client' satisfies PluginClient['name']\n\nexport const pluginClient = createPlugin<PluginClient>((options) => {\n const {\n output = { path: 'clients', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n transformers = {},\n dataReturnType = 'data',\n pathParamsType = 'inline',\n operations = false,\n generators = [clientGenerator, group ? groupedClientGenerator : undefined, operations ? operationsGenerator : undefined].filter(Boolean),\n importPath = '@kubb/plugin-client/client',\n parser = 'client',\n } = options\n\n return {\n name: pluginClientName,\n options: {\n output,\n group,\n parser,\n dataReturnType,\n importPath,\n pathParamsType,\n baseURL: undefined,\n },\n pre: [pluginOasName, parser === 'zod' ? pluginZodName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (options?.tag && group?.type === 'tag') {\n const groupName: Group['name'] = group?.name ? group.name : (ctx) => `${ctx.group}Controller`\n\n return path.resolve(root, output.path, groupName({ group: camelCase(options.tag) }), baseName)\n }\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n const resolvedName = camelCase(name, { isFile: type === 'file' })\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n const baseURL = await swaggerPlugin.context.getBaseURL()\n\n const operationGenerator = new OperationGenerator(\n {\n ...this.plugin.options,\n baseURL,\n },\n {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n },\n )\n\n const files = await operationGenerator.build(...generators)\n\n await this.addFile(...files)\n\n const barrelFiles = await this.fileManager.getBarrelFiles({\n type: output.barrelType ?? 'named',\n root,\n output,\n files: this.fileManager.files,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n },\n }\n})\n","import transformers from '@kubb/core/transformers'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n } = useApp<PluginVueQuery>()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = !isQuery && options.mutation && options.mutation.methods.some((method) => operation.method === method)\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\n }\n\n const client = {\n name: getName(operation, { type: 'function', pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'QueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'QueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'QueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\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 if (!isQuery || typeof options.query === 'boolean') {\n return null\n }\n\n return (\n <File baseName={query.file.baseName} path={query.file.path} meta={query.file.meta} banner={output?.banner} footer={output?.footer}>\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={query.file.path} path={zod.file.path} />}\n <File.Import name={['useQuery', 'queryOptions']} path={options.query.importPath} />\n <File.Import name={['QueryKey', 'WithRequired', 'QueryObserverOptions', 'UseQueryReturnType']} path={options.query.importPath} isTypeOnly />\n <File.Import name={['unref']} path=\"vue\" />\n <File.Import name={['MaybeRef']} path=\"vue\" isTypeOnly />\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['RequestConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\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={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n keysFn={options.query.key}\n />\n <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\n baseURL={options.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n pathParamsType={options.pathParamsType}\n />\n <Query\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </File>\n )\n },\n})\n","import transformers from '@kubb/core/transformers'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { Mutation, MutationKey } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n } = useApp<PluginVueQuery>()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = !isQuery && options.mutation && options.mutation.methods.some((method) => operation.method === method)\n\n const mutation = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\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 client = {\n name: getName(operation, { type: 'function', pluginKey: [pluginClientName] }),\n }\n\n const mutationKey = {\n name: getName(operation, { type: 'const', suffix: 'MutationKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'MutationKey' }),\n }\n\n if (!isMutation || typeof options.mutation === 'boolean') {\n return null\n }\n\n return (\n <File baseName={mutation.file.baseName} path={mutation.file.path} meta={mutation.file.meta} banner={output?.banner} footer={output?.footer}>\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={mutation.file.path} path={zod.file.path} />}\n <File.Import name={['useMutation']} path={options.mutation.importPath} />\n <File.Import name={['MutationObserverOptions']} path={options.mutation.importPath} isTypeOnly />\n <File.Import name={['MaybeRef']} path=\"vue\" isTypeOnly />\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseConfig']} path={options.client.importPath} isTypeOnly />\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={mutation.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <MutationKey\n name={mutationKey.name}\n typeName={mutationKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n keysFn={options.mutation.key}\n />\n <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\n baseURL={options.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n <Mutation\n name={mutation.name}\n clientName={client.name}\n typeName={mutation.typeName}\n typeSchemas={type.schemas}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\n />\n </File>\n )\n },\n})\n","import transformers from '@kubb/core/transformers'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { InfiniteQuery, InfiniteQueryOptions, QueryKey } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const infiniteQueryGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-infinite-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n } = useApp<PluginVueQuery>()\n const { getSchemas, getName, getFile } = useOperationManager()\n const isQuery = typeof options.query === 'boolean' ? options.query : !!options.query.methods?.some((method) => operation.method === method)\n const isInfinite = isQuery && !!options.infinite\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use', suffix: 'infinite' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use', suffix: 'infinite' }),\n }\n\n const client = {\n name: getName(operation, { type: 'function', pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'InfiniteQueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'InfiniteQueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'InfiniteQueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\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 if (!isQuery || !isInfinite || typeof options.query === 'boolean' || typeof options.infinite === 'boolean') {\n return null\n }\n\n return (\n <File baseName={query.file.baseName} path={query.file.path} meta={query.file.meta} banner={output?.banner} footer={output?.footer}>\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={query.file.path} path={zod.file.path} />}\n <File.Import name={['useInfiniteQuery', 'infiniteQueryOptions']} path={options.query.importPath} />\n <File.Import\n name={['QueryKey', 'WithRequired', 'InfiniteQueryObserverOptions', 'UseInfiniteQueryReturnType']}\n path={options.query.importPath}\n isTypeOnly\n />\n <File.Import name={['unref']} path=\"vue\" />\n <File.Import name={['MaybeRef']} path=\"vue\" isTypeOnly />\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['RequestConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\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={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n keysFn={options.query.key}\n />\n <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\n baseURL={options.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n <InfiniteQueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType}\n cursorParam={options.infinite.cursorParam}\n initialPageParam={options.infinite.initialPageParam}\n queryParam={options.infinite.queryParam}\n />\n <InfiniteQuery\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </File>\n )\n },\n})\n"]}
@@ -4,7 +4,7 @@ var chunkFSQSBTBH_cjs = require('./chunk-FSQSBTBH.cjs');
4
4
  var transformers = require('@kubb/core/transformers');
5
5
  var path = require('path');
6
6
  var core = require('@kubb/core');
7
- var utils = require('@kubb/core/utils');
7
+ require('@kubb/core/utils');
8
8
  var pluginOas = require('@kubb/plugin-oas');
9
9
  var pluginZod = require('@kubb/plugin-zod');
10
10
  var hooks = require('@kubb/plugin-oas/hooks');
@@ -14,7 +14,6 @@ var jsxRuntime = require('@kubb/react/jsx-runtime');
14
14
 
15
15
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
16
16
 
17
- var transformers__default = /*#__PURE__*/_interopDefault(transformers);
18
17
  var path__default = /*#__PURE__*/_interopDefault(path);
19
18
 
20
19
  var clientGenerator = pluginOas.createReactGenerator({
@@ -41,11 +40,10 @@ var clientGenerator = pluginOas.createReactGenerator({
41
40
  return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: client.file.baseName, path: client.file.path, meta: client.file.meta, banner: output?.banner, footer: output?.footer, children: [
42
41
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: options.importPath }),
43
42
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["RequestConfig"], path: options.importPath, isTypeOnly: true }),
44
- options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { extName: output?.extName, name: [zod.schemas.response.name], root: client.file.path, path: zod.file.path }),
43
+ options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name], root: client.file.path, path: zod.file.path }),
45
44
  /* @__PURE__ */ jsxRuntime.jsx(
46
45
  react.File.Import,
47
46
  {
48
- extName: output?.extName,
49
47
  name: [
50
48
  type.schemas.request?.name,
51
49
  type.schemas.response.name,
@@ -85,16 +83,61 @@ var operationsGenerator = pluginOas.createReactGenerator({
85
83
  }
86
84
  } = react.useApp();
87
85
  const name = "operations";
88
- const file = pluginManager.getFile({ name, extName: ".ts", pluginKey: [pluginClientName] });
86
+ const file = pluginManager.getFile({ name, extname: ".ts", pluginKey: [pluginClientName] });
89
87
  return /* @__PURE__ */ jsxRuntime.jsx(react.File, { baseName: file.baseName, path: file.path, meta: file.meta, banner: output?.banner, footer: output?.footer, children: /* @__PURE__ */ jsxRuntime.jsx(chunkFSQSBTBH_cjs.Operations, { name, operations }) });
90
88
  }
91
89
  });
90
+ var groupedClientGenerator = pluginOas.createReactGenerator({
91
+ name: "groupedClient",
92
+ Operations({ operations }) {
93
+ const {
94
+ pluginManager,
95
+ plugin: { options }
96
+ } = react.useApp();
97
+ const { getName, getFile } = hooks.useOperationManager();
98
+ const controllers = operations.reduce(
99
+ (acc, operation) => {
100
+ if (options.group?.type === "tag") {
101
+ const tag = operation.getTags().at(0)?.name;
102
+ const name = tag ? options.group?.name?.({ group: transformers.camelCase(tag) }) : void 0;
103
+ if (!tag || !name) {
104
+ return acc;
105
+ }
106
+ const file = pluginManager.getFile({
107
+ name,
108
+ extname: ".ts",
109
+ pluginKey: [pluginClientName],
110
+ options: { tag }
111
+ });
112
+ const client = {
113
+ name: getName(operation, { type: "function" }),
114
+ file: getFile(operation)
115
+ };
116
+ const previousFile = acc.find((item) => item.file.path === file.path);
117
+ if (previousFile) {
118
+ previousFile.clients.push(client);
119
+ } else {
120
+ acc.push({ name, file, clients: [client] });
121
+ }
122
+ }
123
+ return acc;
124
+ },
125
+ []
126
+ );
127
+ return controllers.map(({ name, file, clients }) => {
128
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: file.baseName, path: file.path, meta: file.meta, banner: options.output?.banner, footer: options.output?.footer, children: [
129
+ clients.map((client) => /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [client.name], root: file.path, path: client.file.path }, client.name)),
130
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { export: true, name, children: `return { ${clients.map((client) => client.name).join(", ")} }` }) })
131
+ ] }, file.path);
132
+ });
133
+ }
134
+ });
92
135
 
93
136
  // ../plugin-client/src/plugin.ts
94
137
  var pluginClientName = "plugin-client";
95
138
  core.createPlugin((options) => {
96
139
  const {
97
- output = { path: "clients" },
140
+ output = { path: "clients", barrelType: "named" },
98
141
  group,
99
142
  exclude = [],
100
143
  include,
@@ -103,18 +146,15 @@ core.createPlugin((options) => {
103
146
  dataReturnType = "data",
104
147
  pathParamsType = "inline",
105
148
  operations = false,
106
- generators = [clientGenerator, operations ? operationsGenerator : void 0].filter(Boolean),
149
+ generators = [clientGenerator, group ? groupedClientGenerator : void 0, operations ? operationsGenerator : void 0].filter(Boolean),
107
150
  importPath = "@kubb/plugin-client/client",
108
151
  parser = "client"
109
152
  } = options;
110
- const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`;
111
153
  return {
112
154
  name: pluginClientName,
113
155
  options: {
114
- output: {
115
- exportType: "barrelNamed",
116
- ...output
117
- },
156
+ output,
157
+ group,
118
158
  parser,
119
159
  dataReturnType,
120
160
  importPath,
@@ -125,13 +165,13 @@ core.createPlugin((options) => {
125
165
  resolvePath(baseName, pathMode, options2) {
126
166
  const root = path__default.default.resolve(this.config.root, this.config.output.path);
127
167
  const mode = pathMode ?? core.FileManager.getMode(path__default.default.resolve(root, output.path));
168
+ if (options2?.tag && group?.type === "tag") {
169
+ const groupName = group?.name ? group.name : (ctx) => `${ctx.group}Controller`;
170
+ return path__default.default.resolve(root, output.path, groupName({ group: transformers.camelCase(options2.tag) }), baseName);
171
+ }
128
172
  if (mode === "single") {
129
173
  return path__default.default.resolve(root, output.path);
130
174
  }
131
- if (options2?.tag && group?.type === "tag") {
132
- const tag = transformers.camelCase(options2.tag);
133
- return path__default.default.resolve(root, utils.renderTemplate(template, { tag }), baseName);
134
- }
135
175
  return path__default.default.resolve(root, output.path, baseName);
136
176
  },
137
177
  resolveName(name, type) {
@@ -165,18 +205,17 @@ core.createPlugin((options) => {
165
205
  );
166
206
  const files = await operationGenerator.build(...generators);
167
207
  await this.addFile(...files);
168
- if (this.config.output.exportType) {
169
- const barrelFiles = await this.fileManager.getBarrelFiles({
170
- root,
171
- output,
172
- files: this.fileManager.files,
173
- meta: {
174
- pluginKey: this.plugin.key
175
- },
176
- logger: this.logger
177
- });
178
- await this.addFile(...barrelFiles);
179
- }
208
+ const barrelFiles = await this.fileManager.getBarrelFiles({
209
+ type: output.barrelType ?? "named",
210
+ root,
211
+ output,
212
+ files: this.fileManager.files,
213
+ meta: {
214
+ pluginKey: this.plugin.key
215
+ },
216
+ logger: this.logger
217
+ });
218
+ await this.addFile(...barrelFiles);
180
219
  }
181
220
  };
182
221
  });
@@ -200,11 +239,11 @@ var queryGenerator = pluginOas.createReactGenerator({
200
239
  name: getName(operation, { type: "function", pluginKey: [pluginClientName] })
201
240
  };
202
241
  const queryOptions = {
203
- name: transformers__default.default.camelCase(`${operation.getOperationId()} QueryOptions`)
242
+ name: getName(operation, { type: "function", suffix: "QueryOptions" })
204
243
  };
205
244
  const queryKey = {
206
- name: transformers__default.default.camelCase(`${operation.getOperationId()} QueryKey`),
207
- typeName: transformers__default.default.pascalCase(`${operation.getOperationId()} QueryKey`)
245
+ name: getName(operation, { type: "const", suffix: "QueryKey" }),
246
+ typeName: getName(operation, { type: "type", suffix: "QueryKey" })
208
247
  };
209
248
  const type = {
210
249
  file: getFile(operation, { pluginKey: [pluginTs.pluginTsName] }),
@@ -219,7 +258,7 @@ var queryGenerator = pluginOas.createReactGenerator({
219
258
  return null;
220
259
  }
221
260
  return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: query.file.baseName, path: query.file.path, meta: query.file.meta, banner: output?.banner, footer: output?.footer, children: [
222
- options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { extName: output?.extName, name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
261
+ options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
223
262
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["useQuery", "queryOptions"], path: options.query.importPath }),
224
263
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["QueryKey", "WithRequired", "QueryObserverOptions", "UseQueryReturnType"], path: options.query.importPath, isTypeOnly: true }),
225
264
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["unref"], path: "vue" }),
@@ -230,7 +269,6 @@ var queryGenerator = pluginOas.createReactGenerator({
230
269
  /* @__PURE__ */ jsxRuntime.jsx(
231
270
  react.File.Import,
232
271
  {
233
- extName: output?.extName,
234
272
  name: [
235
273
  type.schemas.request?.name,
236
274
  type.schemas.response.name,
@@ -325,14 +363,14 @@ var mutationGenerator = pluginOas.createReactGenerator({
325
363
  name: getName(operation, { type: "function", pluginKey: [pluginClientName] })
326
364
  };
327
365
  const mutationKey = {
328
- name: transformers__default.default.camelCase(`${operation.getOperationId()} MutationKey`),
329
- typeName: transformers__default.default.pascalCase(`${operation.getOperationId()} MutationKey`)
366
+ name: getName(operation, { type: "const", suffix: "MutationKey" }),
367
+ typeName: getName(operation, { type: "type", suffix: "MutationKey" })
330
368
  };
331
369
  if (!isMutation || typeof options.mutation === "boolean") {
332
370
  return null;
333
371
  }
334
372
  return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: mutation.file.baseName, path: mutation.file.path, meta: mutation.file.meta, banner: output?.banner, footer: output?.footer, children: [
335
- options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { extName: output?.extName, name: [zod.schemas.response.name], root: mutation.file.path, path: zod.file.path }),
373
+ options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name], root: mutation.file.path, path: zod.file.path }),
336
374
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["useMutation"], path: options.mutation.importPath }),
337
375
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["MutationObserverOptions"], path: options.mutation.importPath, isTypeOnly: true }),
338
376
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["MaybeRef"], path: "vue", isTypeOnly: true }),
@@ -341,7 +379,6 @@ var mutationGenerator = pluginOas.createReactGenerator({
341
379
  /* @__PURE__ */ jsxRuntime.jsx(
342
380
  react.File.Import,
343
381
  {
344
- extName: output?.extName,
345
382
  name: [
346
383
  type.schemas.request?.name,
347
384
  type.schemas.response.name,
@@ -417,11 +454,11 @@ var infiniteQueryGenerator = pluginOas.createReactGenerator({
417
454
  name: getName(operation, { type: "function", pluginKey: [pluginClientName] })
418
455
  };
419
456
  const queryOptions = {
420
- name: transformers__default.default.camelCase(`${operation.getOperationId()} InfiniteQueryOptions`)
457
+ name: getName(operation, { type: "function", suffix: "InfiniteQueryOptions" })
421
458
  };
422
459
  const queryKey = {
423
- name: transformers__default.default.camelCase(`${operation.getOperationId()} InfiniteQueryKey`),
424
- typeName: transformers__default.default.pascalCase(`${operation.getOperationId()} InfiniteQueryKey`)
460
+ name: getName(operation, { type: "const", suffix: "InfiniteQueryKey" }),
461
+ typeName: getName(operation, { type: "type", suffix: "InfiniteQueryKey" })
425
462
  };
426
463
  const type = {
427
464
  file: getFile(operation, { pluginKey: [pluginTs.pluginTsName] }),
@@ -436,7 +473,7 @@ var infiniteQueryGenerator = pluginOas.createReactGenerator({
436
473
  return null;
437
474
  }
438
475
  return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: query.file.baseName, path: query.file.path, meta: query.file.meta, banner: output?.banner, footer: output?.footer, children: [
439
- options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { extName: output?.extName, name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
476
+ options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
440
477
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["useInfiniteQuery", "infiniteQueryOptions"], path: options.query.importPath }),
441
478
  /* @__PURE__ */ jsxRuntime.jsx(
442
479
  react.File.Import,
@@ -454,7 +491,6 @@ var infiniteQueryGenerator = pluginOas.createReactGenerator({
454
491
  /* @__PURE__ */ jsxRuntime.jsx(
455
492
  react.File.Import,
456
493
  {
457
- extName: output?.extName,
458
494
  name: [
459
495
  type.schemas.request?.name,
460
496
  type.schemas.response.name,
@@ -528,5 +564,5 @@ var infiniteQueryGenerator = pluginOas.createReactGenerator({
528
564
  exports.infiniteQueryGenerator = infiniteQueryGenerator;
529
565
  exports.mutationGenerator = mutationGenerator;
530
566
  exports.queryGenerator = queryGenerator;
531
- //# sourceMappingURL=chunk-7W4STCTH.cjs.map
532
- //# sourceMappingURL=chunk-7W4STCTH.cjs.map
567
+ //# sourceMappingURL=chunk-IAQL3OW6.cjs.map
568
+ //# sourceMappingURL=chunk-IAQL3OW6.cjs.map