@kubb/plugin-react-query 4.3.1 → 4.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.
- package/dist/chunk-DMmIE7y6.js +28 -0
- package/dist/{components-DUCi70hD.cjs → components-B_-p18Ak.cjs} +47 -47
- package/dist/components-B_-p18Ak.cjs.map +1 -0
- package/dist/{components-Dc5XkKq5.js → components-CbVTS6aF.js} +3 -3
- package/dist/components-CbVTS6aF.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.cts +20 -24
- package/dist/components.d.ts +20 -24
- package/dist/components.js +1 -1
- package/dist/{generators-CqUlfy01.js → generators-egdl4EOg.js} +4 -4
- package/dist/generators-egdl4EOg.js.map +1 -0
- package/dist/{generators-DaV-5jJ5.cjs → generators-hTZEzfNP.cjs} +68 -68
- package/dist/generators-hTZEzfNP.cjs.map +1 -0
- package/dist/generators.cjs +2 -2
- package/dist/generators.d.cts +5 -5
- package/dist/generators.d.ts +5 -5
- package/dist/generators.js +2 -2
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/{types-Dq_Y56GQ.d.ts → types-CLcavQWE.d.ts} +230 -325
- package/dist/{types-2m4m5kf3.d.cts → types-x2_6F962.d.cts} +230 -325
- package/package.json +18 -14
- package/src/components/InfiniteQuery.tsx +3 -2
- package/src/components/InfiniteQueryOptions.tsx +3 -2
- package/src/components/Mutation.tsx +12 -2
- package/src/components/MutationKey.tsx +3 -2
- package/src/components/MutationOptions.tsx +3 -3
- package/src/components/Query.tsx +3 -2
- package/src/components/QueryKey.tsx +3 -2
- package/src/components/QueryOptions.tsx +4 -4
- package/src/components/SuspenseQuery.tsx +3 -2
- package/src/generators/__snapshots__/findSuspenseByTags.ts +80 -0
- package/src/generators/infiniteQueryGenerator.tsx +1 -1
- package/src/generators/mutationGenerator.tsx +1 -1
- package/src/generators/queryGenerator.tsx +1 -1
- package/src/generators/suspenseQueryGenerator.tsx +1 -1
- package/src/plugin.ts +1 -0
- package/src/types.ts +1 -1
- package/dist/components-DUCi70hD.cjs.map +0 -1
- package/dist/components-Dc5XkKq5.js.map +0 -1
- package/dist/generators-CqUlfy01.js.map +0 -1
- package/dist/generators-DaV-5jJ5.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_components = require('./components-
|
|
1
|
+
const require_components = require('./components-B_-p18Ak.cjs');
|
|
2
2
|
let __kubb_plugin_oas = require("@kubb/plugin-oas");
|
|
3
3
|
__kubb_plugin_oas = require_components.__toESM(__kubb_plugin_oas);
|
|
4
4
|
let __kubb_plugin_ts = require("@kubb/plugin-ts");
|
|
@@ -7,10 +7,10 @@ let __kubb_plugin_zod = require("@kubb/plugin-zod");
|
|
|
7
7
|
__kubb_plugin_zod = require_components.__toESM(__kubb_plugin_zod);
|
|
8
8
|
let __kubb_plugin_oas_utils = require("@kubb/plugin-oas/utils");
|
|
9
9
|
__kubb_plugin_oas_utils = require_components.__toESM(__kubb_plugin_oas_utils);
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
|
|
10
|
+
let __kubb_react_fabric = require("@kubb/react-fabric");
|
|
11
|
+
__kubb_react_fabric = require_components.__toESM(__kubb_react_fabric);
|
|
12
|
+
let __kubb_react_fabric_jsx_runtime = require("@kubb/react-fabric/jsx-runtime");
|
|
13
|
+
__kubb_react_fabric_jsx_runtime = require_components.__toESM(__kubb_react_fabric_jsx_runtime);
|
|
14
14
|
let __kubb_plugin_client_components = require("@kubb/plugin-client/components");
|
|
15
15
|
__kubb_plugin_client_components = require_components.__toESM(__kubb_plugin_client_components);
|
|
16
16
|
let __kubb_core_hooks = require("@kubb/core/hooks");
|
|
@@ -78,7 +78,7 @@ const queryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
78
78
|
})
|
|
79
79
|
};
|
|
80
80
|
if (!isQuery || isMutation) return null;
|
|
81
|
-
return /* @__PURE__ */ (0,
|
|
81
|
+
return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric.File, {
|
|
82
82
|
baseName: query.file.baseName,
|
|
83
83
|
path: query.file.path,
|
|
84
84
|
meta: query.file.meta,
|
|
@@ -92,31 +92,31 @@ const queryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
92
92
|
output
|
|
93
93
|
}),
|
|
94
94
|
children: [
|
|
95
|
-
options.parser === "zod" && /* @__PURE__ */ (0,
|
|
95
|
+
options.parser === "zod" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
96
96
|
name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
|
|
97
97
|
root: query.file.path,
|
|
98
98
|
path: zod.file.path
|
|
99
99
|
}),
|
|
100
|
-
/* @__PURE__ */ (0,
|
|
100
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
101
101
|
name: "fetch",
|
|
102
102
|
path: options.client.importPath
|
|
103
103
|
}),
|
|
104
|
-
hasClientPlugin && /* @__PURE__ */ (0,
|
|
104
|
+
hasClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
105
105
|
name: [client.name],
|
|
106
106
|
root: query.file.path,
|
|
107
107
|
path: client.file.path
|
|
108
108
|
}),
|
|
109
|
-
/* @__PURE__ */ (0,
|
|
109
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
110
110
|
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
111
111
|
path: options.client.importPath,
|
|
112
112
|
isTypeOnly: true
|
|
113
113
|
}),
|
|
114
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
114
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
115
115
|
name: ["ResponseConfig"],
|
|
116
116
|
path: options.client.importPath,
|
|
117
117
|
isTypeOnly: true
|
|
118
118
|
}),
|
|
119
|
-
/* @__PURE__ */ (0,
|
|
119
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
120
120
|
name: [
|
|
121
121
|
type.schemas.request?.name,
|
|
122
122
|
type.schemas.response.name,
|
|
@@ -129,7 +129,7 @@ const queryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
129
129
|
path: type.file.path,
|
|
130
130
|
isTypeOnly: true
|
|
131
131
|
}),
|
|
132
|
-
/* @__PURE__ */ (0,
|
|
132
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.QueryKey, {
|
|
133
133
|
name: queryKey.name,
|
|
134
134
|
typeName: queryKey.typeName,
|
|
135
135
|
operation,
|
|
@@ -138,7 +138,7 @@ const queryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
138
138
|
paramsCasing: options.paramsCasing,
|
|
139
139
|
transformer: options.queryKey
|
|
140
140
|
}),
|
|
141
|
-
!hasClientPlugin && /* @__PURE__ */ (0,
|
|
141
|
+
!hasClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_plugin_client_components.Client, {
|
|
142
142
|
name: client.name,
|
|
143
143
|
baseURL: options.client.baseURL,
|
|
144
144
|
operation,
|
|
@@ -150,11 +150,11 @@ const queryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
150
150
|
pathParamsType: options.pathParamsType,
|
|
151
151
|
parser: options.parser
|
|
152
152
|
}),
|
|
153
|
-
/* @__PURE__ */ (0,
|
|
153
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
154
154
|
name: ["queryOptions"],
|
|
155
155
|
path: importPath
|
|
156
156
|
}),
|
|
157
|
-
/* @__PURE__ */ (0,
|
|
157
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.QueryOptions, {
|
|
158
158
|
name: queryOptions.name,
|
|
159
159
|
clientName: client.name,
|
|
160
160
|
queryKeyName: queryKey.name,
|
|
@@ -164,12 +164,12 @@ const queryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
164
164
|
pathParamsType: options.pathParamsType,
|
|
165
165
|
dataReturnType: options.client.dataReturnType
|
|
166
166
|
}),
|
|
167
|
-
options.query && /* @__PURE__ */ (0,
|
|
168
|
-
/* @__PURE__ */ (0,
|
|
167
|
+
options.query && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [
|
|
168
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
169
169
|
name: ["useQuery"],
|
|
170
170
|
path: importPath
|
|
171
171
|
}),
|
|
172
|
-
/* @__PURE__ */ (0,
|
|
172
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
173
173
|
name: [
|
|
174
174
|
"QueryKey",
|
|
175
175
|
"QueryClient",
|
|
@@ -180,7 +180,7 @@ const queryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
180
180
|
path: importPath,
|
|
181
181
|
isTypeOnly: true
|
|
182
182
|
}),
|
|
183
|
-
/* @__PURE__ */ (0,
|
|
183
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.Query, {
|
|
184
184
|
name: query.name,
|
|
185
185
|
queryOptionsName: queryOptions.name,
|
|
186
186
|
typeSchemas: type.schemas,
|
|
@@ -254,7 +254,7 @@ const mutationGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
254
254
|
})
|
|
255
255
|
};
|
|
256
256
|
if (!isMutation) return null;
|
|
257
|
-
return /* @__PURE__ */ (0,
|
|
257
|
+
return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric.File, {
|
|
258
258
|
baseName: mutation.file.baseName,
|
|
259
259
|
path: mutation.file.path,
|
|
260
260
|
meta: mutation.file.meta,
|
|
@@ -268,21 +268,21 @@ const mutationGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
268
268
|
output
|
|
269
269
|
}),
|
|
270
270
|
children: [
|
|
271
|
-
options.parser === "zod" && /* @__PURE__ */ (0,
|
|
271
|
+
options.parser === "zod" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
272
272
|
name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
|
|
273
273
|
root: mutation.file.path,
|
|
274
274
|
path: zod.file.path
|
|
275
275
|
}),
|
|
276
|
-
/* @__PURE__ */ (0,
|
|
276
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
277
277
|
name: "fetch",
|
|
278
278
|
path: options.client.importPath
|
|
279
279
|
}),
|
|
280
|
-
!!hasClientPlugin && /* @__PURE__ */ (0,
|
|
280
|
+
!!hasClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
281
281
|
name: [client.name],
|
|
282
282
|
root: mutation.file.path,
|
|
283
283
|
path: client.file.path
|
|
284
284
|
}),
|
|
285
|
-
/* @__PURE__ */ (0,
|
|
285
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
286
286
|
name: [
|
|
287
287
|
"RequestConfig",
|
|
288
288
|
"ResponseConfig",
|
|
@@ -291,7 +291,7 @@ const mutationGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
291
291
|
path: options.client.importPath,
|
|
292
292
|
isTypeOnly: true
|
|
293
293
|
}),
|
|
294
|
-
/* @__PURE__ */ (0,
|
|
294
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
295
295
|
name: [
|
|
296
296
|
type.schemas.request?.name,
|
|
297
297
|
type.schemas.response.name,
|
|
@@ -304,7 +304,7 @@ const mutationGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
304
304
|
path: type.file.path,
|
|
305
305
|
isTypeOnly: true
|
|
306
306
|
}),
|
|
307
|
-
/* @__PURE__ */ (0,
|
|
307
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.MutationKey, {
|
|
308
308
|
name: mutationKey.name,
|
|
309
309
|
typeName: mutationKey.typeName,
|
|
310
310
|
operation,
|
|
@@ -313,7 +313,7 @@ const mutationGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
313
313
|
paramsCasing: options.paramsCasing,
|
|
314
314
|
transformer: options.mutationKey
|
|
315
315
|
}),
|
|
316
|
-
!hasClientPlugin && /* @__PURE__ */ (0,
|
|
316
|
+
!hasClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_plugin_client_components.Client, {
|
|
317
317
|
name: client.name,
|
|
318
318
|
baseURL: options.client.baseURL,
|
|
319
319
|
operation,
|
|
@@ -325,11 +325,11 @@ const mutationGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
325
325
|
pathParamsType: options.pathParamsType,
|
|
326
326
|
parser: options.parser
|
|
327
327
|
}),
|
|
328
|
-
/* @__PURE__ */ (0,
|
|
328
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
329
329
|
name: ["mutationOptions"],
|
|
330
330
|
path: importPath
|
|
331
331
|
}),
|
|
332
|
-
/* @__PURE__ */ (0,
|
|
332
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.MutationOptions, {
|
|
333
333
|
name: mutationOptions.name,
|
|
334
334
|
clientName: client.name,
|
|
335
335
|
mutationKeyName: mutationKey.name,
|
|
@@ -339,12 +339,12 @@ const mutationGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
339
339
|
pathParamsType: options.pathParamsType,
|
|
340
340
|
dataReturnType: options.client.dataReturnType
|
|
341
341
|
}),
|
|
342
|
-
options.mutation && /* @__PURE__ */ (0,
|
|
343
|
-
/* @__PURE__ */ (0,
|
|
342
|
+
options.mutation && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [
|
|
343
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
344
344
|
name: ["useMutation"],
|
|
345
345
|
path: importPath
|
|
346
346
|
}),
|
|
347
|
-
/* @__PURE__ */ (0,
|
|
347
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
348
348
|
name: [
|
|
349
349
|
"UseMutationOptions",
|
|
350
350
|
"UseMutationResult",
|
|
@@ -353,7 +353,7 @@ const mutationGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
353
353
|
path: importPath,
|
|
354
354
|
isTypeOnly: true
|
|
355
355
|
}),
|
|
356
|
-
/* @__PURE__ */ (0,
|
|
356
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.Mutation, {
|
|
357
357
|
name: mutation.name,
|
|
358
358
|
mutationOptionsName: mutationOptions.name,
|
|
359
359
|
typeName: mutation.typeName,
|
|
@@ -443,7 +443,7 @@ const infiniteQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
443
443
|
const hasQueryParam = queryParam ? queryParamKeys.some((key) => normalizeKey(key) === queryParam) : false;
|
|
444
444
|
const hasCursorParam = cursorParam ? responseKeys.some((key) => normalizeKey(key) === cursorParam) : true;
|
|
445
445
|
if (!hasQueryParam || !hasCursorParam) return null;
|
|
446
|
-
return /* @__PURE__ */ (0,
|
|
446
|
+
return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric.File, {
|
|
447
447
|
baseName: query.file.baseName,
|
|
448
448
|
path: query.file.path,
|
|
449
449
|
meta: query.file.meta,
|
|
@@ -457,31 +457,31 @@ const infiniteQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
457
457
|
output
|
|
458
458
|
}),
|
|
459
459
|
children: [
|
|
460
|
-
options.parser === "zod" && /* @__PURE__ */ (0,
|
|
460
|
+
options.parser === "zod" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
461
461
|
name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
|
|
462
462
|
root: query.file.path,
|
|
463
463
|
path: zod.file.path
|
|
464
464
|
}),
|
|
465
|
-
/* @__PURE__ */ (0,
|
|
465
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
466
466
|
name: "fetch",
|
|
467
467
|
path: options.client.importPath
|
|
468
468
|
}),
|
|
469
|
-
hasClientPlugin && /* @__PURE__ */ (0,
|
|
469
|
+
hasClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
470
470
|
name: [client.name],
|
|
471
471
|
root: query.file.path,
|
|
472
472
|
path: client.file.path
|
|
473
473
|
}),
|
|
474
|
-
/* @__PURE__ */ (0,
|
|
474
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
475
475
|
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
476
476
|
path: options.client.importPath,
|
|
477
477
|
isTypeOnly: true
|
|
478
478
|
}),
|
|
479
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
479
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
480
480
|
name: ["ResponseConfig"],
|
|
481
481
|
path: options.client.importPath,
|
|
482
482
|
isTypeOnly: true
|
|
483
483
|
}),
|
|
484
|
-
/* @__PURE__ */ (0,
|
|
484
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
485
485
|
name: [
|
|
486
486
|
type.schemas.request?.name,
|
|
487
487
|
type.schemas.response.name,
|
|
@@ -494,7 +494,7 @@ const infiniteQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
494
494
|
path: type.file.path,
|
|
495
495
|
isTypeOnly: true
|
|
496
496
|
}),
|
|
497
|
-
/* @__PURE__ */ (0,
|
|
497
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.QueryKey, {
|
|
498
498
|
name: queryKey.name,
|
|
499
499
|
typeName: queryKey.typeName,
|
|
500
500
|
operation,
|
|
@@ -503,7 +503,7 @@ const infiniteQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
503
503
|
typeSchemas: type.schemas,
|
|
504
504
|
transformer: options.queryKey
|
|
505
505
|
}),
|
|
506
|
-
!hasClientPlugin && /* @__PURE__ */ (0,
|
|
506
|
+
!hasClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_plugin_client_components.Client, {
|
|
507
507
|
name: client.name,
|
|
508
508
|
baseURL: options.client.baseURL,
|
|
509
509
|
operation,
|
|
@@ -515,17 +515,17 @@ const infiniteQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
515
515
|
pathParamsType: options.pathParamsType,
|
|
516
516
|
parser: options.parser
|
|
517
517
|
}),
|
|
518
|
-
infiniteOptions && /* @__PURE__ */ (0,
|
|
519
|
-
/* @__PURE__ */ (0,
|
|
518
|
+
infiniteOptions && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [
|
|
519
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
520
520
|
name: ["InfiniteData"],
|
|
521
521
|
isTypeOnly: true,
|
|
522
522
|
path: importPath
|
|
523
523
|
}),
|
|
524
|
-
/* @__PURE__ */ (0,
|
|
524
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
525
525
|
name: ["infiniteQueryOptions"],
|
|
526
526
|
path: importPath
|
|
527
527
|
}),
|
|
528
|
-
/* @__PURE__ */ (0,
|
|
528
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.InfiniteQueryOptions, {
|
|
529
529
|
name: queryOptions.name,
|
|
530
530
|
clientName: client.name,
|
|
531
531
|
queryKeyName: queryKey.name,
|
|
@@ -539,12 +539,12 @@ const infiniteQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
539
539
|
queryParam: infiniteOptions.queryParam
|
|
540
540
|
})
|
|
541
541
|
] }),
|
|
542
|
-
infiniteOptions && /* @__PURE__ */ (0,
|
|
543
|
-
/* @__PURE__ */ (0,
|
|
542
|
+
infiniteOptions && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [
|
|
543
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
544
544
|
name: ["useInfiniteQuery"],
|
|
545
545
|
path: importPath
|
|
546
546
|
}),
|
|
547
|
-
/* @__PURE__ */ (0,
|
|
547
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
548
548
|
name: [
|
|
549
549
|
"QueryKey",
|
|
550
550
|
"QueryClient",
|
|
@@ -554,7 +554,7 @@ const infiniteQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
554
554
|
path: importPath,
|
|
555
555
|
isTypeOnly: true
|
|
556
556
|
}),
|
|
557
|
-
/* @__PURE__ */ (0,
|
|
557
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.InfiniteQuery, {
|
|
558
558
|
name: query.name,
|
|
559
559
|
queryOptionsName: queryOptions.name,
|
|
560
560
|
typeSchemas: type.schemas,
|
|
@@ -639,7 +639,7 @@ const suspenseQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
639
639
|
})
|
|
640
640
|
};
|
|
641
641
|
if (!isQuery || isMutation || !isSuspense) return null;
|
|
642
|
-
return /* @__PURE__ */ (0,
|
|
642
|
+
return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric.File, {
|
|
643
643
|
baseName: query.file.baseName,
|
|
644
644
|
path: query.file.path,
|
|
645
645
|
meta: query.file.meta,
|
|
@@ -653,31 +653,31 @@ const suspenseQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
653
653
|
output
|
|
654
654
|
}),
|
|
655
655
|
children: [
|
|
656
|
-
options.parser === "zod" && /* @__PURE__ */ (0,
|
|
656
|
+
options.parser === "zod" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
657
657
|
name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
|
|
658
658
|
root: query.file.path,
|
|
659
659
|
path: zod.file.path
|
|
660
660
|
}),
|
|
661
|
-
/* @__PURE__ */ (0,
|
|
661
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
662
662
|
name: "fetch",
|
|
663
663
|
path: options.client.importPath
|
|
664
664
|
}),
|
|
665
|
-
hasClientPlugin && /* @__PURE__ */ (0,
|
|
665
|
+
hasClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
666
666
|
name: [client.name],
|
|
667
667
|
root: query.file.path,
|
|
668
668
|
path: client.file.path
|
|
669
669
|
}),
|
|
670
|
-
/* @__PURE__ */ (0,
|
|
670
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
671
671
|
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
672
672
|
path: options.client.importPath,
|
|
673
673
|
isTypeOnly: true
|
|
674
674
|
}),
|
|
675
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
675
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
676
676
|
name: ["ResponseConfig"],
|
|
677
677
|
path: options.client.importPath,
|
|
678
678
|
isTypeOnly: true
|
|
679
679
|
}),
|
|
680
|
-
/* @__PURE__ */ (0,
|
|
680
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
681
681
|
name: [
|
|
682
682
|
type.schemas.request?.name,
|
|
683
683
|
type.schemas.response.name,
|
|
@@ -690,7 +690,7 @@ const suspenseQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
690
690
|
path: type.file.path,
|
|
691
691
|
isTypeOnly: true
|
|
692
692
|
}),
|
|
693
|
-
/* @__PURE__ */ (0,
|
|
693
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.QueryKey, {
|
|
694
694
|
name: queryKey.name,
|
|
695
695
|
typeName: queryKey.typeName,
|
|
696
696
|
operation,
|
|
@@ -699,7 +699,7 @@ const suspenseQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
699
699
|
typeSchemas: type.schemas,
|
|
700
700
|
transformer: options.queryKey
|
|
701
701
|
}),
|
|
702
|
-
!hasClientPlugin && /* @__PURE__ */ (0,
|
|
702
|
+
!hasClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_plugin_client_components.Client, {
|
|
703
703
|
name: client.name,
|
|
704
704
|
baseURL: options.client.baseURL,
|
|
705
705
|
operation,
|
|
@@ -711,11 +711,11 @@ const suspenseQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
711
711
|
pathParamsType: options.pathParamsType,
|
|
712
712
|
parser: options.parser
|
|
713
713
|
}),
|
|
714
|
-
/* @__PURE__ */ (0,
|
|
714
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
715
715
|
name: ["queryOptions"],
|
|
716
716
|
path: importPath
|
|
717
717
|
}),
|
|
718
|
-
/* @__PURE__ */ (0,
|
|
718
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.QueryOptions, {
|
|
719
719
|
name: queryOptions.name,
|
|
720
720
|
clientName: client.name,
|
|
721
721
|
queryKeyName: queryKey.name,
|
|
@@ -725,12 +725,12 @@ const suspenseQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
725
725
|
pathParamsType: options.pathParamsType,
|
|
726
726
|
dataReturnType: options.client.dataReturnType
|
|
727
727
|
}),
|
|
728
|
-
options.suspense && /* @__PURE__ */ (0,
|
|
729
|
-
/* @__PURE__ */ (0,
|
|
728
|
+
options.suspense && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [
|
|
729
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
730
730
|
name: ["useSuspenseQuery"],
|
|
731
731
|
path: importPath
|
|
732
732
|
}),
|
|
733
|
-
/* @__PURE__ */ (0,
|
|
733
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
734
734
|
name: [
|
|
735
735
|
"QueryKey",
|
|
736
736
|
"QueryClient",
|
|
@@ -740,12 +740,12 @@ const suspenseQueryGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
740
740
|
path: importPath,
|
|
741
741
|
isTypeOnly: true
|
|
742
742
|
}),
|
|
743
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
743
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
|
|
744
744
|
name: ["ResponseConfig"],
|
|
745
745
|
path: options.client.importPath,
|
|
746
746
|
isTypeOnly: true
|
|
747
747
|
}),
|
|
748
|
-
/* @__PURE__ */ (0,
|
|
748
|
+
/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.SuspenseQuery, {
|
|
749
749
|
name: query.name,
|
|
750
750
|
queryOptionsName: queryOptions.name,
|
|
751
751
|
typeSchemas: type.schemas,
|
|
@@ -788,4 +788,4 @@ Object.defineProperty(exports, 'suspenseQueryGenerator', {
|
|
|
788
788
|
return suspenseQueryGenerator;
|
|
789
789
|
}
|
|
790
790
|
});
|
|
791
|
-
//# sourceMappingURL=generators-
|
|
791
|
+
//# sourceMappingURL=generators-hTZEzfNP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators-hTZEzfNP.cjs","names":["pluginClientName","pluginTsName","pluginZodName","File","QueryKey","Client","QueryOptions","Query","pluginTsName","pluginZodName","pluginClientName","File","MutationKey","Client","MutationOptions","Mutation","pluginClientName","pluginTsName","pluginZodName","File","QueryKey","Client","InfiniteQueryOptions","InfiniteQuery","pluginClientName","pluginTsName","pluginZodName","File","QueryKey","Client","QueryOptions","SuspenseQuery"],"sources":["../src/generators/queryGenerator.tsx","../src/generators/mutationGenerator.tsx","../src/generators/infiniteQueryGenerator.tsx","../src/generators/suspenseQueryGenerator.tsx"],"sourcesContent":["import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginReactQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginReactQuery>({\n name: 'react-query',\n Operation({ options, operation }) {\n const {\n options: { output },\n } = usePlugin<PluginReactQuery>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\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(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n\n const importPath = options.query ? options.query.importPath : '@tanstack/react-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\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 // grouping is coming from react-query instead of zod option, we need to pass the options of zod instead\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\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n <File.Import name={'fetch'} path={options.client.importPath} />\n {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\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 pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n transformer={options.queryKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsType={options.paramsType}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\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={['useQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'QueryObserverOptions', 'UseQueryResult', 'QueryClient']} path={importPath} isTypeOnly />\n <Query\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport { MutationOptions } from '../components/MutationOptions.tsx'\nimport type { PluginReactQuery } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginReactQuery>({\n name: 'react-query',\n Operation({ options, operation }) {\n const {\n options: { output },\n } = usePlugin<PluginReactQuery>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method)\n const isMutation =\n !isQuery &&\n difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method)\n\n const importPath = options.mutation ? options.mutation.importPath : '@tanstack/react-query'\n\n const mutation = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\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 const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const mutationOptions = {\n name: getName(operation, { type: 'function', suffix: 'MutationOptions' }),\n }\n\n const mutationKey = {\n name: getName(operation, { type: 'const', suffix: 'MutationKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'MutationKey' }),\n }\n\n if (!isMutation) {\n return null\n }\n\n return (\n <File\n baseName={mutation.file.baseName}\n path={mutation.file.path}\n meta={mutation.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={mutation.file.path} path={zod.file.path} />\n )}\n <File.Import name={'fetch'} path={options.client.importPath} />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseConfig', 'ResponseErrorConfig']} 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={mutation.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <MutationKey\n name={mutationKey.name}\n typeName={mutationKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n transformer={options.mutationKey}\n />\n\n {!hasClientPlugin && (\n <Client\n name={client.name}\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 )}\n <File.Import name={['mutationOptions']} path={importPath} />\n\n <MutationOptions\n name={mutationOptions.name}\n clientName={client.name}\n mutationKeyName={mutationKey.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.mutation && (\n <>\n <File.Import name={['useMutation']} path={importPath} />\n <File.Import name={['UseMutationOptions', 'UseMutationResult', 'QueryClient']} path={importPath} isTypeOnly />\n <Mutation\n name={mutation.name}\n mutationOptionsName={mutationOptions.name}\n typeName={mutation.typeName}\n typeSchemas={type.schemas}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { InfiniteQuery, InfiniteQueryOptions, QueryKey } from '../components'\nimport type { PluginReactQuery } from '../types'\n\nexport const infiniteQueryGenerator = createReactGenerator<PluginReactQuery>({\n name: 'react-infinite-query',\n Operation({ options, operation }) {\n const {\n options: { output },\n } = usePlugin<PluginReactQuery>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\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(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n const infiniteOptions = options.infinite && typeof options.infinite === 'object' ? options.infinite : undefined\n\n const importPath = options.query ? options.query.importPath : '@tanstack/react-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use', suffix: 'infinite' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use', suffix: 'infinite' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n suffix: 'infinite',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'InfiniteQueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'InfiniteQueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'InfiniteQueryKey' }),\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 || !infiniteOptions) {\n return null\n }\n\n const normalizeKey = (key?: string | null) => (key ?? '').replace(/\\?$/, '')\n const queryParam = infiniteOptions.queryParam\n const cursorParam = infiniteOptions.cursorParam\n const queryParamKeys = type.schemas.queryParams?.keys ?? []\n const responseKeys = [...(type.schemas.responses?.flatMap((item) => item.keys ?? []) ?? []), ...(type.schemas.response?.keys ?? [])]\n\n const hasQueryParam = queryParam ? queryParamKeys.some((key) => normalizeKey(key) === queryParam) : false\n const hasCursorParam = cursorParam ? responseKeys.some((key) => normalizeKey(key) === cursorParam) : true\n\n if (!hasQueryParam || !hasCursorParam) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n {<File.Import name={'fetch'} path={options.client.importPath} />}\n {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\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 {!hasClientPlugin && (\n <Client\n name={client.name}\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 )}\n {infiniteOptions && (\n <>\n <File.Import name={['InfiniteData']} isTypeOnly path={importPath} />\n <File.Import name={['infiniteQueryOptions']} path={importPath} />\n <InfiniteQueryOptions\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 cursorParam={infiniteOptions.cursorParam}\n initialPageParam={infiniteOptions.initialPageParam}\n queryParam={infiniteOptions.queryParam}\n />\n </>\n )}\n {infiniteOptions && (\n <>\n <File.Import name={['useInfiniteQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'InfiniteQueryObserverOptions', 'UseInfiniteQueryResult']} path={importPath} isTypeOnly />\n <InfiniteQuery\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n initialPageParam={infiniteOptions.initialPageParam}\n queryParam={infiniteOptions.queryParam}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { QueryKey, QueryOptions, SuspenseQuery } from '../components'\nimport type { PluginReactQuery } from '../types'\n\nexport const suspenseQueryGenerator = createReactGenerator<PluginReactQuery>({\n name: 'react-suspense-query',\n Operation({ options, operation }) {\n const {\n options: { output },\n } = usePlugin<PluginReactQuery>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\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(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n\n const isSuspense = !!options.suspense\n\n const importPath = options.query ? options.query.importPath : '@tanstack/react-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use', suffix: 'suspense' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use', suffix: 'suspense' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n suffix: 'suspense',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'SuspenseQueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'SuspenseQueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'SuspenseQueryKey' }),\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 || !isSuspense) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n <File.Import name={'fetch'} path={options.client.importPath} />\n {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\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\n {!hasClientPlugin && (\n <Client\n name={client.name}\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 )}\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.suspense && (\n <>\n <File.Import name={['useSuspenseQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'UseSuspenseQueryOptions', 'UseSuspenseQueryResult']} path={importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n\n <SuspenseQuery\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAa,6DAAwD;CACnE,MAAM;CACN,UAAU,EAAE,SAAS,aAAa;EAChC,MAAM,EACJ,SAAS,EAAE,+CACoB;EACjC,MAAM,yDAAkC;EAExC,MAAM,2CAAc;EACpB,MAAM,EAAE,YAAY,SAAS,8DAAiC;EAE9D,MAAM,UAAU,OAAO,QAAQ,UAAU,YAAY,OAAO,QAAQ,OAAO,QAAQ,MAAM,WAAW,UAAU,WAAW,OAAO;EAChI,MAAM,oCAAwB,QAAQ,WAAW,QAAQ,SAAS,UAAU,EAAE,EAAE,QAAQ,QAAQ,QAAQ,MAAM,UAAU,EAAE,CAAC,CAAC,MACzH,WAAW,UAAU,WAAW,OAClC;EAED,MAAM,aAAa,QAAQ,QAAQ,QAAQ,MAAM,aAAa;EAE9D,MAAM,QAAQ;GACZ,MAAM,QAAQ,WAAW;IAAE,MAAM;IAAY,QAAQ;IAAO,CAAC;GAC7D,UAAU,QAAQ,WAAW,EAAE,MAAM,QAAQ,CAAC;GAC9C,MAAM,QAAQ,WAAW,EAAE,QAAQ,OAAO,CAAC;GAC5C;EAED,MAAM,kBAAkB,CAAC,CAAC,cAAc,eAAe,CAACA,sCAAiB,CAAC;EAC1E,MAAM,SAAS;GACb,MAAM,kBACF,QAAQ,WAAW;IACjB,MAAM;IACN,WAAW,CAACA,sCAAiB;IAC9B,CAAC,GACF,QAAQ,WAAW,EACjB,MAAM,YACP,CAAC;GACN,MAAM,QAAQ,WAAW,EAAE,WAAW,CAACA,sCAAiB,EAAE,CAAC;GAC5D;EAED,MAAM,eAAe,EACnB,MAAM,QAAQ,WAAW;GAAE,MAAM;GAAY,QAAQ;GA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AAgB,QAAQ;KACxB,QAAQ,QAAQ;MAChB;IAEJ,yDAACF,yBAAK;KAAO,MAAM,CAAC,eAAe;KAAE,MAAM;MAAc;IACzD,yDAACG;KACC,MAAM,aAAa;KACnB,YAAY,OAAO;KACnB,cAAc,SAAS;KACvB,aAAa,KAAK;KAClB,cAAc,QAAQ;KACtB,YAAY,QAAQ;KACpB,gBAAgB,QAAQ;KACxB,gBAAgB,QAAQ,OAAO;MAC/B;IACD,QAAQ,YACP;KACE,yDAACH,yBAAK;MAAO,MAAM,CAAC,mBAAmB;MAAE,MAAM;OAAc;KAC7D,yDAACA,yBAAK;MAAO,MAAM;OAAC;OAAY;OAAe;OAA2B;OAAyB;MAAE,MAAM;MAAY;OAAa;KACnI,QAAQ,OAAO,mBAAmB,UAAU,yDAACA,yBAAK;MAAO,MAAM,CAAC,iBAAiB;MAAE,MAAM,QAAQ,OAAO;MAAY;OAAa;KAElI,yDAACI;MACC,MAAM,MAAM;MACZ,kBAAkB,aAAa;MAC/B,aAAa,KAAK;MAClB,YAAY,QAAQ;MACpB,cAAc,QAAQ;MACtB,gBAAgB,QAAQ;MACb;MACX,gBAAgB,QAAQ,OAAO;MAC/B,cAAc,SAAS;MACvB,kBAAkB,SAAS;OAC3B;QACD;;IAEA;;CAGZ,CAAC"}
|
package/dist/generators.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require('./components-
|
|
2
|
-
const require_generators = require('./generators-
|
|
1
|
+
require('./components-B_-p18Ak.cjs');
|
|
2
|
+
const require_generators = require('./generators-hTZEzfNP.cjs');
|
|
3
3
|
|
|
4
4
|
exports.infiniteQueryGenerator = require_generators.infiniteQueryGenerator;
|
|
5
5
|
exports.mutationGenerator = require_generators.mutationGenerator;
|
package/dist/generators.d.cts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as ReactGenerator, r as PluginReactQuery } from "./types-x2_6F962.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/generators/queryGenerator.d.ts
|
|
4
|
-
declare const queryGenerator:
|
|
4
|
+
declare const queryGenerator: ReactGenerator<PluginReactQuery>;
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/generators/mutationGenerator.d.ts
|
|
7
|
-
declare const mutationGenerator:
|
|
7
|
+
declare const mutationGenerator: ReactGenerator<PluginReactQuery>;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/generators/infiniteQueryGenerator.d.ts
|
|
10
|
-
declare const infiniteQueryGenerator:
|
|
10
|
+
declare const infiniteQueryGenerator: ReactGenerator<PluginReactQuery>;
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/generators/suspenseQueryGenerator.d.ts
|
|
13
|
-
declare const suspenseQueryGenerator:
|
|
13
|
+
declare const suspenseQueryGenerator: ReactGenerator<PluginReactQuery>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { infiniteQueryGenerator, mutationGenerator, queryGenerator, suspenseQueryGenerator };
|
|
16
16
|
//# sourceMappingURL=generators.d.cts.map
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as ReactGenerator, r as PluginReactQuery } from "./types-CLcavQWE.js";
|
|
2
2
|
|
|
3
3
|
//#region src/generators/queryGenerator.d.ts
|
|
4
|
-
declare const queryGenerator:
|
|
4
|
+
declare const queryGenerator: ReactGenerator<PluginReactQuery>;
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/generators/mutationGenerator.d.ts
|
|
7
|
-
declare const mutationGenerator:
|
|
7
|
+
declare const mutationGenerator: ReactGenerator<PluginReactQuery>;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/generators/infiniteQueryGenerator.d.ts
|
|
10
|
-
declare const infiniteQueryGenerator:
|
|
10
|
+
declare const infiniteQueryGenerator: ReactGenerator<PluginReactQuery>;
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/generators/suspenseQueryGenerator.d.ts
|
|
13
|
-
declare const suspenseQueryGenerator:
|
|
13
|
+
declare const suspenseQueryGenerator: ReactGenerator<PluginReactQuery>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { infiniteQueryGenerator, mutationGenerator, queryGenerator, suspenseQueryGenerator };
|
|
16
16
|
//# sourceMappingURL=generators.d.ts.map
|
package/dist/generators.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./components-
|
|
2
|
-
import { i as queryGenerator, n as infiniteQueryGenerator, r as mutationGenerator, t as suspenseQueryGenerator } from "./generators-
|
|
1
|
+
import "./components-CbVTS6aF.js";
|
|
2
|
+
import { i as queryGenerator, n as infiniteQueryGenerator, r as mutationGenerator, t as suspenseQueryGenerator } from "./generators-egdl4EOg.js";
|
|
3
3
|
|
|
4
4
|
export { infiniteQueryGenerator, mutationGenerator, queryGenerator, suspenseQueryGenerator };
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_components = require('./components-
|
|
2
|
-
const require_generators = require('./generators-
|
|
1
|
+
const require_components = require('./components-B_-p18Ak.cjs');
|
|
2
|
+
const require_generators = require('./generators-hTZEzfNP.cjs');
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
node_path = require_components.__toESM(node_path);
|
|
5
5
|
let __kubb_core = require("@kubb/core");
|
|
@@ -102,6 +102,7 @@ const pluginReactQuery = (0, __kubb_core.createPlugin)((options) => {
|
|
|
102
102
|
const baseURL = await swaggerPlugin.context.getBaseURL();
|
|
103
103
|
if (baseURL) this.plugin.options.client.baseURL = baseURL;
|
|
104
104
|
const files = await new __kubb_plugin_oas.OperationGenerator(this.plugin.options, {
|
|
105
|
+
fabric: this.fabric,
|
|
105
106
|
oas,
|
|
106
107
|
pluginManager: this.pluginManager,
|
|
107
108
|
plugin: this.plugin,
|