@kubb/plugin-vue-query 4.5.11 → 4.5.12

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.
Files changed (35) hide show
  1. package/dist/{components-Cpik9Er1.cjs → components-D_5ExAbi.cjs} +20 -18
  2. package/dist/components-D_5ExAbi.cjs.map +1 -0
  3. package/dist/{components-CvWdx6lq.js → components-DhWwe20V.js} +19 -17
  4. package/dist/components-DhWwe20V.js.map +1 -0
  5. package/dist/components.cjs +1 -1
  6. package/dist/components.js +1 -1
  7. package/dist/{generators-FB2Is5pa.cjs → generators-BCOVIRvJ.cjs} +4 -4
  8. package/dist/generators-BCOVIRvJ.cjs.map +1 -0
  9. package/dist/{generators-kmb86DA3.js → generators-kFLa_9GP.js} +4 -4
  10. package/dist/generators-kFLa_9GP.js.map +1 -0
  11. package/dist/generators.cjs +2 -2
  12. package/dist/generators.js +2 -2
  13. package/dist/index.cjs +2 -2
  14. package/dist/index.js +2 -2
  15. package/package.json +7 -7
  16. package/src/components/InfiniteQuery.tsx +6 -6
  17. package/src/components/InfiniteQueryOptions.tsx +2 -2
  18. package/src/components/Query.tsx +6 -6
  19. package/src/components/QueryOptions.tsx +2 -2
  20. package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +12 -6
  21. package/src/generators/__snapshots__/clientGetImportPath.ts +6 -6
  22. package/src/generators/__snapshots__/findByTags.ts +6 -6
  23. package/src/generators/__snapshots__/findByTagsObject.ts +6 -6
  24. package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +6 -6
  25. package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +6 -6
  26. package/src/generators/__snapshots__/findByTagsWithZod.ts +6 -6
  27. package/src/generators/__snapshots__/findInfiniteByTags.ts +12 -6
  28. package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +12 -6
  29. package/src/generators/__snapshots__/postAsQuery.ts +12 -6
  30. package/src/generators/infiniteQueryGenerator.tsx +1 -1
  31. package/src/generators/queryGenerator.tsx +1 -1
  32. package/dist/components-Cpik9Er1.cjs.map +0 -1
  33. package/dist/components-CvWdx6lq.js.map +0 -1
  34. package/dist/generators-FB2Is5pa.cjs.map +0 -1
  35. package/dist/generators-kmb86DA3.js.map +0 -1
@@ -1,4 +1,4 @@
1
- const require_generators = require('./generators-FB2Is5pa.cjs');
1
+ const require_generators = require('./generators-BCOVIRvJ.cjs');
2
2
  let __kubb_core_utils = require("@kubb/core/utils");
3
3
  let __kubb_oas = require("@kubb/oas");
4
4
  let __kubb_plugin_oas_utils = require("@kubb/plugin-oas/utils");
@@ -169,7 +169,7 @@ function QueryOptions({ name, clientName, dataReturnType, typeSchemas, paramsCas
169
169
  typeSchemas,
170
170
  paramsCasing
171
171
  });
172
- const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key : void 0).filter(Boolean).join("&& ");
172
+ const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? `${key}` : void 0).filter(Boolean).join(" && ");
173
173
  const enabledText = enabled ? `enabled: !!(${enabled}),` : "";
174
174
  return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Source, {
175
175
  name,
@@ -233,7 +233,7 @@ function getParams$4({ paramsType, paramsCasing, pathParamsType, dataReturnType,
233
233
  options: {
234
234
  type: `
235
235
  {
236
- query?: Partial<InfiniteQueryObserverOptions<${[
236
+ query?: Partial<UseInfiniteQueryOptions<${[
237
237
  TData,
238
238
  TError,
239
239
  "TQueryData",
@@ -276,7 +276,7 @@ function getParams$4({ paramsType, paramsCasing, pathParamsType, dataReturnType,
276
276
  options: {
277
277
  type: `
278
278
  {
279
- query?: Partial<InfiniteQueryObserverOptions<${[
279
+ query?: Partial<UseInfiniteQueryOptions<${[
280
280
  TData,
281
281
  TError,
282
282
  "TQueryData",
@@ -292,7 +292,8 @@ function getParams$4({ paramsType, paramsCasing, pathParamsType, dataReturnType,
292
292
  }
293
293
  function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, paramsCasing, dataReturnType, typeSchemas, operation }) {
294
294
  const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
295
- const returnType = `UseInfiniteQueryReturnType<${["TData", `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`].join(", ")}> & { queryKey: TQueryKey }`;
295
+ const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
296
+ const returnType = `UseInfiniteQueryReturnType<${["TData", TError].join(", ")}> & { queryKey: TQueryKey }`;
296
297
  const generics = [
297
298
  `TData = InfiniteData<${TData}>`,
298
299
  `TQueryData = ${TData}`,
@@ -330,13 +331,13 @@ function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName,
330
331
  children: `
331
332
  const { query: queryConfig = {}, client: config = {} } = options ?? {}
332
333
  const { client: queryClient, ...queryOptions } = queryConfig
333
- const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})
334
+ const queryKey = (queryOptions && 'queryKey' in queryOptions ? toValue(queryOptions.queryKey) : undefined) ?? ${queryKeyName}(${queryKeyParams.toCall()})
334
335
 
335
336
  const query = useInfiniteQuery({
336
337
  ...${queryOptions},
337
- queryKey,
338
- ...queryOptions
339
- } as unknown as InfiniteQueryObserverOptions, queryClient) as ${returnType}
338
+ ...queryOptions,
339
+ queryKey
340
+ } as unknown as UseInfiniteQueryOptions<${TData}, ${TError}, ${TData}, TQueryKey, ${TData}>, toValue(queryClient)) as ${returnType}
340
341
 
341
342
  query.queryKey = queryKey as TQueryKey
342
343
 
@@ -450,7 +451,7 @@ function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam,
450
451
  params = { }
451
452
  }
452
453
  params['${queryParam}'] = pageParam as unknown as ${typeSchemas.queryParams?.name}['${queryParam}']` : "";
453
- const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key : void 0).filter(Boolean).join("&& ");
454
+ const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? `${key}` : void 0).filter(Boolean).join(" && ");
454
455
  const enabledText = enabled ? `enabled: !!(${enabled}),` : "";
455
456
  return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Source, {
456
457
  name,
@@ -684,7 +685,7 @@ function getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, t
684
685
  options: {
685
686
  type: `
686
687
  {
687
- query?: Partial<QueryObserverOptions<${[
688
+ query?: Partial<UseQueryOptions<${[
688
689
  TData,
689
690
  TError,
690
691
  "TData",
@@ -727,7 +728,7 @@ function getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, t
727
728
  options: {
728
729
  type: `
729
730
  {
730
- query?: Partial<QueryObserverOptions<${[
731
+ query?: Partial<UseQueryOptions<${[
731
732
  TData,
732
733
  TError,
733
734
  "TData",
@@ -743,7 +744,8 @@ function getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, t
743
744
  }
744
745
  function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas, operation }) {
745
746
  const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
746
- const returnType = `UseQueryReturnType<${["TData", `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`].join(", ")}> & { queryKey: TQueryKey }`;
747
+ const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
748
+ const returnType = `UseQueryReturnType<${["TData", TError].join(", ")}> & { queryKey: TQueryKey }`;
747
749
  const generics = [
748
750
  `TData = ${TData}`,
749
751
  `TQueryData = ${TData}`,
@@ -781,13 +783,13 @@ function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsT
781
783
  children: `
782
784
  const { query: queryConfig = {}, client: config = {} } = options ?? {}
783
785
  const { client: queryClient, ...queryOptions } = queryConfig
784
- const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})
786
+ const queryKey = (queryOptions && 'queryKey' in queryOptions ? toValue(queryOptions.queryKey) : undefined) ?? ${queryKeyName}(${queryKeyParams.toCall()})
785
787
 
786
788
  const query = useQuery({
787
789
  ...${queryOptions},
788
- queryKey,
789
- ...queryOptions
790
- } as unknown as QueryObserverOptions, queryClient) as ${returnType}
790
+ ...queryOptions,
791
+ queryKey
792
+ } as unknown as UseQueryOptions<${TData}, ${TError}, TData, ${TData}, TQueryKey>, toValue(queryClient)) as ${returnType}
791
793
 
792
794
  query.queryKey = queryKey as TQueryKey
793
795
 
@@ -841,4 +843,4 @@ Object.defineProperty(exports, 'QueryOptions', {
841
843
  return QueryOptions;
842
844
  }
843
845
  });
844
- //# sourceMappingURL=components-Cpik9Er1.cjs.map
846
+ //# sourceMappingURL=components-D_5ExAbi.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-D_5ExAbi.cjs","names":["getParams","FunctionParams","getTransformer: Transformer","URLPath","getTransformer","File","Function","Type","getParams","FunctionParams","Client","File","Function","name","getParams","FunctionParams","File","Function","getParams","FunctionParams","Client","File","Function","name","getParams","FunctionParams","getTransformer: Transformer","URLPath","File","Function","Type","getParams","FunctionParams","Client","File","Function","FunctionParams","File","Function"],"sources":["../src/components/QueryKey.tsx","../src/components/QueryOptions.tsx","../src/components/InfiniteQuery.tsx","../src/components/InfiniteQueryOptions.tsx","../src/components/MutationKey.tsx","../src/components/Mutation.tsx","../src/components/Query.tsx"],"sourcesContent":["import { URLPath } from '@kubb/core/utils'\nimport { isOptional, type Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams, Type } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery, Transformer } from '../types'\n\ntype Props = {\n name: string\n typeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n transformer: Transformer | undefined\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ pathParamsType, paramsCasing, typeSchemas }: GetParamsProps) {\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n })\n}\n\nconst getTransformer: Transformer = ({ operation, schemas, casing }) => {\n const path = new URLPath(operation.path, { casing })\n const keys = [\n path.toObject({\n type: 'path',\n stringify: true,\n }),\n schemas.queryParams?.name ? '...(params ? [params] : [])' : undefined,\n schemas.request?.name ? '...(data ? [data] : [])' : undefined,\n ].filter(Boolean)\n\n return keys\n}\n\nexport function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }: Props): KubbNode {\n const params = getParams({ pathParamsType, typeSchemas, paramsCasing })\n const keys = transformer({\n operation,\n schemas: typeSchemas,\n casing: paramsCasing,\n })\n\n return (\n <>\n <File.Source name={name} isExportable isIndexable>\n <Function.Arrow name={name} export params={params.toConstructor()} singleLine>\n {`[${keys.join(', ')}] as const`}\n </Function.Arrow>\n </File.Source>\n <File.Source name={typeName} isExportable isIndexable isTypeOnly>\n <Type name={typeName} export>\n {`ReturnType<typeof ${name}>`}\n </Type>\n </File.Source>\n </>\n )\n}\n\nQueryKey.getParams = getParams\nQueryKey.getTransformer = getTransformer\n","import { isOptional } from '@kubb/oas'\nimport { Client } from '@kubb/plugin-client/components'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\n\ntype Props = {\n name: string\n clientName: string\n queryKeyName: string\n typeSchemas: OperationSchemas\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) {\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n optional: isOptional(typeSchemas.pathParams?.schema),\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n}\n\nexport function QueryOptions({ name, clientName, dataReturnType, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }: Props): KubbNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })\n const clientParams = Client.getParams({\n paramsType,\n paramsCasing,\n typeSchemas,\n pathParamsType,\n isConfigurable: true,\n })\n const queryKeyParams = QueryKey.getParams({\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n\n const enabled = Object.entries(queryKeyParams.flatParams)\n .map(([key, item]) => (item && !item.optional ? `${key}` : undefined))\n .filter(Boolean)\n .join(' && ')\n\n const enabledText = enabled ? `enabled: !!(${enabled}),` : ''\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={params.toConstructor()}>\n {`\n const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})\n return queryOptions<${TData}, ${TError}, ${TData}, typeof queryKey>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal }) => {\n config.signal = signal\n return ${clientName}(${clientParams.toCall({\n transformName(name) {\n return `toValue(${name})`\n },\n })})\n },\n })\n`}\n </Function>\n </File.Source>\n )\n}\n\nQueryOptions.getParams = getParams\n","import { isOptional, type Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\nimport { QueryOptions } from './QueryOptions.tsx'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n queryOptionsName: string\n queryKeyName: string\n queryKeyTypeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n options: {\n type: `\n{\n query?: Partial<UseInfiniteQueryOptions<${[TData, TError, 'TQueryData', 'TQueryKey', 'TQueryData'].join(', ')}>> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'}\n}\n`,\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n optional: isOptional(typeSchemas.pathParams?.schema),\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n options: {\n type: `\n{\n query?: Partial<UseInfiniteQueryOptions<${[TData, TError, 'TQueryData', 'TQueryKey', 'TQueryData'].join(', ')}>> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'}\n}\n`,\n default: '{}',\n },\n })\n}\n\nexport function InfiniteQuery({\n name,\n queryKeyTypeName,\n queryOptionsName,\n queryKeyName,\n paramsType,\n pathParamsType,\n paramsCasing,\n dataReturnType,\n typeSchemas,\n operation,\n}: Props): KubbNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n const returnType = `UseInfiniteQueryReturnType<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`\n const generics = [`TData = InfiniteData<${TData}>`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]\n\n const queryKeyParams = QueryKey.getParams({\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const queryOptionsParams = QueryOptions.getParams({\n paramsType,\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const params = getParams({\n paramsCasing,\n paramsType,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n })\n\n const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})`\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n generics={generics.join(', ')}\n params={params.toConstructor()}\n JSDoc={{\n comments: getComments(operation),\n }}\n >\n {`\n const { query: queryConfig = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...queryOptions } = queryConfig\n const queryKey = (queryOptions && 'queryKey' in queryOptions ? toValue(queryOptions.queryKey) : undefined) ?? ${queryKeyName}(${queryKeyParams.toCall()})\n\n const query = useInfiniteQuery({\n ...${queryOptions},\n ...queryOptions,\n queryKey\n } as unknown as UseInfiniteQueryOptions<${TData}, ${TError}, ${TData}, TQueryKey, ${TData}>, toValue(queryClient)) as ${returnType}\n\n query.queryKey = queryKey as TQueryKey\n\n return query\n `}\n </Function>\n </File.Source>\n )\n}\n\nInfiniteQuery.getParams = getParams\n","import { isOptional } from '@kubb/oas'\nimport { Client } from '@kubb/plugin-client/components'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { Infinite, PluginVueQuery } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\n\ntype Props = {\n name: string\n clientName: string\n queryKeyName: string\n typeSchemas: OperationSchemas\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n initialPageParam: Infinite['initialPageParam']\n cursorParam: Infinite['cursorParam']\n queryParam: Infinite['queryParam']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) {\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n optional: isOptional(typeSchemas.pathParams?.schema),\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n}\n\nexport function InfiniteQueryOptions({\n name,\n clientName,\n initialPageParam,\n cursorParam,\n typeSchemas,\n paramsType,\n paramsCasing,\n dataReturnType,\n pathParamsType,\n queryParam,\n queryKeyName,\n}: Props): KubbNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })\n const clientParams = Client.getParams({\n paramsType,\n paramsCasing,\n typeSchemas,\n pathParamsType,\n isConfigurable: true,\n })\n const queryKeyParams = QueryKey.getParams({\n paramsCasing,\n pathParamsType,\n typeSchemas,\n })\n\n const queryOptions = [\n `initialPageParam: ${typeof initialPageParam === 'string' ? JSON.stringify(initialPageParam) : initialPageParam}`,\n cursorParam ? `getNextPageParam: (lastPage) => lastPage['${cursorParam}']` : undefined,\n cursorParam ? `getPreviousPageParam: (firstPage) => firstPage['${cursorParam}']` : undefined,\n !cursorParam && dataReturnType === 'full'\n ? 'getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage.data) && lastPage.data.length === 0 ? undefined : lastPageParam + 1'\n : undefined,\n !cursorParam && dataReturnType === 'data'\n ? 'getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage) && lastPage.length === 0 ? undefined : lastPageParam + 1'\n : undefined,\n !cursorParam ? 'getPreviousPageParam: (_firstPage, _allPages, firstPageParam) => firstPageParam <= 1 ? undefined : firstPageParam - 1' : undefined,\n ].filter(Boolean)\n\n const infiniteOverrideParams =\n queryParam && typeSchemas.queryParams?.name\n ? `\n if (!params) {\n params = { }\n }\n params['${queryParam}'] = pageParam as unknown as ${typeSchemas.queryParams?.name}['${queryParam}']`\n : ''\n\n const enabled = Object.entries(queryKeyParams.flatParams)\n .map(([key, item]) => (item && !item.optional ? `${key}` : undefined))\n .filter(Boolean)\n .join(' && ')\n\n const enabledText = enabled ? `enabled: !!(${enabled}),` : ''\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={params.toConstructor()}>\n {`\n const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})\n return infiniteQueryOptions<${TData}, ${TError}, ${TData}, typeof queryKey, number>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal, pageParam }) => {\n config.signal = signal\n ${infiniteOverrideParams}\n return ${clientName}(${clientParams.toCall({\n transformName(name) {\n return `toValue(${name})`\n },\n })})\n },\n ${queryOptions.join(',\\n')}\n })\n`}\n </Function>\n </File.Source>\n )\n}\n\nInfiniteQueryOptions.getParams = getParams\n","import { URLPath } from '@kubb/core/utils'\nimport type { Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { File, Function, FunctionParams, Type } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery, Transformer } from '../types'\n\ntype Props = {\n name: string\n typeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n transformer: Transformer | undefined\n}\n\ntype GetParamsProps = {\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({}: GetParamsProps) {\n return FunctionParams.factory({})\n}\n\nconst getTransformer: Transformer = ({ operation, casing }) => {\n const path = new URLPath(operation.path, { casing })\n\n return [`{ url: '${path.toURLPath()}' }`]\n}\n\nexport function MutationKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }: Props): KubbNode {\n const params = getParams({ pathParamsType, typeSchemas })\n const keys = transformer({ operation, schemas: typeSchemas, casing: paramsCasing })\n\n return (\n <>\n <File.Source name={name} isExportable isIndexable>\n <Function.Arrow name={name} export params={params.toConstructor()} singleLine>\n {`[${keys.join(', ')}] as const`}\n </Function.Arrow>\n </File.Source>\n <File.Source name={typeName} isExportable isIndexable isTypeOnly>\n <Type name={typeName} export>\n {`ReturnType<typeof ${name}>`}\n </Type>\n </File.Source>\n </>\n )\n}\n\nMutationKey.getParams = getParams\nMutationKey.getTransformer = getTransformer\n","import { isOptional, type Operation } from '@kubb/oas'\nimport { Client } from '@kubb/plugin-client/components'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode, Params } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { MutationKey } from './MutationKey.tsx'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n typeName: string\n clientName: string\n mutationKeyName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsCasing, dataReturnType, typeSchemas }: GetParamsProps) {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const mutationParams = FunctionParams.factory({\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n })\n const TRequest = mutationParams.toConstructor()\n\n return FunctionParams.factory({\n options: {\n type: `\n{\n mutation?: MutationObserverOptions<${[TData, TError, TRequest ? `{${TRequest}}` : 'void', 'TContext'].join(', ')}> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'},\n}\n`,\n default: '{}',\n },\n })\n}\n\nexport function Mutation({\n name,\n clientName,\n paramsCasing,\n paramsType,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n operation,\n mutationKeyName,\n}: Props): KubbNode {\n const mutationKeyParams = MutationKey.getParams({\n pathParamsType,\n typeSchemas,\n })\n\n const params = getParams({\n paramsCasing,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n })\n\n const clientParams = Client.getParams({\n paramsCasing,\n paramsType,\n typeSchemas,\n pathParamsType,\n isConfigurable: true,\n })\n\n const mutationParams = FunctionParams.factory({\n ...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: typeSchemas.queryParams?.name,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: typeSchemas.headerParams?.name,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n })\n const dataParams = FunctionParams.factory({\n data: {\n // No use of pathParams because useMutation can only take one argument in object form,\n // see https://tanstack.com/query/latest/docs/framework/react/reference/useMutation#usemutation\n mode: 'object',\n children: Object.entries(mutationParams.params).reduce((acc, [key, value]) => {\n if (value) {\n acc[key] = {\n ...value,\n type: undefined,\n }\n }\n\n return acc\n }, {} as Params),\n },\n })\n\n const TRequest = mutationParams.toConstructor()\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const generics = [TData, TError, TRequest ? `{${TRequest}}` : 'void', 'TContext'].join(', ')\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n params={params.toConstructor()}\n JSDoc={{\n comments: getComments(operation),\n }}\n generics={['TContext']}\n >\n {`\n const { mutation = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...mutationOptions } = mutation;\n const mutationKey = mutationOptions?.mutationKey ?? ${mutationKeyName}(${mutationKeyParams.toCall()})\n\n return useMutation<${generics}>({\n mutationFn: async(${dataParams.toConstructor()}) => {\n return ${clientName}(${clientParams.toCall()})\n },\n mutationKey,\n ...mutationOptions\n }, queryClient)\n `}\n </Function>\n </File.Source>\n )\n}\n","import { isOptional, type Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\nimport { QueryOptions } from './QueryOptions.tsx'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n queryOptionsName: string\n queryKeyName: string\n queryKeyTypeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n options: {\n type: `\n{\n query?: Partial<UseQueryOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'}\n}\n`,\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n optional: isOptional(typeSchemas.pathParams?.schema),\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n options: {\n type: `\n{\n query?: Partial<UseQueryOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'}\n}\n`,\n default: '{}',\n },\n })\n}\n\nexport function Query({\n name,\n queryKeyTypeName,\n queryOptionsName,\n queryKeyName,\n paramsType,\n paramsCasing,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n operation,\n}: Props): KubbNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n const returnType = `UseQueryReturnType<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`\n const generics = [`TData = ${TData}`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]\n\n const queryKeyParams = QueryKey.getParams({\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const queryOptionsParams = QueryOptions.getParams({\n paramsType,\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const params = getParams({\n paramsCasing,\n paramsType,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n })\n\n const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})`\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n generics={generics.join(', ')}\n params={params.toConstructor()}\n JSDoc={{\n comments: getComments(operation),\n }}\n >\n {`\n const { query: queryConfig = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...queryOptions } = queryConfig\n const queryKey = (queryOptions && 'queryKey' in queryOptions ? toValue(queryOptions.queryKey) : undefined) ?? ${queryKeyName}(${queryKeyParams.toCall()})\n\n const query = useQuery({\n ...${queryOptions},\n ...queryOptions,\n queryKey\n } as unknown as UseQueryOptions<${TData}, ${TError}, TData, ${TData}, TQueryKey>, toValue(queryClient)) as ${returnType}\n\n query.queryKey = queryKey as TQueryKey\n\n return query\n `}\n </Function>\n </File.Source>\n )\n}\n\nQuery.getParams = getParams\n"],"mappings":";;;;;;;;;AAwBA,SAASA,YAAU,EAAE,gBAAgB,cAAc,eAA+B;AAChF,QAAOC,mCAAe,QAAQ;EAC5B,YAAY;GACV,MAAM,mBAAmB,WAAW,WAAW;GAC/C,qDAAwB,YAAY,YAAY;IAC9C,OAAO;IACP,QAAQ;IACR,SAAS,MAAM;AACb,YAAO;MACL,GAAG;MACH,MAAM,oBAAoB,KAAK,KAAK;MACrC;;IAEJ,CAAC;GACH;EACD,MAAM,YAAY,SAAS,OACvB;GACE,MAAM,oBAAoB,YAAY,SAAS,KAAK;GACpD,qCAAqB,YAAY,SAAS,OAAO;GAClD,GACD;EACJ,QAAQ,YAAY,aAAa,OAC7B;GACE,MAAM,oBAAoB,YAAY,aAAa,KAAK;GACxD,qCAAqB,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sCas
168
168
  typeSchemas,
169
169
  paramsCasing
170
170
  });
171
- const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key : void 0).filter(Boolean).join("&& ");
171
+ const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? `${key}` : void 0).filter(Boolean).join(" && ");
172
172
  const enabledText = enabled ? `enabled: !!(${enabled}),` : "";
173
173
  return /* @__PURE__ */ jsx(File.Source, {
174
174
  name,
@@ -232,7 +232,7 @@ function getParams$4({ paramsType, paramsCasing, pathParamsType, dataReturnType,
232
232
  options: {
233
233
  type: `
234
234
  {
235
- query?: Partial<InfiniteQueryObserverOptions<${[
235
+ query?: Partial<UseInfiniteQueryOptions<${[
236
236
  TData,
237
237
  TError,
238
238
  "TQueryData",
@@ -275,7 +275,7 @@ function getParams$4({ paramsType, paramsCasing, pathParamsType, dataReturnType,
275
275
  options: {
276
276
  type: `
277
277
  {
278
- query?: Partial<InfiniteQueryObserverOptions<${[
278
+ query?: Partial<UseInfiniteQueryOptions<${[
279
279
  TData,
280
280
  TError,
281
281
  "TQueryData",
@@ -291,7 +291,8 @@ function getParams$4({ paramsType, paramsCasing, pathParamsType, dataReturnType,
291
291
  }
292
292
  function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, paramsCasing, dataReturnType, typeSchemas, operation }) {
293
293
  const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
294
- const returnType = `UseInfiniteQueryReturnType<${["TData", `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`].join(", ")}> & { queryKey: TQueryKey }`;
294
+ const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
295
+ const returnType = `UseInfiniteQueryReturnType<${["TData", TError].join(", ")}> & { queryKey: TQueryKey }`;
295
296
  const generics = [
296
297
  `TData = InfiniteData<${TData}>`,
297
298
  `TQueryData = ${TData}`,
@@ -329,13 +330,13 @@ function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName,
329
330
  children: `
330
331
  const { query: queryConfig = {}, client: config = {} } = options ?? {}
331
332
  const { client: queryClient, ...queryOptions } = queryConfig
332
- const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})
333
+ const queryKey = (queryOptions && 'queryKey' in queryOptions ? toValue(queryOptions.queryKey) : undefined) ?? ${queryKeyName}(${queryKeyParams.toCall()})
333
334
 
334
335
  const query = useInfiniteQuery({
335
336
  ...${queryOptions},
336
- queryKey,
337
- ...queryOptions
338
- } as unknown as InfiniteQueryObserverOptions, queryClient) as ${returnType}
337
+ ...queryOptions,
338
+ queryKey
339
+ } as unknown as UseInfiniteQueryOptions<${TData}, ${TError}, ${TData}, TQueryKey, ${TData}>, toValue(queryClient)) as ${returnType}
339
340
 
340
341
  query.queryKey = queryKey as TQueryKey
341
342
 
@@ -449,7 +450,7 @@ function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam,
449
450
  params = { }
450
451
  }
451
452
  params['${queryParam}'] = pageParam as unknown as ${typeSchemas.queryParams?.name}['${queryParam}']` : "";
452
- const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key : void 0).filter(Boolean).join("&& ");
453
+ const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? `${key}` : void 0).filter(Boolean).join(" && ");
453
454
  const enabledText = enabled ? `enabled: !!(${enabled}),` : "";
454
455
  return /* @__PURE__ */ jsx(File.Source, {
455
456
  name,
@@ -683,7 +684,7 @@ function getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, t
683
684
  options: {
684
685
  type: `
685
686
  {
686
- query?: Partial<QueryObserverOptions<${[
687
+ query?: Partial<UseQueryOptions<${[
687
688
  TData,
688
689
  TError,
689
690
  "TData",
@@ -726,7 +727,7 @@ function getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, t
726
727
  options: {
727
728
  type: `
728
729
  {
729
- query?: Partial<QueryObserverOptions<${[
730
+ query?: Partial<UseQueryOptions<${[
730
731
  TData,
731
732
  TError,
732
733
  "TData",
@@ -742,7 +743,8 @@ function getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, t
742
743
  }
743
744
  function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas, operation }) {
744
745
  const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
745
- const returnType = `UseQueryReturnType<${["TData", `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`].join(", ")}> & { queryKey: TQueryKey }`;
746
+ const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
747
+ const returnType = `UseQueryReturnType<${["TData", TError].join(", ")}> & { queryKey: TQueryKey }`;
746
748
  const generics = [
747
749
  `TData = ${TData}`,
748
750
  `TQueryData = ${TData}`,
@@ -780,13 +782,13 @@ function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsT
780
782
  children: `
781
783
  const { query: queryConfig = {}, client: config = {} } = options ?? {}
782
784
  const { client: queryClient, ...queryOptions } = queryConfig
783
- const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})
785
+ const queryKey = (queryOptions && 'queryKey' in queryOptions ? toValue(queryOptions.queryKey) : undefined) ?? ${queryKeyName}(${queryKeyParams.toCall()})
784
786
 
785
787
  const query = useQuery({
786
788
  ...${queryOptions},
787
- queryKey,
788
- ...queryOptions
789
- } as unknown as QueryObserverOptions, queryClient) as ${returnType}
789
+ ...queryOptions,
790
+ queryKey
791
+ } as unknown as UseQueryOptions<${TData}, ${TError}, TData, ${TData}, TQueryKey>, toValue(queryClient)) as ${returnType}
790
792
 
791
793
  query.queryKey = queryKey as TQueryKey
792
794
 
@@ -799,4 +801,4 @@ Query.getParams = getParams;
799
801
 
800
802
  //#endregion
801
803
  export { InfiniteQuery as a, InfiniteQueryOptions as i, Mutation as n, QueryOptions as o, MutationKey as r, QueryKey as s, Query as t };
802
- //# sourceMappingURL=components-CvWdx6lq.js.map
804
+ //# sourceMappingURL=components-DhWwe20V.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-DhWwe20V.js","names":["getParams","getTransformer: Transformer","getTransformer","getParams","name","getParams","getParams","name","getParams","getTransformer: Transformer","getParams"],"sources":["../src/components/QueryKey.tsx","../src/components/QueryOptions.tsx","../src/components/InfiniteQuery.tsx","../src/components/InfiniteQueryOptions.tsx","../src/components/MutationKey.tsx","../src/components/Mutation.tsx","../src/components/Query.tsx"],"sourcesContent":["import { URLPath } from '@kubb/core/utils'\nimport { isOptional, type Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams, Type } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery, Transformer } from '../types'\n\ntype Props = {\n name: string\n typeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n transformer: Transformer | undefined\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ pathParamsType, paramsCasing, typeSchemas }: GetParamsProps) {\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n })\n}\n\nconst getTransformer: Transformer = ({ operation, schemas, casing }) => {\n const path = new URLPath(operation.path, { casing })\n const keys = [\n path.toObject({\n type: 'path',\n stringify: true,\n }),\n schemas.queryParams?.name ? '...(params ? [params] : [])' : undefined,\n schemas.request?.name ? '...(data ? [data] : [])' : undefined,\n ].filter(Boolean)\n\n return keys\n}\n\nexport function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }: Props): KubbNode {\n const params = getParams({ pathParamsType, typeSchemas, paramsCasing })\n const keys = transformer({\n operation,\n schemas: typeSchemas,\n casing: paramsCasing,\n })\n\n return (\n <>\n <File.Source name={name} isExportable isIndexable>\n <Function.Arrow name={name} export params={params.toConstructor()} singleLine>\n {`[${keys.join(', ')}] as const`}\n </Function.Arrow>\n </File.Source>\n <File.Source name={typeName} isExportable isIndexable isTypeOnly>\n <Type name={typeName} export>\n {`ReturnType<typeof ${name}>`}\n </Type>\n </File.Source>\n </>\n )\n}\n\nQueryKey.getParams = getParams\nQueryKey.getTransformer = getTransformer\n","import { isOptional } from '@kubb/oas'\nimport { Client } from '@kubb/plugin-client/components'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\n\ntype Props = {\n name: string\n clientName: string\n queryKeyName: string\n typeSchemas: OperationSchemas\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) {\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n optional: isOptional(typeSchemas.pathParams?.schema),\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n}\n\nexport function QueryOptions({ name, clientName, dataReturnType, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }: Props): KubbNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })\n const clientParams = Client.getParams({\n paramsType,\n paramsCasing,\n typeSchemas,\n pathParamsType,\n isConfigurable: true,\n })\n const queryKeyParams = QueryKey.getParams({\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n\n const enabled = Object.entries(queryKeyParams.flatParams)\n .map(([key, item]) => (item && !item.optional ? `${key}` : undefined))\n .filter(Boolean)\n .join(' && ')\n\n const enabledText = enabled ? `enabled: !!(${enabled}),` : ''\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={params.toConstructor()}>\n {`\n const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})\n return queryOptions<${TData}, ${TError}, ${TData}, typeof queryKey>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal }) => {\n config.signal = signal\n return ${clientName}(${clientParams.toCall({\n transformName(name) {\n return `toValue(${name})`\n },\n })})\n },\n })\n`}\n </Function>\n </File.Source>\n )\n}\n\nQueryOptions.getParams = getParams\n","import { isOptional, type Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\nimport { QueryOptions } from './QueryOptions.tsx'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n queryOptionsName: string\n queryKeyName: string\n queryKeyTypeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n options: {\n type: `\n{\n query?: Partial<UseInfiniteQueryOptions<${[TData, TError, 'TQueryData', 'TQueryKey', 'TQueryData'].join(', ')}>> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'}\n}\n`,\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n optional: isOptional(typeSchemas.pathParams?.schema),\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n options: {\n type: `\n{\n query?: Partial<UseInfiniteQueryOptions<${[TData, TError, 'TQueryData', 'TQueryKey', 'TQueryData'].join(', ')}>> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'}\n}\n`,\n default: '{}',\n },\n })\n}\n\nexport function InfiniteQuery({\n name,\n queryKeyTypeName,\n queryOptionsName,\n queryKeyName,\n paramsType,\n pathParamsType,\n paramsCasing,\n dataReturnType,\n typeSchemas,\n operation,\n}: Props): KubbNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n const returnType = `UseInfiniteQueryReturnType<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`\n const generics = [`TData = InfiniteData<${TData}>`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]\n\n const queryKeyParams = QueryKey.getParams({\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const queryOptionsParams = QueryOptions.getParams({\n paramsType,\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const params = getParams({\n paramsCasing,\n paramsType,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n })\n\n const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})`\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n generics={generics.join(', ')}\n params={params.toConstructor()}\n JSDoc={{\n comments: getComments(operation),\n }}\n >\n {`\n const { query: queryConfig = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...queryOptions } = queryConfig\n const queryKey = (queryOptions && 'queryKey' in queryOptions ? toValue(queryOptions.queryKey) : undefined) ?? ${queryKeyName}(${queryKeyParams.toCall()})\n\n const query = useInfiniteQuery({\n ...${queryOptions},\n ...queryOptions,\n queryKey\n } as unknown as UseInfiniteQueryOptions<${TData}, ${TError}, ${TData}, TQueryKey, ${TData}>, toValue(queryClient)) as ${returnType}\n\n query.queryKey = queryKey as TQueryKey\n\n return query\n `}\n </Function>\n </File.Source>\n )\n}\n\nInfiniteQuery.getParams = getParams\n","import { isOptional } from '@kubb/oas'\nimport { Client } from '@kubb/plugin-client/components'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { Infinite, PluginVueQuery } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\n\ntype Props = {\n name: string\n clientName: string\n queryKeyName: string\n typeSchemas: OperationSchemas\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n initialPageParam: Infinite['initialPageParam']\n cursorParam: Infinite['cursorParam']\n queryParam: Infinite['queryParam']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) {\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n optional: isOptional(typeSchemas.pathParams?.schema),\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n}\n\nexport function InfiniteQueryOptions({\n name,\n clientName,\n initialPageParam,\n cursorParam,\n typeSchemas,\n paramsType,\n paramsCasing,\n dataReturnType,\n pathParamsType,\n queryParam,\n queryKeyName,\n}: Props): KubbNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })\n const clientParams = Client.getParams({\n paramsType,\n paramsCasing,\n typeSchemas,\n pathParamsType,\n isConfigurable: true,\n })\n const queryKeyParams = QueryKey.getParams({\n paramsCasing,\n pathParamsType,\n typeSchemas,\n })\n\n const queryOptions = [\n `initialPageParam: ${typeof initialPageParam === 'string' ? JSON.stringify(initialPageParam) : initialPageParam}`,\n cursorParam ? `getNextPageParam: (lastPage) => lastPage['${cursorParam}']` : undefined,\n cursorParam ? `getPreviousPageParam: (firstPage) => firstPage['${cursorParam}']` : undefined,\n !cursorParam && dataReturnType === 'full'\n ? 'getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage.data) && lastPage.data.length === 0 ? undefined : lastPageParam + 1'\n : undefined,\n !cursorParam && dataReturnType === 'data'\n ? 'getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage) && lastPage.length === 0 ? undefined : lastPageParam + 1'\n : undefined,\n !cursorParam ? 'getPreviousPageParam: (_firstPage, _allPages, firstPageParam) => firstPageParam <= 1 ? undefined : firstPageParam - 1' : undefined,\n ].filter(Boolean)\n\n const infiniteOverrideParams =\n queryParam && typeSchemas.queryParams?.name\n ? `\n if (!params) {\n params = { }\n }\n params['${queryParam}'] = pageParam as unknown as ${typeSchemas.queryParams?.name}['${queryParam}']`\n : ''\n\n const enabled = Object.entries(queryKeyParams.flatParams)\n .map(([key, item]) => (item && !item.optional ? `${key}` : undefined))\n .filter(Boolean)\n .join(' && ')\n\n const enabledText = enabled ? `enabled: !!(${enabled}),` : ''\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={params.toConstructor()}>\n {`\n const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})\n return infiniteQueryOptions<${TData}, ${TError}, ${TData}, typeof queryKey, number>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal, pageParam }) => {\n config.signal = signal\n ${infiniteOverrideParams}\n return ${clientName}(${clientParams.toCall({\n transformName(name) {\n return `toValue(${name})`\n },\n })})\n },\n ${queryOptions.join(',\\n')}\n })\n`}\n </Function>\n </File.Source>\n )\n}\n\nInfiniteQueryOptions.getParams = getParams\n","import { URLPath } from '@kubb/core/utils'\nimport type { Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { File, Function, FunctionParams, Type } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery, Transformer } from '../types'\n\ntype Props = {\n name: string\n typeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n transformer: Transformer | undefined\n}\n\ntype GetParamsProps = {\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({}: GetParamsProps) {\n return FunctionParams.factory({})\n}\n\nconst getTransformer: Transformer = ({ operation, casing }) => {\n const path = new URLPath(operation.path, { casing })\n\n return [`{ url: '${path.toURLPath()}' }`]\n}\n\nexport function MutationKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }: Props): KubbNode {\n const params = getParams({ pathParamsType, typeSchemas })\n const keys = transformer({ operation, schemas: typeSchemas, casing: paramsCasing })\n\n return (\n <>\n <File.Source name={name} isExportable isIndexable>\n <Function.Arrow name={name} export params={params.toConstructor()} singleLine>\n {`[${keys.join(', ')}] as const`}\n </Function.Arrow>\n </File.Source>\n <File.Source name={typeName} isExportable isIndexable isTypeOnly>\n <Type name={typeName} export>\n {`ReturnType<typeof ${name}>`}\n </Type>\n </File.Source>\n </>\n )\n}\n\nMutationKey.getParams = getParams\nMutationKey.getTransformer = getTransformer\n","import { isOptional, type Operation } from '@kubb/oas'\nimport { Client } from '@kubb/plugin-client/components'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode, Params } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { MutationKey } from './MutationKey.tsx'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n typeName: string\n clientName: string\n mutationKeyName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsCasing, dataReturnType, typeSchemas }: GetParamsProps) {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const mutationParams = FunctionParams.factory({\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n })\n const TRequest = mutationParams.toConstructor()\n\n return FunctionParams.factory({\n options: {\n type: `\n{\n mutation?: MutationObserverOptions<${[TData, TError, TRequest ? `{${TRequest}}` : 'void', 'TContext'].join(', ')}> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'},\n}\n`,\n default: '{}',\n },\n })\n}\n\nexport function Mutation({\n name,\n clientName,\n paramsCasing,\n paramsType,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n operation,\n mutationKeyName,\n}: Props): KubbNode {\n const mutationKeyParams = MutationKey.getParams({\n pathParamsType,\n typeSchemas,\n })\n\n const params = getParams({\n paramsCasing,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n })\n\n const clientParams = Client.getParams({\n paramsCasing,\n paramsType,\n typeSchemas,\n pathParamsType,\n isConfigurable: true,\n })\n\n const mutationParams = FunctionParams.factory({\n ...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: typeSchemas.queryParams?.name,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: typeSchemas.headerParams?.name,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n })\n const dataParams = FunctionParams.factory({\n data: {\n // No use of pathParams because useMutation can only take one argument in object form,\n // see https://tanstack.com/query/latest/docs/framework/react/reference/useMutation#usemutation\n mode: 'object',\n children: Object.entries(mutationParams.params).reduce((acc, [key, value]) => {\n if (value) {\n acc[key] = {\n ...value,\n type: undefined,\n }\n }\n\n return acc\n }, {} as Params),\n },\n })\n\n const TRequest = mutationParams.toConstructor()\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const generics = [TData, TError, TRequest ? `{${TRequest}}` : 'void', 'TContext'].join(', ')\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n params={params.toConstructor()}\n JSDoc={{\n comments: getComments(operation),\n }}\n generics={['TContext']}\n >\n {`\n const { mutation = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...mutationOptions } = mutation;\n const mutationKey = mutationOptions?.mutationKey ?? ${mutationKeyName}(${mutationKeyParams.toCall()})\n\n return useMutation<${generics}>({\n mutationFn: async(${dataParams.toConstructor()}) => {\n return ${clientName}(${clientParams.toCall()})\n },\n mutationKey,\n ...mutationOptions\n }, queryClient)\n `}\n </Function>\n </File.Source>\n )\n}\n","import { isOptional, type Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\nimport { QueryOptions } from './QueryOptions.tsx'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n queryOptionsName: string\n queryKeyName: string\n queryKeyTypeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n options: {\n type: `\n{\n query?: Partial<UseQueryOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'}\n}\n`,\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n optional: isOptional(typeSchemas.pathParams?.schema),\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n options: {\n type: `\n{\n query?: Partial<UseQueryOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'}\n}\n`,\n default: '{}',\n },\n })\n}\n\nexport function Query({\n name,\n queryKeyTypeName,\n queryOptionsName,\n queryKeyName,\n paramsType,\n paramsCasing,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n operation,\n}: Props): KubbNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n const returnType = `UseQueryReturnType<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`\n const generics = [`TData = ${TData}`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]\n\n const queryKeyParams = QueryKey.getParams({\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const queryOptionsParams = QueryOptions.getParams({\n paramsType,\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const params = getParams({\n paramsCasing,\n paramsType,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n })\n\n const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})`\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n generics={generics.join(', ')}\n params={params.toConstructor()}\n JSDoc={{\n comments: getComments(operation),\n }}\n >\n {`\n const { query: queryConfig = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...queryOptions } = queryConfig\n const queryKey = (queryOptions && 'queryKey' in queryOptions ? toValue(queryOptions.queryKey) : undefined) ?? ${queryKeyName}(${queryKeyParams.toCall()})\n\n const query = useQuery({\n ...${queryOptions},\n ...queryOptions,\n queryKey\n } as unknown as UseQueryOptions<${TData}, ${TError}, TData, ${TData}, TQueryKey>, toValue(queryClient)) as ${returnType}\n\n query.queryKey = queryKey as TQueryKey\n\n return query\n `}\n </Function>\n </File.Source>\n )\n}\n\nQuery.getParams = getParams\n"],"mappings":";;;;;;;;AAwBA,SAASA,YAAU,EAAE,gBAAgB,cAAc,eAA+B;AAChF,QAAO,eAAe,QAAQ;EAC5B,YAAY;GACV,MAAM,mBAAmB,WAAW,WAAW;GAC/C,UAAU,cAAc,YAAY,YAAY;IAC9C,OAAO;IACP,QAAQ;IACR,SAAS,MAAM;AACb,YAAO;MACL,GAAG;MACH,MAAM,oBAAoB,KAAK,KAAK;MACrC;;IAEJ,CAAC;GACH;EACD,MAAM,YAAY,SAAS,OACvB;GACE,MAAM,oBAAoB,YAAY,SAAS,KAAK;GACpD,UAAU,WAAW,YAAY,SAAS,OAAO;GAClD,GACD;EACJ,QAAQ,YAAY,aAAa,OAC7B;GACE,MAAM,oBAAoB,YAAY,aAAa,KAAK;GACxD,UAAU,WAAW,YAAY,aAAa,OAAO;GACtD,GACD;EACL,CAAC;;AAGJ,MAAMC,oBAA+B,EAAE,WAAW,SAAS,aAAa;AAWtE,QATa;EADA,IAAI,QAAQ,UAAU,MAAM,EAAE,QAAQ,CAAC,CAE7C,SAAS;GACZ,MAAM;GACN,WAAW;GACZ,CAAC;EACF,QAAQ,aAAa,OAAO,gCAAgC;EAC5D,QAAQ,SAAS,OAAO,4BAA4B;EACrD,CAAC,OAAO,QAAQ;;AAKnB,SAAgB,SAAS,EAAE,MAAM,aAAa,cAAc,gBAAgB,WAAW,UAAU,cAAcC,oBAAmC;CAChJ,MAAM,SAASF,YAAU;EAAE;EAAgB;EAAa;EAAc,CAAC;CACvE,MAAM,OAAO,YAAY;EACvB;EACA,SAAS;EACT,QAAQ;EACT,CAAC;AAEF,QACE,4CACE,oBAAC,KAAK;EAAa;EAAM;EAAa;YACpC,oBAAC,SAAS;GAAY;GAAM;GAAO,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AI,QAAQ;CAC1G,MAAM,aAAa,sBAAsB,CAAC,SAAS,OAAO,CAAC,KAAK,KAAK,CAAC;CACtE,MAAM,WAAW;EAAC,WAAW;EAAS,gBAAgB;EAAS,gCAAgC;EAAmB;CAElH,MAAM,iBAAiB,SAAS,UAAU;EACxC;EACA;EACA;EACD,CAAC;CACF,MAAM,qBAAqB,aAAa,UAAU;EAChD;EACA;EACA;EACA;EACD,CAAC;CACF,MAAM,SAAS,UAAU;EACvB;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,eAAe,GAAG,iBAAiB,GAAG,mBAAmB,QAAQ,CAAC;AAExE,QACE,oBAAC,KAAK;EAAa;EAAM;EAAa;YACpC,oBAAC;GACO;GACN;GACA,UAAU,SAAS,KAAK,KAAK;GAC7B,QAAQ,OAAO,eAAe;GAC9B,OAAO,EACL,UAAU,YAAY,UAAU,EACjC;aAEA;;;uHAG8G,aAAa,GAAG,eAAe,QAAQ,CAAC;;;aAGlJ,aAAa;;;yCAGe,MAAM,IAAI,OAAO,WAAW,MAAM,yCAAyC,WAAW;;;;;;IAM9G;GACC;;AAIlB,MAAM,YAAY"}
@@ -1,4 +1,4 @@
1
- const require_components = require('./components-Cpik9Er1.cjs');
1
+ const require_components = require('./components-D_5ExAbi.cjs');
2
2
 
3
3
  exports.InfiniteQuery = require_components.InfiniteQuery;
4
4
  exports.InfiniteQueryOptions = require_components.InfiniteQueryOptions;
@@ -1,3 +1,3 @@
1
- import { a as InfiniteQuery, i as InfiniteQueryOptions, n as Mutation, o as QueryOptions, r as MutationKey, s as QueryKey, t as Query } from "./components-CvWdx6lq.js";
1
+ import { a as InfiniteQuery, i as InfiniteQueryOptions, n as Mutation, o as QueryOptions, r as MutationKey, s as QueryKey, t as Query } from "./components-DhWwe20V.js";
2
2
 
3
3
  export { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Query, QueryKey, QueryOptions };
@@ -25,7 +25,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  }) : target, mod));
26
26
 
27
27
  //#endregion
28
- const require_components = require('./components-Cpik9Er1.cjs');
28
+ const require_components = require('./components-D_5ExAbi.cjs');
29
29
  let node_path = require("node:path");
30
30
  node_path = __toESM(node_path);
31
31
  let __kubb_plugin_client = require("@kubb/plugin-client");
@@ -238,7 +238,7 @@ const infiniteQueryGenerator = (0, __kubb_plugin_oas_generators.createReactGener
238
238
  name: [
239
239
  "QueryKey",
240
240
  "QueryClient",
241
- "InfiniteQueryObserverOptions",
241
+ "UseInfiniteQueryOptions",
242
242
  "UseInfiniteQueryReturnType"
243
243
  ],
244
244
  path: importPath,
@@ -620,7 +620,7 @@ const queryGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)({
620
620
  name: [
621
621
  "QueryKey",
622
622
  "QueryClient",
623
- "QueryObserverOptions",
623
+ "UseQueryOptions",
624
624
  "UseQueryReturnType"
625
625
  ],
626
626
  path: importPath,
@@ -669,4 +669,4 @@ Object.defineProperty(exports, 'queryGenerator', {
669
669
  return queryGenerator;
670
670
  }
671
671
  });
672
- //# sourceMappingURL=generators-FB2Is5pa.cjs.map
672
+ //# sourceMappingURL=generators-BCOVIRvJ.cjs.map