@kubb/plugin-react-query 3.0.0-alpha.17 → 3.0.0-alpha.18

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.
@@ -6,7 +6,7 @@ import { useOperationManager } from '@kubb/plugin-oas/hooks'
6
6
  import { pluginTsName } from '@kubb/plugin-ts'
7
7
  import { pluginZodName } from '@kubb/plugin-zod'
8
8
  import { File, useApp } from '@kubb/react'
9
- import { InfiniteQuery, InfiniteQueryOptions, Query, QueryKey, QueryOptions, SuspenseQuery } from '../components'
9
+ import { QueryKey, QueryOptions, SuspenseQuery } from '../components'
10
10
  import type { PluginReactQuery } from '../types'
11
11
 
12
12
  export const suspenseQueryGenerator = createReactGenerator<PluginReactQuery>({
package/src/types.ts CHANGED
@@ -4,9 +4,9 @@ import type * as KubbFile from '@kubb/fs/types'
4
4
  import type { HttpMethod } from '@kubb/oas'
5
5
  import type { Exclude, Include, Override, ResolvePathOptions } from '@kubb/plugin-oas'
6
6
 
7
- export type Suspense = object
7
+ type Suspense = object
8
8
 
9
- export type Query = {
9
+ type Query = {
10
10
  /**
11
11
  * Customize the queryKey, here you can specify a suffix.
12
12
  */
@@ -26,7 +26,7 @@ export type Query = {
26
26
  importPath?: string
27
27
  }
28
28
 
29
- export type Mutation = {
29
+ type Mutation = {
30
30
  /**
31
31
  * Define which HttpMethods can be used for mutations
32
32
  * @default ['post', 'put', 'delete']
@@ -199,9 +199,4 @@ type ResolvedOptions = {
199
199
  mutation: NonNullable<Required<Mutation>> | false
200
200
  }
201
201
 
202
- export type FileMeta = {
203
- pluginKey?: Plugin['key']
204
- tag?: string
205
- }
206
-
207
202
  export type PluginReactQuery = PluginFactoryOptions<'plugin-react-query', Options, ResolvedOptions, never, ResolvePathOptions>
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
- }