@kubb/plugin-react-query 3.0.0-alpha.9 → 3.0.0-beta.2
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/README.md +14 -5
- package/dist/chunk-37VO6QXJ.cjs +669 -0
- package/dist/chunk-37VO6QXJ.cjs.map +1 -0
- package/dist/chunk-C2H3KPHM.cjs +658 -0
- package/dist/chunk-C2H3KPHM.cjs.map +1 -0
- package/dist/chunk-IRW2Y3EC.js +660 -0
- package/dist/chunk-IRW2Y3EC.js.map +1 -0
- package/dist/chunk-Y3DM2P6L.js +647 -0
- package/dist/chunk-Y3DM2P6L.js.map +1 -0
- package/dist/components.cjs +39 -12
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +161 -6
- package/dist/components.d.ts +161 -6
- package/dist/components.js +2 -12
- package/dist/components.js.map +1 -1
- package/dist/generators.cjs +25 -0
- package/dist/generators.cjs.map +1 -0
- package/dist/generators.d.cts +14 -0
- package/dist/generators.d.ts +14 -0
- package/dist/generators.js +4 -0
- package/dist/generators.js.map +1 -0
- package/dist/index.cjs +78 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.js +61 -120
- package/dist/index.js.map +1 -1
- package/dist/types-5pnOmDmM.d.cts +231 -0
- package/dist/types-5pnOmDmM.d.ts +231 -0
- package/package.json +22 -17
- package/src/components/InfiniteQuery.tsx +129 -0
- package/src/components/InfiniteQueryOptions.tsx +130 -0
- package/src/components/Mutation.tsx +137 -321
- package/src/components/MutationKey.tsx +48 -0
- package/src/components/Query.tsx +91 -594
- package/src/components/QueryKey.tsx +51 -182
- package/src/components/QueryOptions.tsx +71 -473
- package/src/components/SuspenseQuery.tsx +129 -0
- package/src/components/index.ts +4 -0
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +51 -0
- package/src/generators/__snapshots__/clientGetImportPath.ts +51 -0
- package/src/generators/__snapshots__/clientPostImportPath.ts +44 -0
- package/src/generators/__snapshots__/findByTags.ts +51 -0
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +51 -0
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +51 -0
- package/src/generators/__snapshots__/findByTagsWithZod.ts +51 -0
- package/src/generators/__snapshots__/findInfiniteByTags.ts +57 -0
- package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +57 -0
- package/src/generators/__snapshots__/getAsMutation.ts +31 -0
- package/src/generators/__snapshots__/postAsQuery.ts +50 -0
- package/src/generators/__snapshots__/updatePetById.ts +44 -0
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +46 -0
- package/src/generators/index.ts +4 -0
- package/src/generators/infiniteQueryGenerator.tsx +124 -0
- package/src/generators/mutationGenerator.tsx +108 -0
- package/src/generators/queryGenerator.tsx +121 -0
- package/src/generators/suspenseQueryGenerator.tsx +120 -0
- package/src/plugin.ts +60 -76
- package/src/types.ts +42 -115
- package/dist/chunk-7ZODZVKP.cjs +0 -1470
- package/dist/chunk-7ZODZVKP.cjs.map +0 -1
- package/dist/chunk-ZYTZV43V.js +0 -1470
- package/dist/chunk-ZYTZV43V.js.map +0 -1
- package/dist/index-5kpkk-7M.d.cts +0 -545
- package/dist/index-5kpkk-7M.d.ts +0 -545
- package/src/OperationGenerator.tsx +0 -57
- package/src/__snapshots__/mutateAsQuery/updatePetWithForm.ts +0 -69
- package/src/__snapshots__/pathParamsTypeInline/getPetById.ts +0 -62
- package/src/__snapshots__/pathParamsTypeObject/getPetById.ts +0 -68
- package/src/__snapshots__/queryOptions/getPetById.ts +0 -41
- package/src/__snapshots__/queryWithoutQueryOptions/getPetById.ts +0 -51
- package/src/__snapshots__/variablesTypeMutate/deletePet.ts +0 -24
- package/src/components/QueryImports.tsx +0 -167
- package/src/components/SchemaType.tsx +0 -59
- package/src/components/__snapshots__/gen/showPetById.ts +0 -67
- package/src/components/__snapshots__/gen/useCreatePets.ts +0 -46
- package/src/components/__snapshots__/gen/useCreatePetsMutate.ts +0 -46
- package/src/utils.ts +0 -96
package/src/utils.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { PackageManager } from '@kubb/core'
|
|
2
|
-
|
|
3
|
-
export const reactQueryDepRegex = /@tanstack\/(react|solid|vue|svelte)-query/
|
|
4
|
-
|
|
5
|
-
export function getImportNames() {
|
|
6
|
-
const isV5 = new PackageManager().isValidSync(reactQueryDepRegex, '>=5')
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
mutation: {
|
|
10
|
-
react: {
|
|
11
|
-
path: '@tanstack/react-query',
|
|
12
|
-
hookName: 'useMutation',
|
|
13
|
-
optionsType: 'UseMutationOptions',
|
|
14
|
-
resultType: 'UseMutationResult',
|
|
15
|
-
},
|
|
16
|
-
solid: {
|
|
17
|
-
path: '@tanstack/solid-query',
|
|
18
|
-
hookName: 'createMutation',
|
|
19
|
-
optionsType: 'CreateMutationOptions',
|
|
20
|
-
resultType: 'CreateMutationResult',
|
|
21
|
-
},
|
|
22
|
-
svelte: {
|
|
23
|
-
path: '@tanstack/svelte-query',
|
|
24
|
-
hookName: 'createMutation',
|
|
25
|
-
optionsType: 'CreateMutationOptions',
|
|
26
|
-
resultType: 'CreateMutationResult',
|
|
27
|
-
},
|
|
28
|
-
vue: {
|
|
29
|
-
path: '@tanstack/vue-query',
|
|
30
|
-
hookName: 'useMutation',
|
|
31
|
-
optionsType: isV5 ? 'UseMutationOptions' : 'VueMutationObserverOptions',
|
|
32
|
-
resultType: 'UseMutationReturnType',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
query: {
|
|
36
|
-
react: {
|
|
37
|
-
path: '@tanstack/react-query',
|
|
38
|
-
hookName: 'useQuery',
|
|
39
|
-
optionsType: isV5 ? 'QueryObserverOptions' : 'UseBaseQueryOptions',
|
|
40
|
-
resultType: 'UseQueryResult',
|
|
41
|
-
},
|
|
42
|
-
solid: {
|
|
43
|
-
path: '@tanstack/solid-query',
|
|
44
|
-
hookName: 'createQuery',
|
|
45
|
-
optionsType: 'CreateBaseQueryOptions',
|
|
46
|
-
resultType: 'CreateQueryResult',
|
|
47
|
-
},
|
|
48
|
-
svelte: {
|
|
49
|
-
path: '@tanstack/svelte-query',
|
|
50
|
-
hookName: 'createQuery',
|
|
51
|
-
optionsType: 'CreateBaseQueryOptions',
|
|
52
|
-
resultType: 'CreateQueryResult',
|
|
53
|
-
},
|
|
54
|
-
vue: {
|
|
55
|
-
path: '@tanstack/vue-query',
|
|
56
|
-
hookName: 'useQuery',
|
|
57
|
-
optionsType: isV5 ? 'QueryObserverOptions' : 'VueQueryObserverOptions',
|
|
58
|
-
resultType: isV5 ? 'UseQueryReturnType' : 'UseQueryReturnType',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
queryInfinite: {
|
|
62
|
-
react: {
|
|
63
|
-
path: '@tanstack/react-query',
|
|
64
|
-
hookName: 'useInfiniteQuery',
|
|
65
|
-
optionsType: isV5 ? 'InfiniteQueryObserverOptions' : 'UseInfiniteQueryOptions',
|
|
66
|
-
resultType: 'UseInfiniteQueryResult',
|
|
67
|
-
},
|
|
68
|
-
solid: {
|
|
69
|
-
path: '@tanstack/solid-query',
|
|
70
|
-
hookName: 'createInfiniteQuery',
|
|
71
|
-
optionsType: 'CreateInfiniteQueryOptions',
|
|
72
|
-
resultType: 'CreateInfiniteQueryResult',
|
|
73
|
-
},
|
|
74
|
-
svelte: {
|
|
75
|
-
path: '@tanstack/svelte-query',
|
|
76
|
-
hookName: 'createInfiniteQuery',
|
|
77
|
-
optionsType: 'CreateInfiniteQueryOptions',
|
|
78
|
-
resultType: 'CreateInfiniteQueryResult',
|
|
79
|
-
},
|
|
80
|
-
vue: {
|
|
81
|
-
path: '@tanstack/vue-query',
|
|
82
|
-
hookName: 'useInfiniteQuery',
|
|
83
|
-
optionsType: isV5 ? 'UseInfiniteQueryOptions' : 'VueInfiniteQueryObserverOptions',
|
|
84
|
-
resultType: isV5 ? 'UseInfiniteQueryReturnType' : 'VueInfiniteQueryObserverOptions',
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
querySuspense: {
|
|
88
|
-
react: {
|
|
89
|
-
path: '@tanstack/react-query',
|
|
90
|
-
hookName: 'useSuspenseQuery',
|
|
91
|
-
optionsType: 'UseSuspenseQueryOptions',
|
|
92
|
-
resultType: 'UseSuspenseQueryResult',
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
} as const
|
|
96
|
-
}
|