@kubb/plugin-react-query 3.3.5 → 3.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-BQWHLRZV.cjs → chunk-5YNH6XF6.cjs} +85 -48
- package/dist/chunk-5YNH6XF6.cjs.map +1 -0
- package/dist/{chunk-6C4KXSF3.js → chunk-7R7Q7R3I.js} +7 -7
- package/dist/chunk-7R7Q7R3I.js.map +1 -0
- package/dist/{chunk-AXOVGSBC.js → chunk-HAEHUITJ.js} +85 -48
- package/dist/chunk-HAEHUITJ.js.map +1 -0
- package/dist/{chunk-3WYRNATD.cjs → chunk-KWKS56G3.cjs} +22 -22
- package/dist/chunk-KWKS56G3.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 +10 -10
- package/src/components/InfiniteQuery.tsx +5 -3
- package/src/components/InfiniteQueryOptions.tsx +1 -1
- package/src/components/Mutation.tsx +4 -6
- package/src/components/Query.tsx +5 -3
- package/src/components/QueryOptions.tsx +1 -1
- package/src/components/SuspenseQuery.tsx +5 -3
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +10 -5
- package/src/generators/__snapshots__/clientGetImportPath.ts +5 -5
- package/src/generators/__snapshots__/clientPostImportPath.ts +4 -4
- package/src/generators/__snapshots__/findByTags.ts +5 -5
- package/src/generators/__snapshots__/findByTagsObject.ts +5 -5
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +5 -5
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +5 -5
- package/src/generators/__snapshots__/findByTagsWithZod.ts +5 -5
- package/src/generators/__snapshots__/findInfiniteByTags.ts +5 -5
- package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +5 -5
- package/src/generators/__snapshots__/getPetIdCamelCase.ts +9 -5
- package/src/generators/__snapshots__/postAsQuery.ts +5 -5
- package/src/generators/__snapshots__/updatePetById.ts +4 -4
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +4 -4
- package/src/generators/infiniteQueryGenerator.tsx +1 -1
- package/src/generators/mutationGenerator.tsx +1 -2
- package/src/generators/queryGenerator.tsx +1 -1
- package/src/generators/suspenseQueryGenerator.tsx +1 -1
- package/dist/chunk-3WYRNATD.cjs.map +0 -1
- package/dist/chunk-6C4KXSF3.js.map +0 -1
- package/dist/chunk-AXOVGSBC.js.map +0 -1
- package/dist/chunk-BQWHLRZV.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkKWKS56G3_cjs = require('./chunk-KWKS56G3.cjs');
|
|
4
|
+
var chunk5YNH6XF6_cjs = require('./chunk-5YNH6XF6.cjs');
|
|
5
5
|
var path = require('path');
|
|
6
6
|
var core = require('@kubb/core');
|
|
7
7
|
var transformers = require('@kubb/core/transformers');
|
|
@@ -27,11 +27,11 @@ var pluginReactQuery = core.createPlugin((options) => {
|
|
|
27
27
|
transformers: transformers$1 = {},
|
|
28
28
|
paramsType = "inline",
|
|
29
29
|
pathParamsType = "inline",
|
|
30
|
-
generators = [
|
|
30
|
+
generators = [chunkKWKS56G3_cjs.queryGenerator, chunkKWKS56G3_cjs.suspenseQueryGenerator, chunkKWKS56G3_cjs.infiniteQueryGenerator, chunkKWKS56G3_cjs.mutationGenerator].filter(Boolean),
|
|
31
31
|
mutation = {},
|
|
32
32
|
query = {},
|
|
33
|
-
mutationKey =
|
|
34
|
-
queryKey =
|
|
33
|
+
mutationKey = chunk5YNH6XF6_cjs.MutationKey.getTransformer,
|
|
34
|
+
queryKey = chunk5YNH6XF6_cjs.QueryKey.getTransformer,
|
|
35
35
|
paramsCasing
|
|
36
36
|
} = options;
|
|
37
37
|
return {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { queryGenerator, suspenseQueryGenerator, infiniteQueryGenerator, mutationGenerator } from './chunk-
|
|
2
|
-
import { MutationKey, QueryKey } from './chunk-
|
|
1
|
+
import { queryGenerator, suspenseQueryGenerator, infiniteQueryGenerator, mutationGenerator } from './chunk-7R7Q7R3I.js';
|
|
2
|
+
import { MutationKey, QueryKey } from './chunk-HAEHUITJ.js';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { createPlugin, FileManager, PluginManager } from '@kubb/core';
|
|
5
5
|
import { camelCase, pascalCase } from '@kubb/core/transformers';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-react-query",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Generator react-query hooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"faker",
|
|
@@ -63,21 +63,21 @@
|
|
|
63
63
|
],
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"remeda": "^2.19.0",
|
|
66
|
-
"@kubb/core": "3.
|
|
67
|
-
"@kubb/
|
|
68
|
-
"@kubb/
|
|
69
|
-
"@kubb/plugin-oas": "3.
|
|
70
|
-
"@kubb/plugin-ts": "3.
|
|
71
|
-
"@kubb/plugin-zod": "3.
|
|
72
|
-
"@kubb/react": "3.
|
|
66
|
+
"@kubb/core": "3.4.0",
|
|
67
|
+
"@kubb/oas": "3.4.0",
|
|
68
|
+
"@kubb/fs": "3.4.0",
|
|
69
|
+
"@kubb/plugin-oas": "3.4.0",
|
|
70
|
+
"@kubb/plugin-ts": "3.4.0",
|
|
71
|
+
"@kubb/plugin-zod": "3.4.0",
|
|
72
|
+
"@kubb/react": "3.4.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/react": "^18.3.18",
|
|
76
76
|
"react": "^18.3.1",
|
|
77
77
|
"tsup": "^8.3.5",
|
|
78
78
|
"typescript": "^5.7.2",
|
|
79
|
-
"@kubb/config-ts": "3.
|
|
80
|
-
"@kubb/config-tsup": "3.
|
|
79
|
+
"@kubb/config-ts": "3.4.0",
|
|
80
|
+
"@kubb/config-tsup": "3.4.0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"@kubb/react": "^3.0.0"
|
|
@@ -34,6 +34,7 @@ type GetParamsProps = {
|
|
|
34
34
|
|
|
35
35
|
function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) {
|
|
36
36
|
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
37
|
+
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
37
38
|
|
|
38
39
|
if (paramsType === 'object') {
|
|
39
40
|
return FunctionParams.factory({
|
|
@@ -64,7 +65,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
64
65
|
options: {
|
|
65
66
|
type: `
|
|
66
67
|
{
|
|
67
|
-
query?: Partial<InfiniteQueryObserverOptions<${[TData,
|
|
68
|
+
query?: Partial<InfiniteQueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
|
|
68
69
|
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>'}
|
|
69
70
|
}
|
|
70
71
|
`,
|
|
@@ -102,7 +103,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
102
103
|
options: {
|
|
103
104
|
type: `
|
|
104
105
|
{
|
|
105
|
-
query?: Partial<InfiniteQueryObserverOptions<${[TData,
|
|
106
|
+
query?: Partial<InfiniteQueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
|
|
106
107
|
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>'}
|
|
107
108
|
}
|
|
108
109
|
`,
|
|
@@ -124,7 +125,8 @@ export function InfiniteQuery({
|
|
|
124
125
|
operation,
|
|
125
126
|
}: Props): ReactNode {
|
|
126
127
|
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
127
|
-
const
|
|
128
|
+
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
129
|
+
const returnType = `UseInfiniteQueryResult<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`
|
|
128
130
|
const generics = [`TData = InfiniteData<${TData}>`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]
|
|
129
131
|
|
|
130
132
|
const queryKeyParams = QueryKey.getParams({
|
|
@@ -111,7 +111,7 @@ export function InfiniteQueryOptions({
|
|
|
111
111
|
queryKeyName,
|
|
112
112
|
}: Props): ReactNode {
|
|
113
113
|
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
114
|
-
const TError = typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'
|
|
114
|
+
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
115
115
|
|
|
116
116
|
const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })
|
|
117
117
|
const clientParams = Client.getParams({
|
|
@@ -56,9 +56,8 @@ function getParams({ paramsCasing, dataReturnType, typeSchemas }: GetParamsProps
|
|
|
56
56
|
: undefined,
|
|
57
57
|
})
|
|
58
58
|
const TRequest = mutationParams.toConstructor({ valueAsType: true })
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
.join(', ')
|
|
59
|
+
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
60
|
+
const generics = [TData, TError, TRequest ? `{${TRequest}}` : undefined].filter(Boolean).join(', ')
|
|
62
61
|
|
|
63
62
|
return FunctionParams.factory({
|
|
64
63
|
options: {
|
|
@@ -145,9 +144,8 @@ export function Mutation({
|
|
|
145
144
|
|
|
146
145
|
const TRequest = mutationParams.toConstructor({ valueAsType: true })
|
|
147
146
|
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
.join(', ')
|
|
147
|
+
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
148
|
+
const generics = [TData, TError, TRequest ? `{${TRequest}}` : undefined].filter(Boolean).join(', ')
|
|
151
149
|
|
|
152
150
|
return (
|
|
153
151
|
<File.Source name={name} isExportable isIndexable>
|
package/src/components/Query.tsx
CHANGED
|
@@ -34,6 +34,7 @@ type GetParamsProps = {
|
|
|
34
34
|
|
|
35
35
|
function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) {
|
|
36
36
|
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
37
|
+
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
37
38
|
|
|
38
39
|
if (paramsType === 'object') {
|
|
39
40
|
return FunctionParams.factory({
|
|
@@ -64,7 +65,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
64
65
|
options: {
|
|
65
66
|
type: `
|
|
66
67
|
{
|
|
67
|
-
query?: Partial<QueryObserverOptions<${[TData,
|
|
68
|
+
query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
|
|
68
69
|
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>'}
|
|
69
70
|
}
|
|
70
71
|
`,
|
|
@@ -102,7 +103,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
102
103
|
options: {
|
|
103
104
|
type: `
|
|
104
105
|
{
|
|
105
|
-
query?: Partial<QueryObserverOptions<${[TData,
|
|
106
|
+
query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
|
|
106
107
|
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>'}
|
|
107
108
|
}
|
|
108
109
|
`,
|
|
@@ -124,7 +125,8 @@ export function Query({
|
|
|
124
125
|
operation,
|
|
125
126
|
}: Props): ReactNode {
|
|
126
127
|
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
127
|
-
const
|
|
128
|
+
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
129
|
+
const returnType = `UseQueryResult<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`
|
|
128
130
|
const generics = [`TData = ${TData}`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]
|
|
129
131
|
|
|
130
132
|
const queryKeyParams = QueryKey.getParams({
|
|
@@ -121,7 +121,7 @@ export function QueryOptions({ name, clientName, dataReturnType, typeSchemas, pa
|
|
|
121
121
|
<Function name={name} export params={params.toConstructor()}>
|
|
122
122
|
{`
|
|
123
123
|
const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})
|
|
124
|
-
return queryOptions<${TData},
|
|
124
|
+
return queryOptions<${TData}, ResponseErrorConfig<${TError}>, ${TData}, typeof queryKey>({
|
|
125
125
|
${enabledText}
|
|
126
126
|
queryKey,
|
|
127
127
|
queryFn: async ({ signal }) => {
|
|
@@ -34,6 +34,7 @@ type GetParamsProps = {
|
|
|
34
34
|
|
|
35
35
|
function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) {
|
|
36
36
|
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
37
|
+
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
37
38
|
|
|
38
39
|
if (paramsType === 'object') {
|
|
39
40
|
return FunctionParams.factory({
|
|
@@ -64,7 +65,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
64
65
|
options: {
|
|
65
66
|
type: `
|
|
66
67
|
{
|
|
67
|
-
query?: Partial<UseSuspenseQueryOptions<${[TData,
|
|
68
|
+
query?: Partial<UseSuspenseQueryOptions<${[TData, TError, 'TData', 'TQueryKey'].join(', ')}>>,
|
|
68
69
|
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>'}
|
|
69
70
|
}
|
|
70
71
|
`,
|
|
@@ -102,7 +103,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
102
103
|
options: {
|
|
103
104
|
type: `
|
|
104
105
|
{
|
|
105
|
-
query?: Partial<UseSuspenseQueryOptions<${[TData,
|
|
106
|
+
query?: Partial<UseSuspenseQueryOptions<${[TData, TError, 'TData', 'TQueryKey'].join(', ')}>>,
|
|
106
107
|
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>'}
|
|
107
108
|
}
|
|
108
109
|
`,
|
|
@@ -124,7 +125,8 @@ export function SuspenseQuery({
|
|
|
124
125
|
operation,
|
|
125
126
|
}: Props): ReactNode {
|
|
126
127
|
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
127
|
-
const
|
|
128
|
+
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
|
|
129
|
+
const returnType = `UseSuspenseQueryResult<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`
|
|
128
130
|
const generics = [`TData = ${TData}`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]
|
|
129
131
|
|
|
130
132
|
const queryKeyParams = QueryKey.getParams({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
|
-
import type { RequestConfig, ResponseConfig } from '@kubb/plugin-client/clients/axios'
|
|
2
|
+
import type { RequestConfig, ResponseErrorConfig, ResponseConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
3
|
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
|
|
4
4
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
15
|
async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
16
|
-
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
16
|
+
const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
17
|
method: 'GET',
|
|
18
18
|
url: `/pet/findByTags`,
|
|
19
19
|
params,
|
|
@@ -25,7 +25,12 @@ async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: Find
|
|
|
25
25
|
|
|
26
26
|
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
27
27
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
28
|
-
return queryOptions<
|
|
28
|
+
return queryOptions<
|
|
29
|
+
ResponseConfig<FindPetsByTagsQueryResponse>,
|
|
30
|
+
ResponseErrorConfig<FindPetsByTags400>,
|
|
31
|
+
ResponseConfig<FindPetsByTagsQueryResponse>,
|
|
32
|
+
typeof queryKey
|
|
33
|
+
>({
|
|
29
34
|
queryKey,
|
|
30
35
|
queryFn: async ({ signal }) => {
|
|
31
36
|
config.signal = signal
|
|
@@ -47,7 +52,7 @@ export function useFindPetsByTags<
|
|
|
47
52
|
headers: FindPetsByTagsHeaderParams,
|
|
48
53
|
params?: FindPetsByTagsQueryParams,
|
|
49
54
|
options: {
|
|
50
|
-
query?: Partial<QueryObserverOptions<ResponseConfig<FindPetsByTagsQueryResponse>, FindPetsByTags400
|
|
55
|
+
query?: Partial<QueryObserverOptions<ResponseConfig<FindPetsByTagsQueryResponse>, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
51
56
|
client?: Partial<RequestConfig>
|
|
52
57
|
} = {},
|
|
53
58
|
) {
|
|
@@ -58,7 +63,7 @@ export function useFindPetsByTags<
|
|
|
58
63
|
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
59
64
|
queryKey,
|
|
60
65
|
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
61
|
-
}) as UseQueryResult<TData, FindPetsByTags400
|
|
66
|
+
}) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
62
67
|
|
|
63
68
|
query.queryKey = queryKey as TQueryKey
|
|
64
69
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import client from 'axios'
|
|
2
2
|
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
|
|
3
|
-
import type { RequestConfig } from 'axios'
|
|
3
|
+
import type { RequestConfig, ResponseErrorConfig } from 'axios'
|
|
4
4
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
5
5
|
|
|
6
6
|
export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
|
|
@@ -13,7 +13,7 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
15
|
async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
16
|
-
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
16
|
+
const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
17
|
method: 'GET',
|
|
18
18
|
url: `/pet/findByTags`,
|
|
19
19
|
params,
|
|
@@ -25,7 +25,7 @@ async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: Find
|
|
|
25
25
|
|
|
26
26
|
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
27
27
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
28
|
-
return queryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
28
|
+
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
29
29
|
queryKey,
|
|
30
30
|
queryFn: async ({ signal }) => {
|
|
31
31
|
config.signal = signal
|
|
@@ -47,7 +47,7 @@ export function useFindPetsByTags<
|
|
|
47
47
|
headers: FindPetsByTagsHeaderParams,
|
|
48
48
|
params?: FindPetsByTagsQueryParams,
|
|
49
49
|
options: {
|
|
50
|
-
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
50
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
51
51
|
client?: Partial<RequestConfig>
|
|
52
52
|
} = {},
|
|
53
53
|
) {
|
|
@@ -58,7 +58,7 @@ export function useFindPetsByTags<
|
|
|
58
58
|
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
59
59
|
queryKey,
|
|
60
60
|
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
61
|
-
}) as UseQueryResult<TData, FindPetsByTags400
|
|
61
|
+
}) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
62
62
|
|
|
63
63
|
query.queryKey = queryKey as TQueryKey
|
|
64
64
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import client from 'axios'
|
|
2
2
|
import type { UseMutationOptions } from '@tanstack/react-query'
|
|
3
|
-
import type { RequestConfig } from 'axios'
|
|
3
|
+
import type { RequestConfig, ResponseErrorConfig } from 'axios'
|
|
4
4
|
import { useMutation } from '@tanstack/react-query'
|
|
5
5
|
|
|
6
6
|
export const updatePetWithFormMutationKey = () => [{ url: '/pet/{pet_id}' }] as const
|
|
@@ -17,7 +17,7 @@ async function updatePetWithForm(
|
|
|
17
17
|
params?: UpdatePetWithFormQueryParams,
|
|
18
18
|
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
|
|
19
19
|
) {
|
|
20
|
-
const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405
|
|
20
|
+
const res = await client<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
|
|
21
21
|
method: 'POST',
|
|
22
22
|
url: `/pet/${pet_id}`,
|
|
23
23
|
params,
|
|
@@ -35,7 +35,7 @@ export function useUpdatePetWithForm(
|
|
|
35
35
|
options: {
|
|
36
36
|
mutation?: UseMutationOptions<
|
|
37
37
|
UpdatePetWithFormMutationResponse,
|
|
38
|
-
UpdatePetWithForm405
|
|
38
|
+
ResponseErrorConfig<UpdatePetWithForm405>,
|
|
39
39
|
{ petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
|
|
40
40
|
>
|
|
41
41
|
client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
|
|
@@ -46,7 +46,7 @@ export function useUpdatePetWithForm(
|
|
|
46
46
|
|
|
47
47
|
return useMutation<
|
|
48
48
|
UpdatePetWithFormMutationResponse,
|
|
49
|
-
UpdatePetWithForm405
|
|
49
|
+
ResponseErrorConfig<UpdatePetWithForm405>,
|
|
50
50
|
{ petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
|
|
51
51
|
>({
|
|
52
52
|
mutationFn: async ({ petId, data, params }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
|
-
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
2
|
+
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
3
|
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
|
|
4
4
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
15
|
async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
16
|
-
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
16
|
+
const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
17
|
method: 'GET',
|
|
18
18
|
url: `/pet/findByTags`,
|
|
19
19
|
params,
|
|
@@ -25,7 +25,7 @@ async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: Find
|
|
|
25
25
|
|
|
26
26
|
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
27
27
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
28
|
-
return queryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
28
|
+
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
29
29
|
queryKey,
|
|
30
30
|
queryFn: async ({ signal }) => {
|
|
31
31
|
config.signal = signal
|
|
@@ -47,7 +47,7 @@ export function useFindPetsByTags<
|
|
|
47
47
|
headers: FindPetsByTagsHeaderParams,
|
|
48
48
|
params?: FindPetsByTagsQueryParams,
|
|
49
49
|
options: {
|
|
50
|
-
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
50
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
51
51
|
client?: Partial<RequestConfig>
|
|
52
52
|
} = {},
|
|
53
53
|
) {
|
|
@@ -58,7 +58,7 @@ export function useFindPetsByTags<
|
|
|
58
58
|
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
59
59
|
queryKey,
|
|
60
60
|
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
61
|
-
}) as UseQueryResult<TData, FindPetsByTags400
|
|
61
|
+
}) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
62
62
|
|
|
63
63
|
query.queryKey = queryKey as TQueryKey
|
|
64
64
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
|
-
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
2
|
+
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
3
|
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
|
|
4
4
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ async function findPetsByTags(
|
|
|
16
16
|
{ headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
|
|
17
17
|
config: Partial<RequestConfig> = {},
|
|
18
18
|
) {
|
|
19
|
-
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
19
|
+
const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
20
20
|
method: 'GET',
|
|
21
21
|
url: `/pet/findByTags`,
|
|
22
22
|
params,
|
|
@@ -31,7 +31,7 @@ export function findPetsByTagsQueryOptions(
|
|
|
31
31
|
config: Partial<RequestConfig> = {},
|
|
32
32
|
) {
|
|
33
33
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
34
|
-
return queryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
34
|
+
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
35
35
|
queryKey,
|
|
36
36
|
queryFn: async ({ signal }) => {
|
|
37
37
|
config.signal = signal
|
|
@@ -52,7 +52,7 @@ export function useFindPetsByTags<
|
|
|
52
52
|
>(
|
|
53
53
|
{ headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
|
|
54
54
|
options: {
|
|
55
|
-
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
55
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
56
56
|
client?: Partial<RequestConfig>
|
|
57
57
|
} = {},
|
|
58
58
|
) {
|
|
@@ -63,7 +63,7 @@ export function useFindPetsByTags<
|
|
|
63
63
|
...(findPetsByTagsQueryOptions({ headers, params }, config) as unknown as QueryObserverOptions),
|
|
64
64
|
queryKey,
|
|
65
65
|
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
66
|
-
}) as UseQueryResult<TData, FindPetsByTags400
|
|
66
|
+
}) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
67
67
|
|
|
68
68
|
query.queryKey = queryKey as TQueryKey
|
|
69
69
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
|
-
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
2
|
+
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
3
|
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
|
|
4
4
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
15
|
async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
16
|
-
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
16
|
+
const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
17
|
method: 'GET',
|
|
18
18
|
url: `/pet/findByTags`,
|
|
19
19
|
params,
|
|
@@ -25,7 +25,7 @@ async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: Find
|
|
|
25
25
|
|
|
26
26
|
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
27
27
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
28
|
-
return queryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
28
|
+
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
29
29
|
queryKey,
|
|
30
30
|
queryFn: async ({ signal }) => {
|
|
31
31
|
config.signal = signal
|
|
@@ -47,7 +47,7 @@ export function useFindPetsByTags<
|
|
|
47
47
|
headers: FindPetsByTagsHeaderParams,
|
|
48
48
|
params?: FindPetsByTagsQueryParams,
|
|
49
49
|
options: {
|
|
50
|
-
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
50
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
51
51
|
client?: Partial<RequestConfig>
|
|
52
52
|
} = {},
|
|
53
53
|
) {
|
|
@@ -58,7 +58,7 @@ export function useFindPetsByTags<
|
|
|
58
58
|
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
59
59
|
queryKey,
|
|
60
60
|
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
61
|
-
}) as UseQueryResult<TData, FindPetsByTags400
|
|
61
|
+
}) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
62
62
|
|
|
63
63
|
query.queryKey = queryKey as TQueryKey
|
|
64
64
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
|
-
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
2
|
+
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
3
|
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
|
|
4
4
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
15
|
async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
16
|
-
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
16
|
+
const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
17
|
method: 'GET',
|
|
18
18
|
url: `/pet/findByTags`,
|
|
19
19
|
params,
|
|
@@ -25,7 +25,7 @@ async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: Find
|
|
|
25
25
|
|
|
26
26
|
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
27
27
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
28
|
-
return queryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
28
|
+
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
29
29
|
queryKey,
|
|
30
30
|
queryFn: async ({ signal }) => {
|
|
31
31
|
config.signal = signal
|
|
@@ -47,7 +47,7 @@ export function useFindPetsByTags<
|
|
|
47
47
|
headers: FindPetsByTagsHeaderParams,
|
|
48
48
|
params?: FindPetsByTagsQueryParams,
|
|
49
49
|
options: {
|
|
50
|
-
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
50
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
51
51
|
client?: Partial<RequestConfig>
|
|
52
52
|
} = {},
|
|
53
53
|
) {
|
|
@@ -58,7 +58,7 @@ export function useFindPetsByTags<
|
|
|
58
58
|
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
59
59
|
queryKey,
|
|
60
60
|
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
61
|
-
}) as UseQueryResult<TData, FindPetsByTags400
|
|
61
|
+
}) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
62
62
|
|
|
63
63
|
query.queryKey = queryKey as TQueryKey
|
|
64
64
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
|
-
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
2
|
+
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
3
|
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
|
|
4
4
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
|
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
15
|
async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
16
|
-
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
16
|
+
const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
17
|
method: 'GET',
|
|
18
18
|
url: `/pet/findByTags`,
|
|
19
19
|
params,
|
|
@@ -25,7 +25,7 @@ async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: Find
|
|
|
25
25
|
|
|
26
26
|
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
27
27
|
const queryKey = findPetsByTagsQueryKey(params)
|
|
28
|
-
return queryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
28
|
+
return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
|
|
29
29
|
queryKey,
|
|
30
30
|
queryFn: async ({ signal }) => {
|
|
31
31
|
config.signal = signal
|
|
@@ -47,7 +47,7 @@ export function useFindPetsByTags<
|
|
|
47
47
|
headers: FindPetsByTagsHeaderParams,
|
|
48
48
|
params?: FindPetsByTagsQueryParams,
|
|
49
49
|
options: {
|
|
50
|
-
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
50
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
51
51
|
client?: Partial<RequestConfig>
|
|
52
52
|
} = {},
|
|
53
53
|
) {
|
|
@@ -58,7 +58,7 @@ export function useFindPetsByTags<
|
|
|
58
58
|
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
59
59
|
queryKey,
|
|
60
60
|
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
61
|
-
}) as UseQueryResult<TData, FindPetsByTags400
|
|
61
|
+
}) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
62
62
|
|
|
63
63
|
query.queryKey = queryKey as TQueryKey
|
|
64
64
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
|
-
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
2
|
+
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
3
|
import type { InfiniteData, QueryKey, InfiniteQueryObserverOptions, UseInfiniteQueryResult } from '@tanstack/react-query'
|
|
4
4
|
import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query'
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ export type FindPetsByTagsInfiniteQueryKey = ReturnType<typeof findPetsByTagsInf
|
|
|
13
13
|
* {@link /pet/findByTags}
|
|
14
14
|
*/
|
|
15
15
|
async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
16
|
-
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
16
|
+
const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
17
17
|
method: 'GET',
|
|
18
18
|
url: `/pet/findByTags`,
|
|
19
19
|
params,
|
|
@@ -29,7 +29,7 @@ export function findPetsByTagsInfiniteQueryOptions(
|
|
|
29
29
|
config: Partial<RequestConfig> = {},
|
|
30
30
|
) {
|
|
31
31
|
const queryKey = findPetsByTagsInfiniteQueryKey(params)
|
|
32
|
-
return infiniteQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
32
|
+
return infiniteQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey, number>({
|
|
33
33
|
queryKey,
|
|
34
34
|
queryFn: async ({ signal, pageParam }) => {
|
|
35
35
|
config.signal = signal
|
|
@@ -58,7 +58,7 @@ export function useFindPetsByTagsInfinite<
|
|
|
58
58
|
headers: FindPetsByTagsHeaderParams,
|
|
59
59
|
params?: FindPetsByTagsQueryParams,
|
|
60
60
|
options: {
|
|
61
|
-
query?: Partial<InfiniteQueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400
|
|
61
|
+
query?: Partial<InfiniteQueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
62
62
|
client?: Partial<RequestConfig>
|
|
63
63
|
} = {},
|
|
64
64
|
) {
|
|
@@ -69,7 +69,7 @@ export function useFindPetsByTagsInfinite<
|
|
|
69
69
|
...(findPetsByTagsInfiniteQueryOptions(headers, params, config) as unknown as InfiniteQueryObserverOptions),
|
|
70
70
|
queryKey,
|
|
71
71
|
...(queryOptions as unknown as Omit<InfiniteQueryObserverOptions, 'queryKey'>),
|
|
72
|
-
}) as UseInfiniteQueryResult<TData, FindPetsByTags400
|
|
72
|
+
}) as UseInfiniteQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
73
73
|
|
|
74
74
|
query.queryKey = queryKey as TQueryKey
|
|
75
75
|
|