@kubb/plugin-vue-query 3.2.0 → 3.3.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.
@@ -1,53 +1,72 @@
1
- import client from "@kubb/plugin-client/client";
2
- import type { RequestConfig } from "@kubb/plugin-client/client";
3
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from "@tanstack/react-query";
4
- import type { MaybeRef } from "vue";
5
- import { queryOptions, useQuery } from "@tanstack/react-query";
6
- import { unref } from "vue";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
4
+ import type { MaybeRef } from 'vue'
5
+ import { queryOptions, useQuery } from '@tanstack/react-query'
6
+ import { unref } from 'vue'
7
7
 
8
- export const findPetsByTagsQueryKey = (params?: MaybeRef<FindPetsByTagsQueryParams>) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
8
+ export const findPetsByTagsQueryKey = (params?: MaybeRef<FindPetsByTagsQueryParams>) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
9
9
 
10
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>;
10
+ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
11
11
 
12
- /**
12
+ /**
13
13
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
14
14
  * @summary Finds Pets by tags
15
15
  * {@link /pet/findByTags}
16
16
  */
17
17
  async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
18
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "GET", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
19
- return findPetsByTagsQueryResponse.parse(res.data);
18
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
19
+ method: 'GET',
20
+ url: `/pet/findByTags`,
21
+ params,
22
+ headers: { ...headers, ...config.headers },
23
+ ...config,
24
+ })
25
+ return findPetsByTagsQueryResponse.parse(res.data)
20
26
  }
21
27
 
22
- export function findPetsByTagsQueryOptions(headers: MaybeRef<FindPetsByTagsQueryParams>, params?: MaybeRef<FindPetsByTagsQueryParams>, config: Partial<RequestConfig> = {}) {
23
- const queryKey = findPetsByTagsQueryKey(params);
24
- return queryOptions({
25
- queryKey,
26
- queryFn: async ({ signal }) => {
27
- config.signal = signal;
28
- return findPetsByTags(unref(headers), unref(params), unref(config));
29
- },
30
- });
28
+ export function findPetsByTagsQueryOptions(
29
+ headers: MaybeRef<FindPetsByTagsQueryParams>,
30
+ params?: MaybeRef<FindPetsByTagsQueryParams>,
31
+ config: Partial<RequestConfig> = {},
32
+ ) {
33
+ const queryKey = findPetsByTagsQueryKey(params)
34
+ return queryOptions({
35
+ queryKey,
36
+ queryFn: async ({ signal }) => {
37
+ config.signal = signal
38
+ return findPetsByTags(unref(headers), unref(params), unref(config))
39
+ },
40
+ })
31
41
  }
32
42
 
33
- /**
43
+ /**
34
44
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
35
45
  * @summary Finds Pets by tags
36
46
  * {@link /pet/findByTags}
37
47
  */
38
- export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: MaybeRef<FindPetsByTagsHeaderParams>, params?: MaybeRef<FindPetsByTagsQueryParams>, options: {
39
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
40
- client?: Partial<RequestConfig>;
41
- } = {}) {
42
- const { query: queryOptions, client: config = {} } = options ?? {};
43
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
44
- const query = useQuery({
45
- ...findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions,
46
- queryKey: queryKey as QueryKey,
47
- ...queryOptions as unknown as Omit<QueryObserverOptions, "queryKey">
48
- }) as UseQueryReturnType<TData, FindPetsByTags400> & {
49
- queryKey: TQueryKey;
50
- };
51
- query.queryKey = queryKey as TQueryKey;
52
- return query;
48
+ export function useFindPetsByTags<
49
+ TData = FindPetsByTagsQueryResponse,
50
+ TQueryData = FindPetsByTagsQueryResponse,
51
+ TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
52
+ >(
53
+ headers: MaybeRef<FindPetsByTagsHeaderParams>,
54
+ params?: MaybeRef<FindPetsByTagsQueryParams>,
55
+ options: {
56
+ query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
57
+ client?: Partial<RequestConfig>
58
+ } = {},
59
+ ) {
60
+ const { query: queryOptions, client: config = {} } = options ?? {}
61
+ const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
62
+
63
+ const query = useQuery({
64
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
65
+ queryKey: queryKey as QueryKey,
66
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
67
+ }) as UseQueryReturnType<TData, FindPetsByTags400> & { queryKey: TQueryKey }
68
+
69
+ query.queryKey = queryKey as TQueryKey
70
+
71
+ return query
53
72
  }
@@ -1,62 +1,73 @@
1
- import client from "@kubb/plugin-client/client";
2
- import type { RequestConfig } from "@kubb/plugin-client/client";
3
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from "@tanstack/react-query";
4
- import type { MaybeRef } from "vue";
5
- import { queryOptions, useQuery } from "@tanstack/react-query";
6
- import { unref } from "vue";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
4
+ import type { MaybeRef } from 'vue'
5
+ import { queryOptions, useQuery } from '@tanstack/react-query'
6
+ import { unref } from 'vue'
7
7
 
8
- export const findPetsByTagsQueryKey = (params?: MaybeRef<FindPetsByTagsQueryParams>) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
8
+ export const findPetsByTagsQueryKey = (params?: MaybeRef<FindPetsByTagsQueryParams>) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
9
9
 
10
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>;
10
+ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
11
11
 
12
- /**
12
+ /**
13
13
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
14
14
  * @summary Finds Pets by tags
15
15
  * {@link /pet/findByTags}
16
16
  */
17
- async function findPetsByTags({ headers, params }: {
18
- headers: FindPetsByTagsHeaderParams;
19
- params?: FindPetsByTagsQueryParams;
20
- }, config: Partial<RequestConfig> = {}) {
21
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "GET", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
22
- return findPetsByTagsQueryResponse.parse(res.data);
17
+ async function findPetsByTags(
18
+ { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
19
+ config: Partial<RequestConfig> = {},
20
+ ) {
21
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
22
+ method: 'GET',
23
+ url: `/pet/findByTags`,
24
+ params,
25
+ headers: { ...headers, ...config.headers },
26
+ ...config,
27
+ })
28
+ return findPetsByTagsQueryResponse.parse(res.data)
23
29
  }
24
30
 
25
- export function findPetsByTagsQueryOptions({ headers, params }: {
26
- headers: MaybeRef<FindPetsByTagsQueryParams>;
27
- params?: MaybeRef<FindPetsByTagsQueryParams>;
28
- }, config: Partial<RequestConfig> = {}) {
29
- const queryKey = findPetsByTagsQueryKey(params);
30
- return queryOptions({
31
- queryKey,
32
- queryFn: async ({ signal }) => {
33
- config.signal = signal;
34
- return findPetsByTags(unref({ headers: unref(headers), params: unref(params) }), unref(config));
35
- },
36
- });
31
+ export function findPetsByTagsQueryOptions(
32
+ { headers, params }: { headers: MaybeRef<FindPetsByTagsQueryParams>; params?: MaybeRef<FindPetsByTagsQueryParams> },
33
+ config: Partial<RequestConfig> = {},
34
+ ) {
35
+ const queryKey = findPetsByTagsQueryKey(params)
36
+ return queryOptions({
37
+ queryKey,
38
+ queryFn: async ({ signal }) => {
39
+ config.signal = signal
40
+ return findPetsByTags(unref({ headers: unref(headers), params: unref(params) }), unref(config))
41
+ },
42
+ })
37
43
  }
38
44
 
39
- /**
45
+ /**
40
46
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
41
47
  * @summary Finds Pets by tags
42
48
  * {@link /pet/findByTags}
43
49
  */
44
- export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>({ headers, params }: {
45
- headers: MaybeRef<FindPetsByTagsHeaderParams>;
46
- params?: MaybeRef<FindPetsByTagsQueryParams>;
47
- }, options: {
48
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
49
- client?: Partial<RequestConfig>;
50
- } = {}) {
51
- const { query: queryOptions, client: config = {} } = options ?? {};
52
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
53
- const query = useQuery({
54
- ...findPetsByTagsQueryOptions({ headers, params }, config) as unknown as QueryObserverOptions,
55
- queryKey: queryKey as QueryKey,
56
- ...queryOptions as unknown as Omit<QueryObserverOptions, "queryKey">
57
- }) as UseQueryReturnType<TData, FindPetsByTags400> & {
58
- queryKey: TQueryKey;
59
- };
60
- query.queryKey = queryKey as TQueryKey;
61
- return query;
50
+ export function useFindPetsByTags<
51
+ TData = FindPetsByTagsQueryResponse,
52
+ TQueryData = FindPetsByTagsQueryResponse,
53
+ TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
54
+ >(
55
+ { headers, params }: { headers: MaybeRef<FindPetsByTagsHeaderParams>; params?: MaybeRef<FindPetsByTagsQueryParams> },
56
+ options: {
57
+ query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
58
+ client?: Partial<RequestConfig>
59
+ } = {},
60
+ ) {
61
+ const { query: queryOptions, client: config = {} } = options ?? {}
62
+ const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
63
+
64
+ const query = useQuery({
65
+ ...(findPetsByTagsQueryOptions({ headers, params }, config) as unknown as QueryObserverOptions),
66
+ queryKey: queryKey as QueryKey,
67
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
68
+ }) as UseQueryReturnType<TData, FindPetsByTags400> & { queryKey: TQueryKey }
69
+
70
+ query.queryKey = queryKey as TQueryKey
71
+
72
+ return query
62
73
  }
@@ -1,53 +1,72 @@
1
- import client from "@kubb/plugin-client/client";
2
- import type { RequestConfig } from "@kubb/plugin-client/client";
3
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from "@tanstack/react-query";
4
- import type { MaybeRef } from "vue";
5
- import { queryOptions, useQuery } from "@tanstack/react-query";
6
- import { unref } from "vue";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
4
+ import type { MaybeRef } from 'vue'
5
+ import { queryOptions, useQuery } from '@tanstack/react-query'
6
+ import { unref } from 'vue'
7
7
 
8
- export const findPetsByTagsQueryKey = (params?: MaybeRef<FindPetsByTagsQueryParams>) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
8
+ export const findPetsByTagsQueryKey = (params?: MaybeRef<FindPetsByTagsQueryParams>) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
9
9
 
10
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>;
10
+ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
11
11
 
12
- /**
12
+ /**
13
13
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
14
14
  * @summary Finds Pets by tags
15
15
  * {@link /pet/findByTags}
16
16
  */
17
17
  async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
18
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "GET", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
19
- return findPetsByTagsQueryResponse.parse(res.data);
18
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
19
+ method: 'GET',
20
+ url: `/pet/findByTags`,
21
+ params,
22
+ headers: { ...headers, ...config.headers },
23
+ ...config,
24
+ })
25
+ return findPetsByTagsQueryResponse.parse(res.data)
20
26
  }
21
27
 
22
- export function findPetsByTagsQueryOptions(headers: MaybeRef<FindPetsByTagsQueryParams>, params?: MaybeRef<FindPetsByTagsQueryParams>, config: Partial<RequestConfig> = {}) {
23
- const queryKey = findPetsByTagsQueryKey(params);
24
- return queryOptions({
25
- queryKey,
26
- queryFn: async ({ signal }) => {
27
- config.signal = signal;
28
- return findPetsByTags(unref(headers), unref(params), unref(config));
29
- },
30
- });
28
+ export function findPetsByTagsQueryOptions(
29
+ headers: MaybeRef<FindPetsByTagsQueryParams>,
30
+ params?: MaybeRef<FindPetsByTagsQueryParams>,
31
+ config: Partial<RequestConfig> = {},
32
+ ) {
33
+ const queryKey = findPetsByTagsQueryKey(params)
34
+ return queryOptions({
35
+ queryKey,
36
+ queryFn: async ({ signal }) => {
37
+ config.signal = signal
38
+ return findPetsByTags(unref(headers), unref(params), unref(config))
39
+ },
40
+ })
31
41
  }
32
42
 
33
- /**
43
+ /**
34
44
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
35
45
  * @summary Finds Pets by tags
36
46
  * {@link /pet/findByTags}
37
47
  */
38
- export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: MaybeRef<FindPetsByTagsHeaderParams>, params?: MaybeRef<FindPetsByTagsQueryParams>, options: {
39
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
40
- client?: Partial<RequestConfig>;
41
- } = {}) {
42
- const { query: queryOptions, client: config = {} } = options ?? {};
43
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
44
- const query = useQuery({
45
- ...findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions,
46
- queryKey: queryKey as QueryKey,
47
- ...queryOptions as unknown as Omit<QueryObserverOptions, "queryKey">
48
- }) as UseQueryReturnType<TData, FindPetsByTags400> & {
49
- queryKey: TQueryKey;
50
- };
51
- query.queryKey = queryKey as TQueryKey;
52
- return query;
48
+ export function useFindPetsByTags<
49
+ TData = FindPetsByTagsQueryResponse,
50
+ TQueryData = FindPetsByTagsQueryResponse,
51
+ TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
52
+ >(
53
+ headers: MaybeRef<FindPetsByTagsHeaderParams>,
54
+ params?: MaybeRef<FindPetsByTagsQueryParams>,
55
+ options: {
56
+ query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
57
+ client?: Partial<RequestConfig>
58
+ } = {},
59
+ ) {
60
+ const { query: queryOptions, client: config = {} } = options ?? {}
61
+ const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
62
+
63
+ const query = useQuery({
64
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
65
+ queryKey: queryKey as QueryKey,
66
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
67
+ }) as UseQueryReturnType<TData, FindPetsByTags400> & { queryKey: TQueryKey }
68
+
69
+ query.queryKey = queryKey as TQueryKey
70
+
71
+ return query
53
72
  }
@@ -1,53 +1,73 @@
1
- import client from "@kubb/plugin-client/client";
2
- import type { RequestConfig } from "@kubb/plugin-client/client";
3
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from "@tanstack/react-query";
4
- import type { MaybeRef } from "vue";
5
- import { queryOptions, useQuery } from "@tanstack/react-query";
6
- import { unref } from "vue";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
4
+ import type { MaybeRef } from 'vue'
5
+ import { queryOptions, useQuery } from '@tanstack/react-query'
6
+ import { unref } from 'vue'
7
7
 
8
- export const findPetsByTagsQueryKey = (params?: MaybeRef<FindPetsByTagsQueryParams>) => ["test", { url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
8
+ export const findPetsByTagsQueryKey = (params?: MaybeRef<FindPetsByTagsQueryParams>) =>
9
+ ['test', { url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
9
10
 
10
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>;
11
+ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
11
12
 
12
- /**
13
+ /**
13
14
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
14
15
  * @summary Finds Pets by tags
15
16
  * {@link /pet/findByTags}
16
17
  */
17
18
  async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
18
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "GET", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
19
- return findPetsByTagsQueryResponse.parse(res.data);
19
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
20
+ method: 'GET',
21
+ url: `/pet/findByTags`,
22
+ params,
23
+ headers: { ...headers, ...config.headers },
24
+ ...config,
25
+ })
26
+ return findPetsByTagsQueryResponse.parse(res.data)
20
27
  }
21
28
 
22
- export function findPetsByTagsQueryOptions(headers: MaybeRef<FindPetsByTagsQueryParams>, params?: MaybeRef<FindPetsByTagsQueryParams>, config: Partial<RequestConfig> = {}) {
23
- const queryKey = findPetsByTagsQueryKey(params);
24
- return queryOptions({
25
- queryKey,
26
- queryFn: async ({ signal }) => {
27
- config.signal = signal;
28
- return findPetsByTags(unref(headers), unref(params), unref(config));
29
- },
30
- });
29
+ export function findPetsByTagsQueryOptions(
30
+ headers: MaybeRef<FindPetsByTagsQueryParams>,
31
+ params?: MaybeRef<FindPetsByTagsQueryParams>,
32
+ config: Partial<RequestConfig> = {},
33
+ ) {
34
+ const queryKey = findPetsByTagsQueryKey(params)
35
+ return queryOptions({
36
+ queryKey,
37
+ queryFn: async ({ signal }) => {
38
+ config.signal = signal
39
+ return findPetsByTags(unref(headers), unref(params), unref(config))
40
+ },
41
+ })
31
42
  }
32
43
 
33
- /**
44
+ /**
34
45
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
35
46
  * @summary Finds Pets by tags
36
47
  * {@link /pet/findByTags}
37
48
  */
38
- export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: MaybeRef<FindPetsByTagsHeaderParams>, params?: MaybeRef<FindPetsByTagsQueryParams>, options: {
39
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
40
- client?: Partial<RequestConfig>;
41
- } = {}) {
42
- const { query: queryOptions, client: config = {} } = options ?? {};
43
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
44
- const query = useQuery({
45
- ...findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions,
46
- queryKey: queryKey as QueryKey,
47
- ...queryOptions as unknown as Omit<QueryObserverOptions, "queryKey">
48
- }) as UseQueryReturnType<TData, FindPetsByTags400> & {
49
- queryKey: TQueryKey;
50
- };
51
- query.queryKey = queryKey as TQueryKey;
52
- return query;
49
+ export function useFindPetsByTags<
50
+ TData = FindPetsByTagsQueryResponse,
51
+ TQueryData = FindPetsByTagsQueryResponse,
52
+ TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
53
+ >(
54
+ headers: MaybeRef<FindPetsByTagsHeaderParams>,
55
+ params?: MaybeRef<FindPetsByTagsQueryParams>,
56
+ options: {
57
+ query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
58
+ client?: Partial<RequestConfig>
59
+ } = {},
60
+ ) {
61
+ const { query: queryOptions, client: config = {} } = options ?? {}
62
+ const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
63
+
64
+ const query = useQuery({
65
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
66
+ queryKey: queryKey as QueryKey,
67
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
68
+ }) as UseQueryReturnType<TData, FindPetsByTags400> & { queryKey: TQueryKey }
69
+
70
+ query.queryKey = queryKey as TQueryKey
71
+
72
+ return query
53
73
  }
@@ -1,53 +1,72 @@
1
- import client from "@kubb/plugin-client/client";
2
- import type { RequestConfig } from "@kubb/plugin-client/client";
3
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from "@tanstack/react-query";
4
- import type { MaybeRef } from "vue";
5
- import { queryOptions, useQuery } from "@tanstack/react-query";
6
- import { unref } from "vue";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
4
+ import type { MaybeRef } from 'vue'
5
+ import { queryOptions, useQuery } from '@tanstack/react-query'
6
+ import { unref } from 'vue'
7
7
 
8
- export const findPetsByTagsQueryKey = (params?: MaybeRef<FindPetsByTagsQueryParams>) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
8
+ export const findPetsByTagsQueryKey = (params?: MaybeRef<FindPetsByTagsQueryParams>) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
9
9
 
10
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>;
10
+ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
11
11
 
12
- /**
12
+ /**
13
13
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
14
14
  * @summary Finds Pets by tags
15
15
  * {@link /pet/findByTags}
16
16
  */
17
17
  async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
18
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "GET", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
19
- return findPetsByTagsQueryResponse.parse(res.data);
18
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
19
+ method: 'GET',
20
+ url: `/pet/findByTags`,
21
+ params,
22
+ headers: { ...headers, ...config.headers },
23
+ ...config,
24
+ })
25
+ return findPetsByTagsQueryResponse.parse(res.data)
20
26
  }
21
27
 
22
- export function findPetsByTagsQueryOptions(headers: MaybeRef<FindPetsByTagsQueryParams>, params?: MaybeRef<FindPetsByTagsQueryParams>, config: Partial<RequestConfig> = {}) {
23
- const queryKey = findPetsByTagsQueryKey(params);
24
- return queryOptions({
25
- queryKey,
26
- queryFn: async ({ signal }) => {
27
- config.signal = signal;
28
- return findPetsByTags(unref(headers), unref(params), unref(config));
29
- },
30
- });
28
+ export function findPetsByTagsQueryOptions(
29
+ headers: MaybeRef<FindPetsByTagsQueryParams>,
30
+ params?: MaybeRef<FindPetsByTagsQueryParams>,
31
+ config: Partial<RequestConfig> = {},
32
+ ) {
33
+ const queryKey = findPetsByTagsQueryKey(params)
34
+ return queryOptions({
35
+ queryKey,
36
+ queryFn: async ({ signal }) => {
37
+ config.signal = signal
38
+ return findPetsByTags(unref(headers), unref(params), unref(config))
39
+ },
40
+ })
31
41
  }
32
42
 
33
- /**
43
+ /**
34
44
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
35
45
  * @summary Finds Pets by tags
36
46
  * {@link /pet/findByTags}
37
47
  */
38
- export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: MaybeRef<FindPetsByTagsHeaderParams>, params?: MaybeRef<FindPetsByTagsQueryParams>, options: {
39
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
40
- client?: Partial<RequestConfig>;
41
- } = {}) {
42
- const { query: queryOptions, client: config = {} } = options ?? {};
43
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
44
- const query = useQuery({
45
- ...findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions,
46
- queryKey: queryKey as QueryKey,
47
- ...queryOptions as unknown as Omit<QueryObserverOptions, "queryKey">
48
- }) as UseQueryReturnType<TData, FindPetsByTags400> & {
49
- queryKey: TQueryKey;
50
- };
51
- query.queryKey = queryKey as TQueryKey;
52
- return query;
48
+ export function useFindPetsByTags<
49
+ TData = FindPetsByTagsQueryResponse,
50
+ TQueryData = FindPetsByTagsQueryResponse,
51
+ TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
52
+ >(
53
+ headers: MaybeRef<FindPetsByTagsHeaderParams>,
54
+ params?: MaybeRef<FindPetsByTagsQueryParams>,
55
+ options: {
56
+ query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
57
+ client?: Partial<RequestConfig>
58
+ } = {},
59
+ ) {
60
+ const { query: queryOptions, client: config = {} } = options ?? {}
61
+ const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
62
+
63
+ const query = useQuery({
64
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
65
+ queryKey: queryKey as QueryKey,
66
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
67
+ }) as UseQueryReturnType<TData, FindPetsByTags400> & { queryKey: TQueryKey }
68
+
69
+ query.queryKey = queryKey as TQueryKey
70
+
71
+ return query
53
72
  }