@kubb/plugin-vue-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/generators.cjs +1 -1
  2. package/dist/generators.js +1 -1
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/{queryGenerator-gk8pNl_4.js → queryGenerator-Da1vIMnD.js} +7 -7
  6. package/dist/queryGenerator-Da1vIMnD.js.map +1 -0
  7. package/dist/{queryGenerator-e6WGv0jo.cjs → queryGenerator-Y2_A3T-a.cjs} +7 -7
  8. package/dist/queryGenerator-Y2_A3T-a.cjs.map +1 -0
  9. package/package.json +11 -10
  10. package/src/generators/infiniteQueryGenerator.tsx +4 -2
  11. package/src/generators/mutationGenerator.tsx +4 -2
  12. package/src/generators/queryGenerator.tsx +4 -2
  13. package/dist/queryGenerator-e6WGv0jo.cjs.map +0 -1
  14. package/dist/queryGenerator-gk8pNl_4.js.map +0 -1
  15. package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +0 -102
  16. package/src/generators/__snapshots__/clientGetImportPath.ts +0 -91
  17. package/src/generators/__snapshots__/clientPostImportPath.ts +0 -77
  18. package/src/generators/__snapshots__/findByTags.ts +0 -91
  19. package/src/generators/__snapshots__/findByTagsObject.ts +0 -88
  20. package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +0 -91
  21. package/src/generators/__snapshots__/findByTagsTemplateString.ts +0 -92
  22. package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +0 -91
  23. package/src/generators/__snapshots__/findByTagsWithZod.ts +0 -91
  24. package/src/generators/__snapshots__/findInfiniteByTags.ts +0 -105
  25. package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +0 -105
  26. package/src/generators/__snapshots__/postAsQuery.ts +0 -104
  27. package/src/generators/__snapshots__/updatePetById.ts +0 -77
  28. package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +0 -77
@@ -1,77 +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 { MutationObserverOptions, QueryClient } from '@tanstack/vue-query'
7
- import type { MaybeRefOrGetter } from 'vue'
8
- import { fetch } from './test/.kubb/fetch'
9
- import { useMutation } from '@tanstack/vue-query'
10
-
11
- export const updatePetWithFormMutationKey = () => [{ url: '/pet/:petId' }] as const
12
-
13
- export type UpdatePetWithFormMutationKey = ReturnType<typeof updatePetWithFormMutationKey>
14
-
15
- /**
16
- * @summary Updates a pet in the store with form data
17
- * {@link /pet/:petId}
18
- */
19
- export async function updatePetWithForm(
20
- { petId }: { petId: UpdatePetWithFormPathParams['petId'] },
21
- data?: UpdatePetWithFormMutationRequest,
22
- params?: UpdatePetWithFormQueryParams,
23
- config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: Client } = {},
24
- ) {
25
- const { client: request = fetch, ...requestConfig } = config
26
-
27
- const requestData = updatePetWithFormMutationRequest.parse(data)
28
-
29
- const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
30
- method: 'POST',
31
- url: `/pet/${petId}`,
32
- params,
33
- data: requestData,
34
- ...requestConfig,
35
- })
36
- return updatePetWithFormMutationResponse.parse(res.data)
37
- }
38
-
39
- /**
40
- * @summary Updates a pet in the store with form data
41
- * {@link /pet/:petId}
42
- */
43
- export function useUpdatePetWithForm<TContext>(
44
- options: {
45
- mutation?: MutationObserverOptions<
46
- UpdatePetWithFormMutationResponse,
47
- ResponseErrorConfig<UpdatePetWithForm405>,
48
- {
49
- petId: MaybeRefOrGetter<UpdatePetWithFormPathParams['petId']>
50
- data?: MaybeRefOrGetter<UpdatePetWithFormMutationRequest>
51
- params?: MaybeRefOrGetter<UpdatePetWithFormQueryParams>
52
- },
53
- TContext
54
- > & { client?: QueryClient }
55
- client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: Client }
56
- } = {},
57
- ) {
58
- const { mutation = {}, client: config = {} } = options ?? {}
59
- const { client: queryClient, ...mutationOptions } = mutation
60
- const mutationKey = mutationOptions?.mutationKey ?? updatePetWithFormMutationKey()
61
-
62
- return useMutation<
63
- UpdatePetWithFormMutationResponse,
64
- ResponseErrorConfig<UpdatePetWithForm405>,
65
- { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
66
- TContext
67
- >(
68
- {
69
- mutationFn: async ({ petId, data, params }) => {
70
- return updatePetWithForm({ petId }, data, params, config)
71
- },
72
- mutationKey,
73
- ...mutationOptions,
74
- },
75
- queryClient,
76
- )
77
- }