@kubb/plugin-svelte-query 0.0.0-canary-20241213202051 → 0.0.0-canary-20241213215524

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-svelte-query",
3
- "version": "0.0.0-canary-20241213202051",
3
+ "version": "0.0.0-canary-20241213215524",
4
4
  "description": "Generator svelte-query hooks",
5
5
  "keywords": [
6
6
  "faker",
@@ -63,24 +63,24 @@
63
63
  ],
64
64
  "dependencies": {
65
65
  "remeda": "^2.17.4",
66
- "@kubb/core": "0.0.0-canary-20241213202051",
67
- "@kubb/fs": "0.0.0-canary-20241213202051",
68
- "@kubb/oas": "0.0.0-canary-20241213202051",
69
- "@kubb/plugin-oas": "0.0.0-canary-20241213202051",
70
- "@kubb/plugin-ts": "0.0.0-canary-20241213202051",
71
- "@kubb/plugin-zod": "0.0.0-canary-20241213202051",
72
- "@kubb/react": "0.0.0-canary-20241213202051"
66
+ "@kubb/core": "0.0.0-canary-20241213215524",
67
+ "@kubb/fs": "0.0.0-canary-20241213215524",
68
+ "@kubb/oas": "0.0.0-canary-20241213215524",
69
+ "@kubb/plugin-oas": "0.0.0-canary-20241213215524",
70
+ "@kubb/plugin-ts": "0.0.0-canary-20241213215524",
71
+ "@kubb/plugin-zod": "0.0.0-canary-20241213215524",
72
+ "@kubb/react": "0.0.0-canary-20241213215524"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@types/react": "^18.3.16",
76
76
  "react": "^18.3.1",
77
77
  "tsup": "^8.3.5",
78
78
  "typescript": "^5.7.2",
79
- "@kubb/config-ts": "0.0.0-canary-20241213202051",
80
- "@kubb/config-tsup": "0.0.0-canary-20241213202051"
79
+ "@kubb/config-ts": "0.0.0-canary-20241213215524",
80
+ "@kubb/config-tsup": "0.0.0-canary-20241213215524"
81
81
  },
82
82
  "peerDependencies": {
83
- "@kubb/react": "0.0.0-canary-20241213202051"
83
+ "@kubb/react": "0.0.0-canary-20241213215524"
84
84
  },
85
85
  "engines": {
86
86
  "node": ">=20"
@@ -1,51 +1,66 @@
1
- import client from "@kubb/plugin-client/clients/axios";
2
- import type { RequestConfig, ResponseConfig } from "@kubb/plugin-client/clients/axios";
3
- import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from "@tanstack/svelte-query";
4
- import { queryOptions, createQuery } from "@tanstack/svelte-query";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig, ResponseConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
4
+ import { queryOptions, createQuery } from '@tanstack/svelte-query'
5
5
 
6
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
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
- 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) };
16
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
17
+ method: 'GET',
18
+ url: `/pet/findByTags`,
19
+ params,
20
+ headers: { ...headers, ...config.headers },
21
+ ...config,
22
+ })
23
+ return { ...res, data: findPetsByTagsQueryResponse.parse(res.data) }
18
24
  }
19
25
 
20
- export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
21
- const queryKey = findPetsByTagsQueryKey(params);
22
- return queryOptions({
23
- queryKey,
24
- queryFn: async ({ signal }) => {
25
- config.signal = signal;
26
- return findPetsByTags(headers, params, config);
27
- },
28
- });
26
+ export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
27
+ const queryKey = findPetsByTagsQueryKey(params)
28
+ return queryOptions({
29
+ queryKey,
30
+ queryFn: async ({ signal }) => {
31
+ config.signal = signal
32
+ return findPetsByTags(headers, params, config)
33
+ },
34
+ })
29
35
  }
30
36
 
31
- /**
37
+ /**
32
38
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
33
39
  * @summary Finds Pets by tags
34
40
  * {@link /pet/findByTags}
35
41
  */
36
- export function createFindPetsByTags<TData = ResponseConfig<FindPetsByTagsQueryResponse>, TQueryData = ResponseConfig<FindPetsByTagsQueryResponse>, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: {
37
- query?: Partial<CreateBaseQueryOptions<ResponseConfig<FindPetsByTagsQueryResponse>, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
38
- client?: Partial<RequestConfig>;
39
- } = {}) {
40
- const { query: queryOptions, client: config = {} } = options ?? {};
41
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
42
- const query = createQuery({
43
- ...findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions,
44
- queryKey,
45
- ...queryOptions as unknown as Omit<CreateBaseQueryOptions, "queryKey">
46
- }) as CreateQueryResult<TData, FindPetsByTags400> & {
47
- queryKey: TQueryKey;
48
- };
49
- query.queryKey = queryKey as TQueryKey;
50
- return query;
42
+ export function createFindPetsByTags<
43
+ TData = ResponseConfig<FindPetsByTagsQueryResponse>,
44
+ TQueryData = ResponseConfig<FindPetsByTagsQueryResponse>,
45
+ TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
46
+ >(
47
+ headers: FindPetsByTagsHeaderParams,
48
+ params?: FindPetsByTagsQueryParams,
49
+ options: {
50
+ query?: Partial<CreateBaseQueryOptions<ResponseConfig<FindPetsByTagsQueryResponse>, FindPetsByTags400, TData, TQueryData, TQueryKey>>
51
+ client?: Partial<RequestConfig>
52
+ } = {},
53
+ ) {
54
+ const { query: queryOptions, client: config = {} } = options ?? {}
55
+ const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
56
+
57
+ const query = createQuery({
58
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions),
59
+ queryKey,
60
+ ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
61
+ }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
62
+
63
+ query.queryKey = queryKey as TQueryKey
64
+
65
+ return query
51
66
  }
@@ -1,51 +1,66 @@
1
- import client from "axios";
2
- import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from "@tanstack/svelte-query";
3
- import type { RequestConfig } from "axios";
4
- import { queryOptions, createQuery } from "@tanstack/svelte-query";
1
+ import client from 'axios'
2
+ import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
3
+ import type { RequestConfig } from 'axios'
4
+ import { queryOptions, createQuery } from '@tanstack/svelte-query'
5
5
 
6
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
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
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "GET", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
17
- return findPetsByTagsQueryResponse.parse(res.data);
16
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
17
+ method: 'GET',
18
+ url: `/pet/findByTags`,
19
+ params,
20
+ headers: { ...headers, ...config.headers },
21
+ ...config,
22
+ })
23
+ return findPetsByTagsQueryResponse.parse(res.data)
18
24
  }
19
25
 
20
- export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
21
- const queryKey = findPetsByTagsQueryKey(params);
22
- return queryOptions({
23
- queryKey,
24
- queryFn: async ({ signal }) => {
25
- config.signal = signal;
26
- return findPetsByTags(headers, params, config);
27
- },
28
- });
26
+ export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
27
+ const queryKey = findPetsByTagsQueryKey(params)
28
+ return queryOptions({
29
+ queryKey,
30
+ queryFn: async ({ signal }) => {
31
+ config.signal = signal
32
+ return findPetsByTags(headers, params, config)
33
+ },
34
+ })
29
35
  }
30
36
 
31
- /**
37
+ /**
32
38
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
33
39
  * @summary Finds Pets by tags
34
40
  * {@link /pet/findByTags}
35
41
  */
36
- export function createFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: {
37
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
38
- client?: Partial<RequestConfig>;
39
- } = {}) {
40
- const { query: queryOptions, client: config = {} } = options ?? {};
41
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
42
- const query = createQuery({
43
- ...findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions,
44
- queryKey,
45
- ...queryOptions as unknown as Omit<CreateBaseQueryOptions, "queryKey">
46
- }) as CreateQueryResult<TData, FindPetsByTags400> & {
47
- queryKey: TQueryKey;
48
- };
49
- query.queryKey = queryKey as TQueryKey;
50
- return query;
42
+ export function createFindPetsByTags<
43
+ TData = FindPetsByTagsQueryResponse,
44
+ TQueryData = FindPetsByTagsQueryResponse,
45
+ TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
46
+ >(
47
+ headers: FindPetsByTagsHeaderParams,
48
+ params?: FindPetsByTagsQueryParams,
49
+ options: {
50
+ query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
51
+ client?: Partial<RequestConfig>
52
+ } = {},
53
+ ) {
54
+ const { query: queryOptions, client: config = {} } = options ?? {}
55
+ const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
56
+
57
+ const query = createQuery({
58
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions),
59
+ queryKey,
60
+ ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
61
+ }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
62
+
63
+ query.queryKey = queryKey as TQueryKey
64
+
65
+ return query
51
66
  }
@@ -1,44 +1,58 @@
1
- import client from "axios";
2
- import type { CreateMutationOptions } from "@tanstack/svelte-query";
3
- import type { RequestConfig } from "axios";
4
- import { createMutation } from "@tanstack/svelte-query";
1
+ import client from 'axios'
2
+ import type { CreateMutationOptions } from '@tanstack/svelte-query'
3
+ import type { RequestConfig } from 'axios'
4
+ import { createMutation } from '@tanstack/svelte-query'
5
5
 
6
- export const updatePetWithFormMutationKey = () => [{ "url": "/pet/{petId}" }] as const;
6
+ export const updatePetWithFormMutationKey = () => [{ url: '/pet/{petId}' }] as const
7
7
 
8
- export type UpdatePetWithFormMutationKey = ReturnType<typeof updatePetWithFormMutationKey>;
8
+ export type UpdatePetWithFormMutationKey = ReturnType<typeof updatePetWithFormMutationKey>
9
9
 
10
- /**
10
+ /**
11
11
  * @summary Updates a pet in the store with form data
12
12
  * {@link /pet/:petId}
13
13
  */
14
- async function updatePetWithForm(petId: UpdatePetWithFormPathParams["petId"], data?: UpdatePetWithFormMutationRequest, params?: UpdatePetWithFormQueryParams, config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {}) {
15
- const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({ method: "POST", url: `/pet/${petId}`, params, data, ...config });
16
- return updatePetWithFormMutationResponse.parse(res.data);
14
+ async function updatePetWithForm(
15
+ petId: UpdatePetWithFormPathParams['petId'],
16
+ data?: UpdatePetWithFormMutationRequest,
17
+ params?: UpdatePetWithFormQueryParams,
18
+ config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
19
+ ) {
20
+ const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({
21
+ method: 'POST',
22
+ url: `/pet/${petId}`,
23
+ params,
24
+ data,
25
+ ...config,
26
+ })
27
+ return updatePetWithFormMutationResponse.parse(res.data)
17
28
  }
18
29
 
19
- /**
30
+ /**
20
31
  * @summary Updates a pet in the store with form data
21
32
  * {@link /pet/:petId}
22
33
  */
23
- export function createUpdatePetWithForm(options: {
24
- mutation?: CreateMutationOptions<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, {
25
- petId: UpdatePetWithFormPathParams["petId"];
26
- data?: UpdatePetWithFormMutationRequest;
27
- params?: UpdatePetWithFormQueryParams;
28
- }>;
29
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>;
30
- } = {}) {
31
- const { mutation: mutationOptions, client: config = {} } = options ?? {};
32
- const mutationKey = mutationOptions?.mutationKey ?? updatePetWithFormMutationKey();
33
- return createMutation<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, {
34
- petId: UpdatePetWithFormPathParams["petId"];
35
- data?: UpdatePetWithFormMutationRequest;
36
- params?: UpdatePetWithFormQueryParams;
37
- }>({
38
- mutationFn: async ({ petId, data, params }) => {
39
- return updatePetWithForm(petId, data, params, config);
40
- },
41
- mutationKey,
42
- ...mutationOptions
43
- });
34
+ export function createUpdatePetWithForm(
35
+ options: {
36
+ mutation?: CreateMutationOptions<
37
+ UpdatePetWithFormMutationResponse,
38
+ UpdatePetWithForm405,
39
+ { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
40
+ >
41
+ client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
42
+ } = {},
43
+ ) {
44
+ const { mutation: mutationOptions, client: config = {} } = options ?? {}
45
+ const mutationKey = mutationOptions?.mutationKey ?? updatePetWithFormMutationKey()
46
+
47
+ return createMutation<
48
+ UpdatePetWithFormMutationResponse,
49
+ UpdatePetWithForm405,
50
+ { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
51
+ >({
52
+ mutationFn: async ({ petId, data, params }) => {
53
+ return updatePetWithForm(petId, data, params, config)
54
+ },
55
+ mutationKey,
56
+ ...mutationOptions,
57
+ })
44
58
  }
@@ -1,51 +1,66 @@
1
- import client from "@kubb/plugin-client/clients/axios";
2
- import type { RequestConfig } from "@kubb/plugin-client/clients/axios";
3
- import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from "@tanstack/svelte-query";
4
- import { queryOptions, createQuery } from "@tanstack/svelte-query";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
4
+ import { queryOptions, createQuery } from '@tanstack/svelte-query'
5
5
 
6
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
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
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "GET", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
17
- return findPetsByTagsQueryResponse.parse(res.data);
16
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
17
+ method: 'GET',
18
+ url: `/pet/findByTags`,
19
+ params,
20
+ headers: { ...headers, ...config.headers },
21
+ ...config,
22
+ })
23
+ return findPetsByTagsQueryResponse.parse(res.data)
18
24
  }
19
25
 
20
- export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
21
- const queryKey = findPetsByTagsQueryKey(params);
22
- return queryOptions({
23
- queryKey,
24
- queryFn: async ({ signal }) => {
25
- config.signal = signal;
26
- return findPetsByTags(headers, params, config);
27
- },
28
- });
26
+ export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
27
+ const queryKey = findPetsByTagsQueryKey(params)
28
+ return queryOptions({
29
+ queryKey,
30
+ queryFn: async ({ signal }) => {
31
+ config.signal = signal
32
+ return findPetsByTags(headers, params, config)
33
+ },
34
+ })
29
35
  }
30
36
 
31
- /**
37
+ /**
32
38
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
33
39
  * @summary Finds Pets by tags
34
40
  * {@link /pet/findByTags}
35
41
  */
36
- export function createFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: {
37
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
38
- client?: Partial<RequestConfig>;
39
- } = {}) {
40
- const { query: queryOptions, client: config = {} } = options ?? {};
41
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
42
- const query = createQuery({
43
- ...findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions,
44
- queryKey,
45
- ...queryOptions as unknown as Omit<CreateBaseQueryOptions, "queryKey">
46
- }) as CreateQueryResult<TData, FindPetsByTags400> & {
47
- queryKey: TQueryKey;
48
- };
49
- query.queryKey = queryKey as TQueryKey;
50
- return query;
42
+ export function createFindPetsByTags<
43
+ TData = FindPetsByTagsQueryResponse,
44
+ TQueryData = FindPetsByTagsQueryResponse,
45
+ TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
46
+ >(
47
+ headers: FindPetsByTagsHeaderParams,
48
+ params?: FindPetsByTagsQueryParams,
49
+ options: {
50
+ query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
51
+ client?: Partial<RequestConfig>
52
+ } = {},
53
+ ) {
54
+ const { query: queryOptions, client: config = {} } = options ?? {}
55
+ const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
56
+
57
+ const query = createQuery({
58
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions),
59
+ queryKey,
60
+ ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
61
+ }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
62
+
63
+ query.queryKey = queryKey as TQueryKey
64
+
65
+ return query
51
66
  }
@@ -1,60 +1,71 @@
1
- import client from "@kubb/plugin-client/clients/axios";
2
- import type { RequestConfig } from "@kubb/plugin-client/clients/axios";
3
- import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from "@tanstack/svelte-query";
4
- import { queryOptions, createQuery } from "@tanstack/svelte-query";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
4
+ import { queryOptions, createQuery } from '@tanstack/svelte-query'
5
5
 
6
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
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
- async function findPetsByTags({ headers, params }: {
16
- headers: FindPetsByTagsHeaderParams;
17
- params?: FindPetsByTagsQueryParams;
18
- }, config: Partial<RequestConfig> = {}) {
19
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "GET", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
20
- return findPetsByTagsQueryResponse.parse(res.data);
15
+ async function findPetsByTags(
16
+ { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
17
+ config: Partial<RequestConfig> = {},
18
+ ) {
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)
21
27
  }
22
28
 
23
- export function findPetsByTagsQueryOptions({ headers, params }: {
24
- headers: FindPetsByTagsHeaderParams;
25
- params?: FindPetsByTagsQueryParams;
26
- }, config: Partial<RequestConfig> = {}) {
27
- const queryKey = findPetsByTagsQueryKey(params);
28
- return queryOptions({
29
- queryKey,
30
- queryFn: async ({ signal }) => {
31
- config.signal = signal;
32
- return findPetsByTags({ headers, params }, config);
33
- },
34
- });
29
+ export function findPetsByTagsQueryOptions(
30
+ { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: 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({ headers, params }, config)
39
+ },
40
+ })
35
41
  }
36
42
 
37
- /**
43
+ /**
38
44
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
39
45
  * @summary Finds Pets by tags
40
46
  * {@link /pet/findByTags}
41
47
  */
42
- export function createFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>({ headers, params }: {
43
- headers: FindPetsByTagsHeaderParams;
44
- params?: FindPetsByTagsQueryParams;
45
- }, options: {
46
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
47
- client?: Partial<RequestConfig>;
48
- } = {}) {
49
- const { query: queryOptions, client: config = {} } = options ?? {};
50
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
51
- const query = createQuery({
52
- ...findPetsByTagsQueryOptions({ headers, params }, config) as unknown as CreateBaseQueryOptions,
53
- queryKey,
54
- ...queryOptions as unknown as Omit<CreateBaseQueryOptions, "queryKey">
55
- }) as CreateQueryResult<TData, FindPetsByTags400> & {
56
- queryKey: TQueryKey;
57
- };
58
- query.queryKey = queryKey as TQueryKey;
59
- return query;
48
+ export function createFindPetsByTags<
49
+ TData = FindPetsByTagsQueryResponse,
50
+ TQueryData = FindPetsByTagsQueryResponse,
51
+ TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
52
+ >(
53
+ { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
54
+ options: {
55
+ query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
56
+ client?: Partial<RequestConfig>
57
+ } = {},
58
+ ) {
59
+ const { query: queryOptions, client: config = {} } = options ?? {}
60
+ const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
61
+
62
+ const query = createQuery({
63
+ ...(findPetsByTagsQueryOptions({ headers, params }, config) as unknown as CreateBaseQueryOptions),
64
+ queryKey,
65
+ ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
66
+ }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
67
+
68
+ query.queryKey = queryKey as TQueryKey
69
+
70
+ return query
60
71
  }
@@ -1,51 +1,66 @@
1
- import client from "@kubb/plugin-client/clients/axios";
2
- import type { RequestConfig } from "@kubb/plugin-client/clients/axios";
3
- import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from "@tanstack/svelte-query";
4
- import { queryOptions, createQuery } from "@tanstack/svelte-query";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
4
+ import { queryOptions, createQuery } from '@tanstack/svelte-query'
5
5
 
6
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
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
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "GET", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
17
- return findPetsByTagsQueryResponse.parse(res.data);
16
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
17
+ method: 'GET',
18
+ url: `/pet/findByTags`,
19
+ params,
20
+ headers: { ...headers, ...config.headers },
21
+ ...config,
22
+ })
23
+ return findPetsByTagsQueryResponse.parse(res.data)
18
24
  }
19
25
 
20
- export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
21
- const queryKey = findPetsByTagsQueryKey(params);
22
- return queryOptions({
23
- queryKey,
24
- queryFn: async ({ signal }) => {
25
- config.signal = signal;
26
- return findPetsByTags(headers, params, config);
27
- },
28
- });
26
+ export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
27
+ const queryKey = findPetsByTagsQueryKey(params)
28
+ return queryOptions({
29
+ queryKey,
30
+ queryFn: async ({ signal }) => {
31
+ config.signal = signal
32
+ return findPetsByTags(headers, params, config)
33
+ },
34
+ })
29
35
  }
30
36
 
31
- /**
37
+ /**
32
38
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
33
39
  * @summary Finds Pets by tags
34
40
  * {@link /pet/findByTags}
35
41
  */
36
- export function createFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: {
37
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
38
- client?: Partial<RequestConfig>;
39
- } = {}) {
40
- const { query: queryOptions, client: config = {} } = options ?? {};
41
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
42
- const query = createQuery({
43
- ...findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions,
44
- queryKey,
45
- ...queryOptions as unknown as Omit<CreateBaseQueryOptions, "queryKey">
46
- }) as CreateQueryResult<TData, FindPetsByTags400> & {
47
- queryKey: TQueryKey;
48
- };
49
- query.queryKey = queryKey as TQueryKey;
50
- return query;
42
+ export function createFindPetsByTags<
43
+ TData = FindPetsByTagsQueryResponse,
44
+ TQueryData = FindPetsByTagsQueryResponse,
45
+ TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
46
+ >(
47
+ headers: FindPetsByTagsHeaderParams,
48
+ params?: FindPetsByTagsQueryParams,
49
+ options: {
50
+ query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
51
+ client?: Partial<RequestConfig>
52
+ } = {},
53
+ ) {
54
+ const { query: queryOptions, client: config = {} } = options ?? {}
55
+ const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
56
+
57
+ const query = createQuery({
58
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions),
59
+ queryKey,
60
+ ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
61
+ }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
62
+
63
+ query.queryKey = queryKey as TQueryKey
64
+
65
+ return query
51
66
  }
@@ -1,51 +1,66 @@
1
- import client from "@kubb/plugin-client/clients/axios";
2
- import type { RequestConfig } from "@kubb/plugin-client/clients/axios";
3
- import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from "@tanstack/react-query";
4
- import { queryOptions, createQuery } from "@tanstack/react-query";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/react-query'
4
+ import { queryOptions, createQuery } from '@tanstack/react-query'
5
5
 
6
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => ["test", { url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
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
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "GET", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
17
- return findPetsByTagsQueryResponse.parse(res.data);
16
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
17
+ method: 'GET',
18
+ url: `/pet/findByTags`,
19
+ params,
20
+ headers: { ...headers, ...config.headers },
21
+ ...config,
22
+ })
23
+ return findPetsByTagsQueryResponse.parse(res.data)
18
24
  }
19
25
 
20
- export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
21
- const queryKey = findPetsByTagsQueryKey(params);
22
- return queryOptions({
23
- queryKey,
24
- queryFn: async ({ signal }) => {
25
- config.signal = signal;
26
- return findPetsByTags(headers, params, config);
27
- },
28
- });
26
+ export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
27
+ const queryKey = findPetsByTagsQueryKey(params)
28
+ return queryOptions({
29
+ queryKey,
30
+ queryFn: async ({ signal }) => {
31
+ config.signal = signal
32
+ return findPetsByTags(headers, params, config)
33
+ },
34
+ })
29
35
  }
30
36
 
31
- /**
37
+ /**
32
38
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
33
39
  * @summary Finds Pets by tags
34
40
  * {@link /pet/findByTags}
35
41
  */
36
- export function createFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: {
37
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
38
- client?: Partial<RequestConfig>;
39
- } = {}) {
40
- const { query: queryOptions, client: config = {} } = options ?? {};
41
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
42
- const query = createQuery({
43
- ...findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions,
44
- queryKey,
45
- ...queryOptions as unknown as Omit<CreateBaseQueryOptions, "queryKey">
46
- }) as CreateQueryResult<TData, FindPetsByTags400> & {
47
- queryKey: TQueryKey;
48
- };
49
- query.queryKey = queryKey as TQueryKey;
50
- return query;
42
+ export function createFindPetsByTags<
43
+ TData = FindPetsByTagsQueryResponse,
44
+ TQueryData = FindPetsByTagsQueryResponse,
45
+ TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
46
+ >(
47
+ headers: FindPetsByTagsHeaderParams,
48
+ params?: FindPetsByTagsQueryParams,
49
+ options: {
50
+ query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
51
+ client?: Partial<RequestConfig>
52
+ } = {},
53
+ ) {
54
+ const { query: queryOptions, client: config = {} } = options ?? {}
55
+ const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
56
+
57
+ const query = createQuery({
58
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions),
59
+ queryKey,
60
+ ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
61
+ }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
62
+
63
+ query.queryKey = queryKey as TQueryKey
64
+
65
+ return query
51
66
  }
@@ -1,51 +1,66 @@
1
- import client from "@kubb/plugin-client/clients/axios";
2
- import type { RequestConfig } from "@kubb/plugin-client/clients/axios";
3
- import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from "@tanstack/svelte-query";
4
- import { queryOptions, createQuery } from "@tanstack/svelte-query";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
4
+ import { queryOptions, createQuery } from '@tanstack/svelte-query'
5
5
 
6
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const;
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
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "GET", url: `/pet/findByTags`, params, headers: { ...headers, ...config.headers }, ...config });
17
- return findPetsByTagsQueryResponse.parse(res.data);
16
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
17
+ method: 'GET',
18
+ url: `/pet/findByTags`,
19
+ params,
20
+ headers: { ...headers, ...config.headers },
21
+ ...config,
22
+ })
23
+ return findPetsByTagsQueryResponse.parse(res.data)
18
24
  }
19
25
 
20
- export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
21
- const queryKey = findPetsByTagsQueryKey(params);
22
- return queryOptions({
23
- queryKey,
24
- queryFn: async ({ signal }) => {
25
- config.signal = signal;
26
- return findPetsByTags(headers, params, config);
27
- },
28
- });
26
+ export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
27
+ const queryKey = findPetsByTagsQueryKey(params)
28
+ return queryOptions({
29
+ queryKey,
30
+ queryFn: async ({ signal }) => {
31
+ config.signal = signal
32
+ return findPetsByTags(headers, params, config)
33
+ },
34
+ })
29
35
  }
30
36
 
31
- /**
37
+ /**
32
38
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
33
39
  * @summary Finds Pets by tags
34
40
  * {@link /pet/findByTags}
35
41
  */
36
- export function createFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: {
37
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>;
38
- client?: Partial<RequestConfig>;
39
- } = {}) {
40
- const { query: queryOptions, client: config = {} } = options ?? {};
41
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params);
42
- const query = createQuery({
43
- ...findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions,
44
- queryKey,
45
- ...queryOptions as unknown as Omit<CreateBaseQueryOptions, "queryKey">
46
- }) as CreateQueryResult<TData, FindPetsByTags400> & {
47
- queryKey: TQueryKey;
48
- };
49
- query.queryKey = queryKey as TQueryKey;
50
- return query;
42
+ export function createFindPetsByTags<
43
+ TData = FindPetsByTagsQueryResponse,
44
+ TQueryData = FindPetsByTagsQueryResponse,
45
+ TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
46
+ >(
47
+ headers: FindPetsByTagsHeaderParams,
48
+ params?: FindPetsByTagsQueryParams,
49
+ options: {
50
+ query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
51
+ client?: Partial<RequestConfig>
52
+ } = {},
53
+ ) {
54
+ const { query: queryOptions, client: config = {} } = options ?? {}
55
+ const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
56
+
57
+ const query = createQuery({
58
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions),
59
+ queryKey,
60
+ ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
61
+ }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
62
+
63
+ query.queryKey = queryKey as TQueryKey
64
+
65
+ return query
51
66
  }
@@ -1,50 +1,80 @@
1
- import client from "@kubb/plugin-client/clients/axios";
2
- import type { RequestConfig } from "@kubb/plugin-client/clients/axios";
3
- import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from "custom-query";
4
- import { queryOptions, createQuery } from "custom-query";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from 'custom-query'
4
+ import { queryOptions, createQuery } from 'custom-query'
5
5
 
6
- export const updatePetWithFormQueryKey = (petId: UpdatePetWithFormPathParams["petId"], data?: UpdatePetWithFormMutationRequest, params?: UpdatePetWithFormQueryParams) => [{ url: "/pet/:petId", params: { petId: petId } }, ...(params ? [params] : []), ...(data ? [data] : [])] as const;
6
+ export const updatePetWithFormQueryKey = (
7
+ petId: UpdatePetWithFormPathParams['petId'],
8
+ data?: UpdatePetWithFormMutationRequest,
9
+ params?: UpdatePetWithFormQueryParams,
10
+ ) => [{ url: '/pet/:petId', params: { petId: petId } }, ...(params ? [params] : []), ...(data ? [data] : [])] as const
7
11
 
8
- export type UpdatePetWithFormQueryKey = ReturnType<typeof updatePetWithFormQueryKey>;
12
+ export type UpdatePetWithFormQueryKey = ReturnType<typeof updatePetWithFormQueryKey>
9
13
 
10
- /**
14
+ /**
11
15
  * @summary Updates a pet in the store with form data
12
16
  * {@link /pet/:petId}
13
17
  */
14
- async function updatePetWithForm(petId: UpdatePetWithFormPathParams["petId"], data?: UpdatePetWithFormMutationRequest, params?: UpdatePetWithFormQueryParams, config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {}) {
15
- const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({ method: "POST", url: `/pet/${petId}`, params, data, ...config });
16
- return updatePetWithFormMutationResponse.parse(res.data);
18
+ async function updatePetWithForm(
19
+ petId: UpdatePetWithFormPathParams['petId'],
20
+ data?: UpdatePetWithFormMutationRequest,
21
+ params?: UpdatePetWithFormQueryParams,
22
+ config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
23
+ ) {
24
+ const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({
25
+ method: 'POST',
26
+ url: `/pet/${petId}`,
27
+ params,
28
+ data,
29
+ ...config,
30
+ })
31
+ return updatePetWithFormMutationResponse.parse(res.data)
17
32
  }
18
33
 
19
- export function updatePetWithFormQueryOptions(petId: UpdatePetWithFormPathParams["petId"], data?: UpdatePetWithFormMutationRequest, params?: UpdatePetWithFormQueryParams, config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {}) {
20
- const queryKey = updatePetWithFormQueryKey(petId, data, params);
21
- return queryOptions({
22
- enabled: !!(petId),
23
- queryKey,
24
- queryFn: async ({ signal }) => {
25
- config.signal = signal;
26
- return updatePetWithForm(petId, data, params, config);
27
- },
28
- });
34
+ export function updatePetWithFormQueryOptions(
35
+ petId: UpdatePetWithFormPathParams['petId'],
36
+ data?: UpdatePetWithFormMutationRequest,
37
+ params?: UpdatePetWithFormQueryParams,
38
+ config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
39
+ ) {
40
+ const queryKey = updatePetWithFormQueryKey(petId, data, params)
41
+ return queryOptions({
42
+ enabled: !!petId,
43
+ queryKey,
44
+ queryFn: async ({ signal }) => {
45
+ config.signal = signal
46
+ return updatePetWithForm(petId, data, params, config)
47
+ },
48
+ })
29
49
  }
30
50
 
31
- /**
51
+ /**
32
52
  * @summary Updates a pet in the store with form data
33
53
  * {@link /pet/:petId}
34
54
  */
35
- export function createUpdatePetWithForm<TData = UpdatePetWithFormMutationResponse, TQueryData = UpdatePetWithFormMutationResponse, TQueryKey extends QueryKey = UpdatePetWithFormQueryKey>(petId: UpdatePetWithFormPathParams["petId"], data?: UpdatePetWithFormMutationRequest, params?: UpdatePetWithFormQueryParams, options: {
36
- query?: Partial<CreateBaseQueryOptions<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, TData, TQueryData, TQueryKey>>;
37
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>;
38
- } = {}) {
39
- const { query: queryOptions, client: config = {} } = options ?? {};
40
- const queryKey = queryOptions?.queryKey ?? updatePetWithFormQueryKey(petId, data, params);
41
- const query = createQuery({
42
- ...updatePetWithFormQueryOptions(petId, data, params, config) as unknown as CreateBaseQueryOptions,
43
- queryKey,
44
- ...queryOptions as unknown as Omit<CreateBaseQueryOptions, "queryKey">
45
- }) as CreateQueryResult<TData, UpdatePetWithForm405> & {
46
- queryKey: TQueryKey;
47
- };
48
- query.queryKey = queryKey as TQueryKey;
49
- return query;
55
+ export function createUpdatePetWithForm<
56
+ TData = UpdatePetWithFormMutationResponse,
57
+ TQueryData = UpdatePetWithFormMutationResponse,
58
+ TQueryKey extends QueryKey = UpdatePetWithFormQueryKey,
59
+ >(
60
+ petId: UpdatePetWithFormPathParams['petId'],
61
+ data?: UpdatePetWithFormMutationRequest,
62
+ params?: UpdatePetWithFormQueryParams,
63
+ options: {
64
+ query?: Partial<CreateBaseQueryOptions<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, TData, TQueryData, TQueryKey>>
65
+ client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
66
+ } = {},
67
+ ) {
68
+ const { query: queryOptions, client: config = {} } = options ?? {}
69
+ const queryKey = queryOptions?.queryKey ?? updatePetWithFormQueryKey(petId, data, params)
70
+
71
+ const query = createQuery({
72
+ ...(updatePetWithFormQueryOptions(petId, data, params, config) as unknown as CreateBaseQueryOptions),
73
+ queryKey,
74
+ ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
75
+ }) as CreateQueryResult<TData, UpdatePetWithForm405> & { queryKey: TQueryKey }
76
+
77
+ query.queryKey = queryKey as TQueryKey
78
+
79
+ return query
50
80
  }
@@ -1,44 +1,58 @@
1
- import client from "@kubb/plugin-client/clients/axios";
2
- import type { RequestConfig } from "@kubb/plugin-client/clients/axios";
3
- import type { CreateMutationOptions } from "@tanstack/svelte-query";
4
- import { createMutation } from "@tanstack/svelte-query";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { CreateMutationOptions } from '@tanstack/svelte-query'
4
+ import { createMutation } from '@tanstack/svelte-query'
5
5
 
6
- export const updatePetWithFormMutationKey = () => [{ "url": "/pet/{petId}" }] as const;
6
+ export const updatePetWithFormMutationKey = () => [{ url: '/pet/{petId}' }] as const
7
7
 
8
- export type UpdatePetWithFormMutationKey = ReturnType<typeof updatePetWithFormMutationKey>;
8
+ export type UpdatePetWithFormMutationKey = ReturnType<typeof updatePetWithFormMutationKey>
9
9
 
10
- /**
10
+ /**
11
11
  * @summary Updates a pet in the store with form data
12
12
  * {@link /pet/:petId}
13
13
  */
14
- async function updatePetWithForm(petId: UpdatePetWithFormPathParams["petId"], data?: UpdatePetWithFormMutationRequest, params?: UpdatePetWithFormQueryParams, config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {}) {
15
- const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({ method: "POST", url: `/pet/${petId}`, params, data, ...config });
16
- return updatePetWithFormMutationResponse.parse(res.data);
14
+ async function updatePetWithForm(
15
+ petId: UpdatePetWithFormPathParams['petId'],
16
+ data?: UpdatePetWithFormMutationRequest,
17
+ params?: UpdatePetWithFormQueryParams,
18
+ config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
19
+ ) {
20
+ const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({
21
+ method: 'POST',
22
+ url: `/pet/${petId}`,
23
+ params,
24
+ data,
25
+ ...config,
26
+ })
27
+ return updatePetWithFormMutationResponse.parse(res.data)
17
28
  }
18
29
 
19
- /**
30
+ /**
20
31
  * @summary Updates a pet in the store with form data
21
32
  * {@link /pet/:petId}
22
33
  */
23
- export function createUpdatePetWithForm(options: {
24
- mutation?: CreateMutationOptions<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, {
25
- petId: UpdatePetWithFormPathParams["petId"];
26
- data?: UpdatePetWithFormMutationRequest;
27
- params?: UpdatePetWithFormQueryParams;
28
- }>;
29
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>;
30
- } = {}) {
31
- const { mutation: mutationOptions, client: config = {} } = options ?? {};
32
- const mutationKey = mutationOptions?.mutationKey ?? updatePetWithFormMutationKey();
33
- return createMutation<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, {
34
- petId: UpdatePetWithFormPathParams["petId"];
35
- data?: UpdatePetWithFormMutationRequest;
36
- params?: UpdatePetWithFormQueryParams;
37
- }>({
38
- mutationFn: async ({ petId, data, params }) => {
39
- return updatePetWithForm(petId, data, params, config);
40
- },
41
- mutationKey,
42
- ...mutationOptions
43
- });
34
+ export function createUpdatePetWithForm(
35
+ options: {
36
+ mutation?: CreateMutationOptions<
37
+ UpdatePetWithFormMutationResponse,
38
+ UpdatePetWithForm405,
39
+ { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
40
+ >
41
+ client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
42
+ } = {},
43
+ ) {
44
+ const { mutation: mutationOptions, client: config = {} } = options ?? {}
45
+ const mutationKey = mutationOptions?.mutationKey ?? updatePetWithFormMutationKey()
46
+
47
+ return createMutation<
48
+ UpdatePetWithFormMutationResponse,
49
+ UpdatePetWithForm405,
50
+ { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
51
+ >({
52
+ mutationFn: async ({ petId, data, params }) => {
53
+ return updatePetWithForm(petId, data, params, config)
54
+ },
55
+ mutationKey,
56
+ ...mutationOptions,
57
+ })
44
58
  }
@@ -1,46 +1,58 @@
1
- import client from "@kubb/plugin-client/clients/axios";
2
- import type { RequestConfig } from "@kubb/plugin-client/clients/axios";
3
- import type { CreateMutationOptions } from "@tanstack/svelte-query";
4
- import { createMutation } from "@tanstack/svelte-query";
1
+ import client from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
3
+ import type { CreateMutationOptions } from '@tanstack/svelte-query'
4
+ import { createMutation } from '@tanstack/svelte-query'
5
5
 
6
- export const updatePetWithFormMutationKey = () => [{ "url": "/pet/{petId}" }] as const;
6
+ export const updatePetWithFormMutationKey = () => [{ url: '/pet/{petId}' }] as const
7
7
 
8
- export type UpdatePetWithFormMutationKey = ReturnType<typeof updatePetWithFormMutationKey>;
8
+ export type UpdatePetWithFormMutationKey = ReturnType<typeof updatePetWithFormMutationKey>
9
9
 
10
- /**
10
+ /**
11
11
  * @summary Updates a pet in the store with form data
12
12
  * {@link /pet/:petId}
13
13
  */
14
- async function updatePetWithForm({ petId }: {
15
- petId: UpdatePetWithFormPathParams["petId"];
16
- }, data?: UpdatePetWithFormMutationRequest, params?: UpdatePetWithFormQueryParams, config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {}) {
17
- const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({ method: "POST", url: `/pet/${petId}`, params, data, ...config });
18
- return updatePetWithFormMutationResponse.parse(res.data);
14
+ async function updatePetWithForm(
15
+ { petId }: { petId: UpdatePetWithFormPathParams['petId'] },
16
+ data?: UpdatePetWithFormMutationRequest,
17
+ params?: UpdatePetWithFormQueryParams,
18
+ config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
19
+ ) {
20
+ const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({
21
+ method: 'POST',
22
+ url: `/pet/${petId}`,
23
+ params,
24
+ data,
25
+ ...config,
26
+ })
27
+ return updatePetWithFormMutationResponse.parse(res.data)
19
28
  }
20
29
 
21
- /**
30
+ /**
22
31
  * @summary Updates a pet in the store with form data
23
32
  * {@link /pet/:petId}
24
33
  */
25
- export function createUpdatePetWithForm(options: {
26
- mutation?: CreateMutationOptions<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, {
27
- petId: UpdatePetWithFormPathParams["petId"];
28
- data?: UpdatePetWithFormMutationRequest;
29
- params?: UpdatePetWithFormQueryParams;
30
- }>;
31
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>;
32
- } = {}) {
33
- const { mutation: mutationOptions, client: config = {} } = options ?? {};
34
- const mutationKey = mutationOptions?.mutationKey ?? updatePetWithFormMutationKey();
35
- return createMutation<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, {
36
- petId: UpdatePetWithFormPathParams["petId"];
37
- data?: UpdatePetWithFormMutationRequest;
38
- params?: UpdatePetWithFormQueryParams;
39
- }>({
40
- mutationFn: async ({ petId, data, params }) => {
41
- return updatePetWithForm({ petId }, data, params, config);
42
- },
43
- mutationKey,
44
- ...mutationOptions
45
- });
34
+ export function createUpdatePetWithForm(
35
+ options: {
36
+ mutation?: CreateMutationOptions<
37
+ UpdatePetWithFormMutationResponse,
38
+ UpdatePetWithForm405,
39
+ { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
40
+ >
41
+ client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
42
+ } = {},
43
+ ) {
44
+ const { mutation: mutationOptions, client: config = {} } = options ?? {}
45
+ const mutationKey = mutationOptions?.mutationKey ?? updatePetWithFormMutationKey()
46
+
47
+ return createMutation<
48
+ UpdatePetWithFormMutationResponse,
49
+ UpdatePetWithForm405,
50
+ { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
51
+ >({
52
+ mutationFn: async ({ petId, data, params }) => {
53
+ return updatePetWithForm({ petId }, data, params, config)
54
+ },
55
+ mutationKey,
56
+ ...mutationOptions,
57
+ })
46
58
  }