@kubb/plugin-react-query 3.13.1 → 3.14.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.
Files changed (42) hide show
  1. package/LICENSE +1 -1
  2. package/dist/{chunk-NA52A7UO.js → chunk-CWZ3H3M4.js} +13 -13
  3. package/dist/chunk-CWZ3H3M4.js.map +1 -0
  4. package/dist/{chunk-V6YUKQOK.cjs → chunk-DCK6RDZF.cjs} +18 -18
  5. package/dist/{chunk-V6YUKQOK.cjs.map → chunk-DCK6RDZF.cjs.map} +1 -1
  6. package/dist/{chunk-Y4YHIO7Q.cjs → chunk-HXZAB52N.cjs} +13 -13
  7. package/dist/chunk-HXZAB52N.cjs.map +1 -0
  8. package/dist/{chunk-MUIA6FBY.js → chunk-ROPPXITS.js} +7 -7
  9. package/dist/{chunk-MUIA6FBY.js.map → chunk-ROPPXITS.js.map} +1 -1
  10. package/dist/components.cjs +9 -9
  11. package/dist/components.js +1 -1
  12. package/dist/generators.cjs +6 -6
  13. package/dist/generators.js +2 -2
  14. package/dist/index.cjs +5 -5
  15. package/dist/index.js +2 -2
  16. package/package.json +23 -21
  17. package/src/components/InfiniteQuery.tsx +2 -2
  18. package/src/components/InfiniteQueryOptions.tsx +4 -4
  19. package/src/components/Mutation.tsx +1 -1
  20. package/src/components/Query.tsx +2 -2
  21. package/src/components/QueryOptions.tsx +4 -4
  22. package/src/components/SuspenseQuery.tsx +2 -2
  23. package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +5 -5
  24. package/src/generators/__snapshots__/clientGetImportPath.ts +5 -5
  25. package/src/generators/__snapshots__/clientPostImportPath.ts +4 -4
  26. package/src/generators/__snapshots__/findByTags.ts +5 -5
  27. package/src/generators/__snapshots__/findByTagsObject.ts +5 -5
  28. package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +5 -5
  29. package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +5 -5
  30. package/src/generators/__snapshots__/findByTagsWithZod.ts +5 -5
  31. package/src/generators/__snapshots__/findInfiniteByTags.ts +5 -5
  32. package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +5 -5
  33. package/src/generators/__snapshots__/getPetIdCamelCase.ts +5 -5
  34. package/src/generators/__snapshots__/postAsQuery.ts +5 -5
  35. package/src/generators/__snapshots__/updatePetById.ts +4 -4
  36. package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +4 -4
  37. package/src/generators/infiniteQueryGenerator.tsx +1 -1
  38. package/src/generators/mutationGenerator.tsx +1 -1
  39. package/src/generators/queryGenerator.tsx +1 -1
  40. package/src/generators/suspenseQueryGenerator.tsx +1 -1
  41. package/dist/chunk-NA52A7UO.js.map +0 -1
  42. package/dist/chunk-Y4YHIO7Q.cjs.map +0 -1
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from 'axios'
5
+ import fetch from 'axios'
6
6
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
7
7
  import type { RequestConfig, ResponseErrorConfig } from 'axios'
8
8
  import { queryOptions, useQuery } from '@tanstack/react-query'
@@ -19,9 +19,9 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
19
19
  export async function findPetsByTags(
20
20
  headers: FindPetsByTagsHeaderParams,
21
21
  params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: typeof client } = {},
22
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
23
23
  ) {
24
- const { client: request = client, ...requestConfig } = config
24
+ const { client: request = fetch, ...requestConfig } = config
25
25
 
26
26
  const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
27
  method: 'GET',
@@ -36,7 +36,7 @@ export async function findPetsByTags(
36
36
  export function findPetsByTagsQueryOptions(
37
37
  headers: FindPetsByTagsHeaderParams,
38
38
  params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: typeof client } = {},
39
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
40
40
  ) {
41
41
  const queryKey = findPetsByTagsQueryKey(params)
42
42
  return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
@@ -64,7 +64,7 @@ export function useFindPetsByTags<
64
64
  query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
65
65
  client?: QueryClient
66
66
  }
67
- client?: Partial<RequestConfig> & { client?: typeof client }
67
+ client?: Partial<RequestConfig> & { client?: typeof fetch }
68
68
  } = {},
69
69
  ) {
70
70
  const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from 'axios'
5
+ import fetch from 'axios'
6
6
  import type { UseMutationOptions, QueryClient } from '@tanstack/react-query'
7
7
  import type { RequestConfig, ResponseErrorConfig } from 'axios'
8
8
  import { useMutation } from '@tanstack/react-query'
@@ -19,9 +19,9 @@ export async function updatePetWithForm(
19
19
  petId: UpdatePetWithFormPathParams['petId'],
20
20
  data?: UpdatePetWithFormMutationRequest,
21
21
  params?: UpdatePetWithFormQueryParams,
22
- config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client } = {},
22
+ config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof fetch } = {},
23
23
  ) {
24
- const { client: request = client, ...requestConfig } = config
24
+ const { client: request = fetch, ...requestConfig } = config
25
25
 
26
26
  const requestData = updatePetWithFormMutationRequest.parse(data)
27
27
  const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
@@ -46,7 +46,7 @@ export function useUpdatePetWithForm<TContext>(
46
46
  { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
47
47
  TContext
48
48
  > & { client?: QueryClient }
49
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client }
49
+ client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof fetch }
50
50
  } = {},
51
51
  ) {
52
52
  const { mutation = {}, client: config = {} } = options ?? {}
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from '@kubb/plugin-client/clients/axios'
5
+ import fetch from '@kubb/plugin-client/clients/axios'
6
6
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
7
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
8
8
  import { queryOptions, useQuery } from '@tanstack/react-query'
@@ -19,9 +19,9 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
19
19
  export async function findPetsByTags(
20
20
  headers: FindPetsByTagsHeaderParams,
21
21
  params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: typeof client } = {},
22
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
23
23
  ) {
24
- const { client: request = client, ...requestConfig } = config
24
+ const { client: request = fetch, ...requestConfig } = config
25
25
 
26
26
  const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
27
  method: 'GET',
@@ -36,7 +36,7 @@ export async function findPetsByTags(
36
36
  export function findPetsByTagsQueryOptions(
37
37
  headers: FindPetsByTagsHeaderParams,
38
38
  params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: typeof client } = {},
39
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
40
40
  ) {
41
41
  const queryKey = findPetsByTagsQueryKey(params)
42
42
  return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
@@ -64,7 +64,7 @@ export function useFindPetsByTags<
64
64
  query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
65
65
  client?: QueryClient
66
66
  }
67
- client?: Partial<RequestConfig> & { client?: typeof client }
67
+ client?: Partial<RequestConfig> & { client?: typeof fetch }
68
68
  } = {},
69
69
  ) {
70
70
  const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from '@kubb/plugin-client/clients/axios'
5
+ import fetch from '@kubb/plugin-client/clients/axios'
6
6
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
7
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
8
8
  import { queryOptions, useQuery } from '@tanstack/react-query'
@@ -18,9 +18,9 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
18
18
  */
19
19
  export async function findPetsByTags(
20
20
  { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
21
- config: Partial<RequestConfig> & { client?: typeof client } = {},
21
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
22
22
  ) {
23
- const { client: request = client, ...requestConfig } = config
23
+ const { client: request = fetch, ...requestConfig } = config
24
24
 
25
25
  const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
26
26
  method: 'GET',
@@ -34,7 +34,7 @@ export async function findPetsByTags(
34
34
 
35
35
  export function findPetsByTagsQueryOptions(
36
36
  { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
37
- config: Partial<RequestConfig> & { client?: typeof client } = {},
37
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
38
38
  ) {
39
39
  const queryKey = findPetsByTagsQueryKey(params)
40
40
  return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
@@ -61,7 +61,7 @@ export function useFindPetsByTags<
61
61
  query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
62
62
  client?: QueryClient
63
63
  }
64
- client?: Partial<RequestConfig> & { client?: typeof client }
64
+ client?: Partial<RequestConfig> & { client?: typeof fetch }
65
65
  } = {},
66
66
  ) {
67
67
  const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from '@kubb/plugin-client/clients/axios'
5
+ import fetch from '@kubb/plugin-client/clients/axios'
6
6
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
7
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
8
8
  import { queryOptions, useQuery } from '@tanstack/react-query'
@@ -19,9 +19,9 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
19
19
  export async function findPetsByTags(
20
20
  headers: FindPetsByTagsHeaderParams,
21
21
  params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: typeof client } = {},
22
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
23
23
  ) {
24
- const { client: request = client, ...requestConfig } = config
24
+ const { client: request = fetch, ...requestConfig } = config
25
25
 
26
26
  const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
27
  method: 'GET',
@@ -36,7 +36,7 @@ export async function findPetsByTags(
36
36
  export function findPetsByTagsQueryOptions(
37
37
  headers: FindPetsByTagsHeaderParams,
38
38
  params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: typeof client } = {},
39
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
40
40
  ) {
41
41
  const queryKey = findPetsByTagsQueryKey(params)
42
42
  return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
@@ -64,7 +64,7 @@ export function useFindPetsByTags<
64
64
  query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
65
65
  client?: QueryClient
66
66
  }
67
- client?: Partial<RequestConfig> & { client?: typeof client }
67
+ client?: Partial<RequestConfig> & { client?: typeof fetch }
68
68
  } = {},
69
69
  ) {
70
70
  const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from '@kubb/plugin-client/clients/axios'
5
+ import fetch from '@kubb/plugin-client/clients/axios'
6
6
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
7
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
8
8
  import { queryOptions, useQuery } from '@tanstack/react-query'
@@ -19,9 +19,9 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
19
19
  export async function findPetsByTags(
20
20
  headers: FindPetsByTagsHeaderParams,
21
21
  params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: typeof client } = {},
22
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
23
23
  ) {
24
- const { client: request = client, ...requestConfig } = config
24
+ const { client: request = fetch, ...requestConfig } = config
25
25
 
26
26
  const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
27
  method: 'GET',
@@ -36,7 +36,7 @@ export async function findPetsByTags(
36
36
  export function findPetsByTagsQueryOptions(
37
37
  headers: FindPetsByTagsHeaderParams,
38
38
  params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: typeof client } = {},
39
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
40
40
  ) {
41
41
  const queryKey = findPetsByTagsQueryKey(params)
42
42
  return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
@@ -64,7 +64,7 @@ export function useFindPetsByTags<
64
64
  query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
65
65
  client?: QueryClient
66
66
  }
67
- client?: Partial<RequestConfig> & { client?: typeof client }
67
+ client?: Partial<RequestConfig> & { client?: typeof fetch }
68
68
  } = {},
69
69
  ) {
70
70
  const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from '@kubb/plugin-client/clients/axios'
5
+ import fetch from '@kubb/plugin-client/clients/axios'
6
6
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
7
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
8
8
  import { queryOptions, useQuery } from '@tanstack/react-query'
@@ -19,9 +19,9 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
19
19
  export async function findPetsByTags(
20
20
  headers: FindPetsByTagsHeaderParams,
21
21
  params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: typeof client } = {},
22
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
23
23
  ) {
24
- const { client: request = client, ...requestConfig } = config
24
+ const { client: request = fetch, ...requestConfig } = config
25
25
 
26
26
  const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
27
  method: 'GET',
@@ -36,7 +36,7 @@ export async function findPetsByTags(
36
36
  export function findPetsByTagsQueryOptions(
37
37
  headers: FindPetsByTagsHeaderParams,
38
38
  params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: typeof client } = {},
39
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
40
40
  ) {
41
41
  const queryKey = findPetsByTagsQueryKey(params)
42
42
  return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
@@ -64,7 +64,7 @@ export function useFindPetsByTags<
64
64
  query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
65
65
  client?: QueryClient
66
66
  }
67
- client?: Partial<RequestConfig> & { client?: typeof client }
67
+ client?: Partial<RequestConfig> & { client?: typeof fetch }
68
68
  } = {},
69
69
  ) {
70
70
  const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from '@kubb/plugin-client/clients/axios'
5
+ import fetch from '@kubb/plugin-client/clients/axios'
6
6
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
7
  import type { InfiniteData, QueryKey, QueryClient, InfiniteQueryObserverOptions, UseInfiniteQueryResult } from '@tanstack/react-query'
8
8
  import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query'
@@ -19,9 +19,9 @@ export type FindPetsByTagsInfiniteQueryKey = ReturnType<typeof findPetsByTagsInf
19
19
  export async function findPetsByTagsInfinite(
20
20
  headers: FindPetsByTagsHeaderParams,
21
21
  params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: typeof client } = {},
22
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
23
23
  ) {
24
- const { client: request = client, ...requestConfig } = config
24
+ const { client: request = fetch, ...requestConfig } = config
25
25
 
26
26
  const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
27
  method: 'GET',
@@ -36,7 +36,7 @@ export async function findPetsByTagsInfinite(
36
36
  export function findPetsByTagsInfiniteQueryOptions(
37
37
  headers: FindPetsByTagsHeaderParams,
38
38
  params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: typeof client } = {},
39
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
40
40
  ) {
41
41
  const queryKey = findPetsByTagsInfiniteQueryKey(params)
42
42
  return infiniteQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey, number>({
@@ -71,7 +71,7 @@ export function useFindPetsByTagsInfinite<
71
71
  query?: Partial<InfiniteQueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryKey>> & {
72
72
  client?: QueryClient
73
73
  }
74
- client?: Partial<RequestConfig> & { client?: typeof client }
74
+ client?: Partial<RequestConfig> & { client?: typeof fetch }
75
75
  } = {},
76
76
  ) {
77
77
  const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from '@kubb/plugin-client/clients/axios'
5
+ import fetch from '@kubb/plugin-client/clients/axios'
6
6
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
7
  import type { InfiniteData, QueryKey, QueryClient, InfiniteQueryObserverOptions, UseInfiniteQueryResult } from '@tanstack/react-query'
8
8
  import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query'
@@ -19,9 +19,9 @@ export type FindPetsByTagsInfiniteQueryKey = ReturnType<typeof findPetsByTagsInf
19
19
  export async function findPetsByTagsInfinite(
20
20
  headers: FindPetsByTagsHeaderParams,
21
21
  params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: typeof client } = {},
22
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
23
23
  ) {
24
- const { client: request = client, ...requestConfig } = config
24
+ const { client: request = fetch, ...requestConfig } = config
25
25
 
26
26
  const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
27
  method: 'GET',
@@ -36,7 +36,7 @@ export async function findPetsByTagsInfinite(
36
36
  export function findPetsByTagsInfiniteQueryOptions(
37
37
  headers: FindPetsByTagsHeaderParams,
38
38
  params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: typeof client } = {},
39
+ config: Partial<RequestConfig> & { client?: typeof fetch } = {},
40
40
  ) {
41
41
  const queryKey = findPetsByTagsInfiniteQueryKey(params)
42
42
  return infiniteQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey, number>({
@@ -71,7 +71,7 @@ export function useFindPetsByTagsInfinite<
71
71
  query?: Partial<InfiniteQueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryKey>> & {
72
72
  client?: QueryClient
73
73
  }
74
- client?: Partial<RequestConfig> & { client?: typeof client }
74
+ client?: Partial<RequestConfig> & { client?: typeof fetch }
75
75
  } = {},
76
76
  ) {
77
77
  const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from '@kubb/plugin-client/clients/axios'
5
+ import fetch from '@kubb/plugin-client/clients/axios'
6
6
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
7
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
8
8
  import { queryOptions, useQuery } from '@tanstack/react-query'
@@ -16,8 +16,8 @@ export type GetPetByIdQueryKey = ReturnType<typeof getPetByIdQueryKey>
16
16
  * @summary Find pet by ID
17
17
  * {@link /pet/:pet_id}
18
18
  */
19
- export async function getPetById(petId: GetPetByIdPathParams['pet_id'], config: Partial<RequestConfig> & { client?: typeof client } = {}) {
20
- const { client: request = client, ...requestConfig } = config
19
+ export async function getPetById(petId: GetPetByIdPathParams['pet_id'], config: Partial<RequestConfig> & { client?: typeof fetch } = {}) {
20
+ const { client: request = fetch, ...requestConfig } = config
21
21
 
22
22
  const res = await request<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, unknown>({
23
23
  method: 'GET',
@@ -27,7 +27,7 @@ export async function getPetById(petId: GetPetByIdPathParams['pet_id'], config:
27
27
  return getPetByIdQueryResponse.parse(res.data)
28
28
  }
29
29
 
30
- export function getPetByIdQueryOptions(petId: GetPetByIdPathParams['pet_id'], config: Partial<RequestConfig> & { client?: typeof client } = {}) {
30
+ export function getPetByIdQueryOptions(petId: GetPetByIdPathParams['pet_id'], config: Partial<RequestConfig> & { client?: typeof fetch } = {}) {
31
31
  const queryKey = getPetByIdQueryKey(petId)
32
32
  return queryOptions<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, GetPetByIdQueryResponse, typeof queryKey>({
33
33
  enabled: !!petId,
@@ -50,7 +50,7 @@ export function useGetPetById<TData = GetPetByIdQueryResponse, TQueryData = GetP
50
50
  query?: Partial<QueryObserverOptions<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, TData, TQueryData, TQueryKey>> & {
51
51
  client?: QueryClient
52
52
  }
53
- client?: Partial<RequestConfig> & { client?: typeof client }
53
+ client?: Partial<RequestConfig> & { client?: typeof fetch }
54
54
  } = {},
55
55
  ) {
56
56
  const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from '@kubb/plugin-client/clients/axios'
5
+ import fetch from '@kubb/plugin-client/clients/axios'
6
6
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
7
  import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryResult } from 'custom-query'
8
8
  import { queryOptions, useQuery } from 'custom-query'
@@ -23,9 +23,9 @@ export async function updatePetWithForm(
23
23
  petId: UpdatePetWithFormPathParams['petId'],
24
24
  data?: UpdatePetWithFormMutationRequest,
25
25
  params?: UpdatePetWithFormQueryParams,
26
- config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client } = {},
26
+ config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof fetch } = {},
27
27
  ) {
28
- const { client: request = client, ...requestConfig } = config
28
+ const { client: request = fetch, ...requestConfig } = config
29
29
 
30
30
  const requestData = updatePetWithFormMutationRequest.parse(data)
31
31
  const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
@@ -42,7 +42,7 @@ export function updatePetWithFormQueryOptions(
42
42
  petId: UpdatePetWithFormPathParams['petId'],
43
43
  data?: UpdatePetWithFormMutationRequest,
44
44
  params?: UpdatePetWithFormQueryParams,
45
- config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client } = {},
45
+ config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof fetch } = {},
46
46
  ) {
47
47
  const queryKey = updatePetWithFormQueryKey(petId, data, params)
48
48
  return queryOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationResponse, typeof queryKey>({
@@ -71,7 +71,7 @@ export function useUpdatePetWithForm<
71
71
  query?: Partial<QueryObserverOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, TData, TQueryData, TQueryKey>> & {
72
72
  client?: QueryClient
73
73
  }
74
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client }
74
+ client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof fetch }
75
75
  } = {},
76
76
  ) {
77
77
  const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from '@kubb/plugin-client/clients/axios'
5
+ import fetch from '@kubb/plugin-client/clients/axios'
6
6
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
7
  import type { UseMutationOptions, QueryClient } from '@tanstack/react-query'
8
8
  import { useMutation } from '@tanstack/react-query'
@@ -19,9 +19,9 @@ export async function updatePetWithForm(
19
19
  petId: UpdatePetWithFormPathParams['petId'],
20
20
  data?: UpdatePetWithFormMutationRequest,
21
21
  params?: UpdatePetWithFormQueryParams,
22
- config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client } = {},
22
+ config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof fetch } = {},
23
23
  ) {
24
- const { client: request = client, ...requestConfig } = config
24
+ const { client: request = fetch, ...requestConfig } = config
25
25
 
26
26
  const requestData = updatePetWithFormMutationRequest.parse(data)
27
27
  const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
@@ -46,7 +46,7 @@ export function useUpdatePetWithForm<TContext>(
46
46
  { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
47
47
  TContext
48
48
  > & { client?: QueryClient }
49
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client }
49
+ client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof fetch }
50
50
  } = {},
51
51
  ) {
52
52
  const { mutation = {}, client: config = {} } = options ?? {}
@@ -2,7 +2,7 @@
2
2
  * Generated by Kubb (https://kubb.dev/).
3
3
  * Do not edit manually.
4
4
  */
5
- import client from '@kubb/plugin-client/clients/axios'
5
+ import fetch from '@kubb/plugin-client/clients/axios'
6
6
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
7
  import type { UseMutationOptions, QueryClient } from '@tanstack/react-query'
8
8
  import { useMutation } from '@tanstack/react-query'
@@ -19,9 +19,9 @@ export async function updatePetWithForm(
19
19
  { petId }: { petId: UpdatePetWithFormPathParams['petId'] },
20
20
  data?: UpdatePetWithFormMutationRequest,
21
21
  params?: UpdatePetWithFormQueryParams,
22
- config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client } = {},
22
+ config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof fetch } = {},
23
23
  ) {
24
- const { client: request = client, ...requestConfig } = config
24
+ const { client: request = fetch, ...requestConfig } = config
25
25
 
26
26
  const requestData = updatePetWithFormMutationRequest.parse(data)
27
27
  const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
@@ -46,7 +46,7 @@ export function useUpdatePetWithForm<TContext>(
46
46
  { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
47
47
  TContext
48
48
  > & { client?: QueryClient }
49
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client }
49
+ client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof fetch }
50
50
  } = {},
51
51
  ) {
52
52
  const { mutation = {}, client: config = {} } = options ?? {}
@@ -85,7 +85,7 @@ export const infiniteQueryGenerator = createReactGenerator<PluginReactQuery>({
85
85
  {options.parser === 'zod' && (
86
86
  <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />
87
87
  )}
88
- {<File.Import name={'client'} path={options.client.importPath} />}
88
+ {<File.Import name={'fetch'} path={options.client.importPath} />}
89
89
  {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}
90
90
  <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
91
91
  {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}
@@ -79,7 +79,7 @@ export const mutationGenerator = createReactGenerator<PluginReactQuery>({
79
79
  {options.parser === 'zod' && (
80
80
  <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={mutation.file.path} path={zod.file.path} />
81
81
  )}
82
- <File.Import name={'client'} path={options.client.importPath} />
82
+ <File.Import name={'fetch'} path={options.client.importPath} />
83
83
  {!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}
84
84
  <File.Import name={['RequestConfig', 'ResponseConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
85
85
  <File.Import
@@ -84,7 +84,7 @@ export const queryGenerator = createReactGenerator<PluginReactQuery>({
84
84
  {options.parser === 'zod' && (
85
85
  <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />
86
86
  )}
87
- <File.Import name={'client'} path={options.client.importPath} />
87
+ <File.Import name={'fetch'} path={options.client.importPath} />
88
88
  {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}
89
89
  <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
90
90
  {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}
@@ -86,7 +86,7 @@ export const suspenseQueryGenerator = createReactGenerator<PluginReactQuery>({
86
86
  {options.parser === 'zod' && (
87
87
  <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />
88
88
  )}
89
- <File.Import name={'client'} path={options.client.importPath} />
89
+ <File.Import name={'fetch'} path={options.client.importPath} />
90
90
  {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}
91
91
  <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
92
92
  {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}