@kubb/plugin-vue-query 4.5.8 → 4.5.9

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 (33) hide show
  1. package/dist/{components-kADKAHgd.js → components-CvWdx6lq.js} +1 -1
  2. package/dist/{components-kADKAHgd.js.map → components-CvWdx6lq.js.map} +1 -1
  3. package/dist/components.d.cts +1 -1
  4. package/dist/components.d.ts +1 -1
  5. package/dist/components.js +1 -1
  6. package/dist/{generators-DDby6w9r.js → generators-kmb86DA3.js} +2 -2
  7. package/dist/{generators-DDby6w9r.js.map → generators-kmb86DA3.js.map} +1 -1
  8. package/dist/generators.d.cts +1 -1
  9. package/dist/generators.d.ts +1 -1
  10. package/dist/generators.js +2 -2
  11. package/dist/index.cjs +6 -8
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.js +8 -10
  16. package/dist/index.js.map +1 -1
  17. package/dist/{types-KYdGiLku.d.ts → types-COROLdSu.d.cts} +4 -11
  18. package/dist/{types-Bo3QWaIS.d.cts → types-DC5yKSuG.d.ts} +4 -11
  19. package/package.json +9 -9
  20. package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +2 -2
  21. package/src/generators/__snapshots__/findByTags.ts +2 -2
  22. package/src/generators/__snapshots__/findByTagsObject.ts +2 -2
  23. package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +2 -2
  24. package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +2 -2
  25. package/src/generators/__snapshots__/findByTagsWithZod.ts +2 -2
  26. package/src/generators/__snapshots__/findInfiniteByTags.ts +2 -2
  27. package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +2 -2
  28. package/src/generators/__snapshots__/postAsQuery.ts +2 -2
  29. package/src/generators/__snapshots__/updatePetById.ts +2 -2
  30. package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +2 -2
  31. package/src/plugin.ts +6 -7
  32. package/src/types.ts +1 -9
  33. /package/dist/{chunk-DMmIE7y6.js → chunk-HKYW5u2u.js} +0 -0
@@ -799,4 +799,4 @@ Query.getParams = getParams;
799
799
 
800
800
  //#endregion
801
801
  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-kADKAHgd.js.map
802
+ //# sourceMappingURL=components-CvWdx6lq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components-kADKAHgd.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<InfiniteQueryObserverOptions<${[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<InfiniteQueryObserverOptions<${[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 ?? ${queryKeyName}(${queryKeyParams.toCall()})\n\n const query = useInfiniteQuery({\n ...${queryOptions},\n queryKey,\n ...queryOptions\n } as unknown as InfiniteQueryObserverOptions, 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<QueryObserverOptions<${[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<QueryObserverOptions<${[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 ?? ${queryKeyName}(${queryKeyParams.toCall()})\n\n const query = useQuery({\n ...${queryOptions},\n queryKey,\n ...queryOptions\n } as unknown as QueryObserverOptions, 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,QAAQ,OAAO,eAAe;GAAE;aAChE,IAAI,KAAK,KAAK,KAAK,CAA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BAAiB,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;;;oDAG2C,aAAa,GAAG,eAAe,QAAQ,CAAC;;;aAG/E,aAAa;;;+DAGqC,WAAW;;;;;;IAMzD;GACC;;AAIlB,MAAM,YAAY"}
1
+ {"version":3,"file":"components-CvWdx6lq.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<InfiniteQueryObserverOptions<${[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<InfiniteQueryObserverOptions<${[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 ?? ${queryKeyName}(${queryKeyParams.toCall()})\n\n const query = useInfiniteQuery({\n ...${queryOptions},\n queryKey,\n ...queryOptions\n } as unknown as InfiniteQueryObserverOptions, 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<QueryObserverOptions<${[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<QueryObserverOptions<${[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 ?? ${queryKeyName}(${queryKeyParams.toCall()})\n\n const query = useQuery({\n ...${queryOptions},\n queryKey,\n ...queryOptions\n } as unknown as QueryObserverOptions, 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,CAA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a,sBAAsB,CAAC,SAD3B,uBAAuB,YAAY,QAAQ,KAAK,SAAS,KAAK,KAAK,CAAC,KAAK,MAAM,IAAI,QAAQ,GAChD,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;;;oDAG2C,aAAa,GAAG,eAAe,QAAQ,CAAC;;;aAG/E,aAAa;;;+DAGqC,WAAW;;;;;;IAMzD;GACC;;AAIlB,MAAM,YAAY"}
@@ -1,4 +1,4 @@
1
- import { c as Operation, i as Transformer, o as OperationSchemas, r as PluginVueQuery, t as Infinite } from "./types-Bo3QWaIS.cjs";
1
+ import { c as Operation, i as Transformer, o as OperationSchemas, r as PluginVueQuery, t as Infinite } from "./types-COROLdSu.cjs";
2
2
  import { FunctionParams } from "@kubb/react-fabric";
3
3
  import { KubbNode } from "@kubb/react-fabric/types";
4
4
 
@@ -1,4 +1,4 @@
1
- import { c as Operation, i as Transformer, o as OperationSchemas, r as PluginVueQuery, t as Infinite } from "./types-KYdGiLku.js";
1
+ import { c as Operation, i as Transformer, o as OperationSchemas, r as PluginVueQuery, t as Infinite } from "./types-DC5yKSuG.js";
2
2
  import { FunctionParams } from "@kubb/react-fabric";
3
3
  import { KubbNode } from "@kubb/react-fabric/types";
4
4
 
@@ -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-kADKAHgd.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-CvWdx6lq.js";
2
2
 
3
3
  export { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Query, QueryKey, QueryOptions };
@@ -1,4 +1,4 @@
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-kADKAHgd.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-CvWdx6lq.js";
2
2
  import path from "node:path";
3
3
  import { pluginClientName } from "@kubb/plugin-client";
4
4
  import { pluginTsName } from "@kubb/plugin-ts";
@@ -618,4 +618,4 @@ const queryGenerator = createReactGenerator({
618
618
 
619
619
  //#endregion
620
620
  export { mutationGenerator as n, infiniteQueryGenerator as r, queryGenerator as t };
621
- //# sourceMappingURL=generators-DDby6w9r.js.map
621
+ //# sourceMappingURL=generators-kmb86DA3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generators-DDby6w9r.js","names":[],"sources":["../src/generators/infiniteQueryGenerator.tsx","../src/generators/mutationGenerator.tsx","../src/generators/queryGenerator.tsx"],"sourcesContent":["import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { InfiniteQuery, InfiniteQueryOptions, QueryKey } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const infiniteQueryGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-infinite-query',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n const isInfinite = isQuery && !!options.infinite\n const importPath = options.query ? options.query.importPath : '@tanstack/vue-query'\n\n const query = {\n name: getName(operation, {\n type: 'function',\n prefix: 'use',\n suffix: 'infinite',\n }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use', suffix: 'infinite' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n suffix: 'infinite',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, {\n type: 'function',\n suffix: 'InfiniteQueryOptions',\n }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'InfiniteQueryKey' }),\n typeName: getName(operation, {\n type: 'type',\n suffix: 'InfiniteQueryKey',\n }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, {\n pluginKey: [pluginTsName],\n type: 'type',\n }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, {\n pluginKey: [pluginZodName],\n type: 'function',\n }),\n }\n\n if (!isQuery || isMutation || !isInfinite) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n {options.client.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n <File.Import name={['fetch']} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={query.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} isTypeOnly />\n )}\n </>\n )}\n <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.queryKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType || 'data'}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n {options.infinite && (\n <>\n <File.Import name={['InfiniteData']} isTypeOnly path={importPath} />\n <File.Import name={['infiniteQueryOptions']} path={importPath} />\n <InfiniteQueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType || 'data'}\n cursorParam={options.infinite.cursorParam}\n initialPageParam={options.infinite.initialPageParam}\n queryParam={options.infinite.queryParam}\n />\n </>\n )}\n {options.infinite && (\n <>\n <File.Import name={['useInfiniteQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'InfiniteQueryObserverOptions', 'UseInfiniteQueryReturnType']} path={importPath} isTypeOnly />\n <InfiniteQuery\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType || 'data'}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-query',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\n\n const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method)\n const isMutation =\n !isQuery &&\n difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method)\n\n const importPath = options.mutation ? options.mutation.importPath : '@tanstack/vue-query'\n\n const mutation = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const mutationKey = {\n name: getName(operation, { type: 'const', suffix: 'MutationKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'MutationKey' }),\n }\n\n if (!isMutation) {\n return null\n }\n\n return (\n <File\n baseName={mutation.file.baseName}\n path={mutation.file.path}\n meta={mutation.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={mutation.file.path} path={zod.file.path} />\n )}\n {options.client.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n <File.Import name={['fetch']} root={mutation.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={mutation.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import\n name={['ResponseConfig']}\n root={mutation.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n )}\n </>\n )}\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={mutation.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <MutationKey\n name={mutationKey.name}\n typeName={mutationKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n typeSchemas={type.schemas}\n transformer={options.mutationKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType || 'data'}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n {options.mutation && (\n <>\n <File.Import name={['useMutation']} path={importPath} />\n <File.Import name={['MutationObserverOptions', 'QueryClient']} path={importPath} isTypeOnly />\n <Mutation\n name={mutation.name}\n clientName={client.name}\n typeName={mutation.typeName}\n typeSchemas={type.schemas}\n operation={operation}\n paramsCasing={options.paramsCasing}\n dataReturnType={options.client.dataReturnType || 'data'}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-query',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n const importPath = options.query ? options.query.importPath : '@tanstack/vue-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'QueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'QueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'QueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, {\n pluginKey: [pluginTsName],\n type: 'type',\n }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, {\n pluginKey: [pluginZodName],\n type: 'function',\n }),\n }\n\n if (!isQuery || isMutation) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n {options.client.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n <File.Import name={['fetch']} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={query.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} isTypeOnly />\n )}\n </>\n )}\n <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.queryKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType || 'data'}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n <File.Import name={['queryOptions']} path={importPath} />\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n paramsCasing={options.paramsCasing}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType || 'data'}\n />\n {options.query && (\n <>\n <File.Import name={['useQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'QueryObserverOptions', 'UseQueryReturnType']} path={importPath} isTypeOnly />\n <Query\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType || 'data'}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,yBAAyB,qBAAqC;CACzE,MAAM;CACN,UAAU,EAAE,QAAQ,WAAW,WAAW,UAAU;EAClD,MAAM,EACJ,SACA,SAAS,EAAE,aACT;EACJ,MAAM,gBAAgB,kBAAkB;EAExC,MAAM,MAAM,QAAQ;EACpB,MAAM,EAAE,YAAY,SAAS,YAAY,oBAAoB,UAAU;EAEvE,MAAM,UAAU,OAAO,QAAQ,UAAU,YAAY,OAAO,QAAQ,OA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MAC/B,aAAa,KAAK;MAClB,cAAc,QAAQ;MACtB,YAAY,QAAQ;MACpB,gBAAgB,QAAQ;MACb;MACX,gBAAgB,QAAQ,OAAO,kBAAkB;MACjD,cAAc,SAAS;MACvB,kBAAkB,SAAS;OAC3B;QACD;;IAEA;;CAGZ,CAAC"}
1
+ {"version":3,"file":"generators-kmb86DA3.js","names":[],"sources":["../src/generators/infiniteQueryGenerator.tsx","../src/generators/mutationGenerator.tsx","../src/generators/queryGenerator.tsx"],"sourcesContent":["import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { InfiniteQuery, InfiniteQueryOptions, QueryKey } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const infiniteQueryGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-infinite-query',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n const isInfinite = isQuery && !!options.infinite\n const importPath = options.query ? options.query.importPath : '@tanstack/vue-query'\n\n const query = {\n name: getName(operation, {\n type: 'function',\n prefix: 'use',\n suffix: 'infinite',\n }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use', suffix: 'infinite' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n suffix: 'infinite',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, {\n type: 'function',\n suffix: 'InfiniteQueryOptions',\n }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'InfiniteQueryKey' }),\n typeName: getName(operation, {\n type: 'type',\n suffix: 'InfiniteQueryKey',\n }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, {\n pluginKey: [pluginTsName],\n type: 'type',\n }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, {\n pluginKey: [pluginZodName],\n type: 'function',\n }),\n }\n\n if (!isQuery || isMutation || !isInfinite) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n {options.client.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n <File.Import name={['fetch']} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={query.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} isTypeOnly />\n )}\n </>\n )}\n <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.queryKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType || 'data'}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n {options.infinite && (\n <>\n <File.Import name={['InfiniteData']} isTypeOnly path={importPath} />\n <File.Import name={['infiniteQueryOptions']} path={importPath} />\n <InfiniteQueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType || 'data'}\n cursorParam={options.infinite.cursorParam}\n initialPageParam={options.infinite.initialPageParam}\n queryParam={options.infinite.queryParam}\n />\n </>\n )}\n {options.infinite && (\n <>\n <File.Import name={['useInfiniteQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'InfiniteQueryObserverOptions', 'UseInfiniteQueryReturnType']} path={importPath} isTypeOnly />\n <InfiniteQuery\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType || 'data'}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-query',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\n\n const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method)\n const isMutation =\n !isQuery &&\n difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method)\n\n const importPath = options.mutation ? options.mutation.importPath : '@tanstack/vue-query'\n\n const mutation = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const mutationKey = {\n name: getName(operation, { type: 'const', suffix: 'MutationKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'MutationKey' }),\n }\n\n if (!isMutation) {\n return null\n }\n\n return (\n <File\n baseName={mutation.file.baseName}\n path={mutation.file.path}\n meta={mutation.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={mutation.file.path} path={zod.file.path} />\n )}\n {options.client.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n <File.Import name={['fetch']} root={mutation.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={mutation.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import\n name={['ResponseConfig']}\n root={mutation.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n )}\n </>\n )}\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={mutation.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <MutationKey\n name={mutationKey.name}\n typeName={mutationKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n typeSchemas={type.schemas}\n transformer={options.mutationKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType || 'data'}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n {options.mutation && (\n <>\n <File.Import name={['useMutation']} path={importPath} />\n <File.Import name={['MutationObserverOptions', 'QueryClient']} path={importPath} isTypeOnly />\n <Mutation\n name={mutation.name}\n clientName={client.name}\n typeName={mutation.typeName}\n typeSchemas={type.schemas}\n operation={operation}\n paramsCasing={options.paramsCasing}\n dataReturnType={options.client.dataReturnType || 'data'}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-query',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n const importPath = options.query ? options.query.importPath : '@tanstack/vue-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'QueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'QueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'QueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, {\n pluginKey: [pluginTsName],\n type: 'type',\n }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, {\n pluginKey: [pluginZodName],\n type: 'function',\n }),\n }\n\n if (!isQuery || isMutation) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n {options.client.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n <File.Import name={['fetch']} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={query.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} isTypeOnly />\n )}\n </>\n )}\n <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.queryKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType || 'data'}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n <File.Import name={['queryOptions']} path={importPath} />\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n paramsCasing={options.paramsCasing}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType || 'data'}\n />\n {options.query && (\n <>\n <File.Import name={['useQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'QueryObserverOptions', 'UseQueryReturnType']} path={importPath} isTypeOnly />\n <Query\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType || 'data'}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,yBAAyB,qBAAqC;CACzE,MAAM;CACN,UAAU,EAAE,QAAQ,WAAW,WAAW,UAAU;EAClD,MAAM,EACJ,SACA,SAAS,EAAE,aACT;EACJ,MAAM,gBAAgB,kBAAkB;EAExC,MAAM,MAAM,QAAQ;EACpB,MAAM,EAAE,YAAY,SAAS,YAAY,oBAAoB,UAAU;EAEvE,MAAM,UAAU,OAAO,QAAQ,UAAU,YAAY,OAAO,QAAQ,OAAO,QAAQ,MAAM,WAAW,UAAU,WAAW,OAAO;EAChI,MAAM,aAAa,WAAW,QAAQ,WAAW,QAAQ,SAAS,UAAU,EAAE,EAAE,QAAQ,QAAQ,QAAQ,MAAM,UAAU,EAAE,CAAC,CAAC,MACzH,WAAW,UAAU,WAAW,OAClC;EACD,MAAM,aAAa,WAAW,CAAC,CAAC,QAAQ;EACxC,MAAM,aAAa,QAAQ,QAAQ,QAAQ,MAAM,aAAa;EAE9D,MAAM,QAAQ;GACZ,MAAM,QAAQ,WAAW;IACvB,MAAM;IACN,QAAQ;IACR,QAAQ;IACT,CAAC;GACF,UAAU,QAAQ,WAAW,EAAE,MAAM,QAAQ,CAAC;GAC9C,MAAM,QAAQ,WAAW;IAAE,QAAQ;IAAO,QAAQ;IAAY,CAAC;GAChE;EAED,MAAM,kBAAkB,CAAC,CAAC,cAAc,eAAe,CAAC,iBAAiB,CAAC;EAC1E,MAAM,SAAS;GACb,MAAM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QAAQ,OAAO;KACb;KACX,aAAa,KAAK;KAClB,YAAY,IAAI;KAChB,gBAAgB,QAAQ,OAAO,kBAAkB;KACjD,cAAc,QAAQ;KACtB,YAAY,QAAQ;KACpB,gBAAgB,QAAQ;KACxB,QAAQ,QAAQ;MAChB;IAEJ,oBAAC,KAAK;KAAO,MAAM,CAAC,eAAe;KAAE,MAAM;MAAc;IACzD,oBAAC;KACC,MAAM,aAAa;KACnB,YAAY,OAAO;KACnB,cAAc,SAAS;KACvB,cAAc,QAAQ;KACtB,aAAa,KAAK;KAClB,YAAY,QAAQ;KACpB,gBAAgB,QAAQ;KACxB,gBAAgB,QAAQ,OAAO,kBAAkB;MACjD;IACD,QAAQ,SACP;KACE,oBAAC,KAAK;MAAO,MAAM,CAAC,WAAW;MAAE,MAAM;OAAc;KACrD,oBAAC,KAAK;MAAO,MAAM;OAAC;OAAY;OAAe;OAAwB;OAAqB;MAAE,MAAM;MAAY;OAAa;KAC7H,oBAAC;MACC,MAAM,MAAM;MACZ,kBAAkB,aAAa;MAC/B,aAAa,KAAK;MAClB,cAAc,QAAQ;MACtB,YAAY,QAAQ;MACpB,gBAAgB,QAAQ;MACb;MACX,gBAAgB,QAAQ,OAAO,kBAAkB;MACjD,cAAc,SAAS;MACvB,kBAAkB,SAAS;OAC3B;QACD;;IAEA;;CAGZ,CAAC"}
@@ -1,4 +1,4 @@
1
- import { a as ReactGenerator, r as PluginVueQuery } from "./types-Bo3QWaIS.cjs";
1
+ import { a as ReactGenerator, r as PluginVueQuery } from "./types-COROLdSu.cjs";
2
2
 
3
3
  //#region src/generators/infiniteQueryGenerator.d.ts
4
4
  declare const infiniteQueryGenerator: ReactGenerator<PluginVueQuery>;
@@ -1,4 +1,4 @@
1
- import { a as ReactGenerator, r as PluginVueQuery } from "./types-KYdGiLku.js";
1
+ import { a as ReactGenerator, r as PluginVueQuery } from "./types-DC5yKSuG.js";
2
2
 
3
3
  //#region src/generators/infiniteQueryGenerator.d.ts
4
4
  declare const infiniteQueryGenerator: ReactGenerator<PluginVueQuery>;
@@ -1,4 +1,4 @@
1
- import "./components-kADKAHgd.js";
2
- import { n as mutationGenerator, r as infiniteQueryGenerator, t as queryGenerator } from "./generators-DDby6w9r.js";
1
+ import "./components-CvWdx6lq.js";
2
+ import { n as mutationGenerator, r as infiniteQueryGenerator, t as queryGenerator } from "./generators-kmb86DA3.js";
3
3
 
4
4
  export { infiniteQueryGenerator, mutationGenerator, queryGenerator };
package/dist/index.cjs CHANGED
@@ -13,7 +13,6 @@ let __kubb_plugin_zod = require("@kubb/plugin-zod");
13
13
  //#region src/plugin.ts
14
14
  const pluginVueQueryName = "plugin-vue-query";
15
15
  const pluginVueQuery = (0, __kubb_core.definePlugin)((options) => {
16
- const bundle = options.bundle ?? false;
17
16
  const { output = {
18
17
  path: "hooks",
19
18
  barrelType: "named"
@@ -21,19 +20,18 @@ const pluginVueQuery = (0, __kubb_core.definePlugin)((options) => {
21
20
  require_generators.queryGenerator,
22
21
  require_generators.infiniteQueryGenerator,
23
22
  require_generators.mutationGenerator
24
- ].filter(Boolean), contentType } = options;
25
- const clientType = options.client?.client ?? "axios";
26
- const clientImportPath = options.client?.importPath ?? (!bundle ? `@kubb/plugin-client/clients/${clientType}` : void 0);
23
+ ].filter(Boolean), contentType, client } = options;
24
+ const clientType = client?.client ?? "axios";
25
+ const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientType}` : void 0);
27
26
  return {
28
27
  name: pluginVueQueryName,
29
28
  options: {
30
- bundle,
31
29
  output,
32
30
  client: {
31
+ ...options.client,
33
32
  client: clientType,
34
- dataReturnType: options.client?.dataReturnType ?? "data",
33
+ dataReturnType: client?.dataReturnType ?? "data",
35
34
  pathParamsType,
36
- baseURL: options.client?.baseURL,
37
35
  importPath: clientImportPath
38
36
  },
39
37
  infinite: infinite ? {
@@ -102,7 +100,7 @@ const pluginVueQuery = (0, __kubb_core.definePlugin)((options) => {
102
100
  if (baseURL) this.plugin.options.client.baseURL = baseURL;
103
101
  const hasClientPlugin = !!this.pluginManager.getPluginByKey([__kubb_plugin_client.pluginClientName]);
104
102
  const containsFetch = this.fabric.files.some((file) => file.baseName === "fetch.ts");
105
- if (bundle && !hasClientPlugin && !this.plugin.options.client.importPath && !containsFetch) await this.addFile({
103
+ if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath && !containsFetch) await this.addFile({
106
104
  baseName: "fetch.ts",
107
105
  path: node_path.default.resolve(root, ".kubb/fetch.ts"),
108
106
  sources: [{
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["MutationKey","QueryKey","queryGenerator","infiniteQueryGenerator","mutationGenerator","pluginOasName","pluginTsName","pluginZodName","path","options","groupName: Group['name']","pluginClientName","OperationGenerator"],"sources":["../src/plugin.ts"],"sourcesContent":["import path from 'node:path'\nimport { definePlugin, type Group, getBarrelFiles, getMode } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { resolveModuleSource } from '@kubb/core/utils'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { MutationKey, QueryKey } from './components'\nimport { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './generators'\nimport type { PluginVueQuery } from './types.ts'\n\nexport const pluginVueQueryName = 'plugin-vue-query' satisfies PluginVueQuery['name']\n\nexport const pluginVueQuery = definePlugin<PluginVueQuery>((options) => {\n const bundle = options.bundle ?? false\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n infinite,\n transformers = {},\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n mutation = {},\n query = {},\n paramsCasing,\n mutationKey = MutationKey.getTransformer,\n queryKey = QueryKey.getTransformer,\n generators = [queryGenerator, infiniteQueryGenerator, mutationGenerator].filter(Boolean),\n contentType,\n } = options\n\n const clientType = options.client?.client ?? 'axios'\n const clientImportPath = options.client?.importPath ?? (!bundle ? `@kubb/plugin-client/clients/${clientType}` : undefined)\n\n return {\n name: pluginVueQueryName,\n options: {\n bundle,\n output,\n client: {\n client: clientType,\n dataReturnType: options.client?.dataReturnType ?? 'data',\n pathParamsType,\n baseURL: options.client?.baseURL,\n importPath: clientImportPath,\n },\n infinite: infinite\n ? {\n queryParam: 'id',\n initialPageParam: 0,\n cursorParam: undefined,\n ...infinite,\n }\n : false,\n queryKey,\n query:\n query === false\n ? false\n : {\n methods: ['get'],\n importPath: '@tanstack/vue-query',\n ...query,\n },\n mutationKey,\n mutation: {\n methods: ['post', 'put', 'patch', 'delete'],\n importPath: '@tanstack/vue-query',\n ...mutation,\n },\n paramsType,\n pathParamsType,\n parser,\n paramsCasing,\n group,\n },\n pre: [pluginOasName, pluginTsName, parser === 'zod' ? pluginZodName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (group && (options?.group?.path || options?.group?.tag)) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n }\n\n return path.resolve(\n root,\n output.path,\n groupName({\n group: group.type === 'path' ? options.group.path! : options.group.tag!,\n }),\n baseName,\n )\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n let resolvedName = camelCase(name)\n\n if (type === 'file' || type === 'function') {\n resolvedName = camelCase(name, {\n isFile: type === 'file',\n })\n }\n if (type === 'type') {\n resolvedName = pascalCase(name)\n }\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async install() {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n const oas = await this.getOas()\n const baseURL = await this.getBaseURL()\n\n if (baseURL) {\n this.plugin.options.client.baseURL = baseURL\n }\n\n const hasClientPlugin = !!this.pluginManager.getPluginByKey([pluginClientName])\n const containsFetch = this.fabric.files.some((file) => file.baseName === 'fetch.ts')\n\n if (bundle && !hasClientPlugin && !this.plugin.options.client.importPath && !containsFetch) {\n // pre add bundled\n await this.addFile({\n baseName: 'fetch.ts',\n path: path.resolve(root, '.kubb/fetch.ts'),\n sources: [\n {\n name: 'fetch',\n value: resolveModuleSource(\n this.plugin.options.client.client === 'fetch' ? '@kubb/plugin-client/templates/clients/fetch' : '@kubb/plugin-client/templates/clients/axios',\n ).source,\n isExportable: true,\n isIndexable: true,\n },\n ],\n })\n }\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n fabric: this.fabric,\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const files = await operationGenerator.build(...generators)\n await this.addFile(...files)\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n },\n }\n})\n"],"mappings":";;;;;;;;;;;;;AAYA,MAAa,qBAAqB;AAElC,MAAa,gDAA+C,YAAY;CACtE,MAAM,SAAS,QAAQ,UAAU;CACjC,MAAM,EACJ,SAAS;EAAE,MAAM;EAAS,YAAY;EAAS,EAC/C,OACA,UAAU,EAAE,EACZ,SACA,WAAW,EAAE,EACb,SAAS,UACT,UACA,eAAe,EAAE,EACjB,aAAa,UACb,iBAAiB,eAAe,WAAW,WAAW,QAAQ,kBAAkB,UAChF,WAAW,EAAE,EACb,QAAQ,EAAE,EACV,cACA,cAAcA,+BAAY,gB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GAAG,WAAW;AAC3D,SAAM,KAAK,QAAQ,GAAG,MAAM;GAE5B,MAAM,cAAc,sCAAqB,KAAK,OAAO,OAAO;IAC1D,MAAM,OAAO,cAAc;IAC3B;IACA;IACA,MAAM,EACJ,WAAW,KAAK,OAAO,KACxB;IACD,QAAQ,KAAK;IACd,CAAC;AAEF,SAAM,KAAK,QAAQ,GAAG,YAAY;;EAErC;EACD"}
1
+ {"version":3,"file":"index.cjs","names":["MutationKey","QueryKey","queryGenerator","infiniteQueryGenerator","mutationGenerator","pluginOasName","pluginTsName","pluginZodName","path","options","groupName: Group['name']","pluginClientName","OperationGenerator"],"sources":["../src/plugin.ts"],"sourcesContent":["import path from 'node:path'\nimport { definePlugin, type Group, getBarrelFiles, getMode } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { resolveModuleSource } from '@kubb/core/utils'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { MutationKey, QueryKey } from './components'\nimport { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './generators'\nimport type { PluginVueQuery } from './types.ts'\n\nexport const pluginVueQueryName = 'plugin-vue-query' satisfies PluginVueQuery['name']\n\nexport const pluginVueQuery = definePlugin<PluginVueQuery>((options) => {\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n infinite,\n transformers = {},\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n mutation = {},\n query = {},\n paramsCasing,\n mutationKey = MutationKey.getTransformer,\n queryKey = QueryKey.getTransformer,\n generators = [queryGenerator, infiniteQueryGenerator, mutationGenerator].filter(Boolean),\n contentType,\n client,\n } = options\n\n const clientType = client?.client ?? 'axios'\n const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientType}` : undefined)\n\n return {\n name: pluginVueQueryName,\n options: {\n output,\n client: {\n ...options.client,\n client: clientType,\n dataReturnType: client?.dataReturnType ?? 'data',\n pathParamsType,\n importPath: clientImportPath,\n },\n infinite: infinite\n ? {\n queryParam: 'id',\n initialPageParam: 0,\n cursorParam: undefined,\n ...infinite,\n }\n : false,\n queryKey,\n query:\n query === false\n ? false\n : {\n methods: ['get'],\n importPath: '@tanstack/vue-query',\n ...query,\n },\n mutationKey,\n mutation: {\n methods: ['post', 'put', 'patch', 'delete'],\n importPath: '@tanstack/vue-query',\n ...mutation,\n },\n paramsType,\n pathParamsType,\n parser,\n paramsCasing,\n group,\n },\n pre: [pluginOasName, pluginTsName, parser === 'zod' ? pluginZodName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (group && (options?.group?.path || options?.group?.tag)) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n }\n\n return path.resolve(\n root,\n output.path,\n groupName({\n group: group.type === 'path' ? options.group.path! : options.group.tag!,\n }),\n baseName,\n )\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n let resolvedName = camelCase(name)\n\n if (type === 'file' || type === 'function') {\n resolvedName = camelCase(name, {\n isFile: type === 'file',\n })\n }\n if (type === 'type') {\n resolvedName = pascalCase(name)\n }\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async install() {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n const oas = await this.getOas()\n const baseURL = await this.getBaseURL()\n\n if (baseURL) {\n this.plugin.options.client.baseURL = baseURL\n }\n\n const hasClientPlugin = !!this.pluginManager.getPluginByKey([pluginClientName])\n const containsFetch = this.fabric.files.some((file) => file.baseName === 'fetch.ts')\n\n if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath && !containsFetch) {\n // pre add bundled\n await this.addFile({\n baseName: 'fetch.ts',\n path: path.resolve(root, '.kubb/fetch.ts'),\n sources: [\n {\n name: 'fetch',\n value: resolveModuleSource(\n this.plugin.options.client.client === 'fetch' ? '@kubb/plugin-client/templates/clients/fetch' : '@kubb/plugin-client/templates/clients/axios',\n ).source,\n isExportable: true,\n isIndexable: true,\n },\n ],\n })\n }\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n fabric: this.fabric,\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const files = await operationGenerator.build(...generators)\n await this.addFile(...files)\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n },\n }\n})\n"],"mappings":";;;;;;;;;;;;;AAYA,MAAa,qBAAqB;AAElC,MAAa,gDAA+C,YAAY;CACtE,MAAM,EACJ,SAAS;EAAE,MAAM;EAAS,YAAY;EAAS,EAC/C,OACA,UAAU,EAAE,EACZ,SACA,WAAW,EAAE,EACb,SAAS,UACT,UACA,eAAe,EAAE,EACjB,aAAa,UACb,iBAAiB,eAAe,WAAW,WAAW,QAAQ,kBAAkB,UAChF,WAAW,EAAE,EACb,QAAQ,EAAE,EACV,cACA,cAAcA,+BAAY,gBAC1B,WAAWC,4BAAS,gBACpB,aAAa;EAACC;EAAgBC;EAAwBC;EAAkB,CAAC,OAAO,QAAQ,EACxF,aACA,WACE;CAEJ,MAAM,aAAa,QAAQ,UAAU;CACrC,MAAM,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M,EACJ,WAAW,KAAK,OAAO,KACxB;IACD,QAAQ,KAAK;IACd,CAAC;AAEF,SAAM,KAAK,QAAQ,GAAG,YAAY;;EAErC;EACD"}
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as Options, r as PluginVueQuery, s as UserPluginWithLifeCycle } from "./types-Bo3QWaIS.cjs";
1
+ import { n as Options, r as PluginVueQuery, s as UserPluginWithLifeCycle } from "./types-COROLdSu.cjs";
2
2
 
3
3
  //#region src/plugin.d.ts
4
4
  declare const pluginVueQueryName = "plugin-vue-query";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as Options, r as PluginVueQuery, s as UserPluginWithLifeCycle } from "./types-KYdGiLku.js";
1
+ import { n as Options, r as PluginVueQuery, s as UserPluginWithLifeCycle } from "./types-DC5yKSuG.js";
2
2
 
3
3
  //#region src/plugin.d.ts
4
4
  declare const pluginVueQueryName = "plugin-vue-query";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { r as MutationKey, s as QueryKey } from "./components-kADKAHgd.js";
2
- import { n as mutationGenerator, r as infiniteQueryGenerator, t as queryGenerator } from "./generators-DDby6w9r.js";
1
+ import { r as MutationKey, s as QueryKey } from "./components-CvWdx6lq.js";
2
+ import { n as mutationGenerator, r as infiniteQueryGenerator, t as queryGenerator } from "./generators-kmb86DA3.js";
3
3
  import path from "node:path";
4
4
  import { definePlugin, getBarrelFiles, getMode } from "@kubb/core";
5
5
  import { camelCase, pascalCase } from "@kubb/core/transformers";
@@ -12,7 +12,6 @@ import { pluginZodName } from "@kubb/plugin-zod";
12
12
  //#region src/plugin.ts
13
13
  const pluginVueQueryName = "plugin-vue-query";
14
14
  const pluginVueQuery = definePlugin((options) => {
15
- const bundle = options.bundle ?? false;
16
15
  const { output = {
17
16
  path: "hooks",
18
17
  barrelType: "named"
@@ -20,19 +19,18 @@ const pluginVueQuery = definePlugin((options) => {
20
19
  queryGenerator,
21
20
  infiniteQueryGenerator,
22
21
  mutationGenerator
23
- ].filter(Boolean), contentType } = options;
24
- const clientType = options.client?.client ?? "axios";
25
- const clientImportPath = options.client?.importPath ?? (!bundle ? `@kubb/plugin-client/clients/${clientType}` : void 0);
22
+ ].filter(Boolean), contentType, client } = options;
23
+ const clientType = client?.client ?? "axios";
24
+ const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientType}` : void 0);
26
25
  return {
27
26
  name: pluginVueQueryName,
28
27
  options: {
29
- bundle,
30
28
  output,
31
29
  client: {
30
+ ...options.client,
32
31
  client: clientType,
33
- dataReturnType: options.client?.dataReturnType ?? "data",
32
+ dataReturnType: client?.dataReturnType ?? "data",
34
33
  pathParamsType,
35
- baseURL: options.client?.baseURL,
36
34
  importPath: clientImportPath
37
35
  },
38
36
  infinite: infinite ? {
@@ -101,7 +99,7 @@ const pluginVueQuery = definePlugin((options) => {
101
99
  if (baseURL) this.plugin.options.client.baseURL = baseURL;
102
100
  const hasClientPlugin = !!this.pluginManager.getPluginByKey([pluginClientName]);
103
101
  const containsFetch = this.fabric.files.some((file) => file.baseName === "fetch.ts");
104
- if (bundle && !hasClientPlugin && !this.plugin.options.client.importPath && !containsFetch) await this.addFile({
102
+ if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath && !containsFetch) await this.addFile({
105
103
  baseName: "fetch.ts",
106
104
  path: path.resolve(root, ".kubb/fetch.ts"),
107
105
  sources: [{
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["options","groupName: Group['name']"],"sources":["../src/plugin.ts"],"sourcesContent":["import path from 'node:path'\nimport { definePlugin, type Group, getBarrelFiles, getMode } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { resolveModuleSource } from '@kubb/core/utils'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { MutationKey, QueryKey } from './components'\nimport { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './generators'\nimport type { PluginVueQuery } from './types.ts'\n\nexport const pluginVueQueryName = 'plugin-vue-query' satisfies PluginVueQuery['name']\n\nexport const pluginVueQuery = definePlugin<PluginVueQuery>((options) => {\n const bundle = options.bundle ?? false\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n infinite,\n transformers = {},\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n mutation = {},\n query = {},\n paramsCasing,\n mutationKey = MutationKey.getTransformer,\n queryKey = QueryKey.getTransformer,\n generators = [queryGenerator, infiniteQueryGenerator, mutationGenerator].filter(Boolean),\n contentType,\n } = options\n\n const clientType = options.client?.client ?? 'axios'\n const clientImportPath = options.client?.importPath ?? (!bundle ? `@kubb/plugin-client/clients/${clientType}` : undefined)\n\n return {\n name: pluginVueQueryName,\n options: {\n bundle,\n output,\n client: {\n client: clientType,\n dataReturnType: options.client?.dataReturnType ?? 'data',\n pathParamsType,\n baseURL: options.client?.baseURL,\n importPath: clientImportPath,\n },\n infinite: infinite\n ? {\n queryParam: 'id',\n initialPageParam: 0,\n cursorParam: undefined,\n ...infinite,\n }\n : false,\n queryKey,\n query:\n query === false\n ? false\n : {\n methods: ['get'],\n importPath: '@tanstack/vue-query',\n ...query,\n },\n mutationKey,\n mutation: {\n methods: ['post', 'put', 'patch', 'delete'],\n importPath: '@tanstack/vue-query',\n ...mutation,\n },\n paramsType,\n pathParamsType,\n parser,\n paramsCasing,\n group,\n },\n pre: [pluginOasName, pluginTsName, parser === 'zod' ? pluginZodName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (group && (options?.group?.path || options?.group?.tag)) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n }\n\n return path.resolve(\n root,\n output.path,\n groupName({\n group: group.type === 'path' ? options.group.path! : options.group.tag!,\n }),\n baseName,\n )\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n let resolvedName = camelCase(name)\n\n if (type === 'file' || type === 'function') {\n resolvedName = camelCase(name, {\n isFile: type === 'file',\n })\n }\n if (type === 'type') {\n resolvedName = pascalCase(name)\n }\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async install() {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n const oas = await this.getOas()\n const baseURL = await this.getBaseURL()\n\n if (baseURL) {\n this.plugin.options.client.baseURL = baseURL\n }\n\n const hasClientPlugin = !!this.pluginManager.getPluginByKey([pluginClientName])\n const containsFetch = this.fabric.files.some((file) => file.baseName === 'fetch.ts')\n\n if (bundle && !hasClientPlugin && !this.plugin.options.client.importPath && !containsFetch) {\n // pre add bundled\n await this.addFile({\n baseName: 'fetch.ts',\n path: path.resolve(root, '.kubb/fetch.ts'),\n sources: [\n {\n name: 'fetch',\n value: resolveModuleSource(\n this.plugin.options.client.client === 'fetch' ? '@kubb/plugin-client/templates/clients/fetch' : '@kubb/plugin-client/templates/clients/axios',\n ).source,\n isExportable: true,\n isIndexable: true,\n },\n ],\n })\n }\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n fabric: this.fabric,\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const files = await operationGenerator.build(...generators)\n await this.addFile(...files)\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n },\n }\n})\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,qBAAqB;AAElC,MAAa,iBAAiB,cAA8B,YAAY;CACtE,MAAM,SAAS,QAAQ,UAAU;CACjC,MAAM,EACJ,SAAS;EAAE,MAAM;EAAS,YAAY;EAAS,EAC/C,OACA,UAAU,EAAE,EACZ,SACA,WAAW,EAAE,EACb,SAAS,UACT,UACA,eAAe,EAAE,EACjB,aAAa,UACb,iBAAiB,eAAe,WAAW,WAAW,QAAQ,kBAAkB,UAChF,WAAW,EAAE,EACb,QAAQ,EAAE,EACV,cACA,cAAc,YAAY,gBAC1B,WAAW,SAAS,gBACpB,aAAa;EAAC;EAAgB;EAAwB;EAAkB,CAAC,OAAO,QAAQ,EACxF,gBACE;CAEJ,MAAM,aAAa,QAAQ,QAAQ,UAAU;CAC7C,MAAM,mBAAmB,QAAQ,QAAQ,eAAe,CAAC,SAAS,+BAA+B,eAAe;AAEhH,QAAO;EACL,MAAM;EACN,SAAS;GACP;GACA;GACA,QAAQ;IACN,QAAQ;IACR,gBAAgB,QAAQ,QAAQ,kBAAkB;IAClD;IACA,SAAS,QAAQ,QAAQ;IACzB,YAAY;IACb;GACD,UAAU,WACN;IACE,YAAY;IACZ,kBAAkB;IAClB,aAAa;IACb,GAAG;IACJ,GACD;GACJ;GACA,OACE,UAAU,QACN,QACA;IACE,SAAS,CAAC,MAAM;IAChB,YAAY;IACZ,GAAG;IACJ;GACP;GACA,UAAU;IACR,SAAS;KAAC;KAAQ;KAAO;KAAS;KAAS;IAC3C,YAAY;IACZ,GAAG;IACJ;GACD;GACA;GACA;GACA;GACA;GACD;EACD,KAAK;GAAC;GAAe;GAAc,WAAW,QAAQ,gBAAgB;GAAU,CAAC,OAAO,QAAQ;EAChG,YAAY,UAAU,UAAU,WAAS;GACvC,M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M,MAAM,SAAS,KAAK,aAAa,WAAW;AAEpF,OAAI,UAAU,CAAC,mBAAmB,CAAC,KAAK,OAAO,QAAQ,OAAO,cAAc,CAAC,cAE3E,OAAM,KAAK,QAAQ;IACjB,UAAU;IACV,MAAM,KAAK,QAAQ,MAAM,iBAAiB;IAC1C,SAAS,CACP;KACE,MAAM;KACN,OAAO,oBACL,KAAK,OAAO,QAAQ,OAAO,WAAW,UAAU,gDAAgD,8CACjG,CAAC;KACF,cAAc;KACd,aAAa;KACd,CACF;IACF,CAAC;GAeJ,MAAM,QAAQ,MAZa,IAAI,mBAAmB,KAAK,OAAO,SAAS;IACrE,QAAQ,KAAK;IACb;IACA,eAAe,KAAK;IACpB,QAAQ,KAAK;IACb;IACA;IACA;IACA;IACA;IACD,CAAC,CAEqC,MAAM,GAAG,WAAW;AAC3D,SAAM,KAAK,QAAQ,GAAG,MAAM;GAE5B,MAAM,cAAc,MAAM,eAAe,KAAK,OAAO,OAAO;IAC1D,MAAM,OAAO,cAAc;IAC3B;IACA;IACA,MAAM,EACJ,WAAW,KAAK,OAAO,KACxB;IACD,QAAQ,KAAK;IACd,CAAC;AAEF,SAAM,KAAK,QAAQ,GAAG,YAAY;;EAErC;EACD"}
1
+ {"version":3,"file":"index.js","names":["options","groupName: Group['name']"],"sources":["../src/plugin.ts"],"sourcesContent":["import path from 'node:path'\nimport { definePlugin, type Group, getBarrelFiles, getMode } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { resolveModuleSource } from '@kubb/core/utils'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { MutationKey, QueryKey } from './components'\nimport { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './generators'\nimport type { PluginVueQuery } from './types.ts'\n\nexport const pluginVueQueryName = 'plugin-vue-query' satisfies PluginVueQuery['name']\n\nexport const pluginVueQuery = definePlugin<PluginVueQuery>((options) => {\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n infinite,\n transformers = {},\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n mutation = {},\n query = {},\n paramsCasing,\n mutationKey = MutationKey.getTransformer,\n queryKey = QueryKey.getTransformer,\n generators = [queryGenerator, infiniteQueryGenerator, mutationGenerator].filter(Boolean),\n contentType,\n client,\n } = options\n\n const clientType = client?.client ?? 'axios'\n const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientType}` : undefined)\n\n return {\n name: pluginVueQueryName,\n options: {\n output,\n client: {\n ...options.client,\n client: clientType,\n dataReturnType: client?.dataReturnType ?? 'data',\n pathParamsType,\n importPath: clientImportPath,\n },\n infinite: infinite\n ? {\n queryParam: 'id',\n initialPageParam: 0,\n cursorParam: undefined,\n ...infinite,\n }\n : false,\n queryKey,\n query:\n query === false\n ? false\n : {\n methods: ['get'],\n importPath: '@tanstack/vue-query',\n ...query,\n },\n mutationKey,\n mutation: {\n methods: ['post', 'put', 'patch', 'delete'],\n importPath: '@tanstack/vue-query',\n ...mutation,\n },\n paramsType,\n pathParamsType,\n parser,\n paramsCasing,\n group,\n },\n pre: [pluginOasName, pluginTsName, parser === 'zod' ? pluginZodName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (group && (options?.group?.path || options?.group?.tag)) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n }\n\n return path.resolve(\n root,\n output.path,\n groupName({\n group: group.type === 'path' ? options.group.path! : options.group.tag!,\n }),\n baseName,\n )\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n let resolvedName = camelCase(name)\n\n if (type === 'file' || type === 'function') {\n resolvedName = camelCase(name, {\n isFile: type === 'file',\n })\n }\n if (type === 'type') {\n resolvedName = pascalCase(name)\n }\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async install() {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n const oas = await this.getOas()\n const baseURL = await this.getBaseURL()\n\n if (baseURL) {\n this.plugin.options.client.baseURL = baseURL\n }\n\n const hasClientPlugin = !!this.pluginManager.getPluginByKey([pluginClientName])\n const containsFetch = this.fabric.files.some((file) => file.baseName === 'fetch.ts')\n\n if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath && !containsFetch) {\n // pre add bundled\n await this.addFile({\n baseName: 'fetch.ts',\n path: path.resolve(root, '.kubb/fetch.ts'),\n sources: [\n {\n name: 'fetch',\n value: resolveModuleSource(\n this.plugin.options.client.client === 'fetch' ? '@kubb/plugin-client/templates/clients/fetch' : '@kubb/plugin-client/templates/clients/axios',\n ).source,\n isExportable: true,\n isIndexable: true,\n },\n ],\n })\n }\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n fabric: this.fabric,\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const files = await operationGenerator.build(...generators)\n await this.addFile(...files)\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n },\n }\n})\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,qBAAqB;AAElC,MAAa,iBAA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OAAO,oBACL,KAAK,OAAO,QAAQ,OAAO,WAAW,UAAU,gDAAgD,8CACjG,CAAC;KACF,cAAc;KACd,aAAa;KACd,CACF;IACF,CAAC;GAeJ,MAAM,QAAQ,MAZa,IAAI,mBAAmB,KAAK,OAAO,SAAS;IACrE,QAAQ,KAAK;IACb;IACA,eAAe,KAAK;IACpB,QAAQ,KAAK;IACb;IACA;IACA;IACA;IACA;IACD,CAAC,CAEqC,MAAM,GAAG,WAAW;AAC3D,SAAM,KAAK,QAAQ,GAAG,MAAM;GAE5B,MAAM,cAAc,MAAM,eAAe,KAAK,OAAO,OAAO;IAC1D,MAAM,OAAO,cAAc;IAC3B;IACA;IACA,MAAM,EACJ,WAAW,KAAK,OAAO,KACxB;IACD,QAAQ,KAAK;IACd,CAAC;AAEF,SAAM,KAAK,QAAQ,GAAG,YAAY;;EAErC;EACD"}
@@ -1,4 +1,3 @@
1
- import { Fabric } from "@kubb/react-fabric";
2
1
  import * as OasTypes from "oas/types";
3
2
  import { HttpMethods as HttpMethod, OASDocument, SchemaObject, User } from "oas/types";
4
3
  import { Operation, Operation as Operation$1 } from "oas/operation";
@@ -6,6 +5,7 @@ import { OpenAPIV3 } from "openapi-types";
6
5
  import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
7
6
  import BaseOas from "oas";
8
7
  import { KubbFile } from "@kubb/fabric-core/types";
8
+ import { Fabric } from "@kubb/react-fabric";
9
9
  import { ConsolaInstance, LogLevel } from "consola";
10
10
  import { KubbNode } from "@kubb/react-fabric/types";
11
11
 
@@ -1109,7 +1109,7 @@ type ResolvedOptions$1 = {
1109
1109
  group?: Options$2['group'];
1110
1110
  baseURL: string | undefined;
1111
1111
  client: Options$2['client'];
1112
- bundle: boolean;
1112
+ bundle: NonNullable<Options$2['bundle']>;
1113
1113
  parser: NonNullable<Options$2['parser']>;
1114
1114
  urlType: NonNullable<Options$2['urlType']>;
1115
1115
  importPath: Options$2['importPath'];
@@ -1196,13 +1196,7 @@ type Options$1 = {
1196
1196
  * Group the @tanstack/query hooks based on the provided name.
1197
1197
  */
1198
1198
  group?: Group;
1199
- client?: Pick<PluginClient['options'], 'client' | 'dataReturnType' | 'importPath' | 'baseURL'>;
1200
- /**
1201
- * Bundle the selected client into the generated `.kubb` directory.
1202
- * When disabled the generated hooks will import the shared runtime from `@kubb/plugin-client/clients/*`.
1203
- * @default false
1204
- */
1205
- bundle?: boolean;
1199
+ client?: Pick<PluginClient['options'], 'client' | 'dataReturnType' | 'importPath' | 'baseURL' | 'bundle'>;
1206
1200
  /**
1207
1201
  * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
1208
1202
  */
@@ -1268,7 +1262,6 @@ type ResolvedOptions = {
1268
1262
  output: Output<Oas>;
1269
1263
  group: Options$1['group'];
1270
1264
  client: NonNullable<PluginVueQuery['options']['client']>;
1271
- bundle: boolean;
1272
1265
  parser: Required<NonNullable<Options$1['parser']>>;
1273
1266
  paramsCasing: Options$1['paramsCasing'];
1274
1267
  paramsType: NonNullable<Options$1['paramsType']>;
@@ -1285,4 +1278,4 @@ type ResolvedOptions = {
1285
1278
  type PluginVueQuery = PluginFactoryOptions<'plugin-vue-query', Options$1, ResolvedOptions, never, ResolvePathOptions>;
1286
1279
  //#endregion
1287
1280
  export { ReactGenerator as a, Operation$1 as c, Transformer as i, Options$1 as n, OperationSchemas as o, PluginVueQuery as r, UserPluginWithLifeCycle as s, Infinite as t };
1288
- //# sourceMappingURL=types-KYdGiLku.d.ts.map
1281
+ //# sourceMappingURL=types-COROLdSu.d.cts.map
@@ -1,3 +1,4 @@
1
+ import { Fabric } from "@kubb/react-fabric";
1
2
  import * as OasTypes from "oas/types";
2
3
  import { HttpMethods as HttpMethod, OASDocument, SchemaObject, User } from "oas/types";
3
4
  import { Operation, Operation as Operation$1 } from "oas/operation";
@@ -5,7 +6,6 @@ import { OpenAPIV3 } from "openapi-types";
5
6
  import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
6
7
  import BaseOas from "oas";
7
8
  import { KubbFile } from "@kubb/fabric-core/types";
8
- import { Fabric } from "@kubb/react-fabric";
9
9
  import { ConsolaInstance, LogLevel } from "consola";
10
10
  import { KubbNode } from "@kubb/react-fabric/types";
11
11
 
@@ -1109,7 +1109,7 @@ type ResolvedOptions$1 = {
1109
1109
  group?: Options$2['group'];
1110
1110
  baseURL: string | undefined;
1111
1111
  client: Options$2['client'];
1112
- bundle: boolean;
1112
+ bundle: NonNullable<Options$2['bundle']>;
1113
1113
  parser: NonNullable<Options$2['parser']>;
1114
1114
  urlType: NonNullable<Options$2['urlType']>;
1115
1115
  importPath: Options$2['importPath'];
@@ -1196,13 +1196,7 @@ type Options$1 = {
1196
1196
  * Group the @tanstack/query hooks based on the provided name.
1197
1197
  */
1198
1198
  group?: Group;
1199
- client?: Pick<PluginClient['options'], 'client' | 'dataReturnType' | 'importPath' | 'baseURL'>;
1200
- /**
1201
- * Bundle the selected client into the generated `.kubb` directory.
1202
- * When disabled the generated hooks will import the shared runtime from `@kubb/plugin-client/clients/*`.
1203
- * @default false
1204
- */
1205
- bundle?: boolean;
1199
+ client?: Pick<PluginClient['options'], 'client' | 'dataReturnType' | 'importPath' | 'baseURL' | 'bundle'>;
1206
1200
  /**
1207
1201
  * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
1208
1202
  */
@@ -1268,7 +1262,6 @@ type ResolvedOptions = {
1268
1262
  output: Output<Oas>;
1269
1263
  group: Options$1['group'];
1270
1264
  client: NonNullable<PluginVueQuery['options']['client']>;
1271
- bundle: boolean;
1272
1265
  parser: Required<NonNullable<Options$1['parser']>>;
1273
1266
  paramsCasing: Options$1['paramsCasing'];
1274
1267
  paramsType: NonNullable<Options$1['paramsType']>;
@@ -1285,4 +1278,4 @@ type ResolvedOptions = {
1285
1278
  type PluginVueQuery = PluginFactoryOptions<'plugin-vue-query', Options$1, ResolvedOptions, never, ResolvePathOptions>;
1286
1279
  //#endregion
1287
1280
  export { ReactGenerator as a, Operation$1 as c, Transformer as i, Options$1 as n, OperationSchemas as o, PluginVueQuery as r, UserPluginWithLifeCycle as s, Infinite as t };
1288
- //# sourceMappingURL=types-Bo3QWaIS.d.cts.map
1281
+ //# sourceMappingURL=types-DC5yKSuG.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-vue-query",
3
- "version": "4.5.8",
3
+ "version": "4.5.9",
4
4
  "description": "Vue Query hooks generator plugin for Kubb, creating type-safe API client hooks from OpenAPI specifications for Vue.js applications.",
5
5
  "keywords": [
6
6
  "vue-query",
@@ -68,17 +68,17 @@
68
68
  }
69
69
  ],
70
70
  "dependencies": {
71
- "@kubb/react-fabric": "0.2.19",
71
+ "@kubb/react-fabric": "0.3.1",
72
72
  "remeda": "^2.32.0",
73
- "@kubb/core": "4.5.8",
74
- "@kubb/oas": "4.5.8",
75
- "@kubb/plugin-client": "4.5.8",
76
- "@kubb/plugin-oas": "4.5.8",
77
- "@kubb/plugin-ts": "4.5.8",
78
- "@kubb/plugin-zod": "4.5.8"
73
+ "@kubb/core": "4.5.9",
74
+ "@kubb/oas": "4.5.9",
75
+ "@kubb/plugin-client": "4.5.9",
76
+ "@kubb/plugin-oas": "4.5.9",
77
+ "@kubb/plugin-ts": "4.5.9",
78
+ "@kubb/plugin-zod": "4.5.9"
79
79
  },
80
80
  "peerDependencies": {
81
- "@kubb/react-fabric": "0.2.19"
81
+ "@kubb/react-fabric": "0.3.1"
82
82
  },
83
83
  "engines": {
84
84
  "node": ">=20"
@@ -2,10 +2,10 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { RequestConfig, ResponseErrorConfig, ResponseConfig } from '@kubb/plugin-client/clients/axios'
5
+ import type { RequestConfig, ResponseErrorConfig, ResponseConfig } from './test/.kubb/fetch'
7
6
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
8
7
  import type { MaybeRefOrGetter } from 'vue'
8
+ import { fetch } from './test/.kubb/fetch'
9
9
  import { queryOptions, useQuery } from '@tanstack/react-query'
10
10
  import { toValue } from 'vue'
11
11
 
@@ -2,10 +2,10 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
5
+ import type { RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
7
6
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
8
7
  import type { MaybeRefOrGetter } from 'vue'
8
+ import { fetch } from './test/.kubb/fetch'
9
9
  import { queryOptions, useQuery } from '@tanstack/react-query'
10
10
  import { toValue } from 'vue'
11
11
 
@@ -2,10 +2,10 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
5
+ import type { RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
7
6
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
8
7
  import type { MaybeRefOrGetter } from 'vue'
8
+ import { fetch } from './test/.kubb/fetch'
9
9
  import { queryOptions, useQuery } from '@tanstack/react-query'
10
10
  import { toValue } from 'vue'
11
11
 
@@ -2,10 +2,10 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
5
+ import type { RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
7
6
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
8
7
  import type { MaybeRefOrGetter } from 'vue'
8
+ import { fetch } from './test/.kubb/fetch'
9
9
  import { queryOptions, useQuery } from '@tanstack/react-query'
10
10
  import { toValue } from 'vue'
11
11
 
@@ -2,10 +2,10 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
5
+ import type { RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
7
6
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
8
7
  import type { MaybeRefOrGetter } from 'vue'
8
+ import { fetch } from './test/.kubb/fetch'
9
9
  import { queryOptions, useQuery } from '@tanstack/react-query'
10
10
  import { toValue } from 'vue'
11
11
 
@@ -2,10 +2,10 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
5
+ import type { RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
7
6
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
8
7
  import type { MaybeRefOrGetter } from 'vue'
8
+ import { fetch } from './test/.kubb/fetch'
9
9
  import { queryOptions, useQuery } from '@tanstack/react-query'
10
10
  import { toValue } from 'vue'
11
11
 
@@ -2,10 +2,10 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
5
+ import type { RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
7
6
  import type { InfiniteData, QueryKey, QueryClient, InfiniteQueryObserverOptions, UseInfiniteQueryReturnType } from '@tanstack/react-query'
8
7
  import type { MaybeRefOrGetter } from 'vue'
8
+ import { fetch } from './test/.kubb/fetch'
9
9
  import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query'
10
10
  import { toValue } from 'vue'
11
11
 
@@ -2,10 +2,10 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
5
+ import type { RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
7
6
  import type { InfiniteData, QueryKey, QueryClient, InfiniteQueryObserverOptions, UseInfiniteQueryReturnType } from '@tanstack/react-query'
8
7
  import type { MaybeRefOrGetter } from 'vue'
8
+ import { fetch } from './test/.kubb/fetch'
9
9
  import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query'
10
10
  import { toValue } from 'vue'
11
11
 
@@ -2,10 +2,10 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
5
+ import type { RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
7
6
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from 'custom-query'
8
7
  import type { MaybeRefOrGetter } from 'vue'
8
+ import { fetch } from './test/.kubb/fetch'
9
9
  import { queryOptions, useQuery } from 'custom-query'
10
10
  import { toValue } from 'vue'
11
11
 
@@ -2,10 +2,10 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
5
+ import type { RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
7
6
  import type { MutationObserverOptions, QueryClient } from '@tanstack/vue-query'
8
7
  import type { MaybeRefOrGetter } from 'vue'
8
+ import { fetch } from './test/.kubb/fetch'
9
9
  import { useMutation } from '@tanstack/vue-query'
10
10
 
11
11
  export const updatePetWithFormMutationKey = () => [{ url: '/pet/:petId' }] as const
@@ -2,10 +2,10 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
5
+ import type { RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
7
6
  import type { MutationObserverOptions, QueryClient } from '@tanstack/vue-query'
8
7
  import type { MaybeRefOrGetter } from 'vue'
8
+ import { fetch } from './test/.kubb/fetch'
9
9
  import { useMutation } from '@tanstack/vue-query'
10
10
 
11
11
  export const updatePetWithFormMutationKey = () => [{ url: '/pet/:petId' }] as const
package/src/plugin.ts CHANGED
@@ -13,7 +13,6 @@ import type { PluginVueQuery } from './types.ts'
13
13
  export const pluginVueQueryName = 'plugin-vue-query' satisfies PluginVueQuery['name']
14
14
 
15
15
  export const pluginVueQuery = definePlugin<PluginVueQuery>((options) => {
16
- const bundle = options.bundle ?? false
17
16
  const {
18
17
  output = { path: 'hooks', barrelType: 'named' },
19
18
  group,
@@ -32,21 +31,21 @@ export const pluginVueQuery = definePlugin<PluginVueQuery>((options) => {
32
31
  queryKey = QueryKey.getTransformer,
33
32
  generators = [queryGenerator, infiniteQueryGenerator, mutationGenerator].filter(Boolean),
34
33
  contentType,
34
+ client,
35
35
  } = options
36
36
 
37
- const clientType = options.client?.client ?? 'axios'
38
- const clientImportPath = options.client?.importPath ?? (!bundle ? `@kubb/plugin-client/clients/${clientType}` : undefined)
37
+ const clientType = client?.client ?? 'axios'
38
+ const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientType}` : undefined)
39
39
 
40
40
  return {
41
41
  name: pluginVueQueryName,
42
42
  options: {
43
- bundle,
44
43
  output,
45
44
  client: {
45
+ ...options.client,
46
46
  client: clientType,
47
- dataReturnType: options.client?.dataReturnType ?? 'data',
47
+ dataReturnType: client?.dataReturnType ?? 'data',
48
48
  pathParamsType,
49
- baseURL: options.client?.baseURL,
50
49
  importPath: clientImportPath,
51
50
  },
52
51
  infinite: infinite
@@ -144,7 +143,7 @@ export const pluginVueQuery = definePlugin<PluginVueQuery>((options) => {
144
143
  const hasClientPlugin = !!this.pluginManager.getPluginByKey([pluginClientName])
145
144
  const containsFetch = this.fabric.files.some((file) => file.baseName === 'fetch.ts')
146
145
 
147
- if (bundle && !hasClientPlugin && !this.plugin.options.client.importPath && !containsFetch) {
146
+ if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath && !containsFetch) {
148
147
  // pre add bundled
149
148
  await this.addFile({
150
149
  baseName: 'fetch.ts',
package/src/types.ts CHANGED
@@ -87,14 +87,7 @@ export type Options = {
87
87
  * Group the @tanstack/query hooks based on the provided name.
88
88
  */
89
89
  group?: Group
90
- client?: Pick<PluginClient['options'], 'client' | 'dataReturnType' | 'importPath' | 'baseURL'>
91
- /**
92
- * Bundle the selected client into the generated `.kubb` directory.
93
- * When disabled the generated hooks will import the shared runtime from `@kubb/plugin-client/clients/*`.
94
- * @default false
95
- */
96
- bundle?: boolean
97
-
90
+ client?: Pick<PluginClient['options'], 'client' | 'dataReturnType' | 'importPath' | 'baseURL' | 'bundle'>
98
91
  /**
99
92
  * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
100
93
  */
@@ -161,7 +154,6 @@ type ResolvedOptions = {
161
154
  output: Output<Oas>
162
155
  group: Options['group']
163
156
  client: NonNullable<PluginVueQuery['options']['client']>
164
- bundle: boolean
165
157
  parser: Required<NonNullable<Options['parser']>>
166
158
  paramsCasing: Options['paramsCasing']
167
159
  paramsType: NonNullable<Options['paramsType']>
File without changes