@kubb/plugin-svelte-query 4.29.1 → 4.31.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 (28) hide show
  1. package/dist/components.d.ts +3 -4
  2. package/dist/generators.cjs +1 -1
  3. package/dist/generators.d.ts +3 -4
  4. package/dist/generators.js +1 -1
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.d.ts +1 -2
  7. package/dist/index.js +1 -1
  8. package/dist/{queryGenerator-tYjKyUsB.cjs → queryGenerator-B6eKMcKo.cjs} +5 -5
  9. package/dist/queryGenerator-B6eKMcKo.cjs.map +1 -0
  10. package/dist/{queryGenerator-C775F9UI.js → queryGenerator-Cz7Up0dL.js} +5 -5
  11. package/dist/queryGenerator-Cz7Up0dL.js.map +1 -0
  12. package/package.json +11 -10
  13. package/src/generators/mutationGenerator.tsx +4 -2
  14. package/src/generators/queryGenerator.tsx +4 -2
  15. package/dist/queryGenerator-C775F9UI.js.map +0 -1
  16. package/dist/queryGenerator-tYjKyUsB.cjs.map +0 -1
  17. package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +0 -93
  18. package/src/generators/__snapshots__/clientGetImportPath.ts +0 -88
  19. package/src/generators/__snapshots__/clientPostImportPath.ts +0 -72
  20. package/src/generators/__snapshots__/findByTags.ts +0 -88
  21. package/src/generators/__snapshots__/findByTagsObject.ts +0 -85
  22. package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +0 -88
  23. package/src/generators/__snapshots__/findByTagsTemplateString.ts +0 -89
  24. package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +0 -88
  25. package/src/generators/__snapshots__/findByTagsWithZod.ts +0 -88
  26. package/src/generators/__snapshots__/postAsQuery.ts +0 -96
  27. package/src/generators/__snapshots__/updatePetById.ts +0 -72
  28. package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +0 -72
@@ -1,88 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import fetch from 'axios'
6
- import type { QueryKey, QueryClient, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
7
- import type { Client, RequestConfig, ResponseErrorConfig } from 'axios'
8
- import { createQuery, queryOptions } from '@tanstack/svelte-query'
9
-
10
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- headers: FindPetsByTagsHeaderParams,
21
- params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: Client } = {},
23
- ) {
24
- const { client: request = fetch, ...requestConfig } = config
25
-
26
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
- method: 'GET',
28
- url: `/pet/findByTags`,
29
- params,
30
- ...requestConfig,
31
- headers: { ...headers, ...requestConfig.headers },
32
- })
33
- return findPetsByTagsQueryResponse.parse(res.data)
34
- }
35
-
36
- export function findPetsByTagsQueryOptions(
37
- headers: FindPetsByTagsHeaderParams,
38
- params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: Client } = {},
40
- ) {
41
- const queryKey = findPetsByTagsQueryKey(params)
42
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
43
- queryKey,
44
- queryFn: async ({ signal }) => {
45
- if (!config.signal) {
46
- config.signal = signal
47
- }
48
- return findPetsByTags(headers, params, config)
49
- },
50
- })
51
- }
52
-
53
- /**
54
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
55
- * @summary Finds Pets by tags
56
- * {@link /pet/findByTags}
57
- */
58
- export function createFindPetsByTags<
59
- TData = FindPetsByTagsQueryResponse,
60
- TQueryData = FindPetsByTagsQueryResponse,
61
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
62
- >(
63
- headers: FindPetsByTagsHeaderParams,
64
- params?: FindPetsByTagsQueryParams,
65
- options: {
66
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
67
- client?: QueryClient
68
- }
69
- client?: Partial<RequestConfig> & { client?: Client }
70
- } = {},
71
- ) {
72
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
73
- const { client: queryClient, ...queryOptions } = queryConfig
74
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
75
-
76
- const query = createQuery(
77
- {
78
- ...findPetsByTagsQueryOptions(headers, params, config),
79
- queryKey,
80
- ...queryOptions,
81
- } as unknown as CreateBaseQueryOptions,
82
- queryClient,
83
- ) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
84
-
85
- query.queryKey = queryKey as TQueryKey
86
-
87
- return query
88
- }
@@ -1,72 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import fetch from 'axios'
6
- import type { CreateMutationOptions, QueryClient } from '@tanstack/svelte-query'
7
- import type { Client, RequestConfig, ResponseErrorConfig } from 'axios'
8
- import { createMutation } from '@tanstack/svelte-query'
9
-
10
- export const updatePetWithFormMutationKey = () => [{ url: '/pet/:petId' }] as const
11
-
12
- export type UpdatePetWithFormMutationKey = ReturnType<typeof updatePetWithFormMutationKey>
13
-
14
- /**
15
- * @summary Updates a pet in the store with form data
16
- * {@link /pet/:petId}
17
- */
18
- export async function updatePetWithForm(
19
- petId: UpdatePetWithFormPathParams['petId'],
20
- data?: UpdatePetWithFormMutationRequest,
21
- params?: UpdatePetWithFormQueryParams,
22
- config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: Client } = {},
23
- ) {
24
- const { client: request = fetch, ...requestConfig } = config
25
-
26
- const requestData = updatePetWithFormMutationRequest.parse(data)
27
-
28
- const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
29
- method: 'POST',
30
- url: `/pet/${petId}`,
31
- params,
32
- data: requestData,
33
- ...requestConfig,
34
- })
35
- return updatePetWithFormMutationResponse.parse(res.data)
36
- }
37
-
38
- /**
39
- * @summary Updates a pet in the store with form data
40
- * {@link /pet/:petId}
41
- */
42
- export function createUpdatePetWithForm<TContext>(
43
- options: {
44
- mutation?: CreateMutationOptions<
45
- UpdatePetWithFormMutationResponse,
46
- ResponseErrorConfig<UpdatePetWithForm405>,
47
- { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
48
- TContext
49
- > & { client?: QueryClient }
50
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: Client }
51
- } = {},
52
- ) {
53
- const { mutation = {}, client: config = {} } = options ?? {}
54
- const { client: queryClient, ...mutationOptions } = mutation
55
- const mutationKey = mutationOptions?.mutationKey ?? updatePetWithFormMutationKey()
56
-
57
- return createMutation<
58
- UpdatePetWithFormMutationResponse,
59
- ResponseErrorConfig<UpdatePetWithForm405>,
60
- { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
61
- TContext
62
- >(
63
- {
64
- mutationFn: async ({ petId, data, params }) => {
65
- return updatePetWithForm(petId, data, params, config)
66
- },
67
- mutationKey,
68
- ...mutationOptions,
69
- },
70
- queryClient,
71
- )
72
- }
@@ -1,88 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { Client, RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
- import type { QueryKey, QueryClient, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
8
- import { createQuery, queryOptions } from '@tanstack/svelte-query'
9
-
10
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- headers: FindPetsByTagsHeaderParams,
21
- params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: Client } = {},
23
- ) {
24
- const { client: request = fetch, ...requestConfig } = config
25
-
26
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
- method: 'GET',
28
- url: `/pet/findByTags`,
29
- params,
30
- ...requestConfig,
31
- headers: { ...headers, ...requestConfig.headers },
32
- })
33
- return findPetsByTagsQueryResponse.parse(res.data)
34
- }
35
-
36
- export function findPetsByTagsQueryOptions(
37
- headers: FindPetsByTagsHeaderParams,
38
- params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: Client } = {},
40
- ) {
41
- const queryKey = findPetsByTagsQueryKey(params)
42
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
43
- queryKey,
44
- queryFn: async ({ signal }) => {
45
- if (!config.signal) {
46
- config.signal = signal
47
- }
48
- return findPetsByTags(headers, params, config)
49
- },
50
- })
51
- }
52
-
53
- /**
54
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
55
- * @summary Finds Pets by tags
56
- * {@link /pet/findByTags}
57
- */
58
- export function createFindPetsByTags<
59
- TData = FindPetsByTagsQueryResponse,
60
- TQueryData = FindPetsByTagsQueryResponse,
61
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
62
- >(
63
- headers: FindPetsByTagsHeaderParams,
64
- params?: FindPetsByTagsQueryParams,
65
- options: {
66
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
67
- client?: QueryClient
68
- }
69
- client?: Partial<RequestConfig> & { client?: Client }
70
- } = {},
71
- ) {
72
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
73
- const { client: queryClient, ...queryOptions } = queryConfig
74
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
75
-
76
- const query = createQuery(
77
- {
78
- ...findPetsByTagsQueryOptions(headers, params, config),
79
- queryKey,
80
- ...queryOptions,
81
- } as unknown as CreateBaseQueryOptions,
82
- queryClient,
83
- ) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
84
-
85
- query.queryKey = queryKey as TQueryKey
86
-
87
- return query
88
- }
@@ -1,85 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { Client, RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
- import type { QueryKey, QueryClient, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
8
- import { createQuery, queryOptions } from '@tanstack/svelte-query'
9
-
10
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
21
- config: Partial<RequestConfig> & { client?: Client } = {},
22
- ) {
23
- const { client: request = fetch, ...requestConfig } = config
24
-
25
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
26
- method: 'GET',
27
- url: `/pet/findByTags`,
28
- params,
29
- ...requestConfig,
30
- headers: { ...headers, ...requestConfig.headers },
31
- })
32
- return findPetsByTagsQueryResponse.parse(res.data)
33
- }
34
-
35
- export function findPetsByTagsQueryOptions(
36
- { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
37
- config: Partial<RequestConfig> & { client?: Client } = {},
38
- ) {
39
- const queryKey = findPetsByTagsQueryKey(params)
40
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
41
- queryKey,
42
- queryFn: async ({ signal }) => {
43
- if (!config.signal) {
44
- config.signal = signal
45
- }
46
- return findPetsByTags({ headers, params }, config)
47
- },
48
- })
49
- }
50
-
51
- /**
52
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
53
- * @summary Finds Pets by tags
54
- * {@link /pet/findByTags}
55
- */
56
- export function createFindPetsByTags<
57
- TData = FindPetsByTagsQueryResponse,
58
- TQueryData = FindPetsByTagsQueryResponse,
59
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
60
- >(
61
- { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
62
- options: {
63
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
64
- client?: QueryClient
65
- }
66
- client?: Partial<RequestConfig> & { client?: Client }
67
- } = {},
68
- ) {
69
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
70
- const { client: queryClient, ...queryOptions } = queryConfig
71
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
72
-
73
- const query = createQuery(
74
- {
75
- ...findPetsByTagsQueryOptions({ headers, params }, config),
76
- queryKey,
77
- ...queryOptions,
78
- } as unknown as CreateBaseQueryOptions,
79
- queryClient,
80
- ) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
81
-
82
- query.queryKey = queryKey as TQueryKey
83
-
84
- return query
85
- }
@@ -1,88 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { Client, RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
- import type { QueryKey, QueryClient, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
8
- import { createQuery, queryOptions } from '@tanstack/svelte-query'
9
-
10
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- headers: FindPetsByTagsHeaderParams,
21
- params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: Client } = {},
23
- ) {
24
- const { client: request = fetch, ...requestConfig } = config
25
-
26
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
- method: 'GET',
28
- url: `/pet/findByTags`,
29
- params,
30
- ...requestConfig,
31
- headers: { ...headers, ...requestConfig.headers },
32
- })
33
- return findPetsByTagsQueryResponse.parse(res.data)
34
- }
35
-
36
- export function findPetsByTagsQueryOptions(
37
- headers: FindPetsByTagsHeaderParams,
38
- params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: Client } = {},
40
- ) {
41
- const queryKey = findPetsByTagsQueryKey(params)
42
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
43
- queryKey,
44
- queryFn: async ({ signal }) => {
45
- if (!config.signal) {
46
- config.signal = signal
47
- }
48
- return findPetsByTags(headers, params, config)
49
- },
50
- })
51
- }
52
-
53
- /**
54
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
55
- * @summary Finds Pets by tags
56
- * {@link /pet/findByTags}
57
- */
58
- export function createFindPetsByTags<
59
- TData = FindPetsByTagsQueryResponse,
60
- TQueryData = FindPetsByTagsQueryResponse,
61
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
62
- >(
63
- headers: FindPetsByTagsHeaderParams,
64
- params?: FindPetsByTagsQueryParams,
65
- options: {
66
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
67
- client?: QueryClient
68
- }
69
- client?: Partial<RequestConfig> & { client?: Client }
70
- } = {},
71
- ) {
72
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
73
- const { client: queryClient, ...queryOptions } = queryConfig
74
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
75
-
76
- const query = createQuery(
77
- {
78
- ...findPetsByTagsQueryOptions(headers, params, config),
79
- queryKey,
80
- ...queryOptions,
81
- } as unknown as CreateBaseQueryOptions,
82
- queryClient,
83
- ) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
84
-
85
- query.queryKey = queryKey as TQueryKey
86
-
87
- return query
88
- }
@@ -1,89 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import type { Client, RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
6
- import type { QueryKey, QueryClient, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
7
- import { fetch } from './test/.kubb/fetch'
8
- import { createQuery, queryOptions } from '@tanstack/svelte-query'
9
-
10
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- headers: FindPetsByTagsHeaderParams,
21
- params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: Client } = {},
23
- ) {
24
- const { client: request = fetch, ...requestConfig } = config
25
-
26
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
- method: 'GET',
28
- url: `/pet/findByTags`,
29
- baseURL: `${123456}`,
30
- params,
31
- ...requestConfig,
32
- headers: { ...headers, ...requestConfig.headers },
33
- })
34
- return findPetsByTagsQueryResponse.parse(res.data)
35
- }
36
-
37
- export function findPetsByTagsQueryOptions(
38
- headers: FindPetsByTagsHeaderParams,
39
- params?: FindPetsByTagsQueryParams,
40
- config: Partial<RequestConfig> & { client?: Client } = {},
41
- ) {
42
- const queryKey = findPetsByTagsQueryKey(params)
43
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
44
- queryKey,
45
- queryFn: async ({ signal }) => {
46
- if (!config.signal) {
47
- config.signal = signal
48
- }
49
- return findPetsByTags(headers, params, config)
50
- },
51
- })
52
- }
53
-
54
- /**
55
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
56
- * @summary Finds Pets by tags
57
- * {@link /pet/findByTags}
58
- */
59
- export function createFindPetsByTags<
60
- TData = FindPetsByTagsQueryResponse,
61
- TQueryData = FindPetsByTagsQueryResponse,
62
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
63
- >(
64
- headers: FindPetsByTagsHeaderParams,
65
- params?: FindPetsByTagsQueryParams,
66
- options: {
67
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
68
- client?: QueryClient
69
- }
70
- client?: Partial<RequestConfig> & { client?: Client }
71
- } = {},
72
- ) {
73
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
74
- const { client: queryClient, ...queryOptions } = queryConfig
75
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
76
-
77
- const query = createQuery(
78
- {
79
- ...findPetsByTagsQueryOptions(headers, params, config),
80
- queryKey,
81
- ...queryOptions,
82
- } as unknown as CreateBaseQueryOptions,
83
- queryClient,
84
- ) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
85
-
86
- query.queryKey = queryKey as TQueryKey
87
-
88
- return query
89
- }
@@ -1,88 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { Client, RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
- import type { QueryKey, QueryClient, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/react-query'
8
- import { createQuery, queryOptions } from '@tanstack/react-query'
9
-
10
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => ['test', { url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- headers: FindPetsByTagsHeaderParams,
21
- params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: Client } = {},
23
- ) {
24
- const { client: request = fetch, ...requestConfig } = config
25
-
26
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
- method: 'GET',
28
- url: `/pet/findByTags`,
29
- params,
30
- ...requestConfig,
31
- headers: { ...headers, ...requestConfig.headers },
32
- })
33
- return findPetsByTagsQueryResponse.parse(res.data)
34
- }
35
-
36
- export function findPetsByTagsQueryOptions(
37
- headers: FindPetsByTagsHeaderParams,
38
- params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: Client } = {},
40
- ) {
41
- const queryKey = findPetsByTagsQueryKey(params)
42
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
43
- queryKey,
44
- queryFn: async ({ signal }) => {
45
- if (!config.signal) {
46
- config.signal = signal
47
- }
48
- return findPetsByTags(headers, params, config)
49
- },
50
- })
51
- }
52
-
53
- /**
54
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
55
- * @summary Finds Pets by tags
56
- * {@link /pet/findByTags}
57
- */
58
- export function createFindPetsByTags<
59
- TData = FindPetsByTagsQueryResponse,
60
- TQueryData = FindPetsByTagsQueryResponse,
61
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
62
- >(
63
- headers: FindPetsByTagsHeaderParams,
64
- params?: FindPetsByTagsQueryParams,
65
- options: {
66
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
67
- client?: QueryClient
68
- }
69
- client?: Partial<RequestConfig> & { client?: Client }
70
- } = {},
71
- ) {
72
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
73
- const { client: queryClient, ...queryOptions } = queryConfig
74
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
75
-
76
- const query = createQuery(
77
- {
78
- ...findPetsByTagsQueryOptions(headers, params, config),
79
- queryKey,
80
- ...queryOptions,
81
- } as unknown as CreateBaseQueryOptions,
82
- queryClient,
83
- ) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
84
-
85
- query.queryKey = queryKey as TQueryKey
86
-
87
- return query
88
- }
@@ -1,88 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import fetch from '@kubb/plugin-client/clients/axios'
6
- import type { Client, RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
7
- import type { QueryKey, QueryClient, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
8
- import { createQuery, queryOptions } from '@tanstack/svelte-query'
9
-
10
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
11
-
12
- export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
-
14
- /**
15
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
16
- * @summary Finds Pets by tags
17
- * {@link /pet/findByTags}
18
- */
19
- export async function findPetsByTags(
20
- headers: FindPetsByTagsHeaderParams,
21
- params?: FindPetsByTagsQueryParams,
22
- config: Partial<RequestConfig> & { client?: Client } = {},
23
- ) {
24
- const { client: request = fetch, ...requestConfig } = config
25
-
26
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
27
- method: 'GET',
28
- url: `/pet/findByTags`,
29
- params,
30
- ...requestConfig,
31
- headers: { ...headers, ...requestConfig.headers },
32
- })
33
- return findPetsByTagsQueryResponse.parse(res.data)
34
- }
35
-
36
- export function findPetsByTagsQueryOptions(
37
- headers: FindPetsByTagsHeaderParams,
38
- params?: FindPetsByTagsQueryParams,
39
- config: Partial<RequestConfig> & { client?: Client } = {},
40
- ) {
41
- const queryKey = findPetsByTagsQueryKey(params)
42
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
43
- queryKey,
44
- queryFn: async ({ signal }) => {
45
- if (!config.signal) {
46
- config.signal = signal
47
- }
48
- return findPetsByTags(headers, params, config)
49
- },
50
- })
51
- }
52
-
53
- /**
54
- * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
55
- * @summary Finds Pets by tags
56
- * {@link /pet/findByTags}
57
- */
58
- export function createFindPetsByTags<
59
- TData = FindPetsByTagsQueryResponse,
60
- TQueryData = FindPetsByTagsQueryResponse,
61
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
62
- >(
63
- headers: FindPetsByTagsHeaderParams,
64
- params?: FindPetsByTagsQueryParams,
65
- options: {
66
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
67
- client?: QueryClient
68
- }
69
- client?: Partial<RequestConfig> & { client?: Client }
70
- } = {},
71
- ) {
72
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
73
- const { client: queryClient, ...queryOptions } = queryConfig
74
- const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
75
-
76
- const query = createQuery(
77
- {
78
- ...findPetsByTagsQueryOptions(headers, params, config),
79
- queryKey,
80
- ...queryOptions,
81
- } as unknown as CreateBaseQueryOptions,
82
- queryClient,
83
- ) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
84
-
85
- query.queryKey = queryKey as TQueryKey
86
-
87
- return query
88
- }