@kubb/plugin-react-query 3.5.4 → 3.5.6
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-3UCN4GIP.js → chunk-CO3KLAV4.js} +25 -8
- package/dist/chunk-CO3KLAV4.js.map +1 -0
- package/dist/{chunk-D3JAKOKY.js → chunk-LVGRZJKZ.js} +25 -20
- package/dist/chunk-LVGRZJKZ.js.map +1 -0
- package/dist/{chunk-7E2B7BQC.cjs → chunk-ODTL4QSL.cjs} +25 -20
- package/dist/chunk-ODTL4QSL.cjs.map +1 -0
- package/dist/{chunk-VKOQV7WK.cjs → chunk-ZVI74AOG.cjs} +43 -26
- package/dist/chunk-ZVI74AOG.cjs.map +1 -0
- package/dist/components.cjs +9 -9
- package/dist/components.js +1 -1
- package/dist/generators.cjs +6 -6
- package/dist/generators.js +2 -2
- package/dist/index.cjs +5 -5
- package/dist/index.js +2 -2
- package/package.json +11 -11
- package/src/components/InfiniteQuery.tsx +2 -2
- package/src/components/InfiniteQueryOptions.tsx +6 -2
- package/src/components/Mutation.tsx +1 -1
- package/src/components/Query.tsx +2 -2
- package/src/components/QueryOptions.tsx +6 -2
- package/src/components/SuspenseQuery.tsx +2 -2
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +16 -6
- package/src/generators/__snapshots__/clientGetImportPath.ts +16 -6
- package/src/generators/__snapshots__/clientPostImportPath.ts +6 -4
- package/src/generators/__snapshots__/findByTags.ts +16 -6
- package/src/generators/__snapshots__/findByTagsObject.ts +8 -6
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +16 -6
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +16 -6
- package/src/generators/__snapshots__/findByTagsWithZod.ts +16 -6
- package/src/generators/__snapshots__/findInfiniteByTags.ts +12 -6
- package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +12 -6
- package/src/generators/__snapshots__/getPetIdCamelCase.ts +7 -5
- package/src/generators/__snapshots__/postAsQuery.ts +7 -5
- package/src/generators/__snapshots__/updatePetById.ts +6 -4
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +6 -4
- package/src/generators/infiniteQueryGenerator.tsx +1 -1
- package/src/generators/mutationGenerator.tsx +1 -1
- package/src/generators/queryGenerator.tsx +17 -2
- package/src/generators/suspenseQueryGenerator.tsx +1 -1
- package/dist/chunk-3UCN4GIP.js.map +0 -1
- package/dist/chunk-7E2B7BQC.cjs.map +0 -1
- package/dist/chunk-D3JAKOKY.js.map +0 -1
- package/dist/chunk-VKOQV7WK.cjs.map +0 -1
|
@@ -64,7 +64,7 @@ function getParams({ paramsCasing, dataReturnType, typeSchemas }: GetParamsProps
|
|
|
64
64
|
type: `
|
|
65
65
|
{
|
|
66
66
|
mutation?: UseMutationOptions<${generics}>,
|
|
67
|
-
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}
|
|
67
|
+
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'},
|
|
68
68
|
}
|
|
69
69
|
`,
|
|
70
70
|
default: '{}',
|
package/src/components/Query.tsx
CHANGED
|
@@ -66,7 +66,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
66
66
|
type: `
|
|
67
67
|
{
|
|
68
68
|
query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
|
|
69
|
-
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}
|
|
69
|
+
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'}
|
|
70
70
|
}
|
|
71
71
|
`,
|
|
72
72
|
default: '{}',
|
|
@@ -104,7 +104,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
104
104
|
type: `
|
|
105
105
|
{
|
|
106
106
|
query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
|
|
107
|
-
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}
|
|
107
|
+
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'}
|
|
108
108
|
}
|
|
109
109
|
`,
|
|
110
110
|
default: '{}',
|
|
@@ -53,7 +53,9 @@ function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: Ge
|
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
55
|
config: {
|
|
56
|
-
type: typeSchemas.request?.name
|
|
56
|
+
type: typeSchemas.request?.name
|
|
57
|
+
? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }`
|
|
58
|
+
: 'Partial<RequestConfig> & { client?: typeof client }',
|
|
57
59
|
default: '{}',
|
|
58
60
|
},
|
|
59
61
|
})
|
|
@@ -86,7 +88,9 @@ function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: Ge
|
|
|
86
88
|
}
|
|
87
89
|
: undefined,
|
|
88
90
|
config: {
|
|
89
|
-
type: typeSchemas.request?.name
|
|
91
|
+
type: typeSchemas.request?.name
|
|
92
|
+
? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }`
|
|
93
|
+
: 'Partial<RequestConfig> & { client?: typeof client }',
|
|
90
94
|
default: '{}',
|
|
91
95
|
},
|
|
92
96
|
})
|
|
@@ -66,7 +66,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
66
66
|
type: `
|
|
67
67
|
{
|
|
68
68
|
query?: Partial<UseSuspenseQueryOptions<${[TData, TError, 'TData', 'TQueryKey'].join(', ')}>>,
|
|
69
|
-
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}
|
|
69
|
+
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'}
|
|
70
70
|
}
|
|
71
71
|
`,
|
|
72
72
|
default: '{}',
|
|
@@ -104,7 +104,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
104
104
|
type: `
|
|
105
105
|
{
|
|
106
106
|
query?: Partial<UseSuspenseQueryOptions<${[TData, TError, 'TData', 'TQueryKey'].join(', ')}>>,
|
|
107
|
-
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}
|
|
107
|
+
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'}
|
|
108
108
|
}
|
|
109
109
|
`,
|
|
110
110
|
default: '{}',
|
|
@@ -12,18 +12,28 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
|
-
export async function findPetsByTags(
|
|
16
|
-
|
|
15
|
+
export async function findPetsByTags(
|
|
16
|
+
headers: FindPetsByTagsHeaderParams,
|
|
17
|
+
params?: FindPetsByTagsQueryParams,
|
|
18
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
19
|
+
) {
|
|
20
|
+
const { client: request = client, ...requestConfig } = config
|
|
21
|
+
|
|
22
|
+
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
23
|
method: 'GET',
|
|
18
24
|
url: `/pet/findByTags`,
|
|
19
25
|
params,
|
|
20
|
-
headers: { ...headers, ...
|
|
21
|
-
...
|
|
26
|
+
headers: { ...headers, ...requestConfig.headers },
|
|
27
|
+
...requestConfig,
|
|
22
28
|
})
|
|
23
29
|
return { ...res, data: findPetsByTagsQueryResponse.parse(res.data) }
|
|
24
30
|
}
|
|
25
31
|
|
|
26
|
-
export function findPetsByTagsQueryOptions(
|
|
32
|
+
export function findPetsByTagsQueryOptions(
|
|
33
|
+
headers: FindPetsByTagsHeaderParams,
|
|
34
|
+
params?: FindPetsByTagsQueryParams,
|
|
35
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
36
|
+
) {
|
|
27
37
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
28
38
|
return queryOptions<
|
|
29
39
|
ResponseConfig<FindPetsByTagsQueryResponse>,
|
|
@@ -53,7 +63,7 @@ export function useFindPetsByTags<
|
|
|
53
63
|
params?: FindPetsByTagsQueryParams,
|
|
54
64
|
options: {
|
|
55
65
|
query?: Partial<QueryObserverOptions<ResponseConfig<FindPetsByTagsQueryResponse>, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
56
|
-
client?: Partial<RequestConfig>
|
|
66
|
+
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
57
67
|
} = {},
|
|
58
68
|
) {
|
|
59
69
|
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
@@ -12,18 +12,28 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
|
-
export async function findPetsByTags(
|
|
16
|
-
|
|
15
|
+
export async function findPetsByTags(
|
|
16
|
+
headers: FindPetsByTagsHeaderParams,
|
|
17
|
+
params?: FindPetsByTagsQueryParams,
|
|
18
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
19
|
+
) {
|
|
20
|
+
const { client: request = client, ...requestConfig } = config
|
|
21
|
+
|
|
22
|
+
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
23
|
method: 'GET',
|
|
18
24
|
url: `/pet/findByTags`,
|
|
19
25
|
params,
|
|
20
|
-
headers: { ...headers, ...
|
|
21
|
-
...
|
|
26
|
+
headers: { ...headers, ...requestConfig.headers },
|
|
27
|
+
...requestConfig,
|
|
22
28
|
})
|
|
23
29
|
return findPetsByTagsQueryResponse.parse(res.data)
|
|
24
30
|
}
|
|
25
31
|
|
|
26
|
-
export function findPetsByTagsQueryOptions(
|
|
32
|
+
export function findPetsByTagsQueryOptions(
|
|
33
|
+
headers: FindPetsByTagsHeaderParams,
|
|
34
|
+
params?: FindPetsByTagsQueryParams,
|
|
35
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
36
|
+
) {
|
|
27
37
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
28
38
|
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
29
39
|
queryKey,
|
|
@@ -48,7 +58,7 @@ export function useFindPetsByTags<
|
|
|
48
58
|
params?: FindPetsByTagsQueryParams,
|
|
49
59
|
options: {
|
|
50
60
|
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
51
|
-
client?: Partial<RequestConfig>
|
|
61
|
+
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
52
62
|
} = {},
|
|
53
63
|
) {
|
|
54
64
|
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
@@ -15,14 +15,16 @@ export async function updatePetWithForm(
|
|
|
15
15
|
petId: UpdatePetWithFormPathParams['petId'],
|
|
16
16
|
data?: UpdatePetWithFormMutationRequest,
|
|
17
17
|
params?: UpdatePetWithFormQueryParams,
|
|
18
|
-
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
|
|
18
|
+
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client } = {},
|
|
19
19
|
) {
|
|
20
|
-
const
|
|
20
|
+
const { client: request = client, ...requestConfig } = config
|
|
21
|
+
|
|
22
|
+
const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
|
|
21
23
|
method: 'POST',
|
|
22
24
|
url: `/pet/${pet_id}`,
|
|
23
25
|
params,
|
|
24
26
|
data,
|
|
25
|
-
...
|
|
27
|
+
...requestConfig,
|
|
26
28
|
})
|
|
27
29
|
return updatePetWithFormMutationResponse.parse(res.data)
|
|
28
30
|
}
|
|
@@ -38,7 +40,7 @@ export function useUpdatePetWithForm(
|
|
|
38
40
|
ResponseErrorConfig<UpdatePetWithForm405>,
|
|
39
41
|
{ petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
|
|
40
42
|
>
|
|
41
|
-
client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
|
|
43
|
+
client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client }
|
|
42
44
|
} = {},
|
|
43
45
|
) {
|
|
44
46
|
const { mutation: mutationOptions, client: config = {} } = options ?? {}
|
|
@@ -12,18 +12,28 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
|
-
export async function findPetsByTags(
|
|
16
|
-
|
|
15
|
+
export async function findPetsByTags(
|
|
16
|
+
headers: FindPetsByTagsHeaderParams,
|
|
17
|
+
params?: FindPetsByTagsQueryParams,
|
|
18
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
19
|
+
) {
|
|
20
|
+
const { client: request = client, ...requestConfig } = config
|
|
21
|
+
|
|
22
|
+
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
23
|
method: 'GET',
|
|
18
24
|
url: `/pet/findByTags`,
|
|
19
25
|
params,
|
|
20
|
-
headers: { ...headers, ...
|
|
21
|
-
...
|
|
26
|
+
headers: { ...headers, ...requestConfig.headers },
|
|
27
|
+
...requestConfig,
|
|
22
28
|
})
|
|
23
29
|
return findPetsByTagsQueryResponse.parse(res.data)
|
|
24
30
|
}
|
|
25
31
|
|
|
26
|
-
export function findPetsByTagsQueryOptions(
|
|
32
|
+
export function findPetsByTagsQueryOptions(
|
|
33
|
+
headers: FindPetsByTagsHeaderParams,
|
|
34
|
+
params?: FindPetsByTagsQueryParams,
|
|
35
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
36
|
+
) {
|
|
27
37
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
28
38
|
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
29
39
|
queryKey,
|
|
@@ -48,7 +58,7 @@ export function useFindPetsByTags<
|
|
|
48
58
|
params?: FindPetsByTagsQueryParams,
|
|
49
59
|
options: {
|
|
50
60
|
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
51
|
-
client?: Partial<RequestConfig>
|
|
61
|
+
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
52
62
|
} = {},
|
|
53
63
|
) {
|
|
54
64
|
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
@@ -14,21 +14,23 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
14
14
|
*/
|
|
15
15
|
export async function findPetsByTags(
|
|
16
16
|
{ headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
|
|
17
|
-
config: Partial<RequestConfig> = {},
|
|
17
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
18
18
|
) {
|
|
19
|
-
const
|
|
19
|
+
const { client: request = client, ...requestConfig } = config
|
|
20
|
+
|
|
21
|
+
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
20
22
|
method: 'GET',
|
|
21
23
|
url: `/pet/findByTags`,
|
|
22
24
|
params,
|
|
23
|
-
headers: { ...headers, ...
|
|
24
|
-
...
|
|
25
|
+
headers: { ...headers, ...requestConfig.headers },
|
|
26
|
+
...requestConfig,
|
|
25
27
|
})
|
|
26
28
|
return findPetsByTagsQueryResponse.parse(res.data)
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export function findPetsByTagsQueryOptions(
|
|
30
32
|
{ headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
|
|
31
|
-
config: Partial<RequestConfig> = {},
|
|
33
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
32
34
|
) {
|
|
33
35
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
34
36
|
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
@@ -53,7 +55,7 @@ export function useFindPetsByTags<
|
|
|
53
55
|
{ headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
|
|
54
56
|
options: {
|
|
55
57
|
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
56
|
-
client?: Partial<RequestConfig>
|
|
58
|
+
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
57
59
|
} = {},
|
|
58
60
|
) {
|
|
59
61
|
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
@@ -12,18 +12,28 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
|
-
export async function findPetsByTags(
|
|
16
|
-
|
|
15
|
+
export async function findPetsByTags(
|
|
16
|
+
headers: FindPetsByTagsHeaderParams,
|
|
17
|
+
params?: FindPetsByTagsQueryParams,
|
|
18
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
19
|
+
) {
|
|
20
|
+
const { client: request = client, ...requestConfig } = config
|
|
21
|
+
|
|
22
|
+
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
23
|
method: 'GET',
|
|
18
24
|
url: `/pet/findByTags`,
|
|
19
25
|
params,
|
|
20
|
-
headers: { ...headers, ...
|
|
21
|
-
...
|
|
26
|
+
headers: { ...headers, ...requestConfig.headers },
|
|
27
|
+
...requestConfig,
|
|
22
28
|
})
|
|
23
29
|
return findPetsByTagsQueryResponse.parse(res.data)
|
|
24
30
|
}
|
|
25
31
|
|
|
26
|
-
export function findPetsByTagsQueryOptions(
|
|
32
|
+
export function findPetsByTagsQueryOptions(
|
|
33
|
+
headers: FindPetsByTagsHeaderParams,
|
|
34
|
+
params?: FindPetsByTagsQueryParams,
|
|
35
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
36
|
+
) {
|
|
27
37
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
28
38
|
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
29
39
|
queryKey,
|
|
@@ -48,7 +58,7 @@ export function useFindPetsByTags<
|
|
|
48
58
|
params?: FindPetsByTagsQueryParams,
|
|
49
59
|
options: {
|
|
50
60
|
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
51
|
-
client?: Partial<RequestConfig>
|
|
61
|
+
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
52
62
|
} = {},
|
|
53
63
|
) {
|
|
54
64
|
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
@@ -12,18 +12,28 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
|
-
export async function findPetsByTags(
|
|
16
|
-
|
|
15
|
+
export async function findPetsByTags(
|
|
16
|
+
headers: FindPetsByTagsHeaderParams,
|
|
17
|
+
params?: FindPetsByTagsQueryParams,
|
|
18
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
19
|
+
) {
|
|
20
|
+
const { client: request = client, ...requestConfig } = config
|
|
21
|
+
|
|
22
|
+
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
23
|
method: 'GET',
|
|
18
24
|
url: `/pet/findByTags`,
|
|
19
25
|
params,
|
|
20
|
-
headers: { ...headers, ...
|
|
21
|
-
...
|
|
26
|
+
headers: { ...headers, ...requestConfig.headers },
|
|
27
|
+
...requestConfig,
|
|
22
28
|
})
|
|
23
29
|
return findPetsByTagsQueryResponse.parse(res.data)
|
|
24
30
|
}
|
|
25
31
|
|
|
26
|
-
export function findPetsByTagsQueryOptions(
|
|
32
|
+
export function findPetsByTagsQueryOptions(
|
|
33
|
+
headers: FindPetsByTagsHeaderParams,
|
|
34
|
+
params?: FindPetsByTagsQueryParams,
|
|
35
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
36
|
+
) {
|
|
27
37
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
28
38
|
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
29
39
|
queryKey,
|
|
@@ -48,7 +58,7 @@ export function useFindPetsByTags<
|
|
|
48
58
|
params?: FindPetsByTagsQueryParams,
|
|
49
59
|
options: {
|
|
50
60
|
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
51
|
-
client?: Partial<RequestConfig>
|
|
61
|
+
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
52
62
|
} = {},
|
|
53
63
|
) {
|
|
54
64
|
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
@@ -12,18 +12,28 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
|
-
export async function findPetsByTags(
|
|
16
|
-
|
|
15
|
+
export async function findPetsByTags(
|
|
16
|
+
headers: FindPetsByTagsHeaderParams,
|
|
17
|
+
params?: FindPetsByTagsQueryParams,
|
|
18
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
19
|
+
) {
|
|
20
|
+
const { client: request = client, ...requestConfig } = config
|
|
21
|
+
|
|
22
|
+
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
23
|
method: 'GET',
|
|
18
24
|
url: `/pet/findByTags`,
|
|
19
25
|
params,
|
|
20
|
-
headers: { ...headers, ...
|
|
21
|
-
...
|
|
26
|
+
headers: { ...headers, ...requestConfig.headers },
|
|
27
|
+
...requestConfig,
|
|
22
28
|
})
|
|
23
29
|
return findPetsByTagsQueryResponse.parse(res.data)
|
|
24
30
|
}
|
|
25
31
|
|
|
26
|
-
export function findPetsByTagsQueryOptions(
|
|
32
|
+
export function findPetsByTagsQueryOptions(
|
|
33
|
+
headers: FindPetsByTagsHeaderParams,
|
|
34
|
+
params?: FindPetsByTagsQueryParams,
|
|
35
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
36
|
+
) {
|
|
27
37
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
28
38
|
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
29
39
|
queryKey,
|
|
@@ -48,7 +58,7 @@ export function useFindPetsByTags<
|
|
|
48
58
|
params?: FindPetsByTagsQueryParams,
|
|
49
59
|
options: {
|
|
50
60
|
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
51
|
-
client?: Partial<RequestConfig>
|
|
61
|
+
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
52
62
|
} = {},
|
|
53
63
|
) {
|
|
54
64
|
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
@@ -12,13 +12,19 @@ export type FindPetsByTagsInfiniteQueryKey = ReturnType<typeof findPetsByTagsInf
|
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
|
-
export async function findPetsByTagsInfinite(
|
|
16
|
-
|
|
15
|
+
export async function findPetsByTagsInfinite(
|
|
16
|
+
headers: FindPetsByTagsHeaderParams,
|
|
17
|
+
params?: FindPetsByTagsQueryParams,
|
|
18
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
19
|
+
) {
|
|
20
|
+
const { client: request = client, ...requestConfig } = config
|
|
21
|
+
|
|
22
|
+
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
23
|
method: 'GET',
|
|
18
24
|
url: `/pet/findByTags`,
|
|
19
25
|
params,
|
|
20
|
-
headers: { ...headers, ...
|
|
21
|
-
...
|
|
26
|
+
headers: { ...headers, ...requestConfig.headers },
|
|
27
|
+
...requestConfig,
|
|
22
28
|
})
|
|
23
29
|
return findPetsByTagsQueryResponse.parse(res.data)
|
|
24
30
|
}
|
|
@@ -26,7 +32,7 @@ export async function findPetsByTagsInfinite(headers: FindPetsByTagsHeaderParams
|
|
|
26
32
|
export function findPetsByTagsInfiniteQueryOptions(
|
|
27
33
|
headers: FindPetsByTagsHeaderParams,
|
|
28
34
|
params?: FindPetsByTagsQueryParams,
|
|
29
|
-
config: Partial<RequestConfig> = {},
|
|
35
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
30
36
|
) {
|
|
31
37
|
const queryKey = findPetsByTagsInfiniteQueryKey(params)
|
|
32
38
|
return infiniteQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey, number>({
|
|
@@ -59,7 +65,7 @@ export function useFindPetsByTagsInfinite<
|
|
|
59
65
|
params?: FindPetsByTagsQueryParams,
|
|
60
66
|
options: {
|
|
61
67
|
query?: Partial<InfiniteQueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
62
|
-
client?: Partial<RequestConfig>
|
|
68
|
+
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
63
69
|
} = {},
|
|
64
70
|
) {
|
|
65
71
|
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
@@ -12,13 +12,19 @@ export type FindPetsByTagsInfiniteQueryKey = ReturnType<typeof findPetsByTagsInf
|
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
|
-
export async function findPetsByTagsInfinite(
|
|
16
|
-
|
|
15
|
+
export async function findPetsByTagsInfinite(
|
|
16
|
+
headers: FindPetsByTagsHeaderParams,
|
|
17
|
+
params?: FindPetsByTagsQueryParams,
|
|
18
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
19
|
+
) {
|
|
20
|
+
const { client: request = client, ...requestConfig } = config
|
|
21
|
+
|
|
22
|
+
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
23
|
method: 'GET',
|
|
18
24
|
url: `/pet/findByTags`,
|
|
19
25
|
params,
|
|
20
|
-
headers: { ...headers, ...
|
|
21
|
-
...
|
|
26
|
+
headers: { ...headers, ...requestConfig.headers },
|
|
27
|
+
...requestConfig,
|
|
22
28
|
})
|
|
23
29
|
return findPetsByTagsQueryResponse.parse(res.data)
|
|
24
30
|
}
|
|
@@ -26,7 +32,7 @@ export async function findPetsByTagsInfinite(headers: FindPetsByTagsHeaderParams
|
|
|
26
32
|
export function findPetsByTagsInfiniteQueryOptions(
|
|
27
33
|
headers: FindPetsByTagsHeaderParams,
|
|
28
34
|
params?: FindPetsByTagsQueryParams,
|
|
29
|
-
config: Partial<RequestConfig> = {},
|
|
35
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {},
|
|
30
36
|
) {
|
|
31
37
|
const queryKey = findPetsByTagsInfiniteQueryKey(params)
|
|
32
38
|
return infiniteQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey, number>({
|
|
@@ -59,7 +65,7 @@ export function useFindPetsByTagsInfinite<
|
|
|
59
65
|
params?: FindPetsByTagsQueryParams,
|
|
60
66
|
options: {
|
|
61
67
|
query?: Partial<InfiniteQueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
62
|
-
client?: Partial<RequestConfig>
|
|
68
|
+
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
63
69
|
} = {},
|
|
64
70
|
) {
|
|
65
71
|
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
@@ -12,16 +12,18 @@ export type GetPetByIdQueryKey = ReturnType<typeof getPetByIdQueryKey>
|
|
|
12
12
|
* @summary Find pet by ID
|
|
13
13
|
* {@link /pet/:pet_id}
|
|
14
14
|
*/
|
|
15
|
-
export async function getPetById(petId: GetPetByIdPathParams['pet_id'], config: Partial<RequestConfig> = {}) {
|
|
16
|
-
const
|
|
15
|
+
export async function getPetById(petId: GetPetByIdPathParams['pet_id'], config: Partial<RequestConfig> & { client?: typeof client } = {}) {
|
|
16
|
+
const { client: request = client, ...requestConfig } = config
|
|
17
|
+
|
|
18
|
+
const res = await request<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, unknown>({
|
|
17
19
|
method: 'GET',
|
|
18
20
|
url: `/pet/${petId}`,
|
|
19
|
-
...
|
|
21
|
+
...requestConfig,
|
|
20
22
|
})
|
|
21
23
|
return getPetByIdQueryResponse.parse(res.data)
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
export function getPetByIdQueryOptions(petId: GetPetByIdPathParams['pet_id'], config: Partial<RequestConfig> = {}) {
|
|
26
|
+
export function getPetByIdQueryOptions(petId: GetPetByIdPathParams['pet_id'], config: Partial<RequestConfig> & { client?: typeof client } = {}) {
|
|
25
27
|
const queryKey = getPetByIdQueryKey(petId)
|
|
26
28
|
return queryOptions<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, GetPetByIdQueryResponse, typeof queryKey>({
|
|
27
29
|
enabled: !!petId,
|
|
@@ -42,7 +44,7 @@ export function useGetPetById<TData = GetPetByIdQueryResponse, TQueryData = GetP
|
|
|
42
44
|
petId: GetPetByIdPathParams['pet_id'],
|
|
43
45
|
options: {
|
|
44
46
|
query?: Partial<QueryObserverOptions<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, TData, TQueryData, TQueryKey>>
|
|
45
|
-
client?: Partial<RequestConfig>
|
|
47
|
+
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
46
48
|
} = {},
|
|
47
49
|
) {
|
|
48
50
|
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
@@ -19,14 +19,16 @@ export async function updatePetWithForm(
|
|
|
19
19
|
petId: UpdatePetWithFormPathParams['petId'],
|
|
20
20
|
data?: UpdatePetWithFormMutationRequest,
|
|
21
21
|
params?: UpdatePetWithFormQueryParams,
|
|
22
|
-
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
|
|
22
|
+
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client } = {},
|
|
23
23
|
) {
|
|
24
|
-
const
|
|
24
|
+
const { client: request = client, ...requestConfig } = config
|
|
25
|
+
|
|
26
|
+
const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
|
|
25
27
|
method: 'POST',
|
|
26
28
|
url: `/pet/${pet_id}`,
|
|
27
29
|
params,
|
|
28
30
|
data,
|
|
29
|
-
...
|
|
31
|
+
...requestConfig,
|
|
30
32
|
})
|
|
31
33
|
return updatePetWithFormMutationResponse.parse(res.data)
|
|
32
34
|
}
|
|
@@ -35,7 +37,7 @@ export function updatePetWithFormQueryOptions(
|
|
|
35
37
|
petId: UpdatePetWithFormPathParams['petId'],
|
|
36
38
|
data?: UpdatePetWithFormMutationRequest,
|
|
37
39
|
params?: UpdatePetWithFormQueryParams,
|
|
38
|
-
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
|
|
40
|
+
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client } = {},
|
|
39
41
|
) {
|
|
40
42
|
const queryKey = updatePetWithFormQueryKey(petId, data, params)
|
|
41
43
|
return queryOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationResponse, typeof queryKey>({
|
|
@@ -62,7 +64,7 @@ export function useUpdatePetWithForm<
|
|
|
62
64
|
params?: UpdatePetWithFormQueryParams,
|
|
63
65
|
options: {
|
|
64
66
|
query?: Partial<QueryObserverOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, TData, TQueryData, TQueryKey>>
|
|
65
|
-
client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
|
|
67
|
+
client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client }
|
|
66
68
|
} = {},
|
|
67
69
|
) {
|
|
68
70
|
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
@@ -15,14 +15,16 @@ export async function updatePetWithForm(
|
|
|
15
15
|
petId: UpdatePetWithFormPathParams['petId'],
|
|
16
16
|
data?: UpdatePetWithFormMutationRequest,
|
|
17
17
|
params?: UpdatePetWithFormQueryParams,
|
|
18
|
-
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
|
|
18
|
+
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client } = {},
|
|
19
19
|
) {
|
|
20
|
-
const
|
|
20
|
+
const { client: request = client, ...requestConfig } = config
|
|
21
|
+
|
|
22
|
+
const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
|
|
21
23
|
method: 'POST',
|
|
22
24
|
url: `/pet/${pet_id}`,
|
|
23
25
|
params,
|
|
24
26
|
data,
|
|
25
|
-
...
|
|
27
|
+
...requestConfig,
|
|
26
28
|
})
|
|
27
29
|
return updatePetWithFormMutationResponse.parse(res.data)
|
|
28
30
|
}
|
|
@@ -38,7 +40,7 @@ export function useUpdatePetWithForm(
|
|
|
38
40
|
ResponseErrorConfig<UpdatePetWithForm405>,
|
|
39
41
|
{ petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
|
|
40
42
|
>
|
|
41
|
-
client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
|
|
43
|
+
client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client }
|
|
42
44
|
} = {},
|
|
43
45
|
) {
|
|
44
46
|
const { mutation: mutationOptions, client: config = {} } = options ?? {}
|
|
@@ -15,14 +15,16 @@ export async function updatePetWithForm(
|
|
|
15
15
|
{ petId }: { petId: UpdatePetWithFormPathParams['petId'] },
|
|
16
16
|
data?: UpdatePetWithFormMutationRequest,
|
|
17
17
|
params?: UpdatePetWithFormQueryParams,
|
|
18
|
-
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
|
|
18
|
+
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client } = {},
|
|
19
19
|
) {
|
|
20
|
-
const
|
|
20
|
+
const { client: request = client, ...requestConfig } = config
|
|
21
|
+
|
|
22
|
+
const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
|
|
21
23
|
method: 'POST',
|
|
22
24
|
url: `/pet/${pet_id}`,
|
|
23
25
|
params,
|
|
24
26
|
data,
|
|
25
|
-
...
|
|
27
|
+
...requestConfig,
|
|
26
28
|
})
|
|
27
29
|
return updatePetWithFormMutationResponse.parse(res.data)
|
|
28
30
|
}
|
|
@@ -38,7 +40,7 @@ export function useUpdatePetWithForm(
|
|
|
38
40
|
ResponseErrorConfig<UpdatePetWithForm405>,
|
|
39
41
|
{ petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
|
|
40
42
|
>
|
|
41
|
-
client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
|
|
43
|
+
client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client }
|
|
42
44
|
} = {},
|
|
43
45
|
) {
|
|
44
46
|
const { mutation: mutationOptions, client: config = {} } = options ?? {}
|
|
@@ -83,7 +83,7 @@ export const infiniteQueryGenerator = createReactGenerator<PluginReactQuery>({
|
|
|
83
83
|
footer={getFooter({ oas, output })}
|
|
84
84
|
>
|
|
85
85
|
{options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={query.file.path} path={zod.file.path} />}
|
|
86
|
-
{
|
|
86
|
+
{<File.Import name={'client'} path={options.client.importPath} />}
|
|
87
87
|
{hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}
|
|
88
88
|
<File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
|
|
89
89
|
{options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}
|
|
@@ -77,7 +77,7 @@ export const mutationGenerator = createReactGenerator<PluginReactQuery>({
|
|
|
77
77
|
footer={getFooter({ oas, output })}
|
|
78
78
|
>
|
|
79
79
|
{options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={mutation.file.path} path={zod.file.path} />}
|
|
80
|
-
|
|
80
|
+
<File.Import name={'client'} path={options.client.importPath} />
|
|
81
81
|
{!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}
|
|
82
82
|
<File.Import name={['RequestConfig', 'ResponseConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
|
|
83
83
|
<File.Import
|