@kubb/plugin-solid-query 3.3.4 → 3.4.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.
Files changed (32) hide show
  1. package/dist/{chunk-5WJYHFK6.js → chunk-2S6OAY7A.js} +6 -5
  2. package/dist/chunk-2S6OAY7A.js.map +1 -0
  3. package/dist/{chunk-7AQUOPJQ.js → chunk-6GYHRQ43.js} +56 -23
  4. package/dist/chunk-6GYHRQ43.js.map +1 -0
  5. package/dist/{chunk-X3AJUPDZ.cjs → chunk-7B6MOH7D.cjs} +56 -23
  6. package/dist/chunk-7B6MOH7D.cjs.map +1 -0
  7. package/dist/{chunk-E7TNK3AV.cjs → chunk-YYSQGXZJ.cjs} +10 -9
  8. package/dist/chunk-YYSQGXZJ.cjs.map +1 -0
  9. package/dist/components.cjs +4 -4
  10. package/dist/components.d.cts +2 -1
  11. package/dist/components.d.ts +2 -1
  12. package/dist/components.js +1 -1
  13. package/dist/generators.cjs +3 -3
  14. package/dist/generators.js +2 -2
  15. package/dist/index.cjs +4 -4
  16. package/dist/index.js +2 -2
  17. package/package.json +12 -12
  18. package/src/components/Query.tsx +5 -3
  19. package/src/components/QueryOptions.tsx +6 -2
  20. package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +10 -5
  21. package/src/generators/__snapshots__/clientGetImportPath.ts +5 -5
  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/queryGenerator.tsx +2 -2
  29. package/dist/chunk-5WJYHFK6.js.map +0 -1
  30. package/dist/chunk-7AQUOPJQ.js.map +0 -1
  31. package/dist/chunk-E7TNK3AV.cjs.map +0 -1
  32. package/dist/chunk-X3AJUPDZ.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkX3AJUPDZ_cjs = require('./chunk-X3AJUPDZ.cjs');
3
+ var chunk7B6MOH7D_cjs = require('./chunk-7B6MOH7D.cjs');
4
4
  var pluginOas = require('@kubb/plugin-oas');
5
5
  var hooks = require('@kubb/plugin-oas/hooks');
6
6
  var pluginTs = require('@kubb/plugin-ts');
@@ -51,7 +51,7 @@ var queryGenerator = pluginOas.createReactGenerator({
51
51
  return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: query.file.baseName, path: query.file.path, meta: query.file.meta, banner: output?.banner, footer: output?.footer, children: [
52
52
  options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
53
53
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: options.client.importPath }),
54
- /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["RequestConfig"], path: options.client.importPath, isTypeOnly: true }),
54
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["RequestConfig", "ResponseErrorConfig"], path: options.client.importPath, isTypeOnly: true }),
55
55
  options.client.dataReturnType === "full" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
56
56
  /* @__PURE__ */ jsxRuntime.jsx(
57
57
  react.File.Import,
@@ -70,7 +70,7 @@ var queryGenerator = pluginOas.createReactGenerator({
70
70
  }
71
71
  ),
72
72
  /* @__PURE__ */ jsxRuntime.jsx(
73
- chunkX3AJUPDZ_cjs.QueryKey,
73
+ chunk7B6MOH7D_cjs.QueryKey,
74
74
  {
75
75
  name: queryKey.name,
76
76
  typeName: queryKey.typeName,
@@ -82,7 +82,7 @@ var queryGenerator = pluginOas.createReactGenerator({
82
82
  }
83
83
  ),
84
84
  /* @__PURE__ */ jsxRuntime.jsx(
85
- chunkX3AJUPDZ_cjs.Client,
85
+ chunk7B6MOH7D_cjs.Client,
86
86
  {
87
87
  name: client.name,
88
88
  isExportable: false,
@@ -100,7 +100,7 @@ var queryGenerator = pluginOas.createReactGenerator({
100
100
  ),
101
101
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["queryOptions"], path: importPath }),
102
102
  /* @__PURE__ */ jsxRuntime.jsx(
103
- chunkX3AJUPDZ_cjs.QueryOptions,
103
+ chunk7B6MOH7D_cjs.QueryOptions,
104
104
  {
105
105
  name: queryOptions.name,
106
106
  clientName: client.name,
@@ -108,14 +108,15 @@ var queryGenerator = pluginOas.createReactGenerator({
108
108
  typeSchemas: type.schemas,
109
109
  paramsCasing: options.paramsCasing,
110
110
  paramsType: options.paramsType,
111
- pathParamsType: options.pathParamsType
111
+ pathParamsType: options.pathParamsType,
112
+ dataReturnType: options.client.dataReturnType
112
113
  }
113
114
  ),
114
115
  options.query && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
115
116
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createQuery"], path: importPath }),
116
117
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["QueryKey", "CreateBaseQueryOptions", "CreateQueryResult"], path: importPath, isTypeOnly: true }),
117
118
  /* @__PURE__ */ jsxRuntime.jsx(
118
- chunkX3AJUPDZ_cjs.Query,
119
+ chunk7B6MOH7D_cjs.Query,
119
120
  {
120
121
  name: query.name,
121
122
  queryOptionsName: queryOptions.name,
@@ -135,5 +136,5 @@ var queryGenerator = pluginOas.createReactGenerator({
135
136
  });
136
137
 
137
138
  exports.queryGenerator = queryGenerator;
138
- //# sourceMappingURL=chunk-E7TNK3AV.cjs.map
139
- //# sourceMappingURL=chunk-E7TNK3AV.cjs.map
139
+ //# sourceMappingURL=chunk-YYSQGXZJ.cjs.map
140
+ //# sourceMappingURL=chunk-YYSQGXZJ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/generators/queryGenerator.tsx"],"names":["createReactGenerator","useApp","useOperationManager","difference","pluginTsName","pluginZodName","File","jsx","QueryKey","Client","QueryOptions","jsxs","Fragment","Query"],"mappings":";;;;;;;;;;;AAUO,IAAM,iBAAiBA,8BAAuC,CAAA;AAAA,EACnE,IAAM,EAAA,cAAA;AAAA,EACN,SAAU,CAAA,EAAE,OAAS,EAAA,SAAA,EAAa,EAAA;AAChC,IAAM,MAAA;AAAA,MACJ,MAAQ,EAAA;AAAA,QACN,OAAA,EAAS,EAAE,MAAO;AAAA;AACpB,QACEC,YAAyB,EAAA;AAC7B,IAAA,MAAM,EAAE,UAAA,EAAY,OAAS,EAAA,OAAA,KAAYC,yBAAoB,EAAA;AAE7D,IAAA,MAAM,OAAU,GAAA,OAAO,OAAQ,CAAA,KAAA,KAAU,YAAY,IAAO,GAAA,OAAA,CAAQ,KAAO,EAAA,OAAA,CAAQ,IAAK,CAAA,CAAC,MAAW,KAAA,SAAA,CAAU,WAAW,MAAM,CAAA;AAC/H,IAAM,MAAA,UAAA,GAAaC,kBAAW,CAAC,MAAA,EAAQ,OAAO,QAAU,EAAA,OAAO,GAAG,OAAQ,CAAA,KAAA,GAAQ,QAAQ,KAAM,CAAA,OAAA,GAAU,EAAE,CAAA,CAAE,KAAK,CAAC,MAAA,KAAW,SAAU,CAAA,MAAA,KAAW,MAAM,CAAA;AAC1J,IAAA,MAAM,UAAa,GAAA,OAAA,CAAQ,KAAQ,GAAA,OAAA,CAAQ,MAAM,UAAa,GAAA,uBAAA;AAE9D,IAAA,MAAM,KAAQ,GAAA;AAAA,MACZ,IAAA,EAAM,QAAQ,SAAW,EAAA,EAAE,MAAM,UAAY,EAAA,MAAA,EAAQ,UAAU,CAAA;AAAA,MAC/D,UAAU,OAAQ,CAAA,SAAA,EAAW,EAAE,IAAA,EAAM,QAAQ,CAAA;AAAA,MAC7C,MAAM,OAAQ,CAAA,SAAA,EAAW,EAAE,MAAA,EA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CAAA,IAAA;AAAA,UACvB,aAAa,IAAK,CAAA,OAAA;AAAA,UAClB,cAAc,OAAQ,CAAA,YAAA;AAAA,UACtB,YAAY,OAAQ,CAAA,UAAA;AAAA,UACpB,gBAAgB,OAAQ,CAAA,cAAA;AAAA,UACxB,cAAA,EAAgB,QAAQ,MAAO,CAAA;AAAA;AAAA,OACjC;AAAA,MACC,OAAA,CAAQ,yBAELC,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA;AAAA,wBAACL,cAAA,CAAAD,UAAA,CAAK,QAAL,EAAY,IAAA,EAAM,CAAC,aAAa,CAAA,EAAG,MAAM,UAAY,EAAA,CAAA;AAAA,wBACrDC,cAAA,CAAAD,UAAA,CAAK,MAAL,EAAA,EAAY,IAAM,EAAA,CAAC,UAAY,EAAA,wBAAA,EAA0B,mBAAmB,CAAA,EAAG,IAAM,EAAA,UAAA,EAAY,YAAU,IAAC,EAAA,CAAA;AAAA,wBAC7GC,cAAA;AAAA,UAACM,uBAAA;AAAA,UAAA;AAAA,YACC,MAAM,KAAM,CAAA,IAAA;AAAA,YACZ,kBAAkB,YAAa,CAAA,IAAA;AAAA,YAC/B,aAAa,IAAK,CAAA,OAAA;AAAA,YAClB,YAAY,OAAQ,CAAA,UAAA;AAAA,YACpB,gBAAgB,OAAQ,CAAA,cAAA;AAAA,YACxB,SAAA;AAAA,YACA,cAAc,OAAQ,CAAA,YAAA;AAAA,YACtB,cAAA,EAAgB,QAAQ,MAAO,CAAA,cAAA;AAAA,YAC/B,cAAc,QAAS,CAAA,IAAA;AAAA,YACvB,kBAAkB,QAAS,CAAA;AAAA;AAAA;AAC7B,OACF,EAAA;AAAA,KAEJ,EAAA,CAAA;AAAA;AAGN,CAAC","file":"chunk-YYSQGXZJ.cjs","sourcesContent":["import { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginSolidQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginSolidQuery>({\n name: 'svelte-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n } = useApp<PluginSolidQuery>()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(['post', 'put', 'delete', 'patch'], options.query ? options.query.methods : []).some((method) => operation.method === method)\n const importPath = options.query ? options.query.importPath : '@tanstack/solid-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'create' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'create' }),\n }\n\n const client = {\n name: getName(operation, { type: 'function' }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'QueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'QueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'QueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n if (!isQuery || isMutation) {\n return null\n }\n\n return (\n <File baseName={query.file.baseName} path={query.file.path} meta={query.file.meta} banner={output?.banner} footer={output?.footer}>\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={query.file.path} path={zod.file.path} />}\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.queryKey}\n />\n <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n <File.Import name={['queryOptions']} path={importPath} />\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType}\n />\n {options.query && (\n <>\n <File.Import name={['createQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'CreateBaseQueryOptions', 'CreateQueryResult']} path={importPath} isTypeOnly />\n <Query\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n paramsCasing={options.paramsCasing}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n"]}
@@ -1,20 +1,20 @@
1
1
  'use strict';
2
2
 
3
- var chunkX3AJUPDZ_cjs = require('./chunk-X3AJUPDZ.cjs');
3
+ var chunk7B6MOH7D_cjs = require('./chunk-7B6MOH7D.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Query", {
8
8
  enumerable: true,
9
- get: function () { return chunkX3AJUPDZ_cjs.Query; }
9
+ get: function () { return chunk7B6MOH7D_cjs.Query; }
10
10
  });
11
11
  Object.defineProperty(exports, "QueryKey", {
12
12
  enumerable: true,
13
- get: function () { return chunkX3AJUPDZ_cjs.QueryKey; }
13
+ get: function () { return chunk7B6MOH7D_cjs.QueryKey; }
14
14
  });
15
15
  Object.defineProperty(exports, "QueryOptions", {
16
16
  enumerable: true,
17
- get: function () { return chunkX3AJUPDZ_cjs.QueryOptions; }
17
+ get: function () { return chunk7B6MOH7D_cjs.QueryOptions; }
18
18
  });
19
19
  //# sourceMappingURL=components.cjs.map
20
20
  //# sourceMappingURL=components.cjs.map
@@ -60,6 +60,7 @@ type Props = {
60
60
  paramsCasing: PluginSolidQuery['resolvedOptions']['paramsCasing'];
61
61
  paramsType: PluginSolidQuery['resolvedOptions']['paramsType'];
62
62
  pathParamsType: PluginSolidQuery['resolvedOptions']['pathParamsType'];
63
+ dataReturnType: PluginSolidQuery['resolvedOptions']['client']['dataReturnType'];
63
64
  };
64
65
  type GetParamsProps = {
65
66
  paramsCasing: PluginSolidQuery['resolvedOptions']['paramsCasing'];
@@ -67,7 +68,7 @@ type GetParamsProps = {
67
68
  pathParamsType: PluginSolidQuery['resolvedOptions']['pathParamsType'];
68
69
  typeSchemas: OperationSchemas;
69
70
  };
70
- declare function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }: Props): ReactNode;
71
+ declare function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, dataReturnType, pathParamsType, queryKeyName }: Props): ReactNode;
71
72
  declare namespace QueryOptions {
72
73
  var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) => FunctionParams;
73
74
  }
@@ -60,6 +60,7 @@ type Props = {
60
60
  paramsCasing: PluginSolidQuery['resolvedOptions']['paramsCasing'];
61
61
  paramsType: PluginSolidQuery['resolvedOptions']['paramsType'];
62
62
  pathParamsType: PluginSolidQuery['resolvedOptions']['pathParamsType'];
63
+ dataReturnType: PluginSolidQuery['resolvedOptions']['client']['dataReturnType'];
63
64
  };
64
65
  type GetParamsProps = {
65
66
  paramsCasing: PluginSolidQuery['resolvedOptions']['paramsCasing'];
@@ -67,7 +68,7 @@ type GetParamsProps = {
67
68
  pathParamsType: PluginSolidQuery['resolvedOptions']['pathParamsType'];
68
69
  typeSchemas: OperationSchemas;
69
70
  };
70
- declare function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }: Props): ReactNode;
71
+ declare function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, dataReturnType, pathParamsType, queryKeyName }: Props): ReactNode;
71
72
  declare namespace QueryOptions {
72
73
  var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) => FunctionParams;
73
74
  }
@@ -1,3 +1,3 @@
1
- export { Query, QueryKey, QueryOptions } from './chunk-7AQUOPJQ.js';
1
+ export { Query, QueryKey, QueryOptions } from './chunk-6GYHRQ43.js';
2
2
  //# sourceMappingURL=components.js.map
3
3
  //# sourceMappingURL=components.js.map
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkE7TNK3AV_cjs = require('./chunk-E7TNK3AV.cjs');
4
- require('./chunk-X3AJUPDZ.cjs');
3
+ var chunkYYSQGXZJ_cjs = require('./chunk-YYSQGXZJ.cjs');
4
+ require('./chunk-7B6MOH7D.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "queryGenerator", {
9
9
  enumerable: true,
10
- get: function () { return chunkE7TNK3AV_cjs.queryGenerator; }
10
+ get: function () { return chunkYYSQGXZJ_cjs.queryGenerator; }
11
11
  });
12
12
  //# sourceMappingURL=generators.cjs.map
13
13
  //# sourceMappingURL=generators.cjs.map
@@ -1,4 +1,4 @@
1
- export { queryGenerator } from './chunk-5WJYHFK6.js';
2
- import './chunk-7AQUOPJQ.js';
1
+ export { queryGenerator } from './chunk-2S6OAY7A.js';
2
+ import './chunk-6GYHRQ43.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 chunkE7TNK3AV_cjs = require('./chunk-E7TNK3AV.cjs');
4
- var chunkX3AJUPDZ_cjs = require('./chunk-X3AJUPDZ.cjs');
3
+ var chunkYYSQGXZJ_cjs = require('./chunk-YYSQGXZJ.cjs');
4
+ var chunk7B6MOH7D_cjs = require('./chunk-7B6MOH7D.cjs');
5
5
  var path = require('path');
6
6
  var core = require('@kubb/core');
7
7
  var transformers = require('@kubb/core/transformers');
@@ -25,8 +25,8 @@ var pluginSolidQuery = core.createPlugin((options) => {
25
25
  transformers: transformers$1 = {},
26
26
  paramsType = "inline",
27
27
  pathParamsType = "inline",
28
- queryKey = chunkX3AJUPDZ_cjs.QueryKey.getTransformer,
29
- generators = [chunkE7TNK3AV_cjs.queryGenerator].filter(Boolean),
28
+ queryKey = chunk7B6MOH7D_cjs.QueryKey.getTransformer,
29
+ generators = [chunkYYSQGXZJ_cjs.queryGenerator].filter(Boolean),
30
30
  query = {},
31
31
  paramsCasing
32
32
  } = options;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { queryGenerator } from './chunk-5WJYHFK6.js';
2
- import { QueryKey } from './chunk-7AQUOPJQ.js';
1
+ import { queryGenerator } from './chunk-2S6OAY7A.js';
2
+ import { QueryKey } from './chunk-6GYHRQ43.js';
3
3
  import path from 'node:path';
4
4
  import { createPlugin, FileManager, PluginManager } from '@kubb/core';
5
5
  import { camelCase, pascalCase } from '@kubb/core/transformers';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-solid-query",
3
- "version": "3.3.4",
3
+ "version": "3.4.0",
4
4
  "description": "Generator solid-query hooks",
5
5
  "keywords": [
6
6
  "faker",
@@ -62,22 +62,22 @@
62
62
  "!/**/__tests__/**"
63
63
  ],
64
64
  "dependencies": {
65
- "remeda": "^2.18.0",
66
- "@kubb/core": "3.3.4",
67
- "@kubb/fs": "3.3.4",
68
- "@kubb/oas": "3.3.4",
69
- "@kubb/plugin-oas": "3.3.4",
70
- "@kubb/plugin-ts": "3.3.4",
71
- "@kubb/plugin-zod": "3.3.4",
72
- "@kubb/react": "3.3.4"
65
+ "remeda": "^2.19.0",
66
+ "@kubb/core": "3.4.0",
67
+ "@kubb/fs": "3.4.0",
68
+ "@kubb/oas": "3.4.0",
69
+ "@kubb/plugin-oas": "3.4.0",
70
+ "@kubb/plugin-ts": "3.4.0",
71
+ "@kubb/plugin-zod": "3.4.0",
72
+ "@kubb/react": "3.4.0"
73
73
  },
74
74
  "devDependencies": {
75
- "@types/react": "^18.3.17",
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.4",
80
- "@kubb/config-tsup": "3.3.4"
79
+ "@kubb/config-ts": "3.4.0",
80
+ "@kubb/config-tsup": "3.4.0"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "@kubb/react": "^3.0.0"
@@ -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({
@@ -17,6 +17,7 @@ type Props = {
17
17
  paramsCasing: PluginSolidQuery['resolvedOptions']['paramsCasing']
18
18
  paramsType: PluginSolidQuery['resolvedOptions']['paramsType']
19
19
  pathParamsType: PluginSolidQuery['resolvedOptions']['pathParamsType']
20
+ dataReturnType: PluginSolidQuery['resolvedOptions']['client']['dataReturnType']
20
21
  }
21
22
 
22
23
  type GetParamsProps = {
@@ -93,7 +94,10 @@ function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: Ge
93
94
  })
94
95
  }
95
96
 
96
- export function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }: Props): ReactNode {
97
+ export function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, dataReturnType, pathParamsType, queryKeyName }: Props): ReactNode {
98
+ const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
99
+ const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
100
+
97
101
  const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })
98
102
  const clientParams = Client.getParams({
99
103
  paramsCasing,
@@ -119,7 +123,7 @@ export function QueryOptions({ name, clientName, typeSchemas, paramsCasing, para
119
123
  <Function name={name} export params={params.toConstructor()}>
120
124
  {`
121
125
  const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})
122
- return queryOptions({
126
+ return queryOptions<${TData}, ${TError}, ${TData}, typeof queryKey>({
123
127
  ${enabledText}
124
128
  queryKey,
125
129
  queryFn: async ({ signal }) => {
@@ -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({
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
  ) {
@@ -59,7 +64,7 @@ export function createFindPetsByTags<
59
64
  queryKey,
60
65
  initialData: null,
61
66
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
62
- })) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
67
+ })) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
63
68
 
64
69
  query.queryKey = queryKey as TQueryKey
65
70
 
@@ -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({
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
  ) {
@@ -59,7 +59,7 @@ export function createFindPetsByTags<
59
59
  queryKey,
60
60
  initialData: null,
61
61
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
62
- })) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
62
+ })) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
63
63
 
64
64
  query.queryKey = queryKey as TQueryKey
65
65
 
@@ -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({
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
  ) {
@@ -59,7 +59,7 @@ export function createFindPetsByTags<
59
59
  queryKey,
60
60
  initialData: null,
61
61
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
62
- })) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
62
+ })) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
63
63
 
64
64
  query.queryKey = queryKey as TQueryKey
65
65
 
@@ -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({
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
  ) {
@@ -64,7 +64,7 @@ export function createFindPetsByTags<
64
64
  queryKey,
65
65
  initialData: null,
66
66
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
67
- })) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
67
+ })) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
68
68
 
69
69
  query.queryKey = queryKey as TQueryKey
70
70
 
@@ -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({
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
  ) {
@@ -59,7 +59,7 @@ export function createFindPetsByTags<
59
59
  queryKey,
60
60
  initialData: null,
61
61
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
62
- })) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
62
+ })) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
63
63
 
64
64
  query.queryKey = queryKey as TQueryKey
65
65
 
@@ -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({
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
  ) {
@@ -59,7 +59,7 @@ export function createFindPetsByTags<
59
59
  queryKey,
60
60
  initialData: null,
61
61
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
62
- })) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
62
+ })) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
63
63
 
64
64
  query.queryKey = queryKey as TQueryKey
65
65
 
@@ -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({
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
  ) {
@@ -59,7 +59,7 @@ export function createFindPetsByTags<
59
59
  queryKey,
60
60
  initialData: null,
61
61
  ...(queryOptions as unknown as Omit<CreateBaseQueryOptions, 'queryKey'>),
62
- })) as CreateQueryResult<TData, FindPetsByTags400> & { queryKey: TQueryKey }
62
+ })) as CreateQueryResult<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
63
63
 
64
64
  query.queryKey = queryKey as TQueryKey
65
65