@kubb/plugin-vue-query 4.4.0 → 4.5.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.
- package/dist/{components-DoPUxAFs.cjs → components-CvorLYVT.cjs} +214 -214
- package/dist/components-CvorLYVT.cjs.map +1 -0
- package/dist/{components-B8p5782n.js → components-kADKAHgd.js} +213 -213
- package/dist/components-kADKAHgd.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.cts +114 -114
- package/dist/components.d.ts +114 -114
- package/dist/components.js +1 -1
- package/dist/{generators-a7s1tUe0.cjs → generators-B7BEw8ZB.cjs} +206 -143
- package/dist/generators-B7BEw8ZB.cjs.map +1 -0
- package/dist/{generators-CxbnV3X_.js → generators-DHkXUh19.js} +203 -141
- package/dist/generators-DHkXUh19.js.map +1 -0
- package/dist/generators.cjs +2 -2
- package/dist/generators.d.cts +5 -5
- package/dist/generators.d.ts +5 -5
- package/dist/generators.js +2 -2
- package/dist/index.cjs +18 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/dist/{types-B1jcCl0j.d.cts → types-BfKwA3Gv.d.cts} +188 -310
- package/dist/{types-DDtBZP0d.d.ts → types-I09wleY8.d.ts} +188 -310
- package/package.json +18 -14
- package/src/components/QueryOptions.tsx +1 -1
- package/src/components/index.ts +3 -3
- package/src/generators/index.ts +2 -2
- package/src/generators/infiniteQueryGenerator.tsx +35 -11
- package/src/generators/mutationGenerator.tsx +34 -9
- package/src/generators/queryGenerator.tsx +35 -11
- package/src/plugin.ts +24 -1
- package/src/types.ts +4 -3
- package/dist/components-B8p5782n.js.map +0 -1
- package/dist/components-DoPUxAFs.cjs.map +0 -1
- package/dist/generators-CxbnV3X_.js.map +0 -1
- package/dist/generators-a7s1tUe0.cjs.map +0 -1
|
@@ -3,9 +3,9 @@ import { Client } from '@kubb/plugin-client/components'
|
|
|
3
3
|
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
4
4
|
import { getPathParams } from '@kubb/plugin-oas/utils'
|
|
5
5
|
import { File, Function, FunctionParams } from '@kubb/react-fabric'
|
|
6
|
+
import type { KubbNode } from '@kubb/react-fabric/types'
|
|
6
7
|
import type { PluginVueQuery } from '../types.ts'
|
|
7
8
|
import { QueryKey } from './QueryKey.tsx'
|
|
8
|
-
import type { KubbNode } from '@kubb/react-fabric/types'
|
|
9
9
|
|
|
10
10
|
type Props = {
|
|
11
11
|
name: string
|
package/src/components/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
export { InfiniteQuery } from './InfiniteQuery.tsx'
|
|
2
|
+
export { InfiniteQueryOptions } from './InfiniteQueryOptions.tsx'
|
|
1
3
|
export { Mutation } from './Mutation.tsx'
|
|
4
|
+
export { MutationKey } from './MutationKey.tsx'
|
|
2
5
|
export { Query } from './Query.tsx'
|
|
3
6
|
export { QueryKey } from './QueryKey.tsx'
|
|
4
7
|
export { QueryOptions } from './QueryOptions.tsx'
|
|
5
|
-
export { InfiniteQueryOptions } from './InfiniteQueryOptions.tsx'
|
|
6
|
-
export { InfiniteQuery } from './InfiniteQuery.tsx'
|
|
7
|
-
export { MutationKey } from './MutationKey.tsx'
|
package/src/generators/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { queryGenerator } from './queryGenerator.tsx'
|
|
2
|
-
export { mutationGenerator } from './mutationGenerator.tsx'
|
|
3
1
|
export { infiniteQueryGenerator } from './infiniteQueryGenerator.tsx'
|
|
2
|
+
export { mutationGenerator } from './mutationGenerator.tsx'
|
|
3
|
+
export { queryGenerator } from './queryGenerator.tsx'
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
import { usePluginManager } from '@kubb/core/hooks'
|
|
2
3
|
import { pluginClientName } from '@kubb/plugin-client'
|
|
3
4
|
import { Client } from '@kubb/plugin-client/components'
|
|
4
|
-
import { createReactGenerator } from '@kubb/plugin-oas'
|
|
5
|
+
import { createReactGenerator } from '@kubb/plugin-oas/generators'
|
|
5
6
|
import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'
|
|
6
7
|
import { getBanner, getFooter } from '@kubb/plugin-oas/utils'
|
|
7
8
|
import { pluginTsName } from '@kubb/plugin-ts'
|
|
@@ -13,14 +14,15 @@ import type { PluginVueQuery } from '../types'
|
|
|
13
14
|
|
|
14
15
|
export const infiniteQueryGenerator = createReactGenerator<PluginVueQuery>({
|
|
15
16
|
name: 'vue-infinite-query',
|
|
16
|
-
Operation({
|
|
17
|
+
Operation({ config, operation, generator, plugin }) {
|
|
17
18
|
const {
|
|
19
|
+
options,
|
|
18
20
|
options: { output },
|
|
19
|
-
} =
|
|
21
|
+
} = plugin
|
|
20
22
|
const pluginManager = usePluginManager()
|
|
21
23
|
|
|
22
24
|
const oas = useOas()
|
|
23
|
-
const { getSchemas, getName, getFile } = useOperationManager()
|
|
25
|
+
const { getSchemas, getName, getFile } = useOperationManager(generator)
|
|
24
26
|
|
|
25
27
|
const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)
|
|
26
28
|
const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(
|
|
@@ -84,12 +86,34 @@ export const infiniteQueryGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
84
86
|
{options.parser === 'zod' && (
|
|
85
87
|
<File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />
|
|
86
88
|
)}
|
|
89
|
+
{options.client.importPath ? (
|
|
90
|
+
<>
|
|
91
|
+
<File.Import name={'fetch'} path={options.client.importPath} />
|
|
92
|
+
<File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
|
|
93
|
+
{options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}
|
|
94
|
+
</>
|
|
95
|
+
) : (
|
|
96
|
+
<>
|
|
97
|
+
<File.Import name={'fetch'} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')} />
|
|
98
|
+
<File.Import
|
|
99
|
+
name={['RequestConfig', 'ResponseErrorConfig']}
|
|
100
|
+
root={query.file.path}
|
|
101
|
+
path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}
|
|
102
|
+
isTypeOnly
|
|
103
|
+
/>
|
|
104
|
+
{options.client.dataReturnType === 'full' && (
|
|
105
|
+
<File.Import
|
|
106
|
+
name={['ResponseConfig']}
|
|
107
|
+
root={query.file.path}
|
|
108
|
+
path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}
|
|
109
|
+
isTypeOnly
|
|
110
|
+
/>
|
|
111
|
+
)}
|
|
112
|
+
</>
|
|
113
|
+
)}
|
|
87
114
|
<File.Import name={['toValue']} path="vue" />
|
|
88
115
|
<File.Import name={['MaybeRefOrGetter']} path="vue" isTypeOnly />
|
|
89
|
-
<File.Import name={'fetch'} path={options.client.importPath} />
|
|
90
116
|
{hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}
|
|
91
|
-
<File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
|
|
92
|
-
{options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}
|
|
93
117
|
<File.Import
|
|
94
118
|
name={[
|
|
95
119
|
type.schemas.request?.name,
|
|
@@ -119,7 +143,7 @@ export const infiniteQueryGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
119
143
|
operation={operation}
|
|
120
144
|
typeSchemas={type.schemas}
|
|
121
145
|
zodSchemas={zod.schemas}
|
|
122
|
-
dataReturnType={options.client.dataReturnType}
|
|
146
|
+
dataReturnType={options.client.dataReturnType || 'data'}
|
|
123
147
|
paramsCasing={options.paramsCasing}
|
|
124
148
|
paramsType={options.paramsType}
|
|
125
149
|
pathParamsType={options.pathParamsType}
|
|
@@ -138,7 +162,7 @@ export const infiniteQueryGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
138
162
|
paramsType={options.paramsType}
|
|
139
163
|
paramsCasing={options.paramsCasing}
|
|
140
164
|
pathParamsType={options.pathParamsType}
|
|
141
|
-
dataReturnType={options.client.dataReturnType}
|
|
165
|
+
dataReturnType={options.client.dataReturnType || 'data'}
|
|
142
166
|
cursorParam={options.infinite.cursorParam}
|
|
143
167
|
initialPageParam={options.infinite.initialPageParam}
|
|
144
168
|
queryParam={options.infinite.queryParam}
|
|
@@ -157,7 +181,7 @@ export const infiniteQueryGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
157
181
|
paramsType={options.paramsType}
|
|
158
182
|
pathParamsType={options.pathParamsType}
|
|
159
183
|
operation={operation}
|
|
160
|
-
dataReturnType={options.client.dataReturnType}
|
|
184
|
+
dataReturnType={options.client.dataReturnType || 'data'}
|
|
161
185
|
queryKeyName={queryKey.name}
|
|
162
186
|
queryKeyTypeName={queryKey.typeName}
|
|
163
187
|
/>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
import { usePluginManager } from '@kubb/core/hooks'
|
|
2
3
|
import { pluginClientName } from '@kubb/plugin-client'
|
|
3
4
|
import { Client } from '@kubb/plugin-client/components'
|
|
4
|
-
import { createReactGenerator } from '@kubb/plugin-oas'
|
|
5
|
+
import { createReactGenerator } from '@kubb/plugin-oas/generators'
|
|
5
6
|
import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'
|
|
6
7
|
import { getBanner, getFooter } from '@kubb/plugin-oas/utils'
|
|
7
8
|
import { pluginTsName } from '@kubb/plugin-ts'
|
|
@@ -13,14 +14,15 @@ import type { PluginVueQuery } from '../types'
|
|
|
13
14
|
|
|
14
15
|
export const mutationGenerator = createReactGenerator<PluginVueQuery>({
|
|
15
16
|
name: 'vue-query',
|
|
16
|
-
Operation({
|
|
17
|
+
Operation({ config, operation, generator, plugin }) {
|
|
17
18
|
const {
|
|
19
|
+
options,
|
|
18
20
|
options: { output },
|
|
19
|
-
} =
|
|
21
|
+
} = plugin
|
|
20
22
|
const pluginManager = usePluginManager()
|
|
21
23
|
|
|
22
24
|
const oas = useOas()
|
|
23
|
-
const { getSchemas, getName, getFile } = useOperationManager()
|
|
25
|
+
const { getSchemas, getName, getFile } = useOperationManager(generator)
|
|
24
26
|
|
|
25
27
|
const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method)
|
|
26
28
|
const isMutation =
|
|
@@ -79,10 +81,33 @@ export const mutationGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
79
81
|
{options.parser === 'zod' && (
|
|
80
82
|
<File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={mutation.file.path} path={zod.file.path} />
|
|
81
83
|
)}
|
|
84
|
+
{options.client.importPath ? (
|
|
85
|
+
<>
|
|
86
|
+
<File.Import name={'fetch'} path={options.client.importPath} />
|
|
87
|
+
<File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
|
|
88
|
+
{options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}
|
|
89
|
+
</>
|
|
90
|
+
) : (
|
|
91
|
+
<>
|
|
92
|
+
<File.Import name={'fetch'} root={mutation.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')} />
|
|
93
|
+
<File.Import
|
|
94
|
+
name={['RequestConfig', 'ResponseErrorConfig']}
|
|
95
|
+
root={mutation.file.path}
|
|
96
|
+
path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}
|
|
97
|
+
isTypeOnly
|
|
98
|
+
/>
|
|
99
|
+
{options.client.dataReturnType === 'full' && (
|
|
100
|
+
<File.Import
|
|
101
|
+
name={['ResponseConfig']}
|
|
102
|
+
root={mutation.file.path}
|
|
103
|
+
path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}
|
|
104
|
+
isTypeOnly
|
|
105
|
+
/>
|
|
106
|
+
)}
|
|
107
|
+
</>
|
|
108
|
+
)}
|
|
82
109
|
<File.Import name={['MaybeRefOrGetter']} path="vue" isTypeOnly />
|
|
83
|
-
<File.Import name={'fetch'} path={options.client.importPath} />
|
|
84
110
|
{!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}
|
|
85
|
-
<File.Import name={['RequestConfig', 'ResponseConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
|
|
86
111
|
<File.Import
|
|
87
112
|
name={[
|
|
88
113
|
type.schemas.request?.name,
|
|
@@ -112,7 +137,7 @@ export const mutationGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
112
137
|
operation={operation}
|
|
113
138
|
typeSchemas={type.schemas}
|
|
114
139
|
zodSchemas={zod.schemas}
|
|
115
|
-
dataReturnType={options.client.dataReturnType}
|
|
140
|
+
dataReturnType={options.client.dataReturnType || 'data'}
|
|
116
141
|
paramsCasing={options.paramsCasing}
|
|
117
142
|
paramsType={options.paramsType}
|
|
118
143
|
pathParamsType={options.pathParamsType}
|
|
@@ -130,7 +155,7 @@ export const mutationGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
130
155
|
typeSchemas={type.schemas}
|
|
131
156
|
operation={operation}
|
|
132
157
|
paramsCasing={options.paramsCasing}
|
|
133
|
-
dataReturnType={options.client.dataReturnType}
|
|
158
|
+
dataReturnType={options.client.dataReturnType || 'data'}
|
|
134
159
|
paramsType={options.paramsType}
|
|
135
160
|
pathParamsType={options.pathParamsType}
|
|
136
161
|
mutationKeyName={mutationKey.name}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
import { usePluginManager } from '@kubb/core/hooks'
|
|
2
3
|
import { pluginClientName } from '@kubb/plugin-client'
|
|
3
4
|
import { Client } from '@kubb/plugin-client/components'
|
|
4
|
-
import { createReactGenerator } from '@kubb/plugin-oas'
|
|
5
|
+
import { createReactGenerator } from '@kubb/plugin-oas/generators'
|
|
5
6
|
import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'
|
|
6
7
|
import { getBanner, getFooter } from '@kubb/plugin-oas/utils'
|
|
7
8
|
import { pluginTsName } from '@kubb/plugin-ts'
|
|
@@ -13,14 +14,15 @@ import type { PluginVueQuery } from '../types'
|
|
|
13
14
|
|
|
14
15
|
export const queryGenerator = createReactGenerator<PluginVueQuery>({
|
|
15
16
|
name: 'vue-query',
|
|
16
|
-
Operation({
|
|
17
|
+
Operation({ config, operation, generator, plugin }) {
|
|
17
18
|
const {
|
|
19
|
+
options,
|
|
18
20
|
options: { output },
|
|
19
|
-
} =
|
|
21
|
+
} = plugin
|
|
20
22
|
const pluginManager = usePluginManager()
|
|
21
23
|
|
|
22
24
|
const oas = useOas()
|
|
23
|
-
const { getSchemas, getName, getFile } = useOperationManager()
|
|
25
|
+
const { getSchemas, getName, getFile } = useOperationManager(generator)
|
|
24
26
|
|
|
25
27
|
const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)
|
|
26
28
|
const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(
|
|
@@ -82,12 +84,34 @@ export const queryGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
82
84
|
{options.parser === 'zod' && (
|
|
83
85
|
<File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />
|
|
84
86
|
)}
|
|
87
|
+
{options.client.importPath ? (
|
|
88
|
+
<>
|
|
89
|
+
<File.Import name={'fetch'} path={options.client.importPath} />
|
|
90
|
+
<File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
|
|
91
|
+
{options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}
|
|
92
|
+
</>
|
|
93
|
+
) : (
|
|
94
|
+
<>
|
|
95
|
+
<File.Import name={'fetch'} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')} />
|
|
96
|
+
<File.Import
|
|
97
|
+
name={['RequestConfig', 'ResponseErrorConfig']}
|
|
98
|
+
root={query.file.path}
|
|
99
|
+
path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}
|
|
100
|
+
isTypeOnly
|
|
101
|
+
/>
|
|
102
|
+
{options.client.dataReturnType === 'full' && (
|
|
103
|
+
<File.Import
|
|
104
|
+
name={['ResponseConfig']}
|
|
105
|
+
root={query.file.path}
|
|
106
|
+
path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}
|
|
107
|
+
isTypeOnly
|
|
108
|
+
/>
|
|
109
|
+
)}
|
|
110
|
+
</>
|
|
111
|
+
)}
|
|
85
112
|
<File.Import name={['toValue']} path="vue" />
|
|
86
113
|
<File.Import name={['MaybeRefOrGetter']} path="vue" isTypeOnly />
|
|
87
|
-
<File.Import name={'fetch'} path={options.client.importPath} />
|
|
88
114
|
{!!hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}
|
|
89
|
-
<File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
|
|
90
|
-
{options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}
|
|
91
115
|
<File.Import
|
|
92
116
|
name={[
|
|
93
117
|
type.schemas.request?.name,
|
|
@@ -117,7 +141,7 @@ export const queryGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
117
141
|
operation={operation}
|
|
118
142
|
typeSchemas={type.schemas}
|
|
119
143
|
zodSchemas={zod.schemas}
|
|
120
|
-
dataReturnType={options.client.dataReturnType}
|
|
144
|
+
dataReturnType={options.client.dataReturnType || 'data'}
|
|
121
145
|
paramsCasing={options.paramsCasing}
|
|
122
146
|
paramsType={options.paramsType}
|
|
123
147
|
pathParamsType={options.pathParamsType}
|
|
@@ -133,7 +157,7 @@ export const queryGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
133
157
|
typeSchemas={type.schemas}
|
|
134
158
|
paramsType={options.paramsType}
|
|
135
159
|
pathParamsType={options.pathParamsType}
|
|
136
|
-
dataReturnType={options.client.dataReturnType}
|
|
160
|
+
dataReturnType={options.client.dataReturnType || 'data'}
|
|
137
161
|
/>
|
|
138
162
|
{options.query && (
|
|
139
163
|
<>
|
|
@@ -147,7 +171,7 @@ export const queryGenerator = createReactGenerator<PluginVueQuery>({
|
|
|
147
171
|
paramsType={options.paramsType}
|
|
148
172
|
pathParamsType={options.pathParamsType}
|
|
149
173
|
operation={operation}
|
|
150
|
-
dataReturnType={options.client.dataReturnType}
|
|
174
|
+
dataReturnType={options.client.dataReturnType || 'data'}
|
|
151
175
|
queryKeyName={queryKey.name}
|
|
152
176
|
queryKeyTypeName={queryKey.typeName}
|
|
153
177
|
/>
|
package/src/plugin.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import { createPlugin, type Group, getBarrelFiles, getMode, type Plugin, PluginManager } from '@kubb/core'
|
|
3
3
|
import { camelCase, pascalCase } from '@kubb/core/transformers'
|
|
4
|
+
import { resolveModuleSource } from '@kubb/core/utils'
|
|
5
|
+
import { pluginClientName } from '@kubb/plugin-client'
|
|
4
6
|
import type { PluginOas } from '@kubb/plugin-oas'
|
|
5
7
|
import { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'
|
|
6
8
|
import { pluginTsName } from '@kubb/plugin-ts'
|
|
@@ -37,7 +39,8 @@ export const pluginVueQuery = createPlugin<PluginVueQuery>((options) => {
|
|
|
37
39
|
options: {
|
|
38
40
|
output,
|
|
39
41
|
client: {
|
|
40
|
-
|
|
42
|
+
client: 'axios',
|
|
43
|
+
importPath: undefined,
|
|
41
44
|
dataReturnType: 'data',
|
|
42
45
|
pathParamsType,
|
|
43
46
|
...options.client,
|
|
@@ -135,6 +138,26 @@ export const pluginVueQuery = createPlugin<PluginVueQuery>((options) => {
|
|
|
135
138
|
if (baseURL) {
|
|
136
139
|
this.plugin.options.client.baseURL = baseURL
|
|
137
140
|
}
|
|
141
|
+
|
|
142
|
+
const hasClientPlugin = !!this.pluginManager.getPluginByKey([pluginClientName])
|
|
143
|
+
const containsFetcher = this.fileManager.files.some((file) => file.baseName === 'fetcher.ts')
|
|
144
|
+
|
|
145
|
+
if (!hasClientPlugin && !this.plugin.options.client.importPath && !containsFetcher) {
|
|
146
|
+
// pre add bundled fetcher
|
|
147
|
+
await this.addFile({
|
|
148
|
+
baseName: 'fetcher.ts',
|
|
149
|
+
path: path.resolve(root, '.kubb/fetcher.ts'),
|
|
150
|
+
sources: [
|
|
151
|
+
{
|
|
152
|
+
name: 'fetcher',
|
|
153
|
+
value: resolveModuleSource(
|
|
154
|
+
this.plugin.options.client.client === 'fetch' ? '@kubb/plugin-client/templates/clients/fetch' : '@kubb/plugin-client/templates/clients/axios',
|
|
155
|
+
).source,
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
|
|
138
161
|
const operationGenerator = new OperationGenerator(this.plugin.options, {
|
|
139
162
|
fabric: this.fabric,
|
|
140
163
|
oas,
|
package/src/types.ts
CHANGED
|
@@ -2,7 +2,8 @@ import type { Group, Output, PluginFactoryOptions, ResolveNameParams } from '@ku
|
|
|
2
2
|
|
|
3
3
|
import type { contentType, HttpMethod, Oas, Operation } from '@kubb/oas'
|
|
4
4
|
import type { PluginClient } from '@kubb/plugin-client'
|
|
5
|
-
import type { Exclude,
|
|
5
|
+
import type { Exclude, Include, OperationSchemas, Override, ResolvePathOptions } from '@kubb/plugin-oas'
|
|
6
|
+
import type { Generator } from '@kubb/plugin-oas/generators'
|
|
6
7
|
|
|
7
8
|
type TransformerProps = {
|
|
8
9
|
operation: Operation
|
|
@@ -86,7 +87,7 @@ export type Options = {
|
|
|
86
87
|
* Group the @tanstack/query hooks based on the provided name.
|
|
87
88
|
*/
|
|
88
89
|
group?: Group
|
|
89
|
-
client?: Pick<PluginClient['options'], 'dataReturnType' | 'importPath' | 'baseURL'>
|
|
90
|
+
client?: Pick<PluginClient['options'], 'client' | 'dataReturnType' | 'importPath' | 'baseURL'>
|
|
90
91
|
|
|
91
92
|
/**
|
|
92
93
|
* Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
|
|
@@ -153,7 +154,7 @@ export type Options = {
|
|
|
153
154
|
type ResolvedOptions = {
|
|
154
155
|
output: Output<Oas>
|
|
155
156
|
group: Options['group']
|
|
156
|
-
client:
|
|
157
|
+
client: NonNullable<PluginVueQuery['options']['client']>
|
|
157
158
|
parser: Required<NonNullable<Options['parser']>>
|
|
158
159
|
paramsCasing: Options['paramsCasing']
|
|
159
160
|
paramsType: NonNullable<Options['paramsType']>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components-B8p5782n.js","names":["getParams","getTransformer: Transformer","getTransformer","getParams","getParams","getTransformer: Transformer","getParams","name","getParams","getParams","name"],"sources":["../src/components/MutationKey.tsx","../src/components/Mutation.tsx","../src/components/QueryKey.tsx","../src/components/QueryOptions.tsx","../src/components/Query.tsx","../src/components/InfiniteQueryOptions.tsx","../src/components/InfiniteQuery.tsx"],"sourcesContent":["import { URLPath } from '@kubb/core/utils'\nimport type { Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { File, Function, FunctionParams, Type } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery, Transformer } from '../types'\n\ntype Props = {\n name: string\n typeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n transformer: Transformer | undefined\n}\n\ntype GetParamsProps = {\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({}: GetParamsProps) {\n return FunctionParams.factory({})\n}\n\nconst getTransformer: Transformer = ({ operation, casing }) => {\n const path = new URLPath(operation.path, { casing })\n\n return [`{ url: '${path.toURLPath()}' }`]\n}\n\nexport function MutationKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }: Props): KubbNode {\n const params = getParams({ pathParamsType, typeSchemas })\n const keys = transformer({ operation, schemas: typeSchemas, casing: paramsCasing })\n\n return (\n <>\n <File.Source name={name} isExportable isIndexable>\n <Function.Arrow name={name} export params={params.toConstructor()} singleLine>\n {`[${keys.join(', ')}] as const`}\n </Function.Arrow>\n </File.Source>\n <File.Source name={typeName} isExportable isIndexable isTypeOnly>\n <Type name={typeName} export>\n {`ReturnType<typeof ${name}>`}\n </Type>\n </File.Source>\n </>\n )\n}\n\nMutationKey.getParams = getParams\nMutationKey.getTransformer = getTransformer\n","import { isOptional, type Operation } from '@kubb/oas'\nimport { Client } from '@kubb/plugin-client/components'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode, Params } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { MutationKey } from './MutationKey.tsx'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n typeName: string\n clientName: string\n mutationKeyName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsCasing, dataReturnType, typeSchemas }: GetParamsProps) {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const mutationParams = FunctionParams.factory({\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n })\n const TRequest = mutationParams.toConstructor()\n\n return FunctionParams.factory({\n options: {\n type: `\n{\n mutation?: MutationObserverOptions<${[TData, TError, TRequest ? `{${TRequest}}` : 'void', 'TContext'].join(', ')}> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'},\n}\n`,\n default: '{}',\n },\n })\n}\n\nexport function Mutation({\n name,\n clientName,\n paramsCasing,\n paramsType,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n operation,\n mutationKeyName,\n}: Props): KubbNode {\n const mutationKeyParams = MutationKey.getParams({\n pathParamsType,\n typeSchemas,\n })\n\n const params = getParams({\n paramsCasing,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n })\n\n const clientParams = Client.getParams({\n paramsCasing,\n paramsType,\n typeSchemas,\n pathParamsType,\n isConfigurable: true,\n })\n\n const mutationParams = FunctionParams.factory({\n ...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: typeSchemas.queryParams?.name,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: typeSchemas.headerParams?.name,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n })\n const dataParams = FunctionParams.factory({\n data: {\n // No use of pathParams because useMutation can only take one argument in object form,\n // see https://tanstack.com/query/latest/docs/framework/react/reference/useMutation#usemutation\n mode: 'object',\n children: Object.entries(mutationParams.params).reduce((acc, [key, value]) => {\n if (value) {\n acc[key] = {\n ...value,\n type: undefined,\n }\n }\n\n return acc\n }, {} as Params),\n },\n })\n\n const TRequest = mutationParams.toConstructor()\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const generics = [TData, TError, TRequest ? `{${TRequest}}` : 'void', 'TContext'].join(', ')\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n params={params.toConstructor()}\n JSDoc={{\n comments: getComments(operation),\n }}\n generics={['TContext']}\n >\n {`\n const { mutation = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...mutationOptions } = mutation;\n const mutationKey = mutationOptions?.mutationKey ?? ${mutationKeyName}(${mutationKeyParams.toCall()})\n\n return useMutation<${generics}>({\n mutationFn: async(${dataParams.toConstructor()}) => {\n return ${clientName}(${clientParams.toCall()})\n },\n mutationKey,\n ...mutationOptions\n }, queryClient)\n `}\n </Function>\n </File.Source>\n )\n}\n","import { URLPath } from '@kubb/core/utils'\nimport { isOptional, type Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams, Type } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery, Transformer } from '../types'\n\ntype Props = {\n name: string\n typeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n transformer: Transformer | undefined\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ pathParamsType, paramsCasing, typeSchemas }: GetParamsProps) {\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n })\n}\n\nconst getTransformer: Transformer = ({ operation, schemas, casing }) => {\n const path = new URLPath(operation.path, { casing })\n const keys = [\n path.toObject({\n type: 'path',\n stringify: true,\n }),\n schemas.queryParams?.name ? '...(params ? [params] : [])' : undefined,\n schemas.request?.name ? '...(data ? [data] : [])' : undefined,\n ].filter(Boolean)\n\n return keys\n}\n\nexport function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }: Props): KubbNode {\n const params = getParams({ pathParamsType, typeSchemas, paramsCasing })\n const keys = transformer({\n operation,\n schemas: typeSchemas,\n casing: paramsCasing,\n })\n\n return (\n <>\n <File.Source name={name} isExportable isIndexable>\n <Function.Arrow name={name} export params={params.toConstructor()} singleLine>\n {`[${keys.join(', ')}] as const`}\n </Function.Arrow>\n </File.Source>\n <File.Source name={typeName} isExportable isIndexable isTypeOnly>\n <Type name={typeName} export>\n {`ReturnType<typeof ${name}>`}\n </Type>\n </File.Source>\n </>\n )\n}\n\nQueryKey.getParams = getParams\nQueryKey.getTransformer = getTransformer\n","import { isOptional } from '@kubb/oas'\nimport { Client } from '@kubb/plugin-client/components'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { PluginVueQuery } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\nimport type { KubbNode } from '@kubb/react-fabric/types'\n\ntype Props = {\n name: string\n clientName: string\n queryKeyName: string\n typeSchemas: OperationSchemas\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) {\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n optional: isOptional(typeSchemas.pathParams?.schema),\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n}\n\nexport function QueryOptions({ name, clientName, dataReturnType, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }: Props): KubbNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })\n const clientParams = Client.getParams({\n paramsType,\n paramsCasing,\n typeSchemas,\n pathParamsType,\n isConfigurable: true,\n })\n const queryKeyParams = QueryKey.getParams({\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n\n const enabled = Object.entries(queryKeyParams.flatParams)\n .map(([key, item]) => (item && !item.optional ? key : undefined))\n .filter(Boolean)\n .join('&& ')\n\n const enabledText = enabled ? `enabled: !!(${enabled}),` : ''\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={params.toConstructor()}>\n {`\n const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})\n return queryOptions<${TData}, ${TError}, ${TData}, typeof queryKey>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal }) => {\n config.signal = signal\n return ${clientName}(${clientParams.toCall({\n transformName(name) {\n return `toValue(${name})`\n },\n })})\n },\n })\n`}\n </Function>\n </File.Source>\n )\n}\n\nQueryOptions.getParams = getParams\n","import { isOptional, type Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\nimport { QueryOptions } from './QueryOptions.tsx'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n queryOptionsName: string\n queryKeyName: string\n queryKeyTypeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n options: {\n type: `\n{\n query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'}\n}\n`,\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n optional: isOptional(typeSchemas.pathParams?.schema),\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n options: {\n type: `\n{\n query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'}\n}\n`,\n default: '{}',\n },\n })\n}\n\nexport function Query({\n name,\n queryKeyTypeName,\n queryOptionsName,\n queryKeyName,\n paramsType,\n paramsCasing,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n operation,\n}: Props): KubbNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n const returnType = `UseQueryReturnType<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`\n const generics = [`TData = ${TData}`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]\n\n const queryKeyParams = QueryKey.getParams({\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const queryOptionsParams = QueryOptions.getParams({\n paramsType,\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const params = getParams({\n paramsCasing,\n paramsType,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n })\n\n const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})`\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n generics={generics.join(', ')}\n params={params.toConstructor()}\n JSDoc={{\n comments: getComments(operation),\n }}\n >\n {`\n const { query: queryConfig = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...queryOptions } = queryConfig\n const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})\n\n const query = useQuery({\n ...${queryOptions},\n queryKey,\n ...queryOptions\n } as unknown as QueryObserverOptions, queryClient) as ${returnType}\n\n query.queryKey = queryKey as TQueryKey\n\n return query\n `}\n </Function>\n </File.Source>\n )\n}\n\nQuery.getParams = getParams\n","import { isOptional } from '@kubb/oas'\nimport { Client } from '@kubb/plugin-client/components'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { Infinite, PluginVueQuery } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\n\ntype Props = {\n name: string\n clientName: string\n queryKeyName: string\n typeSchemas: OperationSchemas\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n initialPageParam: Infinite['initialPageParam']\n cursorParam: Infinite['cursorParam']\n queryParam: Infinite['queryParam']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) {\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n optional: isOptional(typeSchemas.pathParams?.schema),\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n}\n\nexport function InfiniteQueryOptions({\n name,\n clientName,\n initialPageParam,\n cursorParam,\n typeSchemas,\n paramsType,\n paramsCasing,\n dataReturnType,\n pathParamsType,\n queryParam,\n queryKeyName,\n}: Props): KubbNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })\n const clientParams = Client.getParams({\n paramsType,\n paramsCasing,\n typeSchemas,\n pathParamsType,\n isConfigurable: true,\n })\n const queryKeyParams = QueryKey.getParams({\n paramsCasing,\n pathParamsType,\n typeSchemas,\n })\n\n const queryOptions = [\n `initialPageParam: ${typeof initialPageParam === 'string' ? JSON.stringify(initialPageParam) : initialPageParam}`,\n cursorParam ? `getNextPageParam: (lastPage) => lastPage['${cursorParam}']` : undefined,\n cursorParam ? `getPreviousPageParam: (firstPage) => firstPage['${cursorParam}']` : undefined,\n !cursorParam && dataReturnType === 'full'\n ? 'getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage.data) && lastPage.data.length === 0 ? undefined : lastPageParam + 1'\n : undefined,\n !cursorParam && dataReturnType === 'data'\n ? 'getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage) && lastPage.length === 0 ? undefined : lastPageParam + 1'\n : undefined,\n !cursorParam ? 'getPreviousPageParam: (_firstPage, _allPages, firstPageParam) => firstPageParam <= 1 ? undefined : firstPageParam - 1' : undefined,\n ].filter(Boolean)\n\n const infiniteOverrideParams =\n queryParam && typeSchemas.queryParams?.name\n ? `\n if (!params) {\n params = { }\n }\n params['${queryParam}'] = pageParam as unknown as ${typeSchemas.queryParams?.name}['${queryParam}']`\n : ''\n\n const enabled = Object.entries(queryKeyParams.flatParams)\n .map(([key, item]) => (item && !item.optional ? key : undefined))\n .filter(Boolean)\n .join('&& ')\n\n const enabledText = enabled ? `enabled: !!(${enabled}),` : ''\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={params.toConstructor()}>\n {`\n const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})\n return infiniteQueryOptions<${TData}, ${TError}, ${TData}, typeof queryKey, number>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal, pageParam }) => {\n config.signal = signal\n ${infiniteOverrideParams}\n return ${clientName}(${clientParams.toCall({\n transformName(name) {\n return `toValue(${name})`\n },\n })})\n },\n ${queryOptions.join(',\\n')}\n })\n`}\n </Function>\n </File.Source>\n )\n}\n\nInfiniteQueryOptions.getParams = getParams\n","import { isOptional, type Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\nimport { QueryOptions } from './QueryOptions.tsx'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n queryOptionsName: string\n queryKeyName: string\n queryKeyTypeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n options: {\n type: `\n{\n query?: Partial<InfiniteQueryObserverOptions<${[TData, TError, 'TQueryData', 'TQueryKey', 'TQueryData'].join(', ')}>> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'}\n}\n`,\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n optional: isOptional(typeSchemas.pathParams?.schema),\n children: getPathParams(typeSchemas.pathParams, {\n typed: true,\n casing: paramsCasing,\n override(item) {\n return {\n ...item,\n type: `MaybeRefOrGetter<${item.type}>`,\n }\n },\n }),\n },\n data: typeSchemas.request?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n options: {\n type: `\n{\n query?: Partial<InfiniteQueryObserverOptions<${[TData, TError, 'TQueryData', 'TQueryKey', 'TQueryData'].join(', ')}>> & { client?: QueryClient },\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'}\n}\n`,\n default: '{}',\n },\n })\n}\n\nexport function InfiniteQuery({\n name,\n queryKeyTypeName,\n queryOptionsName,\n queryKeyName,\n paramsType,\n pathParamsType,\n paramsCasing,\n dataReturnType,\n typeSchemas,\n operation,\n}: Props): KubbNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n const returnType = `UseInfiniteQueryReturnType<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`\n const generics = [`TData = InfiniteData<${TData}>`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]\n\n const queryKeyParams = QueryKey.getParams({\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const queryOptionsParams = QueryOptions.getParams({\n paramsType,\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const params = getParams({\n paramsCasing,\n paramsType,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n })\n\n const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})`\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n generics={generics.join(', ')}\n params={params.toConstructor()}\n JSDoc={{\n comments: getComments(operation),\n }}\n >\n {`\n const { query: queryConfig = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...queryOptions } = queryConfig\n const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})\n\n const query = useInfiniteQuery({\n ...${queryOptions},\n queryKey,\n ...queryOptions\n } as unknown as InfiniteQueryObserverOptions, queryClient) as ${returnType}\n\n query.queryKey = queryKey as TQueryKey\n\n return query\n `}\n </Function>\n </File.Source>\n )\n}\n\nInfiniteQuery.getParams = getParams\n"],"mappings":";;;;;;;;AAsBA,SAASA,YAAU,IAAoB;AACrC,QAAO,eAAe,QAAQ,EAAE,CAAC;;AAGnC,MAAMC,oBAA+B,EAAE,WAAW,aAAa;AAG7D,QAAO,CAAC,WAFK,IAAI,QAAQ,UAAU,MAAM,EAAE,QAAQ,CAAC,CAE5B,WAAW,CAAC,KAAK;;AAG3C,SAAgB,YAAY,EAAE,MAAM,aAAa,cAAc,gBAAgB,WAAW,UAAU,cAAcC,oBAAmC;CACnJ,MAAM,SAASF,YAAU;EAAE;EAAgB;EAAa,CAAC;CACzD,MAAM,OAAO,YAAY;EAAE;EAAW,SAAS;EAAa,QAAQ;EAAc,CAAC;AAEnF,QACE,4CACE,oBAAC,KAAK;EAAa;EAAM;EAAa;YACpC,oBAAC,SAAS;GAAY;GAAM;GAAO,QAAQ,OAAO,eAAe;GAAE;aAChE,IAAI,KAAK,KAAK,KAAK,CAAC;IACN;GACL,EACd,oBAAC,KAAK;EAAO,MAAM;EAAU;EAAa;EAAY;YACpD,oBAAC;GAAK,MAAM;GAAU;aACnB,qBAAqB,KAAK;IACtB;GACK,IACb;;AAIP,YAAY,YAAYA;AACxB,YAAY,iBAAiBE;;;;ACrB7B,SAASC,YAAU,EAAE,cAAc,gBAAgB,eAA+B;CAChF,MAAM,QAAQ,mBAAmB,SAAS,YAAY,SAAS,OAAO,kBAAkB,YAAY,SAAS,KAAK;CAClH,MAAM,SAAS,uBAAuB,Y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