@kubb/plugin-solid-query 4.13.0 → 4.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-solid-query",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.1",
|
|
4
4
|
"description": "Solid Query hooks generator plugin for Kubb, creating type-safe API client hooks from OpenAPI specifications for Solid.js applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"solid-query",
|
|
@@ -68,17 +68,17 @@
|
|
|
68
68
|
}
|
|
69
69
|
],
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@kubb/react-fabric": "0.9.
|
|
71
|
+
"@kubb/react-fabric": "0.9.2",
|
|
72
72
|
"remeda": "^2.33.1",
|
|
73
|
-
"@kubb/
|
|
74
|
-
"@kubb/
|
|
75
|
-
"@kubb/plugin-client": "4.13.
|
|
76
|
-
"@kubb/plugin-oas": "4.13.
|
|
77
|
-
"@kubb/plugin-ts": "4.13.
|
|
78
|
-
"@kubb/plugin-zod": "4.13.
|
|
73
|
+
"@kubb/oas": "4.13.1",
|
|
74
|
+
"@kubb/core": "4.13.1",
|
|
75
|
+
"@kubb/plugin-client": "4.13.1",
|
|
76
|
+
"@kubb/plugin-oas": "4.13.1",
|
|
77
|
+
"@kubb/plugin-ts": "4.13.1",
|
|
78
|
+
"@kubb/plugin-zod": "4.13.1"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"@kubb/react-fabric": "0.9.
|
|
81
|
+
"@kubb/react-fabric": "0.9.2"
|
|
82
82
|
},
|
|
83
83
|
"engines": {
|
|
84
84
|
"node": ">=20"
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by Kubb (https://kubb.dev/).
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
*/
|
|
5
|
+
import fetch from 'axios'
|
|
6
|
+
import type { UseMutationOptions, QueryClient } from '@tanstack/solid-query'
|
|
7
|
+
import type { RequestConfig, ResponseErrorConfig } from 'axios'
|
|
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?: typeof fetch } = {},
|
|
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?: typeof fetch }
|
|
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
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 { 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?: typeof fetch } = {},
|
|
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?: typeof fetch }
|
|
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
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 { 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?: typeof fetch } = {},
|
|
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?: typeof fetch }
|
|
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
|
+
}
|