@kubb/plugin-svelte-query 3.3.5 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{chunk-RVFCX6HG.js → chunk-FUCS2NGZ.js} +5 -5
  2. package/dist/chunk-FUCS2NGZ.js.map +1 -0
  3. package/dist/{chunk-6A7EBKX5.cjs → chunk-GIWSMC26.cjs} +65 -32
  4. package/dist/chunk-GIWSMC26.cjs.map +1 -0
  5. package/dist/{chunk-FMN5HVBV.js → chunk-HG5X655T.js} +65 -32
  6. package/dist/chunk-HG5X655T.js.map +1 -0
  7. package/dist/{chunk-HPUZVSOO.cjs → chunk-T3ZWZ5MA.cjs} +12 -12
  8. package/dist/chunk-T3ZWZ5MA.cjs.map +1 -0
  9. package/dist/components.cjs +6 -6
  10. package/dist/components.js +1 -1
  11. package/dist/generators.cjs +4 -4
  12. package/dist/generators.js +2 -2
  13. package/dist/index.cjs +5 -5
  14. package/dist/index.js +2 -2
  15. package/package.json +10 -10
  16. package/src/components/Mutation.tsx +5 -4
  17. package/src/components/Query.tsx +5 -3
  18. package/src/components/QueryOptions.tsx +1 -1
  19. package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +10 -5
  20. package/src/generators/__snapshots__/clientGetImportPath.ts +5 -5
  21. package/src/generators/__snapshots__/clientPostImportPath.ts +4 -4
  22. package/src/generators/__snapshots__/findByTags.ts +5 -5
  23. package/src/generators/__snapshots__/findByTagsObject.ts +5 -5
  24. package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +5 -5
  25. package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +5 -5
  26. package/src/generators/__snapshots__/findByTagsWithZod.ts +5 -5
  27. package/src/generators/__snapshots__/postAsQuery.ts +5 -5
  28. package/src/generators/__snapshots__/updatePetById.ts +4 -4
  29. package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +4 -4
  30. package/src/generators/mutationGenerator.tsx +1 -1
  31. package/src/generators/queryGenerator.tsx +1 -1
  32. package/dist/chunk-6A7EBKX5.cjs.map +0 -1
  33. package/dist/chunk-FMN5HVBV.js.map +0 -1
  34. package/dist/chunk-HPUZVSOO.cjs.map +0 -1
  35. package/dist/chunk-RVFCX6HG.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-svelte-query",
3
- "version": "3.3.5",
3
+ "version": "3.4.1",
4
4
  "description": "Generator svelte-query hooks",
5
5
  "keywords": [
6
6
  "faker",
@@ -63,21 +63,21 @@
63
63
  ],
64
64
  "dependencies": {
65
65
  "remeda": "^2.19.0",
66
- "@kubb/core": "3.3.5",
67
- "@kubb/fs": "3.3.5",
68
- "@kubb/oas": "3.3.5",
69
- "@kubb/plugin-oas": "3.3.5",
70
- "@kubb/plugin-ts": "3.3.5",
71
- "@kubb/plugin-zod": "3.3.5",
72
- "@kubb/react": "3.3.5"
66
+ "@kubb/core": "3.4.1",
67
+ "@kubb/fs": "3.4.1",
68
+ "@kubb/oas": "3.4.1",
69
+ "@kubb/plugin-oas": "3.4.1",
70
+ "@kubb/plugin-ts": "3.4.1",
71
+ "@kubb/plugin-zod": "3.4.1",
72
+ "@kubb/react": "3.4.1"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@types/react": "^18.3.18",
76
76
  "react": "^18.3.1",
77
77
  "tsup": "^8.3.5",
78
78
  "typescript": "^5.7.2",
79
- "@kubb/config-ts": "3.3.5",
80
- "@kubb/config-tsup": "3.3.5"
79
+ "@kubb/config-ts": "3.4.1",
80
+ "@kubb/config-tsup": "3.4.1"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "@kubb/react": "^3.0.0"
@@ -34,6 +34,8 @@ type GetParamsProps = {
34
34
 
35
35
  function getParams({ paramsCasing, dataReturnType, typeSchemas }: GetParamsProps) {
36
36
  const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
37
+ const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
38
+
37
39
  const mutationParams = FunctionParams.factory({
38
40
  ...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
39
41
  data: typeSchemas.request?.name
@@ -61,7 +63,7 @@ function getParams({ paramsCasing, dataReturnType, typeSchemas }: GetParamsProps
61
63
  options: {
62
64
  type: `
63
65
  {
64
- mutation?: CreateMutationOptions<${[TData, typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error', TRequest ? `{${TRequest}}` : undefined].filter(Boolean).join(', ')}>,
66
+ mutation?: CreateMutationOptions<${[TData, TError, TRequest ? `{${TRequest}}` : undefined].filter(Boolean).join(', ')}>,
65
67
  client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>'},
66
68
  }
67
69
  `,
@@ -140,9 +142,8 @@ export function Mutation({
140
142
 
141
143
  const TRequest = mutationParams.toConstructor({ valueAsType: true })
142
144
  const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
143
- const generics = [TData, typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error', TRequest ? `{${TRequest}}` : undefined]
144
- .filter(Boolean)
145
- .join(', ')
145
+ const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
146
+ const generics = [TData, TError, TRequest ? `{${TRequest}}` : undefined].filter(Boolean).join(', ')
146
147
 
147
148
  return (
148
149
  <File.Source name={name} isExportable isIndexable>
@@ -34,6 +34,7 @@ type GetParamsProps = {
34
34
 
35
35
  function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) {
36
36
  const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
37
+ const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
37
38
 
38
39
  if (paramsType === 'object') {
39
40
  return FunctionParams.factory({
@@ -64,7 +65,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
64
65
  options: {
65
66
  type: `
66
67
  {
67
- query?: Partial<CreateBaseQueryOptions<${[TData, typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error', 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
68
+ query?: Partial<CreateBaseQueryOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
68
69
  client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>'}
69
70
  }
70
71
  `,
@@ -102,7 +103,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
102
103
  options: {
103
104
  type: `
104
105
  {
105
- query?: Partial<CreateBaseQueryOptions<${[TData, typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error', 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
106
+ query?: Partial<CreateBaseQueryOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
106
107
  client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>'}
107
108
  }
108
109
  `,
@@ -124,7 +125,8 @@ export function Query({
124
125
  operation,
125
126
  }: Props): ReactNode {
126
127
  const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
127
- const returnType = `CreateQueryResult<${['TData', typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'].join(', ')}> & { queryKey: TQueryKey }`
128
+ const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
129
+ const returnType = `CreateQueryResult<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`
128
130
  const generics = [`TData = ${TData}`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]
129
131
 
130
132
  const queryKeyParams = QueryKey.getParams({
@@ -96,7 +96,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: Ge
96
96
 
97
97
  export function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, dataReturnType, pathParamsType, queryKeyName }: Props): ReactNode {
98
98
  const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
99
- const TError = typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'
99
+ const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
100
100
 
101
101
  const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })
102
102
  const clientParams = Client.getParams({
@@ -1,5 +1,5 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
- import type { RequestConfig, ResponseConfig } from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig, ResponseErrorConfig, ResponseConfig } from '@kubb/plugin-client/clients/axios'
3
3
  import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
4
4
  import { queryOptions, createQuery } from '@tanstack/svelte-query'
5
5
 
@@ -13,7 +13,7 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
13
  * {@link /pet/findByTags}
14
14
  */
15
15
  async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
16
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
16
+ const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
17
17
  method: 'GET',
18
18
  url: `/pet/findByTags`,
19
19
  params,
@@ -25,7 +25,12 @@ async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: Find
25
25
 
26
26
  export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
27
27
  const queryKey = findPetsByTagsQueryKey(params)
28
- return queryOptions<ResponseConfig<FindPetsByTagsQueryResponse>, FindPetsByTags400, ResponseConfig<FindPetsByTagsQueryResponse>, typeof queryKey>({
28
+ return queryOptions<
29
+ ResponseConfig<FindPetsByTagsQueryResponse>,
30
+ ResponseErrorConfig<FindPetsByTags400>,
31
+ ResponseConfig<FindPetsByTagsQueryResponse>,
32
+ typeof queryKey
33
+ >({
29
34
  queryKey,
30
35
  queryFn: async ({ signal }) => {
31
36
  config.signal = signal
@@ -47,7 +52,7 @@ export function createFindPetsByTags<
47
52
  headers: FindPetsByTagsHeaderParams,
48
53
  params?: FindPetsByTagsQueryParams,
49
54
  options: {
50
- query?: Partial<CreateBaseQueryOptions<ResponseConfig<FindPetsByTagsQueryResponse>, FindPetsByTags400, TData, TQueryData, TQueryKey>>
55
+ query?: Partial<CreateBaseQueryOptions<ResponseConfig<FindPetsByTagsQueryResponse>, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
51
56
  client?: Partial<RequestConfig>
52
57
  } = {},
53
58
  ) {
@@ -58,7 +63,7 @@ export function createFindPetsByTags<
58
63
  ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions),
59
64
  queryKey,
60
65
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
61
- }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
66
+ }) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
62
67
 
63
68
  query.queryKey = queryKey as TQueryKey
64
69
 
@@ -1,6 +1,6 @@
1
1
  import client from 'axios'
2
2
  import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
3
- import type { RequestConfig } from 'axios'
3
+ import type { RequestConfig, ResponseErrorConfig } from 'axios'
4
4
  import { queryOptions, createQuery } from '@tanstack/svelte-query'
5
5
 
6
6
  export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
@@ -13,7 +13,7 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
13
  * {@link /pet/findByTags}
14
14
  */
15
15
  async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
16
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
16
+ const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
17
17
  method: 'GET',
18
18
  url: `/pet/findByTags`,
19
19
  params,
@@ -25,7 +25,7 @@ async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: Find
25
25
 
26
26
  export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
27
27
  const queryKey = findPetsByTagsQueryKey(params)
28
- return queryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, FindPetsByTagsQueryResponse, typeof queryKey>({
28
+ return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
29
29
  queryKey,
30
30
  queryFn: async ({ signal }) => {
31
31
  config.signal = signal
@@ -47,7 +47,7 @@ export function createFindPetsByTags<
47
47
  headers: FindPetsByTagsHeaderParams,
48
48
  params?: FindPetsByTagsQueryParams,
49
49
  options: {
50
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
50
+ query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
51
51
  client?: Partial<RequestConfig>
52
52
  } = {},
53
53
  ) {
@@ -58,7 +58,7 @@ export function createFindPetsByTags<
58
58
  ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions),
59
59
  queryKey,
60
60
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
61
- }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
61
+ }) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
62
62
 
63
63
  query.queryKey = queryKey as TQueryKey
64
64
 
@@ -1,6 +1,6 @@
1
1
  import client from 'axios'
2
2
  import type { CreateMutationOptions } from '@tanstack/svelte-query'
3
- import type { RequestConfig } from 'axios'
3
+ import type { RequestConfig, ResponseErrorConfig } from 'axios'
4
4
  import { createMutation } from '@tanstack/svelte-query'
5
5
 
6
6
  export const updatePetWithFormMutationKey = () => [{ url: '/pet/{petId}' }] as const
@@ -17,7 +17,7 @@ async function updatePetWithForm(
17
17
  params?: UpdatePetWithFormQueryParams,
18
18
  config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
19
19
  ) {
20
- const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({
20
+ const res = await client<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
21
21
  method: 'POST',
22
22
  url: `/pet/${petId}`,
23
23
  params,
@@ -35,7 +35,7 @@ export function createUpdatePetWithForm(
35
35
  options: {
36
36
  mutation?: CreateMutationOptions<
37
37
  UpdatePetWithFormMutationResponse,
38
- UpdatePetWithForm405,
38
+ ResponseErrorConfig<UpdatePetWithForm405>,
39
39
  { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
40
40
  >
41
41
  client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
@@ -46,7 +46,7 @@ export function createUpdatePetWithForm(
46
46
 
47
47
  return createMutation<
48
48
  UpdatePetWithFormMutationResponse,
49
- UpdatePetWithForm405,
49
+ ResponseErrorConfig<UpdatePetWithForm405>,
50
50
  { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
51
51
  >({
52
52
  mutationFn: async ({ petId, data, params }) => {
@@ -1,5 +1,5 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
- import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
3
  import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
4
4
  import { queryOptions, createQuery } from '@tanstack/svelte-query'
5
5
 
@@ -13,7 +13,7 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
13
  * {@link /pet/findByTags}
14
14
  */
15
15
  async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
16
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
16
+ const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
17
17
  method: 'GET',
18
18
  url: `/pet/findByTags`,
19
19
  params,
@@ -25,7 +25,7 @@ async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: Find
25
25
 
26
26
  export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
27
27
  const queryKey = findPetsByTagsQueryKey(params)
28
- return queryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, FindPetsByTagsQueryResponse, typeof queryKey>({
28
+ return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
29
29
  queryKey,
30
30
  queryFn: async ({ signal }) => {
31
31
  config.signal = signal
@@ -47,7 +47,7 @@ export function createFindPetsByTags<
47
47
  headers: FindPetsByTagsHeaderParams,
48
48
  params?: FindPetsByTagsQueryParams,
49
49
  options: {
50
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
50
+ query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
51
51
  client?: Partial<RequestConfig>
52
52
  } = {},
53
53
  ) {
@@ -58,7 +58,7 @@ export function createFindPetsByTags<
58
58
  ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions),
59
59
  queryKey,
60
60
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
61
- }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
61
+ }) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
62
62
 
63
63
  query.queryKey = queryKey as TQueryKey
64
64
 
@@ -1,5 +1,5 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
- import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
3
  import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
4
4
  import { queryOptions, createQuery } from '@tanstack/svelte-query'
5
5
 
@@ -16,7 +16,7 @@ async function findPetsByTags(
16
16
  { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
17
17
  config: Partial<RequestConfig> = {},
18
18
  ) {
19
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
19
+ const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
20
20
  method: 'GET',
21
21
  url: `/pet/findByTags`,
22
22
  params,
@@ -31,7 +31,7 @@ export function findPetsByTagsQueryOptions(
31
31
  config: Partial<RequestConfig> = {},
32
32
  ) {
33
33
  const queryKey = findPetsByTagsQueryKey(params)
34
- return queryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, FindPetsByTagsQueryResponse, typeof queryKey>({
34
+ return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
35
35
  queryKey,
36
36
  queryFn: async ({ signal }) => {
37
37
  config.signal = signal
@@ -52,7 +52,7 @@ export function createFindPetsByTags<
52
52
  >(
53
53
  { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
54
54
  options: {
55
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
55
+ query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
56
56
  client?: Partial<RequestConfig>
57
57
  } = {},
58
58
  ) {
@@ -63,7 +63,7 @@ export function createFindPetsByTags<
63
63
  ...(findPetsByTagsQueryOptions({ headers, params }, config) as unknown as CreateBaseQueryOptions),
64
64
  queryKey,
65
65
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
66
- }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
66
+ }) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
67
67
 
68
68
  query.queryKey = queryKey as TQueryKey
69
69
 
@@ -1,5 +1,5 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
- import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
3
  import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
4
4
  import { queryOptions, createQuery } from '@tanstack/svelte-query'
5
5
 
@@ -13,7 +13,7 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
13
  * {@link /pet/findByTags}
14
14
  */
15
15
  async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
16
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
16
+ const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
17
17
  method: 'GET',
18
18
  url: `/pet/findByTags`,
19
19
  params,
@@ -25,7 +25,7 @@ async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: Find
25
25
 
26
26
  export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
27
27
  const queryKey = findPetsByTagsQueryKey(params)
28
- return queryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, FindPetsByTagsQueryResponse, typeof queryKey>({
28
+ return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
29
29
  queryKey,
30
30
  queryFn: async ({ signal }) => {
31
31
  config.signal = signal
@@ -47,7 +47,7 @@ export function createFindPetsByTags<
47
47
  headers: FindPetsByTagsHeaderParams,
48
48
  params?: FindPetsByTagsQueryParams,
49
49
  options: {
50
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
50
+ query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
51
51
  client?: Partial<RequestConfig>
52
52
  } = {},
53
53
  ) {
@@ -58,7 +58,7 @@ export function createFindPetsByTags<
58
58
  ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions),
59
59
  queryKey,
60
60
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
61
- }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
61
+ }) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
62
62
 
63
63
  query.queryKey = queryKey as TQueryKey
64
64
 
@@ -1,5 +1,5 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
- import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
3
  import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/react-query'
4
4
  import { queryOptions, createQuery } from '@tanstack/react-query'
5
5
 
@@ -13,7 +13,7 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
13
  * {@link /pet/findByTags}
14
14
  */
15
15
  async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
16
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
16
+ const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
17
17
  method: 'GET',
18
18
  url: `/pet/findByTags`,
19
19
  params,
@@ -25,7 +25,7 @@ async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: Find
25
25
 
26
26
  export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
27
27
  const queryKey = findPetsByTagsQueryKey(params)
28
- return queryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, FindPetsByTagsQueryResponse, typeof queryKey>({
28
+ return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
29
29
  queryKey,
30
30
  queryFn: async ({ signal }) => {
31
31
  config.signal = signal
@@ -47,7 +47,7 @@ export function createFindPetsByTags<
47
47
  headers: FindPetsByTagsHeaderParams,
48
48
  params?: FindPetsByTagsQueryParams,
49
49
  options: {
50
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
50
+ query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
51
51
  client?: Partial<RequestConfig>
52
52
  } = {},
53
53
  ) {
@@ -58,7 +58,7 @@ export function createFindPetsByTags<
58
58
  ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions),
59
59
  queryKey,
60
60
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
61
- }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
61
+ }) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
62
62
 
63
63
  query.queryKey = queryKey as TQueryKey
64
64
 
@@ -1,5 +1,5 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
- import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
3
  import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from '@tanstack/svelte-query'
4
4
  import { queryOptions, createQuery } from '@tanstack/svelte-query'
5
5
 
@@ -13,7 +13,7 @@ export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
13
13
  * {@link /pet/findByTags}
14
14
  */
15
15
  async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
16
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({
16
+ const res = await client<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
17
17
  method: 'GET',
18
18
  url: `/pet/findByTags`,
19
19
  params,
@@ -25,7 +25,7 @@ async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: Find
25
25
 
26
26
  export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
27
27
  const queryKey = findPetsByTagsQueryKey(params)
28
- return queryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, FindPetsByTagsQueryResponse, typeof queryKey>({
28
+ return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
29
29
  queryKey,
30
30
  queryFn: async ({ signal }) => {
31
31
  config.signal = signal
@@ -47,7 +47,7 @@ export function createFindPetsByTags<
47
47
  headers: FindPetsByTagsHeaderParams,
48
48
  params?: FindPetsByTagsQueryParams,
49
49
  options: {
50
- query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, FindPetsByTags400, TData, TQueryData, TQueryKey>>
50
+ query?: Partial<CreateBaseQueryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
51
51
  client?: Partial<RequestConfig>
52
52
  } = {},
53
53
  ) {
@@ -58,7 +58,7 @@ export function createFindPetsByTags<
58
58
  ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as CreateBaseQueryOptions),
59
59
  queryKey,
60
60
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
61
- }) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
61
+ }) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
62
62
 
63
63
  query.queryKey = queryKey as TQueryKey
64
64
 
@@ -1,5 +1,5 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
- import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
3
  import type { QueryKey, CreateBaseQueryOptions, CreateQueryResult } from 'custom-query'
4
4
  import { queryOptions, createQuery } from 'custom-query'
5
5
 
@@ -21,7 +21,7 @@ async function updatePetWithForm(
21
21
  params?: UpdatePetWithFormQueryParams,
22
22
  config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
23
23
  ) {
24
- const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({
24
+ const res = await client<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
25
25
  method: 'POST',
26
26
  url: `/pet/${petId}`,
27
27
  params,
@@ -38,7 +38,7 @@ export function updatePetWithFormQueryOptions(
38
38
  config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
39
39
  ) {
40
40
  const queryKey = updatePetWithFormQueryKey(petId, data, params)
41
- return queryOptions<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationResponse, typeof queryKey>({
41
+ return queryOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationResponse, typeof queryKey>({
42
42
  enabled: !!petId,
43
43
  queryKey,
44
44
  queryFn: async ({ signal }) => {
@@ -61,7 +61,7 @@ export function createUpdatePetWithForm<
61
61
  data?: UpdatePetWithFormMutationRequest,
62
62
  params?: UpdatePetWithFormQueryParams,
63
63
  options: {
64
- query?: Partial<CreateBaseQueryOptions<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, TData, TQueryData, TQueryKey>>
64
+ query?: Partial<CreateBaseQueryOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, TData, TQueryData, TQueryKey>>
65
65
  client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
66
66
  } = {},
67
67
  ) {
@@ -72,7 +72,7 @@ export function createUpdatePetWithForm<
72
72
  ...(updatePetWithFormQueryOptions(petId, data, params, config) as unknown as CreateBaseQueryOptions),
73
73
  queryKey,
74
74
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
75
- }) as CreateQueryResult<TData, UpdatePetWithForm405> & { queryKey: TQueryKey }
75
+ }) as CreateQueryResult<TData, ResponseErrorConfig<UpdatePetWithForm405>> & { queryKey: TQueryKey }
76
76
 
77
77
  query.queryKey = queryKey as TQueryKey
78
78
 
@@ -1,5 +1,5 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
- import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
3
  import type { CreateMutationOptions } from '@tanstack/svelte-query'
4
4
  import { createMutation } from '@tanstack/svelte-query'
5
5
 
@@ -17,7 +17,7 @@ async function updatePetWithForm(
17
17
  params?: UpdatePetWithFormQueryParams,
18
18
  config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
19
19
  ) {
20
- const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({
20
+ const res = await client<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
21
21
  method: 'POST',
22
22
  url: `/pet/${petId}`,
23
23
  params,
@@ -35,7 +35,7 @@ export function createUpdatePetWithForm(
35
35
  options: {
36
36
  mutation?: CreateMutationOptions<
37
37
  UpdatePetWithFormMutationResponse,
38
- UpdatePetWithForm405,
38
+ ResponseErrorConfig<UpdatePetWithForm405>,
39
39
  { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
40
40
  >
41
41
  client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
@@ -46,7 +46,7 @@ export function createUpdatePetWithForm(
46
46
 
47
47
  return createMutation<
48
48
  UpdatePetWithFormMutationResponse,
49
- UpdatePetWithForm405,
49
+ ResponseErrorConfig<UpdatePetWithForm405>,
50
50
  { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
51
51
  >({
52
52
  mutationFn: async ({ petId, data, params }) => {
@@ -1,5 +1,5 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
- import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
2
+ import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
3
  import type { CreateMutationOptions } from '@tanstack/svelte-query'
4
4
  import { createMutation } from '@tanstack/svelte-query'
5
5
 
@@ -17,7 +17,7 @@ async function updatePetWithForm(
17
17
  params?: UpdatePetWithFormQueryParams,
18
18
  config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
19
19
  ) {
20
- const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, UpdatePetWithFormMutationRequest>({
20
+ const res = await client<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
21
21
  method: 'POST',
22
22
  url: `/pet/${petId}`,
23
23
  params,
@@ -35,7 +35,7 @@ export function createUpdatePetWithForm(
35
35
  options: {
36
36
  mutation?: CreateMutationOptions<
37
37
  UpdatePetWithFormMutationResponse,
38
- UpdatePetWithForm405,
38
+ ResponseErrorConfig<UpdatePetWithForm405>,
39
39
  { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
40
40
  >
41
41
  client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>>
@@ -46,7 +46,7 @@ export function createUpdatePetWithForm(
46
46
 
47
47
  return createMutation<
48
48
  UpdatePetWithFormMutationResponse,
49
- UpdatePetWithForm405,
49
+ ResponseErrorConfig<UpdatePetWithForm405>,
50
50
  { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams }
51
51
  >({
52
52
  mutationFn: async ({ petId, data, params }) => {
@@ -61,7 +61,7 @@ export const mutationGenerator = createReactGenerator<PluginSvelteQuery>({
61
61
  {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={mutation.file.path} path={zod.file.path} />}
62
62
 
63
63
  <File.Import name={'client'} path={options.client.importPath} />
64
- <File.Import name={['RequestConfig', 'ResponseConfig']} path={options.client.importPath} isTypeOnly />
64
+ <File.Import name={['RequestConfig', 'ResponseConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
65
65
  <File.Import
66
66
  name={[
67
67
  type.schemas.request?.name,
@@ -62,7 +62,7 @@ export const queryGenerator = createReactGenerator<PluginSvelteQuery>({
62
62
  <File baseName={query.file.baseName} path={query.file.path} meta={query.file.meta} banner={output?.banner} footer={output?.footer}>
63
63
  {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={query.file.path} path={zod.file.path} />}
64
64
  <File.Import name={'client'} path={options.client.importPath} />
65
- <File.Import name={['RequestConfig']} path={options.client.importPath} isTypeOnly />
65
+ <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />
66
66
  {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}
67
67
  <File.Import
68
68
  name={[