@kubb/plugin-vue-query 3.7.4 → 3.7.6
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/{chunk-OVYZOWDO.js → chunk-6MAOBT27.js} +13 -13
- package/dist/chunk-6MAOBT27.js.map +1 -0
- package/dist/{chunk-6K5ZLFYC.cjs → chunk-EGPHAXF4.cjs} +13 -13
- package/dist/chunk-EGPHAXF4.cjs.map +1 -0
- package/dist/{chunk-6BI5N5ZM.cjs → chunk-J76AL45Y.cjs} +27 -23
- package/dist/chunk-J76AL45Y.cjs.map +1 -0
- package/dist/{chunk-VG3HU7R3.js → chunk-XND24OU2.js} +13 -9
- package/dist/chunk-XND24OU2.js.map +1 -0
- package/dist/components.cjs +8 -8
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/generators.cjs +5 -5
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +2 -2
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{types-0FVnSKPu.d.cts → types-_wjAWo-H.d.cts} +8 -0
- package/dist/{types-0FVnSKPu.d.ts → types-_wjAWo-H.d.ts} +8 -0
- package/package.json +10 -10
- package/src/components/InfiniteQuery.tsx +4 -4
- package/src/components/Mutation.tsx +3 -3
- package/src/components/Query.tsx +4 -4
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +13 -8
- package/src/generators/__snapshots__/clientGetImportPath.ts +13 -8
- package/src/generators/__snapshots__/clientPostImportPath.ts +12 -9
- package/src/generators/__snapshots__/findByTags.ts +13 -8
- package/src/generators/__snapshots__/findByTagsObject.ts +13 -8
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +13 -8
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +13 -8
- package/src/generators/__snapshots__/findByTagsWithZod.ts +13 -8
- package/src/generators/__snapshots__/findInfiniteByTags.ts +13 -8
- package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +13 -8
- package/src/generators/__snapshots__/postAsQuery.ts +13 -8
- package/src/generators/__snapshots__/updatePetById.ts +12 -9
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +12 -9
- package/src/generators/infiniteQueryGenerator.tsx +1 -1
- package/src/generators/mutationGenerator.tsx +1 -1
- package/src/generators/queryGenerator.tsx +1 -1
- package/dist/chunk-6BI5N5ZM.cjs.map +0 -1
- package/dist/chunk-6K5ZLFYC.cjs.map +0 -1
- package/dist/chunk-OVYZOWDO.js.map +0 -1
- package/dist/chunk-VG3HU7R3.js.map +0 -1
package/dist/generators.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkJ76AL45Y_cjs = require('./chunk-J76AL45Y.cjs');
|
|
4
|
+
require('./chunk-EGPHAXF4.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "infiniteQueryGenerator", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkJ76AL45Y_cjs.infiniteQueryGenerator; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "mutationGenerator", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkJ76AL45Y_cjs.mutationGenerator; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "queryGenerator", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkJ76AL45Y_cjs.queryGenerator; }
|
|
19
19
|
});
|
|
20
20
|
//# sourceMappingURL=generators.cjs.map
|
|
21
21
|
//# sourceMappingURL=generators.cjs.map
|
package/dist/generators.d.cts
CHANGED
package/dist/generators.d.ts
CHANGED
package/dist/generators.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './chunk-XND24OU2.js';
|
|
2
|
+
import './chunk-6MAOBT27.js';
|
|
3
3
|
//# sourceMappingURL=generators.js.map
|
|
4
4
|
//# sourceMappingURL=generators.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkJ76AL45Y_cjs = require('./chunk-J76AL45Y.cjs');
|
|
4
|
+
var chunkEGPHAXF4_cjs = require('./chunk-EGPHAXF4.cjs');
|
|
5
5
|
var path = require('path');
|
|
6
6
|
var core = require('@kubb/core');
|
|
7
7
|
var transformers = require('@kubb/core/transformers');
|
|
@@ -29,9 +29,9 @@ var pluginVueQuery = core.createPlugin((options) => {
|
|
|
29
29
|
mutation = {},
|
|
30
30
|
query = {},
|
|
31
31
|
paramsCasing,
|
|
32
|
-
mutationKey =
|
|
33
|
-
queryKey =
|
|
34
|
-
generators = [
|
|
32
|
+
mutationKey = chunkEGPHAXF4_cjs.MutationKey.getTransformer,
|
|
33
|
+
queryKey = chunkEGPHAXF4_cjs.QueryKey.getTransformer,
|
|
34
|
+
generators = [chunkJ76AL45Y_cjs.queryGenerator, chunkJ76AL45Y_cjs.infiniteQueryGenerator, chunkJ76AL45Y_cjs.mutationGenerator].filter(Boolean),
|
|
35
35
|
contentType
|
|
36
36
|
} = options;
|
|
37
37
|
return {
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { queryGenerator, infiniteQueryGenerator, mutationGenerator } from './chunk-
|
|
2
|
-
import { MutationKey, QueryKey } from './chunk-
|
|
1
|
+
import { queryGenerator, infiniteQueryGenerator, mutationGenerator } from './chunk-XND24OU2.js';
|
|
2
|
+
import { MutationKey, QueryKey } from './chunk-6MAOBT27.js';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { createPlugin, PluginManager, FileManager } from '@kubb/core';
|
|
5
5
|
import { camelCase, pascalCase } from '@kubb/core/transformers';
|
|
@@ -34,6 +34,13 @@ type Options$2 = {
|
|
|
34
34
|
* @default false
|
|
35
35
|
*/
|
|
36
36
|
operations?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Export urls that are used by operation x
|
|
39
|
+
* `export` will make them part of your barrel file
|
|
40
|
+
* false will not make them exportable
|
|
41
|
+
* @example getGetPetByIdUrl
|
|
42
|
+
*/
|
|
43
|
+
urlType?: 'export' | false;
|
|
37
44
|
/**
|
|
38
45
|
* Path to the client import path that will be used to do the API calls.
|
|
39
46
|
* It will be used as `import client from '${client.importPath}'`.
|
|
@@ -100,6 +107,7 @@ type ResolvedOptions$2 = {
|
|
|
100
107
|
group?: Options$2['group'];
|
|
101
108
|
baseURL: string | undefined;
|
|
102
109
|
parser: NonNullable<Options$2['parser']>;
|
|
110
|
+
urlType: NonNullable<Options$2['urlType']>;
|
|
103
111
|
importPath: NonNullable<Options$2['importPath']>;
|
|
104
112
|
dataReturnType: NonNullable<Options$2['dataReturnType']>;
|
|
105
113
|
pathParamsType: NonNullable<Options$2['pathParamsType']>;
|
|
@@ -34,6 +34,13 @@ type Options$2 = {
|
|
|
34
34
|
* @default false
|
|
35
35
|
*/
|
|
36
36
|
operations?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Export urls that are used by operation x
|
|
39
|
+
* `export` will make them part of your barrel file
|
|
40
|
+
* false will not make them exportable
|
|
41
|
+
* @example getGetPetByIdUrl
|
|
42
|
+
*/
|
|
43
|
+
urlType?: 'export' | false;
|
|
37
44
|
/**
|
|
38
45
|
* Path to the client import path that will be used to do the API calls.
|
|
39
46
|
* It will be used as `import client from '${client.importPath}'`.
|
|
@@ -100,6 +107,7 @@ type ResolvedOptions$2 = {
|
|
|
100
107
|
group?: Options$2['group'];
|
|
101
108
|
baseURL: string | undefined;
|
|
102
109
|
parser: NonNullable<Options$2['parser']>;
|
|
110
|
+
urlType: NonNullable<Options$2['urlType']>;
|
|
103
111
|
importPath: NonNullable<Options$2['importPath']>;
|
|
104
112
|
dataReturnType: NonNullable<Options$2['dataReturnType']>;
|
|
105
113
|
pathParamsType: NonNullable<Options$2['pathParamsType']>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-vue-query",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.6",
|
|
4
4
|
"description": "Generator vue-query hooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"faker",
|
|
@@ -63,21 +63,21 @@
|
|
|
63
63
|
],
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"remeda": "^2.21.2",
|
|
66
|
-
"@kubb/core": "3.7.
|
|
67
|
-
"@kubb/fs": "3.7.
|
|
68
|
-
"@kubb/oas": "3.7.
|
|
69
|
-
"@kubb/plugin-
|
|
70
|
-
"@kubb/plugin-
|
|
71
|
-
"@kubb/plugin-
|
|
72
|
-
"@kubb/react": "3.7.
|
|
66
|
+
"@kubb/core": "3.7.6",
|
|
67
|
+
"@kubb/fs": "3.7.6",
|
|
68
|
+
"@kubb/oas": "3.7.6",
|
|
69
|
+
"@kubb/plugin-oas": "3.7.6",
|
|
70
|
+
"@kubb/plugin-ts": "3.7.6",
|
|
71
|
+
"@kubb/plugin-zod": "3.7.6",
|
|
72
|
+
"@kubb/react": "3.7.6"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/react": "^18.3.20",
|
|
76
76
|
"react": "^18.3.1",
|
|
77
77
|
"tsup": "^8.4.0",
|
|
78
78
|
"typescript": "^5.8.3",
|
|
79
|
-
"@kubb/config-ts": "3.7.
|
|
80
|
-
"@kubb/config-tsup": "3.7.
|
|
79
|
+
"@kubb/config-ts": "3.7.6",
|
|
80
|
+
"@kubb/config-tsup": "3.7.6"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"@kubb/react": "^3.0.0"
|
|
@@ -74,7 +74,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
74
74
|
options: {
|
|
75
75
|
type: `
|
|
76
76
|
{
|
|
77
|
-
query?: Partial<InfiniteQueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}
|
|
77
|
+
query?: Partial<InfiniteQueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },
|
|
78
78
|
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'}
|
|
79
79
|
}
|
|
80
80
|
`,
|
|
@@ -119,7 +119,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
119
119
|
options: {
|
|
120
120
|
type: `
|
|
121
121
|
{
|
|
122
|
-
query?: Partial<InfiniteQueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}
|
|
122
|
+
query?: Partial<InfiniteQueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },
|
|
123
123
|
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'}
|
|
124
124
|
}
|
|
125
125
|
`,
|
|
@@ -178,14 +178,14 @@ export function InfiniteQuery({
|
|
|
178
178
|
}}
|
|
179
179
|
>
|
|
180
180
|
{`
|
|
181
|
-
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
181
|
+
const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
|
|
182
182
|
const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})
|
|
183
183
|
|
|
184
184
|
const query = useInfiniteQuery({
|
|
185
185
|
...${queryOptions},
|
|
186
186
|
queryKey: queryKey as QueryKey,
|
|
187
187
|
...queryOptions as unknown as Omit<InfiniteQueryObserverOptions, "queryKey">
|
|
188
|
-
}) as ${returnType}
|
|
188
|
+
}, queryClient) as ${returnType}
|
|
189
189
|
|
|
190
190
|
query.queryKey = queryKey as TQueryKey
|
|
191
191
|
|
|
@@ -72,7 +72,7 @@ function getParams({ paramsCasing, dataReturnType, typeSchemas }: GetParamsProps
|
|
|
72
72
|
options: {
|
|
73
73
|
type: `
|
|
74
74
|
{
|
|
75
|
-
mutation?: MutationObserverOptions<${[TData, TError, TRequest ? `{${TRequest}}` : 'void', 'TContext'].join(', ')}
|
|
75
|
+
mutation?: MutationObserverOptions<${[TData, TError, TRequest ? `{${TRequest}}` : 'void', 'TContext'].join(', ')}> & { client?: QueryClient },
|
|
76
76
|
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'},
|
|
77
77
|
}
|
|
78
78
|
`,
|
|
@@ -168,7 +168,7 @@ export function Mutation({
|
|
|
168
168
|
generics={['TContext']}
|
|
169
169
|
>
|
|
170
170
|
{`
|
|
171
|
-
const { mutation: mutationOptions, client: config = {} } = options ?? {}
|
|
171
|
+
const { mutation: { client: queryClient, ...mutationOptions } = {}, client: config = {} } = options ?? {}
|
|
172
172
|
const mutationKey = mutationOptions?.mutationKey ?? ${mutationKeyName}(${mutationKeyParams.toCall()})
|
|
173
173
|
|
|
174
174
|
return useMutation<${generics}>({
|
|
@@ -177,7 +177,7 @@ export function Mutation({
|
|
|
177
177
|
},
|
|
178
178
|
mutationKey,
|
|
179
179
|
...mutationOptions
|
|
180
|
-
})
|
|
180
|
+
}, queryClient)
|
|
181
181
|
`}
|
|
182
182
|
</Function>
|
|
183
183
|
</File.Source>
|
package/src/components/Query.tsx
CHANGED
|
@@ -75,7 +75,7 @@ function getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, t
|
|
|
75
75
|
options: {
|
|
76
76
|
type: `
|
|
77
77
|
{
|
|
78
|
-
query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}
|
|
78
|
+
query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },
|
|
79
79
|
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'}
|
|
80
80
|
}
|
|
81
81
|
`,
|
|
@@ -120,7 +120,7 @@ function getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, t
|
|
|
120
120
|
options: {
|
|
121
121
|
type: `
|
|
122
122
|
{
|
|
123
|
-
query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}
|
|
123
|
+
query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },
|
|
124
124
|
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'}
|
|
125
125
|
}
|
|
126
126
|
`,
|
|
@@ -179,14 +179,14 @@ export function Query({
|
|
|
179
179
|
}}
|
|
180
180
|
>
|
|
181
181
|
{`
|
|
182
|
-
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
182
|
+
const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
|
|
183
183
|
const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})
|
|
184
184
|
|
|
185
185
|
const query = useQuery({
|
|
186
186
|
...${queryOptions},
|
|
187
187
|
queryKey: queryKey as QueryKey,
|
|
188
188
|
...queryOptions as unknown as Omit<QueryObserverOptions, "queryKey">
|
|
189
|
-
}) as ${returnType}
|
|
189
|
+
}, queryClient) as ${returnType}
|
|
190
190
|
|
|
191
191
|
query.queryKey = queryKey as TQueryKey
|
|
192
192
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
2
|
import type { RequestConfig, ResponseErrorConfig, ResponseConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
|
-
import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
3
|
+
import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
4
4
|
import type { MaybeRef } from 'vue'
|
|
5
5
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
6
6
|
import { unref } from 'vue'
|
|
@@ -64,18 +64,23 @@ export function useFindPetsByTags<
|
|
|
64
64
|
headers: MaybeRef<FindPetsByTagsHeaderParams>,
|
|
65
65
|
params?: MaybeRef<FindPetsByTagsQueryParams>,
|
|
66
66
|
options: {
|
|
67
|
-
query?: Partial<QueryObserverOptions<ResponseConfig<FindPetsByTagsQueryResponse>, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
67
|
+
query?: Partial<QueryObserverOptions<ResponseConfig<FindPetsByTagsQueryResponse>, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
|
|
68
|
+
client?: QueryClient
|
|
69
|
+
}
|
|
68
70
|
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
69
71
|
} = {},
|
|
70
72
|
) {
|
|
71
|
-
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
73
|
+
const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
|
|
72
74
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
73
75
|
|
|
74
|
-
const query = useQuery(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
const query = useQuery(
|
|
77
|
+
{
|
|
78
|
+
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
79
|
+
queryKey: queryKey as QueryKey,
|
|
80
|
+
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
81
|
+
},
|
|
82
|
+
queryClient,
|
|
83
|
+
) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
79
84
|
|
|
80
85
|
query.queryKey = queryKey as TQueryKey
|
|
81
86
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import client from 'axios'
|
|
2
|
-
import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
2
|
+
import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
3
3
|
import type { RequestConfig, ResponseErrorConfig } from 'axios'
|
|
4
4
|
import type { MaybeRef } from 'vue'
|
|
5
5
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
@@ -59,18 +59,23 @@ export function useFindPetsByTags<
|
|
|
59
59
|
headers: MaybeRef<FindPetsByTagsHeaderParams>,
|
|
60
60
|
params?: MaybeRef<FindPetsByTagsQueryParams>,
|
|
61
61
|
options: {
|
|
62
|
-
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
62
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
|
|
63
|
+
client?: QueryClient
|
|
64
|
+
}
|
|
63
65
|
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
64
66
|
} = {},
|
|
65
67
|
) {
|
|
66
|
-
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
68
|
+
const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
|
|
67
69
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
68
70
|
|
|
69
|
-
const query = useQuery(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
const query = useQuery(
|
|
72
|
+
{
|
|
73
|
+
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
74
|
+
queryKey: queryKey as QueryKey,
|
|
75
|
+
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
76
|
+
},
|
|
77
|
+
queryClient,
|
|
78
|
+
) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
74
79
|
|
|
75
80
|
query.queryKey = queryKey as TQueryKey
|
|
76
81
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import client from 'axios'
|
|
2
|
-
import type { MutationObserverOptions } from '@tanstack/vue-query'
|
|
2
|
+
import type { MutationObserverOptions, QueryClient } from '@tanstack/vue-query'
|
|
3
3
|
import type { RequestConfig, ResponseErrorConfig } from 'axios'
|
|
4
4
|
import type { MaybeRef } from 'vue'
|
|
5
5
|
import { useMutation } from '@tanstack/vue-query'
|
|
@@ -45,11 +45,11 @@ export function useUpdatePetWithForm<TContext>(
|
|
|
45
45
|
params?: MaybeRef<UpdatePetWithFormQueryParams>
|
|
46
46
|
},
|
|
47
47
|
TContext
|
|
48
|
-
>
|
|
48
|
+
> & { client?: QueryClient }
|
|
49
49
|
client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client }
|
|
50
50
|
} = {},
|
|
51
51
|
) {
|
|
52
|
-
const { mutation: mutationOptions, client: config = {} } = options ?? {}
|
|
52
|
+
const { mutation: { client: queryClient, ...mutationOptions } = {}, client: config = {} } = options ?? {}
|
|
53
53
|
const mutationKey = mutationOptions?.mutationKey ?? updatePetWithFormMutationKey()
|
|
54
54
|
|
|
55
55
|
return useMutation<
|
|
@@ -57,11 +57,14 @@ export function useUpdatePetWithForm<TContext>(
|
|
|
57
57
|
ResponseErrorConfig<UpdatePetWithForm405>,
|
|
58
58
|
{ petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
|
|
59
59
|
TContext
|
|
60
|
-
>(
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
>(
|
|
61
|
+
{
|
|
62
|
+
mutationFn: async ({ petId, data, params }) => {
|
|
63
|
+
return updatePetWithForm(petId, data, params, config)
|
|
64
|
+
},
|
|
65
|
+
mutationKey,
|
|
66
|
+
...mutationOptions,
|
|
63
67
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
})
|
|
68
|
+
queryClient,
|
|
69
|
+
)
|
|
67
70
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
2
|
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
|
-
import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
3
|
+
import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
4
4
|
import type { MaybeRef } from 'vue'
|
|
5
5
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
6
6
|
import { unref } from 'vue'
|
|
@@ -59,18 +59,23 @@ export function useFindPetsByTags<
|
|
|
59
59
|
headers: MaybeRef<FindPetsByTagsHeaderParams>,
|
|
60
60
|
params?: MaybeRef<FindPetsByTagsQueryParams>,
|
|
61
61
|
options: {
|
|
62
|
-
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
62
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
|
|
63
|
+
client?: QueryClient
|
|
64
|
+
}
|
|
63
65
|
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
64
66
|
} = {},
|
|
65
67
|
) {
|
|
66
|
-
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
68
|
+
const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
|
|
67
69
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
68
70
|
|
|
69
|
-
const query = useQuery(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
const query = useQuery(
|
|
72
|
+
{
|
|
73
|
+
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
74
|
+
queryKey: queryKey as QueryKey,
|
|
75
|
+
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
76
|
+
},
|
|
77
|
+
queryClient,
|
|
78
|
+
) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
74
79
|
|
|
75
80
|
query.queryKey = queryKey as TQueryKey
|
|
76
81
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
2
|
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
|
-
import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
3
|
+
import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
4
4
|
import type { MaybeRef } from 'vue'
|
|
5
5
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
6
6
|
import { unref } from 'vue'
|
|
@@ -56,18 +56,23 @@ export function useFindPetsByTags<
|
|
|
56
56
|
>(
|
|
57
57
|
{ headers, params }: { headers: MaybeRef<FindPetsByTagsHeaderParams>; params?: MaybeRef<FindPetsByTagsQueryParams> },
|
|
58
58
|
options: {
|
|
59
|
-
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
59
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
|
|
60
|
+
client?: QueryClient
|
|
61
|
+
}
|
|
60
62
|
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
61
63
|
} = {},
|
|
62
64
|
) {
|
|
63
|
-
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
65
|
+
const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
|
|
64
66
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
65
67
|
|
|
66
|
-
const query = useQuery(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
const query = useQuery(
|
|
69
|
+
{
|
|
70
|
+
...(findPetsByTagsQueryOptions({ headers, params }, config) as unknown as QueryObserverOptions),
|
|
71
|
+
queryKey: queryKey as QueryKey,
|
|
72
|
+
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
73
|
+
},
|
|
74
|
+
queryClient,
|
|
75
|
+
) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
71
76
|
|
|
72
77
|
query.queryKey = queryKey as TQueryKey
|
|
73
78
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
2
|
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
|
-
import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
3
|
+
import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
4
4
|
import type { MaybeRef } from 'vue'
|
|
5
5
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
6
6
|
import { unref } from 'vue'
|
|
@@ -59,18 +59,23 @@ export function useFindPetsByTags<
|
|
|
59
59
|
headers: MaybeRef<FindPetsByTagsHeaderParams>,
|
|
60
60
|
params?: MaybeRef<FindPetsByTagsQueryParams>,
|
|
61
61
|
options: {
|
|
62
|
-
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
62
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
|
|
63
|
+
client?: QueryClient
|
|
64
|
+
}
|
|
63
65
|
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
64
66
|
} = {},
|
|
65
67
|
) {
|
|
66
|
-
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
68
|
+
const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
|
|
67
69
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
68
70
|
|
|
69
|
-
const query = useQuery(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
const query = useQuery(
|
|
72
|
+
{
|
|
73
|
+
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
74
|
+
queryKey: queryKey as QueryKey,
|
|
75
|
+
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
76
|
+
},
|
|
77
|
+
queryClient,
|
|
78
|
+
) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
74
79
|
|
|
75
80
|
query.queryKey = queryKey as TQueryKey
|
|
76
81
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
2
|
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
|
-
import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
3
|
+
import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
4
4
|
import type { MaybeRef } from 'vue'
|
|
5
5
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
6
6
|
import { unref } from 'vue'
|
|
@@ -60,18 +60,23 @@ export function useFindPetsByTags<
|
|
|
60
60
|
headers: MaybeRef<FindPetsByTagsHeaderParams>,
|
|
61
61
|
params?: MaybeRef<FindPetsByTagsQueryParams>,
|
|
62
62
|
options: {
|
|
63
|
-
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
63
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
|
|
64
|
+
client?: QueryClient
|
|
65
|
+
}
|
|
64
66
|
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
65
67
|
} = {},
|
|
66
68
|
) {
|
|
67
|
-
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
69
|
+
const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
|
|
68
70
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
69
71
|
|
|
70
|
-
const query = useQuery(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
const query = useQuery(
|
|
73
|
+
{
|
|
74
|
+
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
75
|
+
queryKey: queryKey as QueryKey,
|
|
76
|
+
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
77
|
+
},
|
|
78
|
+
queryClient,
|
|
79
|
+
) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
75
80
|
|
|
76
81
|
query.queryKey = queryKey as TQueryKey
|
|
77
82
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import client from '@kubb/plugin-client/clients/axios'
|
|
2
2
|
import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
|
|
3
|
-
import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
3
|
+
import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
|
|
4
4
|
import type { MaybeRef } from 'vue'
|
|
5
5
|
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
6
6
|
import { unref } from 'vue'
|
|
@@ -59,18 +59,23 @@ export function useFindPetsByTags<
|
|
|
59
59
|
headers: MaybeRef<FindPetsByTagsHeaderParams>,
|
|
60
60
|
params?: MaybeRef<FindPetsByTagsQueryParams>,
|
|
61
61
|
options: {
|
|
62
|
-
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
|
|
62
|
+
query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
|
|
63
|
+
client?: QueryClient
|
|
64
|
+
}
|
|
63
65
|
client?: Partial<RequestConfig> & { client?: typeof client }
|
|
64
66
|
} = {},
|
|
65
67
|
) {
|
|
66
|
-
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
68
|
+
const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
|
|
67
69
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
68
70
|
|
|
69
|
-
const query = useQuery(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
const query = useQuery(
|
|
72
|
+
{
|
|
73
|
+
...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
|
|
74
|
+
queryKey: queryKey as QueryKey,
|
|
75
|
+
...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
|
|
76
|
+
},
|
|
77
|
+
queryClient,
|
|
78
|
+
) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
|
|
74
79
|
|
|
75
80
|
query.queryKey = queryKey as TQueryKey
|
|
76
81
|
|