@kubb/plugin-vue-query 4.5.10 → 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.
- package/dist/{chunk-HKYW5u2u.js → chunk-CT0EDfkp.js} +11 -7
- package/dist/{components-fEdRyxiW.cjs → components-D_5ExAbi.cjs} +20 -18
- package/dist/components-D_5ExAbi.cjs.map +1 -0
- package/dist/{components-CvWdx6lq.js → components-DhWwe20V.js} +19 -17
- package/dist/components-DhWwe20V.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/{generators-B8sZ3OeN.cjs → generators-BCOVIRvJ.cjs} +14 -10
- package/dist/generators-BCOVIRvJ.cjs.map +1 -0
- package/dist/{generators-kmb86DA3.js → generators-kFLa_9GP.js} +4 -4
- package/dist/generators-kFLa_9GP.js.map +1 -0
- package/dist/generators.cjs +2 -2
- package/dist/generators.js +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +9 -9
- package/src/components/InfiniteQuery.tsx +6 -6
- package/src/components/InfiniteQueryOptions.tsx +2 -2
- package/src/components/Query.tsx +6 -6
- package/src/components/QueryOptions.tsx +2 -2
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +12 -6
- package/src/generators/__snapshots__/clientGetImportPath.ts +6 -6
- package/src/generators/__snapshots__/findByTags.ts +6 -6
- package/src/generators/__snapshots__/findByTagsObject.ts +6 -6
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +6 -6
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +6 -6
- package/src/generators/__snapshots__/findByTagsWithZod.ts +6 -6
- package/src/generators/__snapshots__/findInfiniteByTags.ts +12 -6
- package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +12 -6
- package/src/generators/__snapshots__/postAsQuery.ts +12 -6
- package/src/generators/infiniteQueryGenerator.tsx +1 -1
- package/src/generators/queryGenerator.tsx +1 -1
- package/dist/components-CvWdx6lq.js.map +0 -1
- package/dist/components-fEdRyxiW.cjs.map +0 -1
- package/dist/generators-B8sZ3OeN.cjs.map +0 -1
- package/dist/generators-kmb86DA3.js.map +0 -1
|
@@ -8,12 +8,16 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13
|
+
key = keys[i];
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
15
|
+
__defProp(to, key, {
|
|
16
|
+
get: ((k) => from[k]).bind(null, key),
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
17
21
|
}
|
|
18
22
|
return to;
|
|
19
23
|
};
|
|
@@ -21,7 +25,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
25
|
value: mod,
|
|
22
26
|
enumerable: true
|
|
23
27
|
}) : target, mod));
|
|
24
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
29
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
26
30
|
|
|
27
31
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_generators = require('./generators-
|
|
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<
|
|
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<
|
|
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
|
|
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
|
|
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
|
-
|
|
338
|
-
|
|
339
|
-
} as unknown as
|
|
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<
|
|
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<
|
|
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
|
|
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
|
|
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
|
-
|
|
789
|
-
|
|
790
|
-
} as unknown as
|
|
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-
|
|
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,aA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AY"}
|
|
@@ -168,7 +168,7 @@ function QueryOptions({ name, clientName, dataReturnType, typeSchemas, paramsCas
|
|
|
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<
|
|
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<
|
|
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
|
|
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
|
|
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
|
-
|
|
337
|
-
|
|
338
|
-
} as unknown as
|
|
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<
|
|
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<
|
|
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
|
|
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
|
|
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
|
-
|
|
788
|
-
|
|
789
|
-
} as unknown as
|
|
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-
|
|
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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K,KAAK,CAAC;aACtF,YAAY,SAAS,OAAO,yBAAyB,YAAY,SAAS,KAAK,kCAAkC,qDAAqD;;;GAG7K,SAAS;GACV;EACF,CAAC;;AAGJ,SAAgB,MAAM,EACpB,MACA,kBACA,kBACA,cACA,YACA,cACA,gBACA,gBACA,aACA,aACkB;CAClB,MAAM,QAAQ,mBAAmB,SAAS,YAAY,SAAS,OAAO,kBAAkB,YAAY,SAAS,KAAK;CAClH,MAAM,SAAS,uBAAuB,YAAY,QAAQ,KAAK,SAAS,KAAK,KAAK,CAAC,KAAK,MAAM,IAAI,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"}
|
package/dist/components.cjs
CHANGED
package/dist/components.js
CHANGED
|
@@ -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-
|
|
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 };
|
|
@@ -6,12 +6,16 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
return to;
|
|
17
21
|
};
|
|
@@ -21,7 +25,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
25
|
}) : target, mod));
|
|
22
26
|
|
|
23
27
|
//#endregion
|
|
24
|
-
const require_components = require('./components-
|
|
28
|
+
const require_components = require('./components-D_5ExAbi.cjs');
|
|
25
29
|
let node_path = require("node:path");
|
|
26
30
|
node_path = __toESM(node_path);
|
|
27
31
|
let __kubb_plugin_client = require("@kubb/plugin-client");
|
|
@@ -234,7 +238,7 @@ const infiniteQueryGenerator = (0, __kubb_plugin_oas_generators.createReactGener
|
|
|
234
238
|
name: [
|
|
235
239
|
"QueryKey",
|
|
236
240
|
"QueryClient",
|
|
237
|
-
"
|
|
241
|
+
"UseInfiniteQueryOptions",
|
|
238
242
|
"UseInfiniteQueryReturnType"
|
|
239
243
|
],
|
|
240
244
|
path: importPath,
|
|
@@ -616,7 +620,7 @@ const queryGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
616
620
|
name: [
|
|
617
621
|
"QueryKey",
|
|
618
622
|
"QueryClient",
|
|
619
|
-
"
|
|
623
|
+
"UseQueryOptions",
|
|
620
624
|
"UseQueryReturnType"
|
|
621
625
|
],
|
|
622
626
|
path: importPath,
|
|
@@ -665,4 +669,4 @@ Object.defineProperty(exports, 'queryGenerator', {
|
|
|
665
669
|
return queryGenerator;
|
|
666
670
|
}
|
|
667
671
|
});
|
|
668
|
-
//# sourceMappingURL=generators-
|
|
672
|
+
//# sourceMappingURL=generators-BCOVIRvJ.cjs.map
|