@kubb/plugin-react-query 4.37.3 → 4.37.4

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.
@@ -477,7 +477,7 @@ type SchemaV2Props<TOptions extends PluginFactoryOptions> = {
477
477
  node: SchemaNode;
478
478
  };
479
479
  type SchemaProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? SchemaV2Props<TOptions> : SchemaV1Props<TOptions>;
480
- type Generator<TOptions extends PluginFactoryOptions, TVersion extends Version = Version> = CoreGenerator<TOptions, TVersion> | ReactGenerator<TOptions, TVersion>;
480
+ type Generator<TOptions extends PluginFactoryOptions, TVersion extends Version = Version> = TVersion extends Version ? CoreGenerator<TOptions, TVersion> | ReactGenerator<TOptions, TVersion> : never;
481
481
  //#endregion
482
482
  //#region ../plugin-oas/src/generators/createReactGenerator.d.ts
483
483
  type ReactGenerator<TOptions extends PluginFactoryOptions, TVersion extends Version> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-react-query",
3
- "version": "4.37.3",
3
+ "version": "4.37.4",
4
4
  "description": "React Query hooks generator plugin for Kubb, creating type-safe API client hooks from OpenAPI specifications for React applications.",
5
5
  "keywords": [
6
6
  "react-query",
@@ -74,12 +74,12 @@
74
74
  "@kubb/fabric-core": "0.14.0",
75
75
  "@kubb/react-fabric": "0.14.0",
76
76
  "remeda": "^2.33.6",
77
- "@kubb/core": "4.37.3",
78
- "@kubb/oas": "4.37.3",
79
- "@kubb/plugin-client": "4.37.3",
80
- "@kubb/plugin-oas": "4.37.3",
81
- "@kubb/plugin-ts": "4.37.3",
82
- "@kubb/plugin-zod": "4.37.3"
77
+ "@kubb/core": "4.37.4",
78
+ "@kubb/oas": "4.37.4",
79
+ "@kubb/plugin-client": "4.37.4",
80
+ "@kubb/plugin-oas": "4.37.4",
81
+ "@kubb/plugin-ts": "4.37.4",
82
+ "@kubb/plugin-zod": "4.37.4"
83
83
  },
84
84
  "peerDependencies": {
85
85
  "@kubb/fabric-core": "0.14.0",
@@ -89,7 +89,11 @@ function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas, page
89
89
  pathParams: typeSchemas.pathParams?.name
90
90
  ? {
91
91
  mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',
92
- children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing, override: (item) => ({ ...item, type: `${item.type} | undefined` }) }),
92
+ children: getPathParams(typeSchemas.pathParams, {
93
+ typed: true,
94
+ casing: paramsCasing,
95
+ override: (item) => ({ ...item, type: `${item.type} | undefined` }),
96
+ }),
93
97
  default: isAllOptional(typeSchemas.pathParams?.schema) ? '{}' : undefined,
94
98
  }
95
99
  : undefined,
@@ -33,7 +33,11 @@ type GetParamsProps = {
33
33
 
34
34
  function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) {
35
35
  if (paramsType === 'object') {
36
- const pathParams = getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing, override: (item) => ({ ...item, type: `${item.type} | undefined` }) })
36
+ const pathParams = getPathParams(typeSchemas.pathParams, {
37
+ typed: true,
38
+ casing: paramsCasing,
39
+ override: (item) => ({ ...item, type: `${item.type} | undefined` }),
40
+ })
37
41
 
38
42
  const children = {
39
43
  ...pathParams,
@@ -37,7 +37,11 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
37
37
  const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
38
38
 
39
39
  if (paramsType === 'object') {
40
- const pathParams = getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing, override: (item) => ({ ...item, type: `${item.type} | undefined` }) })
40
+ const pathParams = getPathParams(typeSchemas.pathParams, {
41
+ typed: true,
42
+ casing: paramsCasing,
43
+ override: (item) => ({ ...item, type: `${item.type} | undefined` }),
44
+ })
41
45
 
42
46
  const children = {
43
47
  ...pathParams,
@@ -86,7 +90,11 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
86
90
  pathParams: typeSchemas.pathParams?.name
87
91
  ? {
88
92
  mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',
89
- children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing, override: (item) => ({ ...item, type: `${item.type} | undefined` }) }),
93
+ children: getPathParams(typeSchemas.pathParams, {
94
+ typed: true,
95
+ casing: paramsCasing,
96
+ override: (item) => ({ ...item, type: `${item.type} | undefined` }),
97
+ }),
90
98
  default: isAllOptional(typeSchemas.pathParams?.schema) ? '{}' : undefined,
91
99
  }
92
100
  : undefined,
@@ -27,7 +27,11 @@ type GetParamsProps = {
27
27
 
28
28
  function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) {
29
29
  if (paramsType === 'object') {
30
- const pathParams = getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing, override: (item) => ({ ...item, type: `${item.type} | undefined` }) })
30
+ const pathParams = getPathParams(typeSchemas.pathParams, {
31
+ typed: true,
32
+ casing: paramsCasing,
33
+ override: (item) => ({ ...item, type: `${item.type} | undefined` }),
34
+ })
31
35
 
32
36
  const children = {
33
37
  ...pathParams,
@@ -36,7 +36,11 @@ type GetParamsProps = {
36
36
 
37
37
  function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas, pageParamGeneric }: GetParamsProps) {
38
38
  if (paramsType === 'object') {
39
- const pathParams = getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing, override: (item) => ({ ...item, type: `${item.type} | undefined` }) })
39
+ const pathParams = getPathParams(typeSchemas.pathParams, {
40
+ typed: true,
41
+ casing: paramsCasing,
42
+ override: (item) => ({ ...item, type: `${item.type} | undefined` }),
43
+ })
40
44
 
41
45
  const children = {
42
46
  ...pathParams,
@@ -33,7 +33,11 @@ type GetParamsProps = {
33
33
 
34
34
  function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) {
35
35
  if (paramsType === 'object') {
36
- const pathParams = getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing, override: (item) => ({ ...item, type: `${item.type} | undefined` }) })
36
+ const pathParams = getPathParams(typeSchemas.pathParams, {
37
+ typed: true,
38
+ casing: paramsCasing,
39
+ override: (item) => ({ ...item, type: `${item.type} | undefined` }),
40
+ })
37
41
 
38
42
  const children = {
39
43
  ...pathParams,
@@ -37,7 +37,11 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
37
37
  const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`
38
38
 
39
39
  if (paramsType === 'object') {
40
- const pathParams = getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing, override: (item) => ({ ...item, type: `${item.type} | undefined` }) })
40
+ const pathParams = getPathParams(typeSchemas.pathParams, {
41
+ typed: true,
42
+ casing: paramsCasing,
43
+ override: (item) => ({ ...item, type: `${item.type} | undefined` }),
44
+ })
41
45
 
42
46
  const children = {
43
47
  ...pathParams,