@kubb/plugin-solid-query 4.29.0 → 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.
@@ -1,95 +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, UseBaseQueryOptions, UseQueryResult } from 'custom-query'
8
- import { queryOptions, useQuery } from 'custom-query'
9
-
10
- export const updatePetWithFormQueryKey = (
11
- petId: UpdatePetWithFormPathParams['petId'],
12
- data?: UpdatePetWithFormMutationRequest,
13
- params?: UpdatePetWithFormQueryParams,
14
- ) => [{ url: '/pet/:petId', params: { petId: petId } }, ...(params ? [params] : []), ...(data ? [data] : [])] as const
15
-
16
- export type UpdatePetWithFormQueryKey = ReturnType<typeof updatePetWithFormQueryKey>
17
-
18
- /**
19
- * @summary Updates a pet in the store with form data
20
- * {@link /pet/:petId}
21
- */
22
- export async function updatePetWithForm(
23
- petId: UpdatePetWithFormPathParams['petId'],
24
- data?: UpdatePetWithFormMutationRequest,
25
- params?: UpdatePetWithFormQueryParams,
26
- config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: Client } = {},
27
- ) {
28
- const { client: request = fetch, ...requestConfig } = config
29
-
30
- const requestData = updatePetWithFormMutationRequest.parse(data)
31
-
32
- const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
33
- method: 'POST',
34
- url: `/pet/${petId}`,
35
- params,
36
- data: requestData,
37
- ...requestConfig,
38
- })
39
- return updatePetWithFormMutationResponse.parse(res.data)
40
- }
41
-
42
- export function updatePetWithFormQueryOptions(
43
- petId: UpdatePetWithFormPathParams['petId'],
44
- data?: UpdatePetWithFormMutationRequest,
45
- params?: UpdatePetWithFormQueryParams,
46
- config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: Client } = {},
47
- ) {
48
- const queryKey = updatePetWithFormQueryKey(petId, data, params)
49
- return queryOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationResponse, typeof queryKey>({
50
- enabled: !!petId,
51
- queryKey,
52
- queryFn: async ({ signal }) => {
53
- if (!config.signal) {
54
- config.signal = signal
55
- }
56
- return updatePetWithForm(petId, data, params, config)
57
- },
58
- })
59
- }
60
-
61
- /**
62
- * @summary Updates a pet in the store with form data
63
- * {@link /pet/:petId}
64
- */
65
- export function createUpdatePetWithForm<
66
- TData = UpdatePetWithFormMutationResponse,
67
- TQueryData = UpdatePetWithFormMutationResponse,
68
- TQueryKey extends QueryKey = UpdatePetWithFormQueryKey,
69
- >(
70
- petId: UpdatePetWithFormPathParams['petId'],
71
- data?: UpdatePetWithFormMutationRequest,
72
- params?: UpdatePetWithFormQueryParams,
73
- options: {
74
- query?: Partial<UseBaseQueryOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, TData, TQueryData, TQueryKey>> & {
75
- client?: QueryClient
76
- }
77
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: Client }
78
- } = {},
79
- ) {
80
- const { query: queryConfig = {}, client: config = {} } = options ?? {}
81
- const { client: queryClient, ...queryOptions } = queryConfig
82
- const queryKey = queryOptions?.queryKey ?? updatePetWithFormQueryKey(petId, data, params)
83
-
84
- const query = useQuery(
85
- () => ({
86
- ...(updatePetWithFormQueryOptions(petId, data, params, config) as unknown as UseBaseQueryOptions),
87
- queryKey,
88
- initialData: null,
89
- ...(queryOptions as unknown as Omit<UseBaseQueryOptions, 'queryKey'>),
90
- }),
91
- queryClient ? () => queryClient : undefined,
92
- ) as UseQueryResult<TData, ResponseErrorConfig<UpdatePetWithForm405>> & { queryKey: TQueryKey }
93
-
94
- return query
95
- }
@@ -1,74 +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 { UseMutationOptions, QueryClient } from '@tanstack/solid-query'
8
- import { useMutation } from '@tanstack/solid-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 useUpdatePetWithForm<TContext>(
43
- options: {
44
- mutation?: ReturnType<
45
- UseMutationOptions<
46
- UpdatePetWithFormMutationResponse,
47
- ResponseErrorConfig<UpdatePetWithForm405>,
48
- { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
49
- TContext
50
- >
51
- > & { client?: QueryClient }
52
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: Client }
53
- } = {},
54
- ) {
55
- const { mutation = {}, client: config = {} } = options ?? {}
56
- const { client: queryClient, ...mutationOptions } = mutation
57
- const mutationKey = mutationOptions.mutationKey ?? updatePetWithFormMutationKey()
58
-
59
- return useMutation<
60
- UpdatePetWithFormMutationResponse,
61
- ResponseErrorConfig<UpdatePetWithForm405>,
62
- { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
63
- TContext
64
- >(
65
- () => ({
66
- mutationFn: async ({ petId, data, params }) => {
67
- return updatePetWithForm(petId, data, params, config)
68
- },
69
- mutationKey,
70
- ...mutationOptions,
71
- }),
72
- queryClient ? () => queryClient : undefined,
73
- )
74
- }
@@ -1,74 +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 { UseMutationOptions, QueryClient } from '@tanstack/solid-query'
8
- import { useMutation } from '@tanstack/solid-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 }: { 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 useUpdatePetWithForm<TContext>(
43
- options: {
44
- mutation?: ReturnType<
45
- UseMutationOptions<
46
- UpdatePetWithFormMutationResponse,
47
- ResponseErrorConfig<UpdatePetWithForm405>,
48
- { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
49
- TContext
50
- >
51
- > & { client?: QueryClient }
52
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: Client }
53
- } = {},
54
- ) {
55
- const { mutation = {}, client: config = {} } = options ?? {}
56
- const { client: queryClient, ...mutationOptions } = mutation
57
- const mutationKey = mutationOptions.mutationKey ?? updatePetWithFormMutationKey()
58
-
59
- return useMutation<
60
- UpdatePetWithFormMutationResponse,
61
- ResponseErrorConfig<UpdatePetWithForm405>,
62
- { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
63
- TContext
64
- >(
65
- () => ({
66
- mutationFn: async ({ petId, data, params }) => {
67
- return updatePetWithForm({ petId }, data, params, config)
68
- },
69
- mutationKey,
70
- ...mutationOptions,
71
- }),
72
- queryClient ? () => queryClient : undefined,
73
- )
74
- }