@kubb/plugin-react-query 4.3.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-DMmIE7y6.js +28 -0
- package/dist/{components-DUCi70hD.cjs → components-B_-p18Ak.cjs} +47 -47
- package/dist/components-B_-p18Ak.cjs.map +1 -0
- package/dist/{components-Dc5XkKq5.js → components-CbVTS6aF.js} +3 -3
- package/dist/components-CbVTS6aF.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.cts +20 -24
- package/dist/components.d.ts +20 -24
- package/dist/components.js +1 -1
- package/dist/{generators-CqUlfy01.js → generators-egdl4EOg.js} +4 -4
- package/dist/generators-egdl4EOg.js.map +1 -0
- package/dist/{generators-DaV-5jJ5.cjs → generators-hTZEzfNP.cjs} +68 -68
- package/dist/generators-hTZEzfNP.cjs.map +1 -0
- package/dist/generators.cjs +2 -2
- package/dist/generators.d.cts +5 -5
- package/dist/generators.d.ts +5 -5
- package/dist/generators.js +2 -2
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/{types-2m4m5kf3.d.cts → types-CsOfyJFc.d.ts} +225 -206
- package/dist/{types-Dq_Y56GQ.d.ts → types-L74GEs-s.d.cts} +220 -201
- package/package.json +10 -10
- package/src/components/InfiniteQuery.tsx +3 -2
- package/src/components/InfiniteQueryOptions.tsx +3 -2
- package/src/components/Mutation.tsx +12 -2
- package/src/components/MutationKey.tsx +3 -2
- package/src/components/MutationOptions.tsx +3 -3
- package/src/components/Query.tsx +3 -2
- package/src/components/QueryKey.tsx +3 -2
- package/src/components/QueryOptions.tsx +4 -4
- package/src/components/SuspenseQuery.tsx +3 -2
- package/src/generators/__snapshots__/findSuspenseByTags.ts +80 -0
- package/src/generators/infiniteQueryGenerator.tsx +1 -1
- package/src/generators/mutationGenerator.tsx +1 -1
- package/src/generators/queryGenerator.tsx +1 -1
- package/src/generators/suspenseQueryGenerator.tsx +1 -1
- package/src/plugin.ts +1 -0
- package/src/types.ts +1 -1
- package/dist/components-DUCi70hD.cjs.map +0 -1
- package/dist/components-Dc5XkKq5.js.map +0 -1
- package/dist/generators-CqUlfy01.js.map +0 -1
- package/dist/generators-DaV-5jJ5.cjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-react-query",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "React Query hooks generator plugin for Kubb, creating type-safe API client hooks from OpenAPI specifications for React applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-query",
|
|
@@ -60,21 +60,21 @@
|
|
|
60
60
|
"!/**/__tests__/**"
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
|
+
"@kubb/react-fabric": "0.2.8",
|
|
63
64
|
"remeda": "^2.32.0",
|
|
64
|
-
"@kubb/core": "4.
|
|
65
|
-
"@kubb/oas": "4.
|
|
66
|
-
"@kubb/plugin-client": "4.
|
|
67
|
-
"@kubb/plugin-oas": "4.
|
|
68
|
-
"@kubb/plugin-ts": "4.
|
|
69
|
-
"@kubb/plugin-zod": "4.
|
|
70
|
-
"@kubb/react": "4.3.1"
|
|
65
|
+
"@kubb/core": "4.4.0",
|
|
66
|
+
"@kubb/oas": "4.4.0",
|
|
67
|
+
"@kubb/plugin-client": "4.4.0",
|
|
68
|
+
"@kubb/plugin-oas": "4.4.0",
|
|
69
|
+
"@kubb/plugin-ts": "4.4.0",
|
|
70
|
+
"@kubb/plugin-zod": "4.4.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"tsdown": "^0.15.
|
|
73
|
+
"tsdown": "^0.15.11",
|
|
74
74
|
"typescript": "^5.9.3"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@kubb/react": "
|
|
77
|
+
"@kubb/react-fabric": "0.2.8"
|
|
78
78
|
},
|
|
79
79
|
"engines": {
|
|
80
80
|
"node": ">=20"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isOptional, type Operation } from '@kubb/oas'
|
|
2
2
|
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
3
3
|
import { getComments, getPathParams } from '@kubb/plugin-oas/utils'
|
|
4
|
-
import { File, Function, FunctionParams } from '@kubb/react'
|
|
4
|
+
import { File, Function, FunctionParams } from '@kubb/react-fabric'
|
|
5
|
+
import type { KubbNode } from '@kubb/react-fabric/types'
|
|
5
6
|
import type { Infinite, PluginReactQuery } from '../types.ts'
|
|
6
7
|
import { QueryKey } from './QueryKey.tsx'
|
|
7
8
|
import { QueryOptions } from './QueryOptions.tsx'
|
|
@@ -128,7 +129,7 @@ export function InfiniteQuery({
|
|
|
128
129
|
operation,
|
|
129
130
|
initialPageParam,
|
|
130
131
|
queryParam,
|
|
131
|
-
}: Props) {
|
|
132
|
+
}: Props): KubbNode {
|
|
132
133
|
const responseType = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
133
134
|
const errorType = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
134
135
|
const isInitialPageParamDefined = initialPageParam !== undefined && initialPageParam !== null
|
|
@@ -2,7 +2,8 @@ import { isOptional } from '@kubb/oas'
|
|
|
2
2
|
import { Client } from '@kubb/plugin-client/components'
|
|
3
3
|
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
4
4
|
import { getPathParams } from '@kubb/plugin-oas/utils'
|
|
5
|
-
import { File, Function, FunctionParams } from '@kubb/react'
|
|
5
|
+
import { File, Function, FunctionParams } from '@kubb/react-fabric'
|
|
6
|
+
import type { KubbNode } from '@kubb/react-fabric/types'
|
|
6
7
|
import type { Infinite, PluginReactQuery } from '../types.ts'
|
|
7
8
|
import { QueryKey } from './QueryKey.tsx'
|
|
8
9
|
|
|
@@ -116,7 +117,7 @@ export function InfiniteQueryOptions({
|
|
|
116
117
|
pathParamsType,
|
|
117
118
|
queryParam,
|
|
118
119
|
queryKeyName,
|
|
119
|
-
}: Props) {
|
|
120
|
+
}: Props): KubbNode {
|
|
120
121
|
const queryFnDataType = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
121
122
|
const errorType = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
122
123
|
const isInitialPageParamDefined = initialPageParam !== undefined && initialPageParam !== null
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isOptional, type Operation } from '@kubb/oas'
|
|
2
2
|
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
3
3
|
import { getComments, getPathParams } from '@kubb/plugin-oas/utils'
|
|
4
|
-
import { File, Function, FunctionParams } from '@kubb/react'
|
|
4
|
+
import { File, Function, FunctionParams } from '@kubb/react-fabric'
|
|
5
|
+
import type { KubbNode } from '@kubb/react-fabric/types'
|
|
5
6
|
import type { PluginReactQuery } from '../types.ts'
|
|
6
7
|
import { MutationKey } from './MutationKey.tsx'
|
|
7
8
|
import { MutationOptions } from './MutationOptions.tsx'
|
|
@@ -68,7 +69,16 @@ function getParams({ paramsCasing, dataReturnType, typeSchemas }: GetParamsProps
|
|
|
68
69
|
})
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
export function Mutation({
|
|
72
|
+
export function Mutation({
|
|
73
|
+
name,
|
|
74
|
+
mutationOptionsName,
|
|
75
|
+
paramsCasing,
|
|
76
|
+
pathParamsType,
|
|
77
|
+
dataReturnType,
|
|
78
|
+
typeSchemas,
|
|
79
|
+
operation,
|
|
80
|
+
mutationKeyName,
|
|
81
|
+
}: Props): KubbNode {
|
|
72
82
|
const mutationKeyParams = MutationKey.getParams({
|
|
73
83
|
pathParamsType,
|
|
74
84
|
typeSchemas,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { URLPath } from '@kubb/core/utils'
|
|
2
2
|
import type { Operation } from '@kubb/oas'
|
|
3
3
|
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
4
|
-
import { File, Function, FunctionParams, Type } from '@kubb/react'
|
|
4
|
+
import { File, Function, FunctionParams, Type } from '@kubb/react-fabric'
|
|
5
|
+
import type { KubbNode } from '@kubb/react-fabric/types'
|
|
5
6
|
import type { PluginReactQuery, Transformer } from '../types'
|
|
6
7
|
|
|
7
8
|
type Props = {
|
|
@@ -29,7 +30,7 @@ const getTransformer: Transformer = ({ operation, casing }) => {
|
|
|
29
30
|
return [`{ url: '${path.toURLPath()}' }`]
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
export function MutationKey({ name, typeSchemas, pathParamsType, paramsCasing, operation, typeName, transformer = getTransformer }: Props) {
|
|
33
|
+
export function MutationKey({ name, typeSchemas, pathParamsType, paramsCasing, operation, typeName, transformer = getTransformer }: Props): KubbNode {
|
|
33
34
|
const params = getParams({ pathParamsType, typeSchemas })
|
|
34
35
|
const keys = transformer({ operation, schemas: typeSchemas, casing: paramsCasing })
|
|
35
36
|
|
|
@@ -2,8 +2,8 @@ import { isOptional } from '@kubb/oas'
|
|
|
2
2
|
import { Client } from '@kubb/plugin-client/components'
|
|
3
3
|
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
4
4
|
import { getPathParams } from '@kubb/plugin-oas/utils'
|
|
5
|
-
import { File, Function, FunctionParams } from '@kubb/react'
|
|
6
|
-
import type { Params } from '@kubb/react/types'
|
|
5
|
+
import { File, Function, FunctionParams } from '@kubb/react-fabric'
|
|
6
|
+
import type { KubbNode, Params } from '@kubb/react-fabric/types'
|
|
7
7
|
import type { PluginReactQuery } from '../types.ts'
|
|
8
8
|
import { MutationKey } from './MutationKey.tsx'
|
|
9
9
|
|
|
@@ -33,7 +33,7 @@ function getParams({ typeSchemas }: GetParamsProps) {
|
|
|
33
33
|
})
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export function MutationOptions({ name, clientName, dataReturnType, typeSchemas, paramsCasing, paramsType, pathParamsType, mutationKeyName }: Props) {
|
|
36
|
+
export function MutationOptions({ name, clientName, dataReturnType, typeSchemas, paramsCasing, paramsType, pathParamsType, mutationKeyName }: Props): KubbNode {
|
|
37
37
|
const params = getParams({ typeSchemas })
|
|
38
38
|
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
39
39
|
const TError = typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'
|
package/src/components/Query.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isOptional, type Operation } from '@kubb/oas'
|
|
2
2
|
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
3
3
|
import { getComments, getPathParams } from '@kubb/plugin-oas/utils'
|
|
4
|
-
import { File, Function, FunctionParams } from '@kubb/react'
|
|
4
|
+
import { File, Function, FunctionParams } from '@kubb/react-fabric'
|
|
5
|
+
import type { KubbNode } from '@kubb/react-fabric/types'
|
|
5
6
|
import type { PluginReactQuery } from '../types.ts'
|
|
6
7
|
import { QueryKey } from './QueryKey.tsx'
|
|
7
8
|
import { QueryOptions } from './QueryOptions.tsx'
|
|
@@ -121,7 +122,7 @@ export function Query({
|
|
|
121
122
|
dataReturnType,
|
|
122
123
|
typeSchemas,
|
|
123
124
|
operation,
|
|
124
|
-
}: Props) {
|
|
125
|
+
}: Props): KubbNode {
|
|
125
126
|
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
126
127
|
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
127
128
|
const returnType = `UseQueryResult<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`
|
|
@@ -2,7 +2,8 @@ import { URLPath } from '@kubb/core/utils'
|
|
|
2
2
|
import { isOptional, type Operation } from '@kubb/oas'
|
|
3
3
|
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
4
4
|
import { getPathParams } from '@kubb/plugin-oas/utils'
|
|
5
|
-
import { File, Function, FunctionParams, Type } from '@kubb/react'
|
|
5
|
+
import { File, Function, FunctionParams, Type } from '@kubb/react-fabric'
|
|
6
|
+
import type { KubbNode } from '@kubb/react-fabric/types'
|
|
6
7
|
import type { PluginReactQuery, Transformer } from '../types'
|
|
7
8
|
|
|
8
9
|
type Props = {
|
|
@@ -56,7 +57,7 @@ const getTransformer: Transformer = ({ operation, schemas, casing }) => {
|
|
|
56
57
|
return keys
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
export function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }: Props) {
|
|
60
|
+
export function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }: Props): KubbNode {
|
|
60
61
|
const params = getParams({ pathParamsType, typeSchemas, paramsCasing })
|
|
61
62
|
const keys = transformer({
|
|
62
63
|
operation,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getPathParams } from '@kubb/plugin-oas/utils'
|
|
2
|
-
import { File, Function, FunctionParams } from '@kubb/react'
|
|
3
|
-
|
|
4
1
|
import { isOptional } from '@kubb/oas'
|
|
5
2
|
import { Client } from '@kubb/plugin-client/components'
|
|
6
3
|
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
4
|
+
import { getPathParams } from '@kubb/plugin-oas/utils'
|
|
5
|
+
import { File, Function, FunctionParams } from '@kubb/react-fabric'
|
|
6
|
+
import type { KubbNode } from '@kubb/react-fabric/types'
|
|
7
7
|
import type { PluginReactQuery } from '../types.ts'
|
|
8
8
|
import { QueryKey } from './QueryKey.tsx'
|
|
9
9
|
|
|
@@ -96,7 +96,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: Ge
|
|
|
96
96
|
})
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
export function QueryOptions({ name, clientName, dataReturnType, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }: Props) {
|
|
99
|
+
export function QueryOptions({ name, clientName, dataReturnType, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }: Props): KubbNode {
|
|
100
100
|
const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })
|
|
101
101
|
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
102
102
|
const TError = typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isOptional, type Operation } from '@kubb/oas'
|
|
2
2
|
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
3
3
|
import { getComments, getPathParams } from '@kubb/plugin-oas/utils'
|
|
4
|
-
import { File, Function, FunctionParams } from '@kubb/react'
|
|
4
|
+
import { File, Function, FunctionParams } from '@kubb/react-fabric'
|
|
5
|
+
import type { KubbNode } from '@kubb/react-fabric/types'
|
|
5
6
|
import type { PluginReactQuery } from '../types.ts'
|
|
6
7
|
import { QueryKey } from './QueryKey.tsx'
|
|
7
8
|
import { QueryOptions } from './QueryOptions.tsx'
|
|
@@ -128,7 +129,7 @@ export function SuspenseQuery({
|
|
|
128
129
|
dataReturnType,
|
|
129
130
|
typeSchemas,
|
|
130
131
|
operation,
|
|
131
|
-
}: Props) {
|
|
132
|
+
}: Props): KubbNode {
|
|
132
133
|
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
133
134
|
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
134
135
|
const returnType = `UseSuspenseQueryResult<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
*/
|
|
5
|
+
import fetch from '@kubb/plugin-client/clients/axios'
|
|
6
|
+
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
7
|
+
import type { QueryKey, QueryClient, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query'
|
|
8
|
+
import { queryOptions, useSuspenseQuery } from '@tanstack/react-query'
|
|
9
|
+
|
|
10
|
+
export const findPetsByTagsSuspenseQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
|
|
11
|
+
|
|
12
|
+
export type FindPetsByTagsSuspenseQueryKey = ReturnType<typeof findPetsByTagsSuspenseQueryKey>
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
16
|
+
* @summary Finds Pets by tags
|
|
17
|
+
* {@link /pet/findByTags}
|
|
18
|
+
*/
|
|
19
|
+
export async function findPetsByTagsSuspense(
|
|
20
|
+
headers: FindPetsByTagsHeaderParams,
|
|
21
|
+
params?: FindPetsByTagsQueryParams,
|
|
22
|
+
config: Partial<RequestConfig> & { client?: typeof fetch } = {},
|
|
23
|
+
) {
|
|
24
|
+
const { client: request = fetch, ...requestConfig } = config
|
|
25
|
+
|
|
26
|
+
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
27
|
+
method: 'GET',
|
|
28
|
+
url: `/pet/findByTags`,
|
|
29
|
+
params,
|
|
30
|
+
...requestConfig,
|
|
31
|
+
headers: { ...headers, ...requestConfig.headers },
|
|
32
|
+
})
|
|
33
|
+
return findPetsByTagsQueryResponse.parse(res.data)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function findPetsByTagsSuspenseQueryOptions(
|
|
37
|
+
headers: FindPetsByTagsHeaderParams,
|
|
38
|
+
params?: FindPetsByTagsQueryParams,
|
|
39
|
+
config: Partial<RequestConfig> & { client?: typeof fetch } = {},
|
|
40
|
+
) {
|
|
41
|
+
const queryKey = findPetsByTagsSuspenseQueryKey(params)
|
|
42
|
+
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
43
|
+
queryKey,
|
|
44
|
+
queryFn: async ({ signal }) => {
|
|
45
|
+
config.signal = signal
|
|
46
|
+
return findPetsByTagsSuspense(headers, params, config)
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
53
|
+
* @summary Finds Pets by tags
|
|
54
|
+
* {@link /pet/findByTags}
|
|
55
|
+
*/
|
|
56
|
+
export function useFindPetsByTagsSuspense<TData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsSuspenseQueryKey>(
|
|
57
|
+
headers: FindPetsByTagsHeaderParams,
|
|
58
|
+
params?: FindPetsByTagsQueryParams,
|
|
59
|
+
options: {
|
|
60
|
+
query?: Partial<UseSuspenseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryKey>> & { client?: QueryClient }
|
|
61
|
+
client?: Partial<RequestConfig> & { client?: typeof fetch }
|
|
62
|
+
} = {},
|
|
63
|
+
) {
|
|
64
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
65
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
66
|
+
const queryKey = queryOptions?.queryKey ?? findPetsByTagsSuspenseQueryKey(params)
|
|
67
|
+
|
|
68
|
+
const query = useSuspenseQuery(
|
|
69
|
+
{
|
|
70
|
+
...findPetsByTagsSuspenseQueryOptions(headers, params, config),
|
|
71
|
+
queryKey,
|
|
72
|
+
...queryOptions,
|
|
73
|
+
} as unknown as UseSuspenseQueryOptions,
|
|
74
|
+
queryClient,
|
|
75
|
+
) as UseSuspenseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
76
|
+
|
|
77
|
+
query.queryKey = queryKey as TQueryKey
|
|
78
|
+
|
|
79
|
+
return query
|
|
80
|
+
}
|
|
@@ -6,7 +6,7 @@ import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'
|
|
|
6
6
|
import { getBanner, getFooter } from '@kubb/plugin-oas/utils'
|
|
7
7
|
import { pluginTsName } from '@kubb/plugin-ts'
|
|
8
8
|
import { pluginZodName } from '@kubb/plugin-zod'
|
|
9
|
-
import { File } from '@kubb/react'
|
|
9
|
+
import { File } from '@kubb/react-fabric'
|
|
10
10
|
import { difference } from 'remeda'
|
|
11
11
|
import { InfiniteQuery, InfiniteQueryOptions, QueryKey } from '../components'
|
|
12
12
|
import type { PluginReactQuery } from '../types'
|
|
@@ -6,7 +6,7 @@ import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'
|
|
|
6
6
|
import { getBanner, getFooter } from '@kubb/plugin-oas/utils'
|
|
7
7
|
import { pluginTsName } from '@kubb/plugin-ts'
|
|
8
8
|
import { pluginZodName } from '@kubb/plugin-zod'
|
|
9
|
-
import { File } from '@kubb/react'
|
|
9
|
+
import { File } from '@kubb/react-fabric'
|
|
10
10
|
import { difference } from 'remeda'
|
|
11
11
|
import { Mutation, MutationKey } from '../components'
|
|
12
12
|
import { MutationOptions } from '../components/MutationOptions.tsx'
|
|
@@ -6,7 +6,7 @@ import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'
|
|
|
6
6
|
import { getBanner, getFooter } from '@kubb/plugin-oas/utils'
|
|
7
7
|
import { pluginTsName } from '@kubb/plugin-ts'
|
|
8
8
|
import { pluginZodName } from '@kubb/plugin-zod'
|
|
9
|
-
import { File } from '@kubb/react'
|
|
9
|
+
import { File } from '@kubb/react-fabric'
|
|
10
10
|
import { difference } from 'remeda'
|
|
11
11
|
import { Query, QueryKey, QueryOptions } from '../components'
|
|
12
12
|
import type { PluginReactQuery } from '../types'
|
|
@@ -6,7 +6,7 @@ import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'
|
|
|
6
6
|
import { getBanner, getFooter } from '@kubb/plugin-oas/utils'
|
|
7
7
|
import { pluginTsName } from '@kubb/plugin-ts'
|
|
8
8
|
import { pluginZodName } from '@kubb/plugin-zod'
|
|
9
|
-
import { File } from '@kubb/react'
|
|
9
|
+
import { File } from '@kubb/react-fabric'
|
|
10
10
|
import { difference } from 'remeda'
|
|
11
11
|
import { QueryKey, QueryOptions, SuspenseQuery } from '../components'
|
|
12
12
|
import type { PluginReactQuery } from '../types'
|
package/src/plugin.ts
CHANGED
|
@@ -140,6 +140,7 @@ export const pluginReactQuery = createPlugin<PluginReactQuery>((options) => {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
const operationGenerator = new OperationGenerator(this.plugin.options, {
|
|
143
|
+
fabric: this.fabric,
|
|
143
144
|
oas,
|
|
144
145
|
pluginManager: this.pluginManager,
|
|
145
146
|
plugin: this.plugin,
|
package/src/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Group, Output, PluginFactoryOptions, ResolveNameParams } from '@kubb/core'
|
|
2
2
|
|
|
3
|
-
import type { HttpMethod, Oas, Operation
|
|
3
|
+
import type { contentType, HttpMethod, Oas, Operation } from '@kubb/oas'
|
|
4
4
|
import type { PluginClient } from '@kubb/plugin-client'
|
|
5
5
|
import type { Exclude, Generator, Include, OperationSchemas, Override, ResolvePathOptions } from '@kubb/plugin-oas'
|
|
6
6
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components-DUCi70hD.cjs","names":["getParams","FunctionParams","getTransformer: Transformer","URLPath","getTransformer","File","Function","Type","getParams","FunctionParams","Client","File","Function","getParams","FunctionParams","File","Function","getParams","FunctionParams","Client","File","Function","getParams","FunctionParams","getTransformer: Transformer","URLPath","File","Function","Type","getParams","FunctionParams","Client","File","Function","getParams","FunctionParams","File","Function","getParams","FunctionParams","File","Function","FunctionParams","File","Function"],"sources":["../src/components/QueryKey.tsx","../src/components/QueryOptions.tsx","../src/components/InfiniteQuery.tsx","../src/components/InfiniteQueryOptions.tsx","../src/components/MutationKey.tsx","../src/components/MutationOptions.tsx","../src/components/Mutation.tsx","../src/components/Query.tsx","../src/components/SuspenseQuery.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'\nimport type { PluginReactQuery, Transformer } from '../types'\n\ntype Props = {\n name: string\n typeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n transformer: Transformer | undefined\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginReactQuery['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, { typed: true, casing: paramsCasing }),\n },\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 })\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) {\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 { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react'\n\nimport { isOptional } from '@kubb/oas'\nimport { Client } from '@kubb/plugin-client/components'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport type { PluginReactQuery } 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: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['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, { 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 },\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: typeSchemas.pathParams?.name\n ? {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n optional: isOptional(typeSchemas.pathParams?.schema),\n }\n : undefined,\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 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) {\n const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'\n\n const clientParams = Client.getParams({\n typeSchemas,\n paramsCasing,\n paramsType,\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}, ResponseErrorConfig<${TError}>, ${TData}, typeof queryKey>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal }) => {\n config.signal = signal\n return ${clientName}(${clientParams.toCall({})})\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'\nimport type { Infinite, PluginReactQuery } 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: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n initialPageParam: Infinite['initialPageParam']\n queryParam?: Infinite['queryParam']\n}\n\ntype GetParamsProps = {\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n pageParamGeneric: string\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas, pageParamGeneric }: 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 }),\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 },\n options: {\n type: `\n{\n query?: Partial<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, ${pageParamGeneric}>> & { 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: typeSchemas.pathParams?.name\n ? {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n }),\n optional: isOptional(typeSchemas.pathParams?.schema),\n }\n : undefined,\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 options: {\n type: `\n{\n query?: Partial<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, ${pageParamGeneric}>> & { 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 paramsCasing,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n operation,\n initialPageParam,\n queryParam,\n}: Props) {\n const responseType = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const errorType = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n const isInitialPageParamDefined = initialPageParam !== undefined && initialPageParam !== null\n const fallbackPageParamType =\n typeof initialPageParam === 'number'\n ? 'number'\n : typeof initialPageParam === 'string'\n ? initialPageParam.includes(' as ')\n ? (() => {\n const parts = initialPageParam.split(' as ')\n return parts[parts.length - 1] ?? 'unknown'\n })()\n : 'string'\n : typeof initialPageParam === 'boolean'\n ? 'boolean'\n : 'unknown'\n const queryParamType = queryParam && typeSchemas.queryParams?.name ? `${typeSchemas.queryParams?.name}['${queryParam}']` : undefined\n const pageParamType = queryParamType ? (isInitialPageParamDefined ? `NonNullable<${queryParamType}>` : queryParamType) : fallbackPageParamType\n const returnType = 'UseInfiniteQueryResult<TData, TError> & { queryKey: TQueryKey }'\n const generics = [\n `TQueryFnData = ${responseType}`,\n `TError = ${errorType}`,\n 'TData = InfiniteData<TQueryFnData>',\n `TQueryKey extends QueryKey = ${queryKeyTypeName}`,\n `TPageParam = ${pageParamType}`,\n ]\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 typeSchemas,\n pageParamGeneric: 'TPageParam',\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<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 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'\nimport type { Infinite, PluginReactQuery } 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: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n initialPageParam: Infinite['initialPageParam']\n cursorParam: Infinite['cursorParam']\n queryParam: Infinite['queryParam']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['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 }),\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 },\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: typeSchemas.pathParams?.name\n ? {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n }),\n optional: isOptional(typeSchemas.pathParams?.schema),\n }\n : undefined,\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 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 paramsCasing,\n paramsType,\n dataReturnType,\n pathParamsType,\n queryParam,\n queryKeyName,\n}: Props) {\n const queryFnDataType = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const errorType = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n const isInitialPageParamDefined = initialPageParam !== undefined && initialPageParam !== null\n const fallbackPageParamType =\n typeof initialPageParam === 'number'\n ? 'number'\n : typeof initialPageParam === 'string'\n ? initialPageParam.includes(' as ')\n ? (() => {\n const parts = initialPageParam.split(' as ')\n return parts[parts.length - 1] ?? 'unknown'\n })()\n : 'string'\n : typeof initialPageParam === 'boolean'\n ? 'boolean'\n : 'unknown'\n const queryParamType = queryParam && typeSchemas.queryParams?.name ? `${typeSchemas.queryParams?.name}['${queryParam}']` : undefined\n const pageParamType = queryParamType ? (isInitialPageParamDefined ? `NonNullable<${queryParamType}>` : queryParamType) : fallbackPageParamType\n\n const params = getParams({\n paramsType,\n paramsCasing,\n pathParamsType,\n typeSchemas,\n })\n const clientParams = Client.getParams({\n paramsCasing,\n typeSchemas,\n paramsType,\n pathParamsType,\n isConfigurable: true,\n })\n const queryKeyParams = QueryKey.getParams({\n pathParamsType,\n typeSchemas,\n paramsCasing,\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 params = {\n ...(params ?? {}),\n ['${queryParam}']: pageParam as unknown as ${typeSchemas.queryParams?.name}['${queryParam}'],\n } as ${typeSchemas.queryParams?.name}`\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 if (infiniteOverrideParams) {\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<${queryFnDataType}, ${errorType}, InfiniteData<${queryFnDataType}>, typeof queryKey, ${pageParamType}>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal, pageParam }) => {\n config.signal = signal\n ${infiniteOverrideParams}\n return ${clientName}(${clientParams.toCall()})\n },\n ${queryOptions.join(',\\n')}\n })\n`}\n </Function>\n </File.Source>\n )\n }\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<${queryFnDataType}, ${errorType}, InfiniteData<${queryFnDataType}>, typeof queryKey, ${pageParamType}>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal }) => {\n config.signal = signal\n return ${clientName}(${clientParams.toCall()})\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'\nimport type { PluginReactQuery, Transformer } from '../types'\n\ntype Props = {\n name: string\n typeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n transformer: Transformer | undefined\n}\n\ntype GetParamsProps = {\n pathParamsType: PluginReactQuery['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, pathParamsType, paramsCasing, operation, typeName, transformer = getTransformer }: Props) {\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 } 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'\nimport type { Params } from '@kubb/react/types'\nimport type { PluginReactQuery } from '../types.ts'\nimport { MutationKey } from './MutationKey.tsx'\n\ntype Props = {\n name: string\n clientName: string\n mutationKeyName: string\n typeSchemas: OperationSchemas\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ typeSchemas }: GetParamsProps) {\n return FunctionParams.factory({\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 MutationOptions({ name, clientName, dataReturnType, typeSchemas, paramsCasing, paramsType, pathParamsType, mutationKeyName }: Props) {\n const params = getParams({ typeSchemas })\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'\n\n const clientParams = Client.getParams({\n typeSchemas,\n paramsCasing,\n paramsType,\n pathParamsType,\n isConfigurable: true,\n })\n\n const mutationKeyParams = MutationKey.getParams({\n pathParamsType,\n typeSchemas,\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\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\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={params.toConstructor()}>\n {`\n const mutationKey = ${mutationKeyName}(${mutationKeyParams.toCall()})\n return mutationOptions<${TData}, ResponseErrorConfig<${TError}>, ${TRequest ? `{${TRequest}}` : 'void'}, typeof mutationKey>({\n mutationKey,\n mutationFn: async(${dataParams.toConstructor()}) => {\n return ${clientName}(${clientParams.toCall()})\n },\n })\n`}\n </Function>\n </File.Source>\n )\n}\n\nMutationOptions.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'\nimport type { PluginReactQuery } from '../types.ts'\nimport { MutationKey } from './MutationKey.tsx'\nimport { MutationOptions } from './MutationOptions.tsx'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n typeName: string\n mutationOptionsName: string\n mutationKeyName: string\n typeSchemas: OperationSchemas\n operation: Operation\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['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 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 TRequest = mutationParams.toConstructor()\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n const generics = [TData, TError, TRequest ? `{${TRequest}}` : 'void', 'TContext'].join(', ')\n\n return FunctionParams.factory({\n options: {\n type: `\n{\n mutation?: UseMutationOptions<${generics}> & { 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({ name, mutationOptionsName, paramsCasing, pathParamsType, dataReturnType, typeSchemas, operation, mutationKeyName }: Props) {\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 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\n const mutationOptionsParams = MutationOptions.getParams({ typeSchemas })\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 const generics = [TData, TError, TRequest ? `{${TRequest}}` : 'void', 'TContext'].join(', ')\n const returnType = `UseMutationResult<${generics}>`\n\n const mutationOptions = `${mutationOptionsName}(${mutationOptionsParams.toCall()})`\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 const baseOptions = ${mutationOptions} as UseMutationOptions<${generics}>\n\n return useMutation<${generics}>({\n ...baseOptions,\n mutationKey,\n ...mutationOptions,\n }, queryClient) as ${returnType}\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'\nimport type { PluginReactQuery } 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: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['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, { 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 },\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: typeSchemas.pathParams?.name\n ? {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n optional: isOptional(typeSchemas.pathParams?.schema),\n }\n : undefined,\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 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) {\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 = `UseQueryResult<${['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","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'\nimport type { PluginReactQuery } 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: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['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, { 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 },\n options: {\n type: `\n{\n query?: Partial<UseSuspenseQueryOptions<${[TData, TError, 'TData', '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: typeSchemas.pathParams?.name\n ? {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n optional: isOptional(typeSchemas.pathParams?.schema),\n }\n : undefined,\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 options: {\n type: `\n{\n query?: Partial<UseSuspenseQueryOptions<${[TData, TError, 'TData', '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/**\n * Generates a strongly-typed React Query Suspense hook function for an OpenAPI operation.\n *\n * The generated function wraps `useSuspenseQuery`, providing type-safe parameters and return types based on the supplied OpenAPI schemas and configuration.\n *\n * @returns A React component source node containing the generated query function.\n */\nexport function SuspenseQuery({\n name,\n queryKeyTypeName,\n queryOptionsName,\n queryKeyName,\n paramsType,\n paramsCasing,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n operation,\n}: Props) {\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 = `UseSuspenseQueryResult<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`\n const generics = [`TData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]\n\n const queryKeyParams = QueryKey.getParams({\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const queryOptionsParams = QueryOptions.getParams({\n paramsCasing,\n paramsType,\n pathParamsType,\n typeSchemas,\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 = useSuspenseQuery({\n ...${queryOptions},\n queryKey,\n ...queryOptions\n } as unknown as UseSuspenseQueryOptions, queryClient) as ${returnType}\n\n query.queryKey = queryKey as TQueryKey\n\n return query\n `}\n </Function>\n </File.Source>\n )\n}\n\nSuspenseQuery.getParams = getParams\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAASA,YAAU,EAAE,gBAAgB,cAAc,eAA+B;AAChF,QAAOC,4BAAe,QAAQ;EAC5B,YAAY;GACV,MAAM,mBAAmB,WAAW,WAAW;GAC/C,qDAAwB,YAAY,YAAY;IAAE,OAAO;IAAM,QAAQ;IAAc,CAAC;GACvF;EACD,MAAM,YAAY,SAAS,OACvB;GACE,MAAM,YAAY,SAAS;GAC3B,qCAAqB,YAAY,SAAS,OAAO;GAClD,GACD;EACJ,QAAQ,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