@kubb/plugin-react-query 4.29.1 → 4.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/{SuspenseQuery-BFn3x1kP.js → SuspenseQuery-BJRjCVPn.js} +26 -26
  2. package/dist/SuspenseQuery-BJRjCVPn.js.map +1 -0
  3. package/dist/{SuspenseQuery-Dqr3APYf.cjs → SuspenseQuery-BS2DyU8v.cjs} +26 -26
  4. package/dist/SuspenseQuery-BS2DyU8v.cjs.map +1 -0
  5. package/dist/components.cjs +1 -1
  6. package/dist/components.js +1 -1
  7. package/dist/generators.cjs +1 -1
  8. package/dist/generators.js +1 -1
  9. package/dist/index.cjs +2 -2
  10. package/dist/index.js +2 -2
  11. package/dist/{suspenseQueryGenerator-BjEGcQcE.js → suspenseQueryGenerator-X-e7npGw.js} +12 -12
  12. package/dist/suspenseQueryGenerator-X-e7npGw.js.map +1 -0
  13. package/dist/{suspenseQueryGenerator-CHrwd9jE.cjs → suspenseQueryGenerator-kZuBiph0.cjs} +12 -12
  14. package/dist/suspenseQueryGenerator-kZuBiph0.cjs.map +1 -0
  15. package/package.json +11 -10
  16. package/src/components/InfiniteQueryOptions.tsx +20 -10
  17. package/src/components/QueryOptions.tsx +9 -4
  18. package/src/components/SuspenseInfiniteQueryOptions.tsx +21 -11
  19. package/src/generators/infiniteQueryGenerator.tsx +4 -2
  20. package/src/generators/mutationGenerator.tsx +4 -2
  21. package/src/generators/queryGenerator.tsx +4 -2
  22. package/src/generators/suspenseInfiniteQueryGenerator.tsx +4 -2
  23. package/src/generators/suspenseQueryGenerator.tsx +4 -2
  24. package/dist/SuspenseQuery-BFn3x1kP.js.map +0 -1
  25. package/dist/SuspenseQuery-Dqr3APYf.cjs.map +0 -1
  26. package/dist/suspenseQueryGenerator-BjEGcQcE.js.map +0 -1
  27. package/dist/suspenseQueryGenerator-CHrwd9jE.cjs.map +0 -1
  28. package/dist/types-BvXj6Cu5.d.ts +0 -204
  29. package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +0 -93
  30. package/src/generators/__snapshots__/clientGetImportPath.ts +0 -88
  31. package/src/generators/__snapshots__/clientPostImportPath.ts +0 -99
  32. package/src/generators/__snapshots__/createUsersWithListInput.ts +0 -83
  33. package/src/generators/__snapshots__/createUsersWithListInputAsQuery.ts +0 -87
  34. package/src/generators/__snapshots__/findByStatusAllOptional.ts +0 -81
  35. package/src/generators/__snapshots__/findByStatusAllOptionalInline.ts +0 -78
  36. package/src/generators/__snapshots__/findByTags.ts +0 -88
  37. package/src/generators/__snapshots__/findByTagsObject.ts +0 -85
  38. package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +0 -88
  39. package/src/generators/__snapshots__/findByTagsTemplateString.ts +0 -89
  40. package/src/generators/__snapshots__/findByTagsWithCustomOptions.ts +0 -91
  41. package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +0 -88
  42. package/src/generators/__snapshots__/findByTagsWithZod.ts +0 -88
  43. package/src/generators/__snapshots__/findInfiniteByStatusAllOptional.ts +0 -99
  44. package/src/generators/__snapshots__/findInfiniteByTags.ts +0 -102
  45. package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +0 -102
  46. package/src/generators/__snapshots__/findInfiniteByTagsNextAndPreviousParam.ts +0 -102
  47. package/src/generators/__snapshots__/findInfiniteByTagsNextParam.ts +0 -101
  48. package/src/generators/__snapshots__/findInfiniteByTagsWithCustomOptions.ts +0 -105
  49. package/src/generators/__snapshots__/findSuspenseByStatusAllOptional.ts +0 -81
  50. package/src/generators/__snapshots__/findSuspenseByTags.ts +0 -82
  51. package/src/generators/__snapshots__/findSuspenseByTagsWithCustomOptions.ts +0 -85
  52. package/src/generators/__snapshots__/findSuspenseInfiniteByStatusAllOptional.ts +0 -99
  53. package/src/generators/__snapshots__/findSuspenseInfiniteByTags.ts +0 -103
  54. package/src/generators/__snapshots__/findSuspenseInfiniteByTagsCursor.ts +0 -103
  55. package/src/generators/__snapshots__/findSuspenseInfiniteByTagsWithCustomOptions.ts +0 -106
  56. package/src/generators/__snapshots__/getAsMutation.ts +0 -31
  57. package/src/generators/__snapshots__/getPetIdCamelCase.ts +0 -76
  58. package/src/generators/__snapshots__/postAsQuery.ts +0 -96
  59. package/src/generators/__snapshots__/requiredOneOfRequestBody.ts +0 -94
  60. package/src/generators/__snapshots__/requiredOneOfRequestBodyWithClientPlugin.ts +0 -71
  61. package/src/generators/__snapshots__/updatePetById.ts +0 -99
  62. package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +0 -99
  63. package/src/generators/__snapshots__/updatePetByIdWithCustomOptions.ts +0 -107
@@ -1,88 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import type { Client, RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
6
- import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
7
- import { fetch } from './test/.kubb/fetch'
8
- import { queryOptions, useQuery } from '@tanstack/react-query'
9
-
10
- export const findPetsByTagsQueryKey = (params: FindPetsByTagsQueryParams = {}) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- headers: FindPetsByTagsHeaderParams,
21
- params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: Client } = {},
23
- ) {
24
- const { client: request = fetch, ...requestConfig } = config
25
-
26
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
- method: 'GET',
28
- url: `/pet/findByTags`,
29
- params,
30
- ...requestConfig,
31
- headers: { ...headers, ...requestConfig.headers },
32
- })
33
- return findPetsByTagsQueryResponse.parse(res.data)
34
- }
35
-
36
- export function findPetsByTagsQueryOptions(
37
- headers: FindPetsByTagsHeaderParams,
38
- params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: Client } = {},
40
- ) {
41
- const queryKey = findPetsByTagsQueryKey(params)
42
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
43
- queryKey,
44
- queryFn: async ({ signal }) => {
45
- if (!config.signal) {
46
- config.signal = signal
47
- }
48
- return findPetsByTags(headers, params, config)
49
- },
50
- })
51
- }
52
-
53
- /**
54
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
55
- * @summary Finds Pets by tags
56
- * {@link /pet/findByTags}
57
- */
58
- export function useFindPetsByTags<
59
- TData = FindPetsByTagsQueryResponse,
60
- TQueryData = FindPetsByTagsQueryResponse,
61
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
62
- >(
63
- headers: FindPetsByTagsHeaderParams,
64
- params?: FindPetsByTagsQueryParams,
65
- options: {
66
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
67
- client?: QueryClient
68
- }
69
- client?: Partial<RequestConfig> & { client?: Client }
70
- } = {},
71
- ) {
72
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
73
- const { client: queryClient, ...queryOptions } = queryConfig
74
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
75
-
76
- const query = useQuery(
77
- {
78
- ...findPetsByTagsQueryOptions(headers, params, config),
79
- queryKey,
80
- ...queryOptions,
81
- } as unknown as QueryObserverOptions,
82
- queryClient,
83
- ) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
84
-
85
- query.queryKey = queryKey as TQueryKey
86
-
87
- return query
88
- }
@@ -1,85 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import type { Client, RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
6
- import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
7
- import { fetch } from './test/.kubb/fetch'
8
- import { queryOptions, useQuery } from '@tanstack/react-query'
9
-
10
- export const findPetsByTagsQueryKey = (params: FindPetsByTagsQueryParams = {}) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
21
- config: Partial<RequestConfig> & { client?: Client } = {},
22
- ) {
23
- const { client: request = fetch, ...requestConfig } = config
24
-
25
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
26
- method: 'GET',
27
- url: `/pet/findByTags`,
28
- params,
29
- ...requestConfig,
30
- headers: { ...headers, ...requestConfig.headers },
31
- })
32
- return findPetsByTagsQueryResponse.parse(res.data)
33
- }
34
-
35
- export function findPetsByTagsQueryOptions(
36
- { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
37
- config: Partial<RequestConfig> & { client?: Client } = {},
38
- ) {
39
- const queryKey = findPetsByTagsQueryKey(params)
40
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
41
- queryKey,
42
- queryFn: async ({ signal }) => {
43
- if (!config.signal) {
44
- config.signal = signal
45
- }
46
- return findPetsByTags({ headers, params }, config)
47
- },
48
- })
49
- }
50
-
51
- /**
52
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
53
- * @summary Finds Pets by tags
54
- * {@link /pet/findByTags}
55
- */
56
- export function useFindPetsByTags<
57
- TData = FindPetsByTagsQueryResponse,
58
- TQueryData = FindPetsByTagsQueryResponse,
59
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
60
- >(
61
- { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
62
- options: {
63
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
64
- client?: QueryClient
65
- }
66
- client?: Partial<RequestConfig> & { client?: Client }
67
- } = {},
68
- ) {
69
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
70
- const { client: queryClient, ...queryOptions } = queryConfig
71
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
72
-
73
- const query = useQuery(
74
- {
75
- ...findPetsByTagsQueryOptions({ headers, params }, config),
76
- queryKey,
77
- ...queryOptions,
78
- } as unknown as QueryObserverOptions,
79
- queryClient,
80
- ) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
81
-
82
- query.queryKey = queryKey as TQueryKey
83
-
84
- return query
85
- }
@@ -1,88 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import type { Client, RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
6
- import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
7
- import { fetch } from './test/.kubb/fetch'
8
- import { queryOptions, useQuery } from '@tanstack/react-query'
9
-
10
- export const findPetsByTagsQueryKey = (params: FindPetsByTagsQueryParams = {}) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- headers: FindPetsByTagsHeaderParams,
21
- params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: Client } = {},
23
- ) {
24
- const { client: request = fetch, ...requestConfig } = config
25
-
26
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
- method: 'GET',
28
- url: `/pet/findByTags`,
29
- params,
30
- ...requestConfig,
31
- headers: { ...headers, ...requestConfig.headers },
32
- })
33
- return findPetsByTagsQueryResponse.parse(res.data)
34
- }
35
-
36
- export function findPetsByTagsQueryOptions(
37
- headers: FindPetsByTagsHeaderParams,
38
- params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: Client } = {},
40
- ) {
41
- const queryKey = findPetsByTagsQueryKey(params)
42
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
43
- queryKey,
44
- queryFn: async ({ signal }) => {
45
- if (!config.signal) {
46
- config.signal = signal
47
- }
48
- return findPetsByTags(headers, params, config)
49
- },
50
- })
51
- }
52
-
53
- /**
54
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
55
- * @summary Finds Pets by tags
56
- * {@link /pet/findByTags}
57
- */
58
- export function useFindPetsByTags<
59
- TData = FindPetsByTagsQueryResponse,
60
- TQueryData = FindPetsByTagsQueryResponse,
61
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
62
- >(
63
- headers: FindPetsByTagsHeaderParams,
64
- params?: FindPetsByTagsQueryParams,
65
- options: {
66
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
67
- client?: QueryClient
68
- }
69
- client?: Partial<RequestConfig> & { client?: Client }
70
- } = {},
71
- ) {
72
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
73
- const { client: queryClient, ...queryOptions } = queryConfig
74
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
75
-
76
- const query = useQuery(
77
- {
78
- ...findPetsByTagsQueryOptions(headers, params, config),
79
- queryKey,
80
- ...queryOptions,
81
- } as unknown as QueryObserverOptions,
82
- queryClient,
83
- ) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
84
-
85
- query.queryKey = queryKey as TQueryKey
86
-
87
- return query
88
- }
@@ -1,89 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import type { Client, RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
6
- import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
7
- import { fetch } from './test/.kubb/fetch'
8
- import { queryOptions, useQuery } from '@tanstack/react-query'
9
-
10
- export const findPetsByTagsQueryKey = (params: FindPetsByTagsQueryParams = {}) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- headers: FindPetsByTagsHeaderParams,
21
- params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: Client } = {},
23
- ) {
24
- const { client: request = fetch, ...requestConfig } = config
25
-
26
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
- method: 'GET',
28
- url: `/pet/findByTags`,
29
- baseURL: `${123456}`,
30
- params,
31
- ...requestConfig,
32
- headers: { ...headers, ...requestConfig.headers },
33
- })
34
- return findPetsByTagsQueryResponse.parse(res.data)
35
- }
36
-
37
- export function findPetsByTagsQueryOptions(
38
- headers: FindPetsByTagsHeaderParams,
39
- params?: FindPetsByTagsQueryParams,
40
- config: Partial<RequestConfig> & { client?: Client } = {},
41
- ) {
42
- const queryKey = findPetsByTagsQueryKey(params)
43
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
44
- queryKey,
45
- queryFn: async ({ signal }) => {
46
- if (!config.signal) {
47
- config.signal = signal
48
- }
49
- return findPetsByTags(headers, params, config)
50
- },
51
- })
52
- }
53
-
54
- /**
55
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
56
- * @summary Finds Pets by tags
57
- * {@link /pet/findByTags}
58
- */
59
- export function useFindPetsByTags<
60
- TData = FindPetsByTagsQueryResponse,
61
- TQueryData = FindPetsByTagsQueryResponse,
62
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
63
- >(
64
- headers: FindPetsByTagsHeaderParams,
65
- params?: FindPetsByTagsQueryParams,
66
- options: {
67
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
68
- client?: QueryClient
69
- }
70
- client?: Partial<RequestConfig> & { client?: Client }
71
- } = {},
72
- ) {
73
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
74
- const { client: queryClient, ...queryOptions } = queryConfig
75
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
76
-
77
- const query = useQuery(
78
- {
79
- ...findPetsByTagsQueryOptions(headers, params, config),
80
- queryKey,
81
- ...queryOptions,
82
- } as unknown as QueryObserverOptions,
83
- queryClient,
84
- ) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
85
-
86
- query.queryKey = queryKey as TQueryKey
87
-
88
- return query
89
- }
@@ -1,91 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import type { Client, RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
6
- import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
7
- import { fetch } from './test/.kubb/fetch'
8
- import { queryOptions, useQuery } from '@tanstack/react-query'
9
- import { useCustomHookOptions } from 'useCustomHookOptions.ts'
10
-
11
- export const findPetsByTagsQueryKey = (params: FindPetsByTagsQueryParams = {}) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
12
-
13
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
14
-
15
- /**
16
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
17
- * @summary Finds Pets by tags
18
- * {@link /pet/findByTags}
19
- */
20
- export async function findPetsByTags(
21
- headers: FindPetsByTagsHeaderParams,
22
- params?: FindPetsByTagsQueryParams,
23
- config: Partial<RequestConfig> & { client?: Client } = {},
24
- ) {
25
- const { client: request = fetch, ...requestConfig } = config
26
-
27
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
28
- method: 'GET',
29
- url: `/pet/findByTags`,
30
- params,
31
- ...requestConfig,
32
- headers: { ...headers, ...requestConfig.headers },
33
- })
34
- return findPetsByTagsQueryResponse.parse(res.data)
35
- }
36
-
37
- export function findPetsByTagsQueryOptions(
38
- headers: FindPetsByTagsHeaderParams,
39
- params?: FindPetsByTagsQueryParams,
40
- config: Partial<RequestConfig> & { client?: Client } = {},
41
- ) {
42
- const queryKey = findPetsByTagsQueryKey(params)
43
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
44
- queryKey,
45
- queryFn: async ({ signal }) => {
46
- if (!config.signal) {
47
- config.signal = signal
48
- }
49
- return findPetsByTags(headers, params, config)
50
- },
51
- })
52
- }
53
-
54
- /**
55
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
56
- * @summary Finds Pets by tags
57
- * {@link /pet/findByTags}
58
- */
59
- export function useFindPetsByTags<
60
- TData = FindPetsByTagsQueryResponse,
61
- TQueryData = FindPetsByTagsQueryResponse,
62
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
63
- >(
64
- headers: FindPetsByTagsHeaderParams,
65
- params?: FindPetsByTagsQueryParams,
66
- options: {
67
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
68
- client?: QueryClient
69
- }
70
- client?: Partial<RequestConfig> & { client?: Client }
71
- } = {},
72
- ) {
73
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
74
- const { client: queryClient, ...queryOptions } = queryConfig
75
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
76
- const customOptions = useCustomHookOptions({ hookName: 'useFindPetsByTags', operationId: 'findPetsByTags' })
77
-
78
- const query = useQuery(
79
- {
80
- ...findPetsByTagsQueryOptions(headers, params, config),
81
- ...customOptions,
82
- queryKey,
83
- ...queryOptions,
84
- } as unknown as QueryObserverOptions,
85
- queryClient,
86
- ) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
87
-
88
- query.queryKey = queryKey as TQueryKey
89
-
90
- return query
91
- }
@@ -1,88 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import type { Client, RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
6
- import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
7
- import { fetch } from './test/.kubb/fetch'
8
- import { queryOptions, useQuery } from '@tanstack/react-query'
9
-
10
- export const findPetsByTagsQueryKey = (params: FindPetsByTagsQueryParams = {}) => ['test', { url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- headers: FindPetsByTagsHeaderParams,
21
- params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: Client } = {},
23
- ) {
24
- const { client: request = fetch, ...requestConfig } = config
25
-
26
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
- method: 'GET',
28
- url: `/pet/findByTags`,
29
- params,
30
- ...requestConfig,
31
- headers: { ...headers, ...requestConfig.headers },
32
- })
33
- return findPetsByTagsQueryResponse.parse(res.data)
34
- }
35
-
36
- export function findPetsByTagsQueryOptions(
37
- headers: FindPetsByTagsHeaderParams,
38
- params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: Client } = {},
40
- ) {
41
- const queryKey = findPetsByTagsQueryKey(params)
42
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
43
- queryKey,
44
- queryFn: async ({ signal }) => {
45
- if (!config.signal) {
46
- config.signal = signal
47
- }
48
- return findPetsByTags(headers, params, config)
49
- },
50
- })
51
- }
52
-
53
- /**
54
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
55
- * @summary Finds Pets by tags
56
- * {@link /pet/findByTags}
57
- */
58
- export function useFindPetsByTags<
59
- TData = FindPetsByTagsQueryResponse,
60
- TQueryData = FindPetsByTagsQueryResponse,
61
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
62
- >(
63
- headers: FindPetsByTagsHeaderParams,
64
- params?: FindPetsByTagsQueryParams,
65
- options: {
66
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
67
- client?: QueryClient
68
- }
69
- client?: Partial<RequestConfig> & { client?: Client }
70
- } = {},
71
- ) {
72
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
73
- const { client: queryClient, ...queryOptions } = queryConfig
74
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
75
-
76
- const query = useQuery(
77
- {
78
- ...findPetsByTagsQueryOptions(headers, params, config),
79
- queryKey,
80
- ...queryOptions,
81
- } as unknown as QueryObserverOptions,
82
- queryClient,
83
- ) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
84
-
85
- query.queryKey = queryKey as TQueryKey
86
-
87
- return query
88
- }
@@ -1,88 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import type { Client, RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
6
- import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
7
- import { fetch } from './test/.kubb/fetch'
8
- import { queryOptions, useQuery } from '@tanstack/react-query'
9
-
10
- export const findPetsByTagsQueryKey = (params: FindPetsByTagsQueryParams = {}) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- headers: FindPetsByTagsHeaderParams,
21
- params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: Client } = {},
23
- ) {
24
- const { client: request = fetch, ...requestConfig } = config
25
-
26
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
- method: 'GET',
28
- url: `/pet/findByTags`,
29
- params,
30
- ...requestConfig,
31
- headers: { ...headers, ...requestConfig.headers },
32
- })
33
- return findPetsByTagsQueryResponse.parse(res.data)
34
- }
35
-
36
- export function findPetsByTagsQueryOptions(
37
- headers: FindPetsByTagsHeaderParams,
38
- params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: Client } = {},
40
- ) {
41
- const queryKey = findPetsByTagsQueryKey(params)
42
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
43
- queryKey,
44
- queryFn: async ({ signal }) => {
45
- if (!config.signal) {
46
- config.signal = signal
47
- }
48
- return findPetsByTags(headers, params, config)
49
- },
50
- })
51
- }
52
-
53
- /**
54
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
55
- * @summary Finds Pets by tags
56
- * {@link /pet/findByTags}
57
- */
58
- export function useFindPetsByTags<
59
- TData = FindPetsByTagsQueryResponse,
60
- TQueryData = FindPetsByTagsQueryResponse,
61
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
62
- >(
63
- headers: FindPetsByTagsHeaderParams,
64
- params?: FindPetsByTagsQueryParams,
65
- options: {
66
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
67
- client?: QueryClient
68
- }
69
- client?: Partial<RequestConfig> & { client?: Client }
70
- } = {},
71
- ) {
72
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
73
- const { client: queryClient, ...queryOptions } = queryConfig
74
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
75
-
76
- const query = useQuery(
77
- {
78
- ...findPetsByTagsQueryOptions(headers, params, config),
79
- queryKey,
80
- ...queryOptions,
81
- } as unknown as QueryObserverOptions,
82
- queryClient,
83
- ) as UseQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
84
-
85
- query.queryKey = queryKey as TQueryKey
86
-
87
- return query
88
- }