@kubb/plugin-vue-query 3.15.0 → 3.16.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-HMPC446F.js → chunk-5RO5VZAJ.js} +8 -8
- package/dist/chunk-5RO5VZAJ.js.map +1 -0
- package/dist/{chunk-QRXBIFH6.cjs → chunk-BBSHBY5N.cjs} +16 -16
- package/dist/chunk-BBSHBY5N.cjs.map +1 -0
- package/dist/{chunk-QKMSX5DE.js → chunk-KHEXOVSW.js} +42 -42
- package/dist/chunk-KHEXOVSW.js.map +1 -0
- package/dist/{chunk-GK7FG2U6.cjs → chunk-ZR7DRLPY.cjs} +42 -42
- 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 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/components/InfiniteQuery.tsx +8 -8
- package/src/components/InfiniteQueryOptions.tsx +8 -8
- package/src/components/Mutation.tsx +4 -4
- package/src/components/Query.tsx +8 -8
- package/src/components/QueryKey.tsx +3 -3
- package/src/components/QueryOptions.tsx +9 -9
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +9 -8
- package/src/generators/__snapshots__/clientGetImportPath.ts +9 -8
- package/src/generators/__snapshots__/clientPostImportPath.ts +4 -4
- package/src/generators/__snapshots__/findByTags.ts +9 -8
- package/src/generators/__snapshots__/findByTagsObject.ts +7 -6
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +9 -8
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +8 -8
- package/src/generators/__snapshots__/findByTagsWithZod.ts +9 -8
- package/src/generators/__snapshots__/findInfiniteByTags.ts +6 -6
- package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +6 -6
- package/src/generators/__snapshots__/postAsQuery.ts +12 -12
- 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/src/plugin.ts +0 -1
- package/dist/chunk-GK7FG2U6.cjs.map +0 -1
- package/dist/chunk-HMPC446F.js.map +0 -1
- package/dist/chunk-QKMSX5DE.js.map +0 -1
- package/dist/chunk-QRXBIFH6.cjs.map +0 -1
|
@@ -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
|
|
@@ -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
|
|
@@ -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
|
|
@@ -5,11 +5,11 @@
|
|
|
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
13
|
['test', { url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
|
|
14
14
|
|
|
15
15
|
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
@@ -37,8 +37,8 @@ export async function findPetsByTags(
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export function findPetsByTagsQueryOptions(
|
|
40
|
-
headers:
|
|
41
|
-
params?:
|
|
40
|
+
headers: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
41
|
+
params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
42
42
|
config: Partial<RequestConfig> & { client?: typeof fetch } = {},
|
|
43
43
|
) {
|
|
44
44
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
@@ -46,7 +46,7 @@ export function findPetsByTagsQueryOptions(
|
|
|
46
46
|
queryKey,
|
|
47
47
|
queryFn: async ({ signal }) => {
|
|
48
48
|
config.signal = signal
|
|
49
|
-
return findPetsByTags(
|
|
49
|
+
return findPetsByTags(toValue(headers), toValue(params), toValue(config))
|
|
50
50
|
},
|
|
51
51
|
})
|
|
52
52
|
}
|
|
@@ -61,8 +61,8 @@ export function useFindPetsByTags<
|
|
|
61
61
|
TQueryData = FindPetsByTagsQueryResponse,
|
|
62
62
|
TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
|
|
63
63
|
>(
|
|
64
|
-
headers:
|
|
65
|
-
params?:
|
|
64
|
+
headers: MaybeRefOrGetter<FindPetsByTagsHeaderParams>,
|
|
65
|
+
params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
66
66
|
options: {
|
|
67
67
|
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
|
|
68
68
|
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
|
|
@@ -5,10 +5,10 @@
|
|
|
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 { InfiniteData, QueryKey, QueryClient, InfiniteQueryObserverOptions, UseInfiniteQueryReturnType } from '@tanstack/react-query'
|
|
8
|
-
import type {
|
|
8
|
+
import type { MaybeRefOrGetter } from 'vue'
|
|
9
9
|
import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query'
|
|
10
10
|
|
|
11
|
-
export const findPetsByTagsInfiniteQueryKey = (params?:
|
|
11
|
+
export const findPetsByTagsInfiniteQueryKey = (params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>) =>
|
|
12
12
|
[{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
|
|
13
13
|
|
|
14
14
|
export type FindPetsByTagsInfiniteQueryKey = ReturnType<typeof findPetsByTagsInfiniteQueryKey>
|
|
@@ -36,8 +36,8 @@ export async function findPetsByTagsInfinite(
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export function findPetsByTagsInfiniteQueryOptions(
|
|
39
|
-
headers:
|
|
40
|
-
params?:
|
|
39
|
+
headers: MaybeRefOrGetter<FindPetsByTagsHeaderParams>,
|
|
40
|
+
params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
41
41
|
config: Partial<RequestConfig> & { client?: typeof fetch } = {},
|
|
42
42
|
) {
|
|
43
43
|
const queryKey = findPetsByTagsInfiniteQueryKey(params)
|
|
@@ -67,8 +67,8 @@ export function useFindPetsByTagsInfinite<
|
|
|
67
67
|
TQueryData = FindPetsByTagsQueryResponse,
|
|
68
68
|
TQueryKey extends QueryKey = FindPetsByTagsInfiniteQueryKey,
|
|
69
69
|
>(
|
|
70
|
-
headers:
|
|
71
|
-
params?:
|
|
70
|
+
headers: MaybeRefOrGetter<FindPetsByTagsHeaderParams>,
|
|
71
|
+
params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
72
72
|
options: {
|
|
73
73
|
query?: Partial<InfiniteQueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryKey>> & {
|
|
74
74
|
client?: QueryClient
|
|
@@ -5,10 +5,10 @@
|
|
|
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 { InfiniteData, QueryKey, QueryClient, InfiniteQueryObserverOptions, UseInfiniteQueryReturnType } from '@tanstack/react-query'
|
|
8
|
-
import type {
|
|
8
|
+
import type { MaybeRefOrGetter } from 'vue'
|
|
9
9
|
import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query'
|
|
10
10
|
|
|
11
|
-
export const findPetsByTagsInfiniteQueryKey = (params?:
|
|
11
|
+
export const findPetsByTagsInfiniteQueryKey = (params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>) =>
|
|
12
12
|
[{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
|
|
13
13
|
|
|
14
14
|
export type FindPetsByTagsInfiniteQueryKey = ReturnType<typeof findPetsByTagsInfiniteQueryKey>
|
|
@@ -36,8 +36,8 @@ export async function findPetsByTagsInfinite(
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export function findPetsByTagsInfiniteQueryOptions(
|
|
39
|
-
headers:
|
|
40
|
-
params?:
|
|
39
|
+
headers: MaybeRefOrGetter<FindPetsByTagsHeaderParams>,
|
|
40
|
+
params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
41
41
|
config: Partial<RequestConfig> & { client?: typeof fetch } = {},
|
|
42
42
|
) {
|
|
43
43
|
const queryKey = findPetsByTagsInfiniteQueryKey(params)
|
|
@@ -67,8 +67,8 @@ export function useFindPetsByTagsInfinite<
|
|
|
67
67
|
TQueryData = FindPetsByTagsQueryResponse,
|
|
68
68
|
TQueryKey extends QueryKey = FindPetsByTagsInfiniteQueryKey,
|
|
69
69
|
>(
|
|
70
|
-
headers:
|
|
71
|
-
params?:
|
|
70
|
+
headers: MaybeRefOrGetter<FindPetsByTagsHeaderParams>,
|
|
71
|
+
params?: MaybeRefOrGetter<FindPetsByTagsQueryParams>,
|
|
72
72
|
options: {
|
|
73
73
|
query?: Partial<InfiniteQueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryKey>> & {
|
|
74
74
|
client?: QueryClient
|
|
@@ -5,14 +5,14 @@
|
|
|
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 'custom-query'
|
|
8
|
-
import type {
|
|
8
|
+
import type { MaybeRefOrGetter } from 'vue'
|
|
9
9
|
import { queryOptions, useQuery } from 'custom-query'
|
|
10
|
-
import {
|
|
10
|
+
import { toValue } from 'vue'
|
|
11
11
|
|
|
12
12
|
export const updatePetWithFormQueryKey = (
|
|
13
|
-
petId:
|
|
14
|
-
data?:
|
|
15
|
-
params?:
|
|
13
|
+
petId: MaybeRefOrGetter<UpdatePetWithFormPathParams['petId']>,
|
|
14
|
+
data?: MaybeRefOrGetter<UpdatePetWithFormMutationRequest>,
|
|
15
|
+
params?: MaybeRefOrGetter<UpdatePetWithFormQueryParams>,
|
|
16
16
|
) => [{ url: '/pet/:petId', params: { petId: petId } }, ...(params ? [params] : []), ...(data ? [data] : [])] as const
|
|
17
17
|
|
|
18
18
|
export type UpdatePetWithFormQueryKey = ReturnType<typeof updatePetWithFormQueryKey>
|
|
@@ -41,9 +41,9 @@ export async function updatePetWithForm(
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export function updatePetWithFormQueryOptions(
|
|
44
|
-
petId:
|
|
45
|
-
data?:
|
|
46
|
-
params?:
|
|
44
|
+
petId: MaybeRefOrGetter<UpdatePetWithFormPathParams['petId']>,
|
|
45
|
+
data?: MaybeRefOrGetter<UpdatePetWithFormMutationRequest>,
|
|
46
|
+
params?: MaybeRefOrGetter<UpdatePetWithFormQueryParams>,
|
|
47
47
|
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof fetch } = {},
|
|
48
48
|
) {
|
|
49
49
|
const queryKey = updatePetWithFormQueryKey(petId, data, params)
|
|
@@ -52,7 +52,7 @@ export function updatePetWithFormQueryOptions(
|
|
|
52
52
|
queryKey,
|
|
53
53
|
queryFn: async ({ signal }) => {
|
|
54
54
|
config.signal = signal
|
|
55
|
-
return updatePetWithForm(
|
|
55
|
+
return updatePetWithForm(toValue(petId), toValue(data), toValue(params), toValue(config))
|
|
56
56
|
},
|
|
57
57
|
})
|
|
58
58
|
}
|
|
@@ -66,9 +66,9 @@ export function useUpdatePetWithForm<
|
|
|
66
66
|
TQueryData = UpdatePetWithFormMutationResponse,
|
|
67
67
|
TQueryKey extends QueryKey = UpdatePetWithFormQueryKey,
|
|
68
68
|
>(
|
|
69
|
-
petId:
|
|
70
|
-
data?:
|
|
71
|
-
params?:
|
|
69
|
+
petId: MaybeRefOrGetter<UpdatePetWithFormPathParams['petId']>,
|
|
70
|
+
data?: MaybeRefOrGetter<UpdatePetWithFormMutationRequest>,
|
|
71
|
+
params?: MaybeRefOrGetter<UpdatePetWithFormQueryParams>,
|
|
72
72
|
options: {
|
|
73
73
|
query?: Partial<QueryObserverOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, TData, TQueryData, TQueryKey>> & {
|
|
74
74
|
client?: QueryClient
|
|
@@ -5,7 +5,7 @@
|
|
|
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 { MutationObserverOptions, QueryClient } from '@tanstack/vue-query'
|
|
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,7 +5,7 @@
|
|
|
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 { MutationObserverOptions, QueryClient } from '@tanstack/vue-query'
|
|
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 }
|
|
@@ -84,8 +84,8 @@ export const infiniteQueryGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
84
84
|
{options.parser === 'zod' && (
|
|
85
85
|
<File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />
|
|
86
86
|
)}
|
|
87
|
-
<File.Import name={['
|
|
88
|
-
<File.Import name={['
|
|
87
|
+
<File.Import name={['toValue']} path="vue" />
|
|
88
|
+
<File.Import name={['MaybeRefOrGetter']} path="vue" isTypeOnly />
|
|
89
89
|
<File.Import name={'fetch'} path={options.client.importPath} />
|
|
90
90
|
{hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}
|
|
91
91
|
<File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
|
|
@@ -79,7 +79,7 @@ export const mutationGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
79
79
|
{options.parser === 'zod' && (
|
|
80
80
|
<File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={mutation.file.path} path={zod.file.path} />
|
|
81
81
|
)}
|
|
82
|
-
<File.Import name={['
|
|
82
|
+
<File.Import name={['MaybeRefOrGetter']} path="vue" isTypeOnly />
|
|
83
83
|
<File.Import name={'fetch'} path={options.client.importPath} />
|
|
84
84
|
{!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}
|
|
85
85
|
<File.Import name={['RequestConfig', 'ResponseConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
|
|
@@ -82,8 +82,8 @@ export const queryGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
82
82
|
{options.parser === 'zod' && (
|
|
83
83
|
<File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />
|
|
84
84
|
)}
|
|
85
|
-
<File.Import name={['
|
|
86
|
-
<File.Import name={['
|
|
85
|
+
<File.Import name={['toValue']} path="vue" />
|
|
86
|
+
<File.Import name={['MaybeRefOrGetter']} path="vue" isTypeOnly />
|
|
87
87
|
<File.Import name={'fetch'} path={options.client.importPath} />
|
|
88
88
|
{!!hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}
|
|
89
89
|
<File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
|