@kubb/plugin-react-query 3.0.0-alpha.16 → 3.0.0-alpha.18
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/README.md +0 -4
- package/dist/{chunk-ME7ZFS5H.js → chunk-G6I2OU3A.js} +2 -2
- package/dist/{chunk-ME7ZFS5H.js.map → chunk-G6I2OU3A.js.map} +1 -1
- package/dist/{chunk-KRG2LWHM.cjs → chunk-MPBVA37Y.cjs} +2 -2
- package/dist/{chunk-KRG2LWHM.cjs.map → chunk-MPBVA37Y.cjs.map} +1 -1
- package/dist/generators.cjs +5 -5
- package/dist/generators.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +11 -14
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +33 -47
- package/src/generators/__snapshots__/clientGetImportPath.ts +33 -47
- package/src/generators/__snapshots__/clientPostImportPath.ts +28 -49
- package/src/generators/__snapshots__/findByTags.ts +33 -47
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +33 -47
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +33 -47
- package/src/generators/__snapshots__/findByTagsWithZod.ts +33 -47
- package/src/generators/__snapshots__/findInfiniteByTags.ts +39 -57
- package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +39 -57
- package/src/generators/__snapshots__/postAsQuery.ts +34 -63
- package/src/generators/__snapshots__/updatePetById.ts +28 -49
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +30 -53
- package/src/generators/infiniteQueryGenerator.tsx +1 -1
- package/src/generators/suspenseQueryGenerator.tsx +1 -1
- package/src/types.ts +3 -8
- package/src/utils.ts +0 -96
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { queryGenerator, suspenseQueryGenerator, infiniteQueryGenerator, mutationGenerator } from './chunk-
|
|
1
|
+
import { queryGenerator, suspenseQueryGenerator, infiniteQueryGenerator, mutationGenerator } from './chunk-G6I2OU3A.js';
|
|
2
2
|
import './chunk-ESENIDWJ.js';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { createPlugin, FileManager, PluginManager } from '@kubb/core';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-react-query",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.18",
|
|
4
4
|
"description": "Generator react-query hooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"faker",
|
|
@@ -62,27 +62,24 @@
|
|
|
62
62
|
"!/**/__tests__/**"
|
|
63
63
|
],
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@kubb/core": "3.0.0-alpha.
|
|
66
|
-
"@kubb/fs": "3.0.0-alpha.
|
|
67
|
-
"@kubb/oas": "3.0.0-alpha.
|
|
68
|
-
"@kubb/
|
|
69
|
-
"@kubb/plugin-
|
|
70
|
-
"@kubb/plugin-
|
|
71
|
-
"@kubb/
|
|
72
|
-
"@kubb/plugin-zod": "3.0.0-alpha.16",
|
|
73
|
-
"@kubb/react": "3.0.0-alpha.16"
|
|
65
|
+
"@kubb/core": "3.0.0-alpha.18",
|
|
66
|
+
"@kubb/fs": "3.0.0-alpha.18",
|
|
67
|
+
"@kubb/oas": "3.0.0-alpha.18",
|
|
68
|
+
"@kubb/plugin-oas": "3.0.0-alpha.18",
|
|
69
|
+
"@kubb/plugin-ts": "3.0.0-alpha.18",
|
|
70
|
+
"@kubb/plugin-zod": "3.0.0-alpha.18",
|
|
71
|
+
"@kubb/react": "3.0.0-alpha.18"
|
|
74
72
|
},
|
|
75
73
|
"devDependencies": {
|
|
76
74
|
"@types/react": "^18.3.5",
|
|
77
75
|
"react": "^18.3.1",
|
|
78
76
|
"tsup": "^8.2.4",
|
|
79
77
|
"typescript": "^5.6.2",
|
|
80
|
-
"@kubb/config-
|
|
81
|
-
"@kubb/config-
|
|
82
|
-
"@kubb/config-tsup": "3.0.0-alpha.16"
|
|
78
|
+
"@kubb/config-ts": "3.0.0-alpha.18",
|
|
79
|
+
"@kubb/config-tsup": "3.0.0-alpha.18"
|
|
83
80
|
},
|
|
84
81
|
"peerDependencies": {
|
|
85
|
-
"@kubb/react": "3.0.0-alpha.
|
|
82
|
+
"@kubb/react": "3.0.0-alpha.18"
|
|
86
83
|
},
|
|
87
84
|
"engines": {
|
|
88
85
|
"node": ">=20"
|
|
@@ -1,64 +1,50 @@
|
|
|
1
|
-
import client from
|
|
2
|
-
import type { RequestConfig, ResponseConfig } from
|
|
3
|
-
import type { QueryKey, QueryObserverOptions, UseQueryResult } from
|
|
4
|
-
import { useQuery, queryOptions } from
|
|
1
|
+
import client from "@kubb/plugin-client/client";
|
|
2
|
+
import type { RequestConfig, ResponseConfig } from "@kubb/plugin-client/client";
|
|
3
|
+
import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
|
|
4
|
+
import { useQuery, queryOptions } from "@tanstack/react-query";
|
|
5
5
|
|
|
6
|
-
export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url:
|
|
6
|
+
export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
|
|
7
7
|
|
|
8
|
-
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey
|
|
8
|
+
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>;
|
|
9
9
|
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
11
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* @link /pet/findByTags
|
|
14
14
|
*/
|
|
15
15
|
async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
url: `/pet/findByTags`,
|
|
19
|
-
params,
|
|
20
|
-
headers: { ...headers, ...config.headers },
|
|
21
|
-
...config,
|
|
22
|
-
})
|
|
23
|
-
return { ...res, data: findPetsByTagsQueryResponse.parse(res.data) }
|
|
16
|
+
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "get", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
|
|
17
|
+
return { ...res, data: findPetsByTagsQueryResponse.parse(res.data) };
|
|
24
18
|
}
|
|
25
19
|
|
|
26
|
-
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
21
|
+
const queryKey = findPetsByTagsQueryKey(params);
|
|
22
|
+
return queryOptions({
|
|
23
|
+
queryKey,
|
|
24
|
+
queryFn: async () => {
|
|
25
|
+
return findPetsByTags(headers, params, config);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
34
28
|
}
|
|
35
29
|
|
|
36
|
-
/**
|
|
30
|
+
/**
|
|
37
31
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
38
32
|
* @summary Finds Pets by tags
|
|
39
33
|
* @link /pet/findByTags
|
|
40
34
|
*/
|
|
41
|
-
export function useFindPetsByTags<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
57
|
-
queryKey,
|
|
58
|
-
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
59
|
-
}) as UseQueryResult<TData, FindPetsByTags400> & {
|
|
60
|
-
queryKey: TQueryKey
|
|
61
|
-
}
|
|
62
|
-
query.queryKey = queryKey as TQueryKey
|
|
63
|
-
return query
|
|
35
|
+
export function useFindPetsByTags<TData = ResponseConfig<FindPetsByTagsQueryResponse>, TQueryData = ResponseConfig<FindPetsByTagsQueryResponse>, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: {
|
|
36
|
+
query?: Partial<QueryObserverOptions<ResponseConfig<FindPetsByTagsQueryResponse>, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
|
|
37
|
+
client?: Partial<RequestConfig>;
|
|
38
|
+
} = {}) {
|
|
39
|
+
const { query: queryOptions, client: config = {} } = options ?? {};
|
|
40
|
+
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
|
|
41
|
+
const query = useQuery({
|
|
42
|
+
...findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions,
|
|
43
|
+
queryKey,
|
|
44
|
+
...queryOptions as unknown as Omit<QueryObserverOptions, "queryKey">
|
|
45
|
+
}) as UseQueryResult<TData, FindPetsByTags400> & {
|
|
46
|
+
queryKey: TQueryKey;
|
|
47
|
+
};
|
|
48
|
+
query.queryKey = queryKey as TQueryKey;
|
|
49
|
+
return query;
|
|
64
50
|
}
|
|
@@ -1,64 +1,50 @@
|
|
|
1
|
-
import client from
|
|
2
|
-
import type { QueryKey, QueryObserverOptions, UseQueryResult } from
|
|
3
|
-
import type { RequestConfig } from
|
|
4
|
-
import { useQuery, queryOptions } from
|
|
1
|
+
import client from "axios";
|
|
2
|
+
import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
|
|
3
|
+
import type { RequestConfig } from "axios";
|
|
4
|
+
import { useQuery, queryOptions } from "@tanstack/react-query";
|
|
5
5
|
|
|
6
|
-
export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url:
|
|
6
|
+
export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
|
|
7
7
|
|
|
8
|
-
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey
|
|
8
|
+
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>;
|
|
9
9
|
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
11
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* @link /pet/findByTags
|
|
14
14
|
*/
|
|
15
15
|
async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
url: `/pet/findByTags`,
|
|
19
|
-
params,
|
|
20
|
-
headers: { ...headers, ...config.headers },
|
|
21
|
-
...config,
|
|
22
|
-
})
|
|
23
|
-
return findPetsByTagsQueryResponse.parse(res.data)
|
|
16
|
+
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "get", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
|
|
17
|
+
return findPetsByTagsQueryResponse.parse(res.data);
|
|
24
18
|
}
|
|
25
19
|
|
|
26
|
-
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
21
|
+
const queryKey = findPetsByTagsQueryKey(params);
|
|
22
|
+
return queryOptions({
|
|
23
|
+
queryKey,
|
|
24
|
+
queryFn: async () => {
|
|
25
|
+
return findPetsByTags(headers, params, config);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
34
28
|
}
|
|
35
29
|
|
|
36
|
-
/**
|
|
30
|
+
/**
|
|
37
31
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
38
32
|
* @summary Finds Pets by tags
|
|
39
33
|
* @link /pet/findByTags
|
|
40
34
|
*/
|
|
41
|
-
export function useFindPetsByTags<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
57
|
-
queryKey,
|
|
58
|
-
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
59
|
-
}) as UseQueryResult<TData, FindPetsByTags400> & {
|
|
60
|
-
queryKey: TQueryKey
|
|
61
|
-
}
|
|
62
|
-
query.queryKey = queryKey as TQueryKey
|
|
63
|
-
return query
|
|
35
|
+
export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: {
|
|
36
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
|
|
37
|
+
client?: Partial<RequestConfig>;
|
|
38
|
+
} = {}) {
|
|
39
|
+
const { query: queryOptions, client: config = {} } = options ?? {};
|
|
40
|
+
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
|
|
41
|
+
const query = useQuery({
|
|
42
|
+
...findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions,
|
|
43
|
+
queryKey,
|
|
44
|
+
...queryOptions as unknown as Omit<QueryObserverOptions, "queryKey">
|
|
45
|
+
}) as UseQueryResult<TData, FindPetsByTags400> & {
|
|
46
|
+
queryKey: TQueryKey;
|
|
47
|
+
};
|
|
48
|
+
query.queryKey = queryKey as TQueryKey;
|
|
49
|
+
return query;
|
|
64
50
|
}
|
|
@@ -1,59 +1,38 @@
|
|
|
1
|
-
import client from
|
|
2
|
-
import type { UseMutationOptions } from
|
|
3
|
-
import type { RequestConfig } from
|
|
4
|
-
import { useMutation } from
|
|
1
|
+
import client from "axios";
|
|
2
|
+
import type { UseMutationOptions } from "@tanstack/react-query";
|
|
3
|
+
import type { RequestConfig } from "axios";
|
|
4
|
+
import { useMutation } from "@tanstack/react-query";
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
7
|
* @summary Updates a pet in the store with form data
|
|
8
8
|
* @link /pet/:petId
|
|
9
9
|
*/
|
|
10
|
-
async function updatePetWithForm(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
params?: UpdatePetWithFormQueryParams,
|
|
14
|
-
config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
|
|
15
|
-
) {
|
|
16
|
-
const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({
|
|
17
|
-
method: 'post',
|
|
18
|
-
url: `/pet/${petId}`,
|
|
19
|
-
params,
|
|
20
|
-
data,
|
|
21
|
-
...config,
|
|
22
|
-
})
|
|
23
|
-
return updatePetWithFormMutationResponse.parse(res.data)
|
|
10
|
+
async function updatePetWithForm(petId: UpdatePetWithFormPathParams["petId"], data?: UpdatePetWithFormMutationRequest, params?: UpdatePetWithFormQueryParams, config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {}) {
|
|
11
|
+
const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({ method: "post", url: `/pet/${petId}`, params, data, ...config });
|
|
12
|
+
return updatePetWithFormMutationResponse.parse(res.data);
|
|
24
13
|
}
|
|
25
14
|
|
|
26
|
-
/**
|
|
15
|
+
/**
|
|
27
16
|
* @summary Updates a pet in the store with form data
|
|
28
17
|
* @link /pet/:petId
|
|
29
18
|
*/
|
|
30
|
-
export function useUpdatePetWithForm(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
params,
|
|
50
|
-
}: {
|
|
51
|
-
petId: UpdatePetWithFormPathParams['petId']
|
|
52
|
-
data?: UpdatePetWithFormMutationRequest
|
|
53
|
-
params?: UpdatePetWithFormQueryParams
|
|
54
|
-
}) => {
|
|
55
|
-
return updatePetWithForm(petId, data, params, config)
|
|
56
|
-
},
|
|
57
|
-
...mutationOptions,
|
|
58
|
-
})
|
|
19
|
+
export function useUpdatePetWithForm(options: {
|
|
20
|
+
mutation?: UseMutationOptions<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, {
|
|
21
|
+
petId: UpdatePetWithFormPathParams["petId"];
|
|
22
|
+
data?: UpdatePetWithFormMutationRequest;
|
|
23
|
+
params?: UpdatePetWithFormQueryParams;
|
|
24
|
+
}>;
|
|
25
|
+
client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>;
|
|
26
|
+
} = {}) {
|
|
27
|
+
const { mutation: mutationOptions, client: config = {} } = options ?? {};
|
|
28
|
+
return useMutation({
|
|
29
|
+
mutationFn: async ({ petId, data, params }: {
|
|
30
|
+
petId: UpdatePetWithFormPathParams["petId"];
|
|
31
|
+
data?: UpdatePetWithFormMutationRequest;
|
|
32
|
+
params?: UpdatePetWithFormQueryParams;
|
|
33
|
+
}) => {
|
|
34
|
+
return updatePetWithForm(petId, data, params, config);
|
|
35
|
+
},
|
|
36
|
+
...mutationOptions
|
|
37
|
+
});
|
|
59
38
|
}
|
|
@@ -1,64 +1,50 @@
|
|
|
1
|
-
import client from
|
|
2
|
-
import type { RequestConfig } from
|
|
3
|
-
import type { QueryKey, QueryObserverOptions, UseQueryResult } from
|
|
4
|
-
import { useQuery, queryOptions } from
|
|
1
|
+
import client from "@kubb/plugin-client/client";
|
|
2
|
+
import type { RequestConfig } from "@kubb/plugin-client/client";
|
|
3
|
+
import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
|
|
4
|
+
import { useQuery, queryOptions } from "@tanstack/react-query";
|
|
5
5
|
|
|
6
|
-
export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url:
|
|
6
|
+
export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
|
|
7
7
|
|
|
8
|
-
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey
|
|
8
|
+
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>;
|
|
9
9
|
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
11
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* @link /pet/findByTags
|
|
14
14
|
*/
|
|
15
15
|
async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
url: `/pet/findByTags`,
|
|
19
|
-
params,
|
|
20
|
-
headers: { ...headers, ...config.headers },
|
|
21
|
-
...config,
|
|
22
|
-
})
|
|
23
|
-
return findPetsByTagsQueryResponse.parse(res.data)
|
|
16
|
+
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "get", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
|
|
17
|
+
return findPetsByTagsQueryResponse.parse(res.data);
|
|
24
18
|
}
|
|
25
19
|
|
|
26
|
-
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
21
|
+
const queryKey = findPetsByTagsQueryKey(params);
|
|
22
|
+
return queryOptions({
|
|
23
|
+
queryKey,
|
|
24
|
+
queryFn: async () => {
|
|
25
|
+
return findPetsByTags(headers, params, config);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
34
28
|
}
|
|
35
29
|
|
|
36
|
-
/**
|
|
30
|
+
/**
|
|
37
31
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
38
32
|
* @summary Finds Pets by tags
|
|
39
33
|
* @link /pet/findByTags
|
|
40
34
|
*/
|
|
41
|
-
export function useFindPetsByTags<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
57
|
-
queryKey,
|
|
58
|
-
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
59
|
-
}) as UseQueryResult<TData, FindPetsByTags400> & {
|
|
60
|
-
queryKey: TQueryKey
|
|
61
|
-
}
|
|
62
|
-
query.queryKey = queryKey as TQueryKey
|
|
63
|
-
return query
|
|
35
|
+
export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: {
|
|
36
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
|
|
37
|
+
client?: Partial<RequestConfig>;
|
|
38
|
+
} = {}) {
|
|
39
|
+
const { query: queryOptions, client: config = {} } = options ?? {};
|
|
40
|
+
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
|
|
41
|
+
const query = useQuery({
|
|
42
|
+
...findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions,
|
|
43
|
+
queryKey,
|
|
44
|
+
...queryOptions as unknown as Omit<QueryObserverOptions, "queryKey">
|
|
45
|
+
}) as UseQueryResult<TData, FindPetsByTags400> & {
|
|
46
|
+
queryKey: TQueryKey;
|
|
47
|
+
};
|
|
48
|
+
query.queryKey = queryKey as TQueryKey;
|
|
49
|
+
return query;
|
|
64
50
|
}
|
|
@@ -1,64 +1,50 @@
|
|
|
1
|
-
import client from
|
|
2
|
-
import type { RequestConfig } from
|
|
3
|
-
import type { QueryKey, QueryObserverOptions, UseQueryResult } from
|
|
4
|
-
import { useQuery, queryOptions } from
|
|
1
|
+
import client from "@kubb/plugin-client/client";
|
|
2
|
+
import type { RequestConfig } from "@kubb/plugin-client/client";
|
|
3
|
+
import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
|
|
4
|
+
import { useQuery, queryOptions } from "@tanstack/react-query";
|
|
5
5
|
|
|
6
|
-
export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url:
|
|
6
|
+
export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
|
|
7
7
|
|
|
8
|
-
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey
|
|
8
|
+
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>;
|
|
9
9
|
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
11
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* @link /pet/findByTags
|
|
14
14
|
*/
|
|
15
15
|
async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
url: `/pet/findByTags`,
|
|
19
|
-
params,
|
|
20
|
-
headers: { ...headers, ...config.headers },
|
|
21
|
-
...config,
|
|
22
|
-
})
|
|
23
|
-
return findPetsByTagsQueryResponse.parse(res.data)
|
|
16
|
+
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "get", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
|
|
17
|
+
return findPetsByTagsQueryResponse.parse(res.data);
|
|
24
18
|
}
|
|
25
19
|
|
|
26
|
-
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
21
|
+
const queryKey = findPetsByTagsQueryKey(params);
|
|
22
|
+
return queryOptions({
|
|
23
|
+
queryKey,
|
|
24
|
+
queryFn: async () => {
|
|
25
|
+
return findPetsByTags(headers, params, config);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
34
28
|
}
|
|
35
29
|
|
|
36
|
-
/**
|
|
30
|
+
/**
|
|
37
31
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
38
32
|
* @summary Finds Pets by tags
|
|
39
33
|
* @link /pet/findByTags
|
|
40
34
|
*/
|
|
41
|
-
export function useFindPetsByTags<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
57
|
-
queryKey,
|
|
58
|
-
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
59
|
-
}) as UseQueryResult<TData, FindPetsByTags400> & {
|
|
60
|
-
queryKey: TQueryKey
|
|
61
|
-
}
|
|
62
|
-
query.queryKey = queryKey as TQueryKey
|
|
63
|
-
return query
|
|
35
|
+
export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: {
|
|
36
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
|
|
37
|
+
client?: Partial<RequestConfig>;
|
|
38
|
+
} = {}) {
|
|
39
|
+
const { query: queryOptions, client: config = {} } = options ?? {};
|
|
40
|
+
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
|
|
41
|
+
const query = useQuery({
|
|
42
|
+
...findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions,
|
|
43
|
+
queryKey,
|
|
44
|
+
...queryOptions as unknown as Omit<QueryObserverOptions, "queryKey">
|
|
45
|
+
}) as UseQueryResult<TData, FindPetsByTags400> & {
|
|
46
|
+
queryKey: TQueryKey;
|
|
47
|
+
};
|
|
48
|
+
query.queryKey = queryKey as TQueryKey;
|
|
49
|
+
return query;
|
|
64
50
|
}
|
|
@@ -1,64 +1,50 @@
|
|
|
1
|
-
import client from
|
|
2
|
-
import type { RequestConfig } from
|
|
3
|
-
import type { QueryKey, QueryObserverOptions, UseQueryResult } from
|
|
4
|
-
import { useQuery, queryOptions } from
|
|
1
|
+
import client from "@kubb/plugin-client/client";
|
|
2
|
+
import type { RequestConfig } from "@kubb/plugin-client/client";
|
|
3
|
+
import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
|
|
4
|
+
import { useQuery, queryOptions } from "@tanstack/react-query";
|
|
5
5
|
|
|
6
|
-
export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [test, { url:
|
|
6
|
+
export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [test, { url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
|
|
7
7
|
|
|
8
|
-
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey
|
|
8
|
+
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>;
|
|
9
9
|
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
11
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
12
12
|
* @summary Finds Pets by tags
|
|
13
13
|
* @link /pet/findByTags
|
|
14
14
|
*/
|
|
15
15
|
async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
url: `/pet/findByTags`,
|
|
19
|
-
params,
|
|
20
|
-
headers: { ...headers, ...config.headers },
|
|
21
|
-
...config,
|
|
22
|
-
})
|
|
23
|
-
return findPetsByTagsQueryResponse.parse(res.data)
|
|
16
|
+
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "get", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
|
|
17
|
+
return findPetsByTagsQueryResponse.parse(res.data);
|
|
24
18
|
}
|
|
25
19
|
|
|
26
|
-
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
21
|
+
const queryKey = findPetsByTagsQueryKey(params);
|
|
22
|
+
return queryOptions({
|
|
23
|
+
queryKey,
|
|
24
|
+
queryFn: async () => {
|
|
25
|
+
return findPetsByTags(headers, params, config);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
34
28
|
}
|
|
35
29
|
|
|
36
|
-
/**
|
|
30
|
+
/**
|
|
37
31
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
38
32
|
* @summary Finds Pets by tags
|
|
39
33
|
* @link /pet/findByTags
|
|
40
34
|
*/
|
|
41
|
-
export function useFindPetsByTags<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
57
|
-
queryKey,
|
|
58
|
-
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
59
|
-
}) as UseQueryResult<TData, FindPetsByTags400> & {
|
|
60
|
-
queryKey: TQueryKey
|
|
61
|
-
}
|
|
62
|
-
query.queryKey = queryKey as TQueryKey
|
|
63
|
-
return query
|
|
35
|
+
export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: {
|
|
36
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
|
|
37
|
+
client?: Partial<RequestConfig>;
|
|
38
|
+
} = {}) {
|
|
39
|
+
const { query: queryOptions, client: config = {} } = options ?? {};
|
|
40
|
+
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
|
|
41
|
+
const query = useQuery({
|
|
42
|
+
...findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions,
|
|
43
|
+
queryKey,
|
|
44
|
+
...queryOptions as unknown as Omit<QueryObserverOptions, "queryKey">
|
|
45
|
+
}) as UseQueryResult<TData, FindPetsByTags400> & {
|
|
46
|
+
queryKey: TQueryKey;
|
|
47
|
+
};
|
|
48
|
+
query.queryKey = queryKey as TQueryKey;
|
|
49
|
+
return query;
|
|
64
50
|
}
|