@kubb/plugin-vue-query 3.14.4 → 3.15.1
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-YIZAKIBL.js → chunk-5RO5VZAJ.js} +8 -8
- package/dist/chunk-5RO5VZAJ.js.map +1 -0
- package/dist/{chunk-JXGMEN72.cjs → chunk-BBSHBY5N.cjs} +16 -16
- package/dist/chunk-BBSHBY5N.cjs.map +1 -0
- package/dist/{chunk-Z7KZM4UR.js → chunk-KHEXOVSW.js} +50 -50
- package/dist/chunk-KHEXOVSW.js.map +1 -0
- package/dist/{chunk-QW2D4COV.cjs → chunk-ZR7DRLPY.cjs} +50 -50
- package/dist/chunk-ZR7DRLPY.cjs.map +1 -0
- package/dist/components.cjs +8 -8
- package/dist/components.js +1 -1
- package/dist/generators.cjs +5 -5
- package/dist/generators.js +2 -2
- package/dist/index.cjs +5 -5
- package/dist/index.js +2 -2
- package/package.json +10 -10
- package/src/components/InfiniteQuery.tsx +12 -12
- package/src/components/InfiniteQueryOptions.tsx +8 -8
- package/src/components/Mutation.tsx +4 -4
- package/src/components/Query.tsx +12 -12
- package/src/components/QueryKey.tsx +3 -3
- package/src/components/QueryOptions.tsx +9 -9
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +13 -12
- package/src/generators/__snapshots__/clientGetImportPath.ts +13 -12
- package/src/generators/__snapshots__/clientPostImportPath.ts +4 -4
- package/src/generators/__snapshots__/findByTags.ts +13 -12
- package/src/generators/__snapshots__/findByTagsObject.ts +11 -10
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +13 -12
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +12 -12
- package/src/generators/__snapshots__/findByTagsWithZod.ts +13 -12
- package/src/generators/__snapshots__/findInfiniteByTags.ts +10 -10
- package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +10 -10
- package/src/generators/__snapshots__/postAsQuery.ts +16 -16
- package/src/generators/__snapshots__/updatePetById.ts +4 -4
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +4 -4
- package/src/generators/infiniteQueryGenerator.tsx +2 -2
- package/src/generators/mutationGenerator.tsx +1 -1
- package/src/generators/queryGenerator.tsx +2 -2
- package/dist/chunk-JXGMEN72.cjs.map +0 -1
- package/dist/chunk-QW2D4COV.cjs.map +0 -1
- package/dist/chunk-YIZAKIBL.js.map +0 -1
- package/dist/chunk-Z7KZM4UR.js.map +0 -1
|
@@ -46,25 +46,25 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
46
46
|
override(item) {
|
|
47
47
|
return {
|
|
48
48
|
...item,
|
|
49
|
-
type: `
|
|
49
|
+
type: `MaybeRefOrGetter<${item.type}>`,
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
}),
|
|
53
53
|
data: typeSchemas.request?.name
|
|
54
54
|
? {
|
|
55
|
-
type: `
|
|
55
|
+
type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,
|
|
56
56
|
optional: isOptional(typeSchemas.request?.schema),
|
|
57
57
|
}
|
|
58
58
|
: undefined,
|
|
59
59
|
params: typeSchemas.queryParams?.name
|
|
60
60
|
? {
|
|
61
|
-
type: `
|
|
61
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
62
62
|
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
63
63
|
}
|
|
64
64
|
: undefined,
|
|
65
65
|
headers: typeSchemas.headerParams?.name
|
|
66
66
|
? {
|
|
67
|
-
type: `
|
|
67
|
+
type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,
|
|
68
68
|
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
69
69
|
}
|
|
70
70
|
: undefined,
|
|
@@ -92,26 +92,26 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
92
92
|
override(item) {
|
|
93
93
|
return {
|
|
94
94
|
...item,
|
|
95
|
-
type: `
|
|
95
|
+
type: `MaybeRefOrGetter<${item.type}>`,
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
}),
|
|
99
99
|
},
|
|
100
100
|
data: typeSchemas.request?.name
|
|
101
101
|
? {
|
|
102
|
-
type: `
|
|
102
|
+
type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,
|
|
103
103
|
optional: isOptional(typeSchemas.request?.schema),
|
|
104
104
|
}
|
|
105
105
|
: undefined,
|
|
106
106
|
params: typeSchemas.queryParams?.name
|
|
107
107
|
? {
|
|
108
|
-
type: `
|
|
108
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
109
109
|
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
110
110
|
}
|
|
111
111
|
: undefined,
|
|
112
112
|
headers: typeSchemas.headerParams?.name
|
|
113
113
|
? {
|
|
114
|
-
type: `
|
|
114
|
+
type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,
|
|
115
115
|
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
116
116
|
}
|
|
117
117
|
: undefined,
|
|
@@ -163,7 +163,7 @@ export function InfiniteQuery({
|
|
|
163
163
|
typeSchemas,
|
|
164
164
|
})
|
|
165
165
|
|
|
166
|
-
const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})
|
|
166
|
+
const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})`
|
|
167
167
|
|
|
168
168
|
return (
|
|
169
169
|
<File.Source name={name} isExportable isIndexable>
|
|
@@ -182,9 +182,9 @@ export function InfiniteQuery({
|
|
|
182
182
|
|
|
183
183
|
const query = useInfiniteQuery({
|
|
184
184
|
...${queryOptions},
|
|
185
|
-
queryKey
|
|
186
|
-
...queryOptions
|
|
187
|
-
}, queryClient) as ${returnType}
|
|
185
|
+
queryKey,
|
|
186
|
+
...queryOptions
|
|
187
|
+
} as unknown as InfiniteQueryObserverOptions, queryClient) as ${returnType}
|
|
188
188
|
|
|
189
189
|
query.queryKey = queryKey as TQueryKey
|
|
190
190
|
|
|
@@ -42,25 +42,25 @@ function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: Ge
|
|
|
42
42
|
override(item) {
|
|
43
43
|
return {
|
|
44
44
|
...item,
|
|
45
|
-
type: `
|
|
45
|
+
type: `MaybeRefOrGetter<${item.type}>`,
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
}),
|
|
49
49
|
data: typeSchemas.request?.name
|
|
50
50
|
? {
|
|
51
|
-
type: `
|
|
51
|
+
type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,
|
|
52
52
|
optional: isOptional(typeSchemas.request?.schema),
|
|
53
53
|
}
|
|
54
54
|
: undefined,
|
|
55
55
|
params: typeSchemas.queryParams?.name
|
|
56
56
|
? {
|
|
57
|
-
type: `
|
|
57
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
58
58
|
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
59
59
|
}
|
|
60
60
|
: undefined,
|
|
61
61
|
headers: typeSchemas.headerParams?.name
|
|
62
62
|
? {
|
|
63
|
-
type: `
|
|
63
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
64
64
|
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
65
65
|
}
|
|
66
66
|
: undefined,
|
|
@@ -85,26 +85,26 @@ function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: Ge
|
|
|
85
85
|
override(item) {
|
|
86
86
|
return {
|
|
87
87
|
...item,
|
|
88
|
-
type: `
|
|
88
|
+
type: `MaybeRefOrGetter<${item.type}>`,
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
}),
|
|
92
92
|
},
|
|
93
93
|
data: typeSchemas.request?.name
|
|
94
94
|
? {
|
|
95
|
-
type: `
|
|
95
|
+
type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,
|
|
96
96
|
optional: isOptional(typeSchemas.request?.schema),
|
|
97
97
|
}
|
|
98
98
|
: undefined,
|
|
99
99
|
params: typeSchemas.queryParams?.name
|
|
100
100
|
? {
|
|
101
|
-
type: `
|
|
101
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
102
102
|
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
103
103
|
}
|
|
104
104
|
: undefined,
|
|
105
105
|
headers: typeSchemas.headerParams?.name
|
|
106
106
|
? {
|
|
107
|
-
type: `
|
|
107
|
+
type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,
|
|
108
108
|
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
109
109
|
}
|
|
110
110
|
: undefined,
|
|
@@ -43,25 +43,25 @@ function getParams({ paramsCasing, dataReturnType, typeSchemas }: GetParamsProps
|
|
|
43
43
|
override(item) {
|
|
44
44
|
return {
|
|
45
45
|
...item,
|
|
46
|
-
type: `
|
|
46
|
+
type: `MaybeRefOrGetter<${item.type}>`,
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
}),
|
|
50
50
|
data: typeSchemas.request?.name
|
|
51
51
|
? {
|
|
52
|
-
type: `
|
|
52
|
+
type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,
|
|
53
53
|
optional: isOptional(typeSchemas.request?.schema),
|
|
54
54
|
}
|
|
55
55
|
: undefined,
|
|
56
56
|
params: typeSchemas.queryParams?.name
|
|
57
57
|
? {
|
|
58
|
-
type: `
|
|
58
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
59
59
|
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
60
60
|
}
|
|
61
61
|
: undefined,
|
|
62
62
|
headers: typeSchemas.headerParams?.name
|
|
63
63
|
? {
|
|
64
|
-
type: `
|
|
64
|
+
type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,
|
|
65
65
|
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
66
66
|
}
|
|
67
67
|
: undefined,
|
package/src/components/Query.tsx
CHANGED
|
@@ -46,25 +46,25 @@ function getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, t
|
|
|
46
46
|
override(item) {
|
|
47
47
|
return {
|
|
48
48
|
...item,
|
|
49
|
-
type: `
|
|
49
|
+
type: `MaybeRefOrGetter<${item.type}>`,
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
}),
|
|
53
53
|
data: typeSchemas.request?.name
|
|
54
54
|
? {
|
|
55
|
-
type: `
|
|
55
|
+
type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,
|
|
56
56
|
optional: isOptional(typeSchemas.request?.schema),
|
|
57
57
|
}
|
|
58
58
|
: undefined,
|
|
59
59
|
params: typeSchemas.queryParams?.name
|
|
60
60
|
? {
|
|
61
|
-
type: `
|
|
61
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
62
62
|
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
63
63
|
}
|
|
64
64
|
: undefined,
|
|
65
65
|
headers: typeSchemas.headerParams?.name
|
|
66
66
|
? {
|
|
67
|
-
type: `
|
|
67
|
+
type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,
|
|
68
68
|
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
69
69
|
}
|
|
70
70
|
: undefined,
|
|
@@ -92,26 +92,26 @@ function getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, t
|
|
|
92
92
|
override(item) {
|
|
93
93
|
return {
|
|
94
94
|
...item,
|
|
95
|
-
type: `
|
|
95
|
+
type: `MaybeRefOrGetter<${item.type}>`,
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
}),
|
|
99
99
|
},
|
|
100
100
|
data: typeSchemas.request?.name
|
|
101
101
|
? {
|
|
102
|
-
type: `
|
|
102
|
+
type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,
|
|
103
103
|
optional: isOptional(typeSchemas.request?.schema),
|
|
104
104
|
}
|
|
105
105
|
: undefined,
|
|
106
106
|
params: typeSchemas.queryParams?.name
|
|
107
107
|
? {
|
|
108
|
-
type: `
|
|
108
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
109
109
|
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
110
110
|
}
|
|
111
111
|
: undefined,
|
|
112
112
|
headers: typeSchemas.headerParams?.name
|
|
113
113
|
? {
|
|
114
|
-
type: `
|
|
114
|
+
type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,
|
|
115
115
|
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
116
116
|
}
|
|
117
117
|
: undefined,
|
|
@@ -163,7 +163,7 @@ export function Query({
|
|
|
163
163
|
typeSchemas,
|
|
164
164
|
})
|
|
165
165
|
|
|
166
|
-
const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})
|
|
166
|
+
const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})`
|
|
167
167
|
|
|
168
168
|
return (
|
|
169
169
|
<File.Source name={name} isExportable isIndexable>
|
|
@@ -182,9 +182,9 @@ export function Query({
|
|
|
182
182
|
|
|
183
183
|
const query = useQuery({
|
|
184
184
|
...${queryOptions},
|
|
185
|
-
queryKey
|
|
186
|
-
...queryOptions
|
|
187
|
-
}, queryClient) as ${returnType}
|
|
185
|
+
queryKey,
|
|
186
|
+
...queryOptions
|
|
187
|
+
} as unknown as QueryObserverOptions, queryClient) as ${returnType}
|
|
188
188
|
|
|
189
189
|
query.queryKey = queryKey as TQueryKey
|
|
190
190
|
|
|
@@ -33,20 +33,20 @@ function getParams({ pathParamsType, paramsCasing, typeSchemas }: GetParamsProps
|
|
|
33
33
|
override(item) {
|
|
34
34
|
return {
|
|
35
35
|
...item,
|
|
36
|
-
type: `
|
|
36
|
+
type: `MaybeRefOrGetter<${item.type}>`,
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
}),
|
|
40
40
|
},
|
|
41
41
|
data: typeSchemas.request?.name
|
|
42
42
|
? {
|
|
43
|
-
type: `
|
|
43
|
+
type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,
|
|
44
44
|
optional: isOptional(typeSchemas.request?.schema),
|
|
45
45
|
}
|
|
46
46
|
: undefined,
|
|
47
47
|
params: typeSchemas.queryParams?.name
|
|
48
48
|
? {
|
|
49
|
-
type: `
|
|
49
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
50
50
|
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
51
51
|
}
|
|
52
52
|
: undefined,
|
|
@@ -39,25 +39,25 @@ function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: Ge
|
|
|
39
39
|
override(item) {
|
|
40
40
|
return {
|
|
41
41
|
...item,
|
|
42
|
-
type: `
|
|
42
|
+
type: `MaybeRefOrGetter<${item.type}>`,
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
}),
|
|
46
46
|
data: typeSchemas.request?.name
|
|
47
47
|
? {
|
|
48
|
-
type: `
|
|
48
|
+
type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,
|
|
49
49
|
optional: isOptional(typeSchemas.request?.schema),
|
|
50
50
|
}
|
|
51
51
|
: undefined,
|
|
52
52
|
params: typeSchemas.queryParams?.name
|
|
53
53
|
? {
|
|
54
|
-
type: `
|
|
54
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
55
55
|
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
56
56
|
}
|
|
57
57
|
: undefined,
|
|
58
58
|
headers: typeSchemas.headerParams?.name
|
|
59
59
|
? {
|
|
60
|
-
type: `
|
|
60
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
61
61
|
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
62
62
|
}
|
|
63
63
|
: undefined,
|
|
@@ -82,26 +82,26 @@ function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: Ge
|
|
|
82
82
|
override(item) {
|
|
83
83
|
return {
|
|
84
84
|
...item,
|
|
85
|
-
type: `
|
|
85
|
+
type: `MaybeRefOrGetter<${item.type}>`,
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
}),
|
|
89
89
|
},
|
|
90
90
|
data: typeSchemas.request?.name
|
|
91
91
|
? {
|
|
92
|
-
type: `
|
|
92
|
+
type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,
|
|
93
93
|
optional: isOptional(typeSchemas.request?.schema),
|
|
94
94
|
}
|
|
95
95
|
: undefined,
|
|
96
96
|
params: typeSchemas.queryParams?.name
|
|
97
97
|
? {
|
|
98
|
-
type: `
|
|
98
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
99
99
|
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
100
100
|
}
|
|
101
101
|
: undefined,
|
|
102
102
|
headers: typeSchemas.headerParams?.name
|
|
103
103
|
? {
|
|
104
|
-
type: `
|
|
104
|
+
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
105
105
|
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
106
106
|
}
|
|
107
107
|
: undefined,
|
|
@@ -151,7 +151,7 @@ export function QueryOptions({ name, clientName, dataReturnType, typeSchemas, pa
|
|
|
151
151
|
config.signal = signal
|
|
152
152
|
return ${clientName}(${clientParams.toCall({
|
|
153
153
|
transformName(name) {
|
|
154
|
-
return `
|
|
154
|
+
return `toValue(${name})`
|
|
155
155
|
},
|
|
156
156
|
})})
|
|
157
157
|
},
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
import fetch from '@kubb/plugin-client/clients/axios'
|
|
6
6
|
import type { RequestConfig, ResponseErrorConfig, ResponseConfig } from '@kubb/plugin-client/clients/axios'
|
|
7
7
|
import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
8
|
-
import type {
|
|
8
|
+
import type { MaybeRefOrGetter } from 'vue'
|
|
9
9
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
10
|
-
import {
|
|
10
|
+
import { toValue } from 'vue'
|
|
11
11
|
|
|
12
|
-
export const findPetsByTagsQueryKey = (params?:
|
|
12
|
+
export const findPetsByTagsQueryKey = (params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>) =>
|
|
13
|
+
[{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
|
|
13
14
|
|
|
14
15
|
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
15
16
|
|
|
@@ -36,8 +37,8 @@ export async function findPetsByTags(
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
export function findPetsByTagsQueryOptions(
|
|
39
|
-
headers:
|
|
40
|
-
params?:
|
|
40
|
+
headers: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
41
|
+
params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
41
42
|
config: Partial<RequestConfig> & { client?: typeof fetch } = {},
|
|
42
43
|
) {
|
|
43
44
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
@@ -50,7 +51,7 @@ export function findPetsByTagsQueryOptions(
|
|
|
50
51
|
queryKey,
|
|
51
52
|
queryFn: async ({ signal }) => {
|
|
52
53
|
config.signal = signal
|
|
53
|
-
return findPetsByTags(
|
|
54
|
+
return findPetsByTags(toValue(headers), toValue(params), toValue(config))
|
|
54
55
|
},
|
|
55
56
|
})
|
|
56
57
|
}
|
|
@@ -65,8 +66,8 @@ export function useFindPetsByTags<
|
|
|
65
66
|
TQueryData = ResponseConfig<FindPetsByTagsQueryResponse>,
|
|
66
67
|
TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
|
|
67
68
|
>(
|
|
68
|
-
headers:
|
|
69
|
-
params?:
|
|
69
|
+
headers: MaybeRefOrGetter<FindPetsByTagsHeaderParams>,
|
|
70
|
+
params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
70
71
|
options: {
|
|
71
72
|
query?: Partial<QueryObserverOptions<ResponseConfig<FindPetsByTagsQueryResponse>, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
|
|
72
73
|
client?: QueryClient
|
|
@@ -79,10 +80,10 @@ export function useFindPetsByTags<
|
|
|
79
80
|
|
|
80
81
|
const query = useQuery(
|
|
81
82
|
{
|
|
82
|
-
...
|
|
83
|
-
queryKey
|
|
84
|
-
...
|
|
85
|
-
},
|
|
83
|
+
...findPetsByTagsQueryOptions(headers, params, config),
|
|
84
|
+
queryKey,
|
|
85
|
+
...queryOptions,
|
|
86
|
+
} as unknown as QueryObserverOptions,
|
|
86
87
|
queryClient,
|
|
87
88
|
) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
88
89
|
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
import fetch from 'axios'
|
|
6
6
|
import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
7
7
|
import type { RequestConfig, ResponseErrorConfig } from 'axios'
|
|
8
|
-
import type {
|
|
8
|
+
import type { MaybeRefOrGetter } from 'vue'
|
|
9
9
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
10
|
-
import {
|
|
10
|
+
import { toValue } from 'vue'
|
|
11
11
|
|
|
12
|
-
export const findPetsByTagsQueryKey = (params?:
|
|
12
|
+
export const findPetsByTagsQueryKey = (params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>) =>
|
|
13
|
+
[{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
|
|
13
14
|
|
|
14
15
|
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
15
16
|
|
|
@@ -36,8 +37,8 @@ export async function findPetsByTags(
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
export function findPetsByTagsQueryOptions(
|
|
39
|
-
headers:
|
|
40
|
-
params?:
|
|
40
|
+
headers: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
41
|
+
params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
41
42
|
config: Partial<RequestConfig> & { client?: typeof fetch } = {},
|
|
42
43
|
) {
|
|
43
44
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
@@ -45,7 +46,7 @@ export function findPetsByTagsQueryOptions(
|
|
|
45
46
|
queryKey,
|
|
46
47
|
queryFn: async ({ signal }) => {
|
|
47
48
|
config.signal = signal
|
|
48
|
-
return findPetsByTags(
|
|
49
|
+
return findPetsByTags(toValue(headers), toValue(params), toValue(config))
|
|
49
50
|
},
|
|
50
51
|
})
|
|
51
52
|
}
|
|
@@ -60,8 +61,8 @@ export function useFindPetsByTags<
|
|
|
60
61
|
TQueryData = FindPetsByTagsQueryResponse,
|
|
61
62
|
TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
|
|
62
63
|
>(
|
|
63
|
-
headers:
|
|
64
|
-
params?:
|
|
64
|
+
headers: MaybeRefOrGetter<FindPetsByTagsHeaderParams>,
|
|
65
|
+
params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
65
66
|
options: {
|
|
66
67
|
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
|
|
67
68
|
client?: QueryClient
|
|
@@ -74,10 +75,10 @@ export function useFindPetsByTags<
|
|
|
74
75
|
|
|
75
76
|
const query = useQuery(
|
|
76
77
|
{
|
|
77
|
-
...
|
|
78
|
-
queryKey
|
|
79
|
-
...
|
|
80
|
-
},
|
|
78
|
+
...findPetsByTagsQueryOptions(headers, params, config),
|
|
79
|
+
queryKey,
|
|
80
|
+
...queryOptions,
|
|
81
|
+
} as unknown as QueryObserverOptions,
|
|
81
82
|
queryClient,
|
|
82
83
|
) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
83
84
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import fetch from 'axios'
|
|
6
6
|
import type { MutationObserverOptions, QueryClient } from '@tanstack/vue-query'
|
|
7
7
|
import type { RequestConfig, ResponseErrorConfig } from 'axios'
|
|
8
|
-
import type {
|
|
8
|
+
import type { MaybeRefOrGetter } from 'vue'
|
|
9
9
|
import { useMutation } from '@tanstack/vue-query'
|
|
10
10
|
|
|
11
11
|
export const updatePetWithFormMutationKey = () => [{ url: '/pet/{petId}' }] as const
|
|
@@ -45,9 +45,9 @@ export function useUpdatePetWithForm<TContext>(
|
|
|
45
45
|
UpdatePetWithFormMutationResponse,
|
|
46
46
|
ResponseErrorConfig<UpdatePetWithForm405>,
|
|
47
47
|
{
|
|
48
|
-
petId:
|
|
49
|
-
data?:
|
|
50
|
-
params?:
|
|
48
|
+
petId: MaybeRefOrGetter<UpdatePetWithFormPathParams['petId']>
|
|
49
|
+
data?: MaybeRefOrGetter<UpdatePetWithFormMutationRequest>
|
|
50
|
+
params?: MaybeRefOrGetter<UpdatePetWithFormQueryParams>
|
|
51
51
|
},
|
|
52
52
|
TContext
|
|
53
53
|
> & { client?: QueryClient }
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
import fetch from '@kubb/plugin-client/clients/axios'
|
|
6
6
|
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
7
7
|
import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
8
|
-
import type {
|
|
8
|
+
import type { MaybeRefOrGetter } from 'vue'
|
|
9
9
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
10
|
-
import {
|
|
10
|
+
import { toValue } from 'vue'
|
|
11
11
|
|
|
12
|
-
export const findPetsByTagsQueryKey = (params?:
|
|
12
|
+
export const findPetsByTagsQueryKey = (params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>) =>
|
|
13
|
+
[{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
|
|
13
14
|
|
|
14
15
|
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
15
16
|
|
|
@@ -36,8 +37,8 @@ export async function findPetsByTags(
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
export function findPetsByTagsQueryOptions(
|
|
39
|
-
headers:
|
|
40
|
-
params?:
|
|
40
|
+
headers: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
41
|
+
params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
41
42
|
config: Partial<RequestConfig> & { client?: typeof fetch } = {},
|
|
42
43
|
) {
|
|
43
44
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
@@ -45,7 +46,7 @@ export function findPetsByTagsQueryOptions(
|
|
|
45
46
|
queryKey,
|
|
46
47
|
queryFn: async ({ signal }) => {
|
|
47
48
|
config.signal = signal
|
|
48
|
-
return findPetsByTags(
|
|
49
|
+
return findPetsByTags(toValue(headers), toValue(params), toValue(config))
|
|
49
50
|
},
|
|
50
51
|
})
|
|
51
52
|
}
|
|
@@ -60,8 +61,8 @@ export function useFindPetsByTags<
|
|
|
60
61
|
TQueryData = FindPetsByTagsQueryResponse,
|
|
61
62
|
TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
|
|
62
63
|
>(
|
|
63
|
-
headers:
|
|
64
|
-
params?:
|
|
64
|
+
headers: MaybeRefOrGetter<FindPetsByTagsHeaderParams>,
|
|
65
|
+
params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
65
66
|
options: {
|
|
66
67
|
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
|
|
67
68
|
client?: QueryClient
|
|
@@ -74,10 +75,10 @@ export function useFindPetsByTags<
|
|
|
74
75
|
|
|
75
76
|
const query = useQuery(
|
|
76
77
|
{
|
|
77
|
-
...
|
|
78
|
-
queryKey
|
|
79
|
-
...
|
|
80
|
-
},
|
|
78
|
+
...findPetsByTagsQueryOptions(headers, params, config),
|
|
79
|
+
queryKey,
|
|
80
|
+
...queryOptions,
|
|
81
|
+
} as unknown as QueryObserverOptions,
|
|
81
82
|
queryClient,
|
|
82
83
|
) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
83
84
|
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
import fetch from '@kubb/plugin-client/clients/axios'
|
|
6
6
|
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
7
7
|
import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
8
|
-
import type {
|
|
8
|
+
import type { MaybeRefOrGetter } from 'vue'
|
|
9
9
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
10
|
-
import {
|
|
10
|
+
import { toValue } from 'vue'
|
|
11
11
|
|
|
12
|
-
export const findPetsByTagsQueryKey = (params?:
|
|
12
|
+
export const findPetsByTagsQueryKey = (params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>) =>
|
|
13
|
+
[{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
|
|
13
14
|
|
|
14
15
|
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
15
16
|
|
|
@@ -35,7 +36,7 @@ export async function findPetsByTags(
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
export function findPetsByTagsQueryOptions(
|
|
38
|
-
{ headers, params }: { headers:
|
|
39
|
+
{ headers, params }: { headers: MaybeRefOrGetter<FindPetsByTagsQueryParams>; params?: MaybeRefOrGetter<FindPetsByTagsQueryParams> },
|
|
39
40
|
config: Partial<RequestConfig> & { client?: typeof fetch } = {},
|
|
40
41
|
) {
|
|
41
42
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
@@ -43,7 +44,7 @@ export function findPetsByTagsQueryOptions(
|
|
|
43
44
|
queryKey,
|
|
44
45
|
queryFn: async ({ signal }) => {
|
|
45
46
|
config.signal = signal
|
|
46
|
-
return findPetsByTags(
|
|
47
|
+
return findPetsByTags(toValue({ headers: toValue(headers), params: toValue(params) }), toValue(config))
|
|
47
48
|
},
|
|
48
49
|
})
|
|
49
50
|
}
|
|
@@ -58,7 +59,7 @@ export function useFindPetsByTags<
|
|
|
58
59
|
TQueryData = FindPetsByTagsQueryResponse,
|
|
59
60
|
TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
|
|
60
61
|
>(
|
|
61
|
-
{ headers, params }: { headers:
|
|
62
|
+
{ headers, params }: { headers: MaybeRefOrGetter<FindPetsByTagsHeaderParams>; params?: MaybeRefOrGetter<FindPetsByTagsQueryParams> },
|
|
62
63
|
options: {
|
|
63
64
|
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
|
|
64
65
|
client?: QueryClient
|
|
@@ -71,10 +72,10 @@ export function useFindPetsByTags<
|
|
|
71
72
|
|
|
72
73
|
const query = useQuery(
|
|
73
74
|
{
|
|
74
|
-
...
|
|
75
|
-
queryKey
|
|
76
|
-
...
|
|
77
|
-
},
|
|
75
|
+
...findPetsByTagsQueryOptions({ headers, params }, config),
|
|
76
|
+
queryKey,
|
|
77
|
+
...queryOptions,
|
|
78
|
+
} as unknown as QueryObserverOptions,
|
|
78
79
|
queryClient,
|
|
79
80
|
) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
80
81
|
|