@kubb/plugin-react-query 5.0.0-beta.42 → 5.0.0-beta.56
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/{components-IArDg-DO.js → components-DL0Cai7l.js} +211 -255
- package/dist/components-DL0Cai7l.js.map +1 -0
- package/dist/{components-DQAYLQW0.cjs → components-yMQOuFmI.cjs} +215 -259
- package/dist/components-yMQOuFmI.cjs.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/{generators-B86BJkmW.js → generators-BG-Vcvfg.js} +151 -231
- package/dist/generators-BG-Vcvfg.js.map +1 -0
- package/dist/{generators-BqGaMUH6.cjs → generators-zGKP8yII.cjs} +149 -229
- package/dist/generators-zGKP8yII.cjs.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +1 -1
- package/dist/index.cjs +35 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +36 -13
- package/dist/index.js.map +1 -1
- package/dist/{types-Dh4HNR9K.d.ts → types-X7D0NSvJ.d.ts} +11 -15
- package/package.json +10 -17
- package/src/components/InfiniteQuery.tsx +4 -5
- package/src/components/InfiniteQueryOptions.tsx +24 -27
- package/src/components/Mutation.tsx +5 -6
- package/src/components/MutationOptions.tsx +2 -2
- package/src/components/Query.tsx +5 -6
- package/src/components/QueryOptions.tsx +6 -25
- package/src/components/SuspenseInfiniteQuery.tsx +4 -5
- package/src/components/SuspenseInfiniteQueryOptions.tsx +24 -25
- package/src/components/SuspenseQuery.tsx +5 -6
- package/src/generators/customHookOptionsFileGenerator.tsx +2 -2
- package/src/generators/hookOptionsGenerator.tsx +2 -2
- package/src/generators/infiniteQueryGenerator.tsx +5 -9
- package/src/generators/mutationGenerator.tsx +8 -9
- package/src/generators/queryGenerator.tsx +5 -9
- package/src/generators/suspenseInfiniteQueryGenerator.tsx +5 -9
- package/src/generators/suspenseQueryGenerator.tsx +5 -9
- package/src/plugin.ts +4 -4
- package/src/resolvers/resolverReactQuery.ts +2 -2
- package/src/types.ts +9 -13
- package/src/utils.ts +1 -0
- package/dist/components-DQAYLQW0.cjs.map +0 -1
- package/dist/components-IArDg-DO.js.map +0 -1
- package/dist/generators-B86BJkmW.js.map +0 -1
- package/dist/generators-BqGaMUH6.cjs.map +0 -1
- package/extension.yaml +0 -1484
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_components = require("./components-
|
|
1
|
+
const require_components = require("./components-yMQOuFmI.cjs");
|
|
2
2
|
let node_path = require("node:path");
|
|
3
3
|
node_path = require_components.__toESM(node_path);
|
|
4
4
|
let _kubb_core = require("@kubb/core");
|
|
@@ -18,7 +18,7 @@ node_fs = require_components.__toESM(node_fs);
|
|
|
18
18
|
*/
|
|
19
19
|
const customHookOptionsFileGenerator = (0, _kubb_core.defineGenerator)({
|
|
20
20
|
name: "react-query-custom-hook-options-file",
|
|
21
|
-
renderer: _kubb_renderer_jsx.
|
|
21
|
+
renderer: _kubb_renderer_jsx.jsxRenderer,
|
|
22
22
|
operations(nodes, ctx) {
|
|
23
23
|
const { resolver, config, root } = ctx;
|
|
24
24
|
const { output, customOptions, query, group } = ctx.options;
|
|
@@ -115,7 +115,7 @@ const customHookOptionsFileGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
115
115
|
*/
|
|
116
116
|
const hookOptionsGenerator = (0, _kubb_core.defineGenerator)({
|
|
117
117
|
name: "react-query-hook-options",
|
|
118
|
-
renderer: _kubb_renderer_jsx.
|
|
118
|
+
renderer: _kubb_renderer_jsx.jsxRenderer,
|
|
119
119
|
operations(nodes, ctx) {
|
|
120
120
|
const { resolver, config, root } = ctx;
|
|
121
121
|
const { output, customOptions, query, mutation, suspense, infinite, group, override } = ctx.options;
|
|
@@ -272,7 +272,7 @@ const hookOptionsGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
272
272
|
*/
|
|
273
273
|
const infiniteQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
274
274
|
name: "react-infinite-query",
|
|
275
|
-
renderer: _kubb_renderer_jsx.
|
|
275
|
+
renderer: _kubb_renderer_jsx.jsxRenderer,
|
|
276
276
|
operation(node, ctx) {
|
|
277
277
|
if (!_kubb_core.ast.isHttpOperationNode(node)) return null;
|
|
278
278
|
const { config, driver, resolver, root } = ctx;
|
|
@@ -313,14 +313,14 @@ const infiniteQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
313
313
|
exclude: [queryKeyTypeName],
|
|
314
314
|
order: "body-response-first"
|
|
315
315
|
});
|
|
316
|
-
const pluginZod = parser
|
|
316
|
+
const pluginZod = (0, _kubb_plugin_client.isParserEnabled)(parser) ? driver.getPlugin(_kubb_plugin_zod.pluginZodName) : null;
|
|
317
317
|
const zodResolver = pluginZod ? driver.getResolver(_kubb_plugin_zod.pluginZodName) : null;
|
|
318
318
|
const fileZod = zodResolver ? zodResolver.resolveFile(require_components.operationFileEntry(node, node.operationId), {
|
|
319
319
|
root,
|
|
320
320
|
output: pluginZod?.options?.output ?? output,
|
|
321
321
|
group: pluginZod?.options?.group ?? void 0
|
|
322
322
|
}) : null;
|
|
323
|
-
const zodSchemaNames = require_components.resolveZodSchemaNames(node, zodResolver);
|
|
323
|
+
const zodSchemaNames = require_components.resolveZodSchemaNames(node, zodResolver, parser);
|
|
324
324
|
const clientPlugin = driver.getPlugin(_kubb_plugin_client.pluginClientName);
|
|
325
325
|
const shouldUseClientPlugin = clientPlugin?.name === _kubb_plugin_client.pluginClientName && clientOptions.clientType !== "class";
|
|
326
326
|
const clientResolver = shouldUseClientPlugin ? driver.getResolver(_kubb_plugin_client.pluginClientName) : null;
|
|
@@ -356,48 +356,31 @@ const infiniteQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
356
356
|
root: meta.file.path,
|
|
357
357
|
path: fileZod.path
|
|
358
358
|
}),
|
|
359
|
-
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
385
|
-
name: [
|
|
386
|
-
"Client",
|
|
387
|
-
"RequestConfig",
|
|
388
|
-
"ResponseErrorConfig"
|
|
389
|
-
],
|
|
390
|
-
root: meta.file.path,
|
|
391
|
-
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
392
|
-
isTypeOnly: true
|
|
393
|
-
}),
|
|
394
|
-
clientOptions.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
395
|
-
name: ["ResponseConfig"],
|
|
396
|
-
root: meta.file.path,
|
|
397
|
-
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
398
|
-
isTypeOnly: true
|
|
399
|
-
})
|
|
400
|
-
] }),
|
|
359
|
+
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
360
|
+
name: "client",
|
|
361
|
+
path: clientOptions.importPath
|
|
362
|
+
}), /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
363
|
+
name: [
|
|
364
|
+
"Client",
|
|
365
|
+
"RequestConfig",
|
|
366
|
+
"ResponseErrorConfig"
|
|
367
|
+
],
|
|
368
|
+
path: clientOptions.importPath,
|
|
369
|
+
isTypeOnly: true
|
|
370
|
+
})] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
371
|
+
name: ["client"],
|
|
372
|
+
root: meta.file.path,
|
|
373
|
+
path: node_path.default.resolve(root, ".kubb/client.ts")
|
|
374
|
+
}), /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
375
|
+
name: [
|
|
376
|
+
"Client",
|
|
377
|
+
"RequestConfig",
|
|
378
|
+
"ResponseErrorConfig"
|
|
379
|
+
],
|
|
380
|
+
root: meta.file.path,
|
|
381
|
+
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
382
|
+
isTypeOnly: true
|
|
383
|
+
})] }),
|
|
401
384
|
shouldUseClientPlugin && clientFile && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
402
385
|
name: [resolvedClientName],
|
|
403
386
|
root: meta.file.path,
|
|
@@ -506,7 +489,7 @@ const infiniteQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
506
489
|
*/
|
|
507
490
|
const mutationGenerator = (0, _kubb_core.defineGenerator)({
|
|
508
491
|
name: "react-query-mutation",
|
|
509
|
-
renderer: _kubb_renderer_jsx.
|
|
492
|
+
renderer: _kubb_renderer_jsx.jsxRenderer,
|
|
510
493
|
operation(node, ctx) {
|
|
511
494
|
if (!_kubb_core.ast.isHttpOperationNode(node)) return null;
|
|
512
495
|
const { config, driver, resolver, root } = ctx;
|
|
@@ -539,14 +522,14 @@ const mutationGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
539
522
|
paramsCasing,
|
|
540
523
|
order: "body-response-first"
|
|
541
524
|
});
|
|
542
|
-
const pluginZod = parser
|
|
525
|
+
const pluginZod = (0, _kubb_plugin_client.isParserEnabled)(parser) ? driver.getPlugin(_kubb_plugin_zod.pluginZodName) : null;
|
|
543
526
|
const zodResolver = pluginZod ? driver.getResolver(_kubb_plugin_zod.pluginZodName) : null;
|
|
544
527
|
const fileZod = zodResolver ? zodResolver.resolveFile(require_components.operationFileEntry(node, node.operationId), {
|
|
545
528
|
root,
|
|
546
529
|
output: pluginZod?.options?.output ?? output,
|
|
547
530
|
group: pluginZod?.options?.group ?? void 0
|
|
548
531
|
}) : null;
|
|
549
|
-
const zodSchemaNames = require_components.resolveZodSchemaNames(node, zodResolver);
|
|
532
|
+
const zodSchemaNames = require_components.resolveZodSchemaNames(node, zodResolver, parser);
|
|
550
533
|
const clientPlugin = driver.getPlugin(_kubb_plugin_client.pluginClientName);
|
|
551
534
|
const shouldUseClientPlugin = clientPlugin?.name === _kubb_plugin_client.pluginClientName && clientOptions.clientType !== "class";
|
|
552
535
|
const clientResolver = shouldUseClientPlugin ? driver.getResolver(_kubb_plugin_client.pluginClientName) : null;
|
|
@@ -582,48 +565,31 @@ const mutationGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
582
565
|
root: meta.file.path,
|
|
583
566
|
path: fileZod.path
|
|
584
567
|
}),
|
|
585
|
-
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
611
|
-
name: [
|
|
612
|
-
"Client",
|
|
613
|
-
"RequestConfig",
|
|
614
|
-
"ResponseErrorConfig"
|
|
615
|
-
],
|
|
616
|
-
root: meta.file.path,
|
|
617
|
-
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
618
|
-
isTypeOnly: true
|
|
619
|
-
}),
|
|
620
|
-
clientOptions.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
621
|
-
name: ["ResponseConfig"],
|
|
622
|
-
root: meta.file.path,
|
|
623
|
-
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
624
|
-
isTypeOnly: true
|
|
625
|
-
})
|
|
626
|
-
] }),
|
|
568
|
+
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
569
|
+
name: "client",
|
|
570
|
+
path: clientOptions.importPath
|
|
571
|
+
}), /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
572
|
+
name: [
|
|
573
|
+
"Client",
|
|
574
|
+
"RequestConfig",
|
|
575
|
+
"ResponseErrorConfig"
|
|
576
|
+
],
|
|
577
|
+
path: clientOptions.importPath,
|
|
578
|
+
isTypeOnly: true
|
|
579
|
+
})] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
580
|
+
name: ["client"],
|
|
581
|
+
root: meta.file.path,
|
|
582
|
+
path: node_path.default.resolve(root, ".kubb/client.ts")
|
|
583
|
+
}), /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
584
|
+
name: [
|
|
585
|
+
"Client",
|
|
586
|
+
"RequestConfig",
|
|
587
|
+
"ResponseErrorConfig"
|
|
588
|
+
],
|
|
589
|
+
root: meta.file.path,
|
|
590
|
+
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
591
|
+
isTypeOnly: true
|
|
592
|
+
})] }),
|
|
627
593
|
shouldUseClientPlugin && clientFile && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
628
594
|
name: [resolvedClientName],
|
|
629
595
|
root: meta.file.path,
|
|
@@ -634,6 +600,11 @@ const mutationGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
634
600
|
root: meta.file.path,
|
|
635
601
|
path: node_path.default.resolve(root, ".kubb/config.ts")
|
|
636
602
|
}),
|
|
603
|
+
!shouldUseClientPlugin && parser === "zod" && zodResolver && node.requestBody?.content?.[0]?.schema && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
604
|
+
name: ["z"],
|
|
605
|
+
path: "zod",
|
|
606
|
+
isTypeOnly: true
|
|
607
|
+
}),
|
|
637
608
|
customOptions && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
638
609
|
name: [customOptions.name],
|
|
639
610
|
path: customOptions.importPath
|
|
@@ -718,7 +689,7 @@ const mutationGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
718
689
|
*/
|
|
719
690
|
const queryGenerator = (0, _kubb_core.defineGenerator)({
|
|
720
691
|
name: "react-query",
|
|
721
|
-
renderer: _kubb_renderer_jsx.
|
|
692
|
+
renderer: _kubb_renderer_jsx.jsxRenderer,
|
|
722
693
|
operation(node, ctx) {
|
|
723
694
|
if (!_kubb_core.ast.isHttpOperationNode(node)) return null;
|
|
724
695
|
const { config, driver, resolver, root } = ctx;
|
|
@@ -753,14 +724,14 @@ const queryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
753
724
|
exclude: [queryKeyTypeName],
|
|
754
725
|
order: "body-response-first"
|
|
755
726
|
});
|
|
756
|
-
const pluginZod = parser
|
|
727
|
+
const pluginZod = (0, _kubb_plugin_client.isParserEnabled)(parser) ? driver.getPlugin(_kubb_plugin_zod.pluginZodName) : null;
|
|
757
728
|
const zodResolver = pluginZod ? driver.getResolver(_kubb_plugin_zod.pluginZodName) : null;
|
|
758
729
|
const fileZod = zodResolver ? zodResolver.resolveFile(require_components.operationFileEntry(node, node.operationId), {
|
|
759
730
|
root,
|
|
760
731
|
output: pluginZod?.options?.output ?? output,
|
|
761
732
|
group: pluginZod?.options?.group ?? void 0
|
|
762
733
|
}) : null;
|
|
763
|
-
const zodSchemaNames = require_components.resolveZodSchemaNames(node, zodResolver);
|
|
734
|
+
const zodSchemaNames = require_components.resolveZodSchemaNames(node, zodResolver, parser);
|
|
764
735
|
const clientPlugin = driver.getPlugin(_kubb_plugin_client.pluginClientName);
|
|
765
736
|
const shouldUseClientPlugin = clientPlugin?.name === _kubb_plugin_client.pluginClientName && clientOptions.clientType !== "class";
|
|
766
737
|
const clientResolver = shouldUseClientPlugin ? driver.getResolver(_kubb_plugin_client.pluginClientName) : null;
|
|
@@ -796,48 +767,31 @@ const queryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
796
767
|
root: meta.file.path,
|
|
797
768
|
path: fileZod.path
|
|
798
769
|
}),
|
|
799
|
-
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
825
|
-
name: [
|
|
826
|
-
"Client",
|
|
827
|
-
"RequestConfig",
|
|
828
|
-
"ResponseErrorConfig"
|
|
829
|
-
],
|
|
830
|
-
root: meta.file.path,
|
|
831
|
-
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
832
|
-
isTypeOnly: true
|
|
833
|
-
}),
|
|
834
|
-
clientOptions.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
835
|
-
name: ["ResponseConfig"],
|
|
836
|
-
root: meta.file.path,
|
|
837
|
-
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
838
|
-
isTypeOnly: true
|
|
839
|
-
})
|
|
840
|
-
] }),
|
|
770
|
+
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
771
|
+
name: "client",
|
|
772
|
+
path: clientOptions.importPath
|
|
773
|
+
}), /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
774
|
+
name: [
|
|
775
|
+
"Client",
|
|
776
|
+
"RequestConfig",
|
|
777
|
+
"ResponseErrorConfig"
|
|
778
|
+
],
|
|
779
|
+
path: clientOptions.importPath,
|
|
780
|
+
isTypeOnly: true
|
|
781
|
+
})] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
782
|
+
name: ["client"],
|
|
783
|
+
root: meta.file.path,
|
|
784
|
+
path: node_path.default.resolve(root, ".kubb/client.ts")
|
|
785
|
+
}), /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
786
|
+
name: [
|
|
787
|
+
"Client",
|
|
788
|
+
"RequestConfig",
|
|
789
|
+
"ResponseErrorConfig"
|
|
790
|
+
],
|
|
791
|
+
root: meta.file.path,
|
|
792
|
+
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
793
|
+
isTypeOnly: true
|
|
794
|
+
})] }),
|
|
841
795
|
shouldUseClientPlugin && clientFile && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
842
796
|
name: [resolvedClientName],
|
|
843
797
|
root: meta.file.path,
|
|
@@ -937,7 +891,7 @@ const queryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
937
891
|
*/
|
|
938
892
|
const suspenseInfiniteQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
939
893
|
name: "react-suspense-infinite-query",
|
|
940
|
-
renderer: _kubb_renderer_jsx.
|
|
894
|
+
renderer: _kubb_renderer_jsx.jsxRenderer,
|
|
941
895
|
operation(node, ctx) {
|
|
942
896
|
if (!_kubb_core.ast.isHttpOperationNode(node)) return null;
|
|
943
897
|
const { config, driver, resolver, root } = ctx;
|
|
@@ -978,14 +932,14 @@ const suspenseInfiniteQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
978
932
|
paramsCasing,
|
|
979
933
|
order: "body-response-first"
|
|
980
934
|
});
|
|
981
|
-
const pluginZod = parser
|
|
935
|
+
const pluginZod = (0, _kubb_plugin_client.isParserEnabled)(parser) ? driver.getPlugin(_kubb_plugin_zod.pluginZodName) : null;
|
|
982
936
|
const zodResolver = pluginZod ? driver.getResolver(_kubb_plugin_zod.pluginZodName) : null;
|
|
983
937
|
const fileZod = zodResolver ? zodResolver.resolveFile(require_components.operationFileEntry(node, node.operationId), {
|
|
984
938
|
root,
|
|
985
939
|
output: pluginZod?.options?.output ?? output,
|
|
986
940
|
group: pluginZod?.options?.group ?? void 0
|
|
987
941
|
}) : null;
|
|
988
|
-
const zodSchemaNames = require_components.resolveZodSchemaNames(node, zodResolver);
|
|
942
|
+
const zodSchemaNames = require_components.resolveZodSchemaNames(node, zodResolver, parser);
|
|
989
943
|
const clientPlugin = driver.getPlugin(_kubb_plugin_client.pluginClientName);
|
|
990
944
|
const shouldUseClientPlugin = clientPlugin?.name === _kubb_plugin_client.pluginClientName && clientOptions.clientType !== "class";
|
|
991
945
|
const clientResolver = shouldUseClientPlugin ? driver.getResolver(_kubb_plugin_client.pluginClientName) : null;
|
|
@@ -1021,48 +975,31 @@ const suspenseInfiniteQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
1021
975
|
root: meta.file.path,
|
|
1022
976
|
path: fileZod.path
|
|
1023
977
|
}),
|
|
1024
|
-
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1050
|
-
name: [
|
|
1051
|
-
"Client",
|
|
1052
|
-
"RequestConfig",
|
|
1053
|
-
"ResponseErrorConfig"
|
|
1054
|
-
],
|
|
1055
|
-
root: meta.file.path,
|
|
1056
|
-
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
1057
|
-
isTypeOnly: true
|
|
1058
|
-
}),
|
|
1059
|
-
clientOptions.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1060
|
-
name: ["ResponseConfig"],
|
|
1061
|
-
root: meta.file.path,
|
|
1062
|
-
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
1063
|
-
isTypeOnly: true
|
|
1064
|
-
})
|
|
1065
|
-
] }),
|
|
978
|
+
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
979
|
+
name: "client",
|
|
980
|
+
path: clientOptions.importPath
|
|
981
|
+
}), /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
982
|
+
name: [
|
|
983
|
+
"Client",
|
|
984
|
+
"RequestConfig",
|
|
985
|
+
"ResponseErrorConfig"
|
|
986
|
+
],
|
|
987
|
+
path: clientOptions.importPath,
|
|
988
|
+
isTypeOnly: true
|
|
989
|
+
})] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
990
|
+
name: ["client"],
|
|
991
|
+
root: meta.file.path,
|
|
992
|
+
path: node_path.default.resolve(root, ".kubb/client.ts")
|
|
993
|
+
}), /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
994
|
+
name: [
|
|
995
|
+
"Client",
|
|
996
|
+
"RequestConfig",
|
|
997
|
+
"ResponseErrorConfig"
|
|
998
|
+
],
|
|
999
|
+
root: meta.file.path,
|
|
1000
|
+
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
1001
|
+
isTypeOnly: true
|
|
1002
|
+
})] }),
|
|
1066
1003
|
shouldUseClientPlugin && clientFile && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1067
1004
|
name: [resolvedClientName],
|
|
1068
1005
|
root: meta.file.path,
|
|
@@ -1172,7 +1109,7 @@ const suspenseInfiniteQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
1172
1109
|
*/
|
|
1173
1110
|
const suspenseQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
1174
1111
|
name: "react-suspense-query",
|
|
1175
|
-
renderer: _kubb_renderer_jsx.
|
|
1112
|
+
renderer: _kubb_renderer_jsx.jsxRenderer,
|
|
1176
1113
|
operation(node, ctx) {
|
|
1177
1114
|
if (!_kubb_core.ast.isHttpOperationNode(node)) return null;
|
|
1178
1115
|
const { config, driver, resolver, root } = ctx;
|
|
@@ -1207,14 +1144,14 @@ const suspenseQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
1207
1144
|
exclude: [queryKeyTypeName],
|
|
1208
1145
|
order: "body-response-first"
|
|
1209
1146
|
});
|
|
1210
|
-
const pluginZod = parser
|
|
1147
|
+
const pluginZod = (0, _kubb_plugin_client.isParserEnabled)(parser) ? driver.getPlugin(_kubb_plugin_zod.pluginZodName) : null;
|
|
1211
1148
|
const zodResolver = pluginZod ? driver.getResolver(_kubb_plugin_zod.pluginZodName) : null;
|
|
1212
1149
|
const fileZod = zodResolver ? zodResolver.resolveFile(require_components.operationFileEntry(node, node.operationId), {
|
|
1213
1150
|
root,
|
|
1214
1151
|
output: pluginZod?.options?.output ?? output,
|
|
1215
1152
|
group: pluginZod?.options?.group ?? void 0
|
|
1216
1153
|
}) : null;
|
|
1217
|
-
const zodSchemaNames = require_components.resolveZodSchemaNames(node, zodResolver);
|
|
1154
|
+
const zodSchemaNames = require_components.resolveZodSchemaNames(node, zodResolver, parser);
|
|
1218
1155
|
const clientPlugin = driver.getPlugin(_kubb_plugin_client.pluginClientName);
|
|
1219
1156
|
const shouldUseClientPlugin = clientPlugin?.name === _kubb_plugin_client.pluginClientName && clientOptions.clientType !== "class";
|
|
1220
1157
|
const clientResolver = shouldUseClientPlugin ? driver.getResolver(_kubb_plugin_client.pluginClientName) : null;
|
|
@@ -1250,48 +1187,31 @@ const suspenseQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
1250
1187
|
root: meta.file.path,
|
|
1251
1188
|
path: fileZod.path
|
|
1252
1189
|
}),
|
|
1253
|
-
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1279
|
-
name: [
|
|
1280
|
-
"Client",
|
|
1281
|
-
"RequestConfig",
|
|
1282
|
-
"ResponseErrorConfig"
|
|
1283
|
-
],
|
|
1284
|
-
root: meta.file.path,
|
|
1285
|
-
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
1286
|
-
isTypeOnly: true
|
|
1287
|
-
}),
|
|
1288
|
-
clientOptions.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1289
|
-
name: ["ResponseConfig"],
|
|
1290
|
-
root: meta.file.path,
|
|
1291
|
-
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
1292
|
-
isTypeOnly: true
|
|
1293
|
-
})
|
|
1294
|
-
] }),
|
|
1190
|
+
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1191
|
+
name: "client",
|
|
1192
|
+
path: clientOptions.importPath
|
|
1193
|
+
}), /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1194
|
+
name: [
|
|
1195
|
+
"Client",
|
|
1196
|
+
"RequestConfig",
|
|
1197
|
+
"ResponseErrorConfig"
|
|
1198
|
+
],
|
|
1199
|
+
path: clientOptions.importPath,
|
|
1200
|
+
isTypeOnly: true
|
|
1201
|
+
})] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1202
|
+
name: ["client"],
|
|
1203
|
+
root: meta.file.path,
|
|
1204
|
+
path: node_path.default.resolve(root, ".kubb/client.ts")
|
|
1205
|
+
}), /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1206
|
+
name: [
|
|
1207
|
+
"Client",
|
|
1208
|
+
"RequestConfig",
|
|
1209
|
+
"ResponseErrorConfig"
|
|
1210
|
+
],
|
|
1211
|
+
root: meta.file.path,
|
|
1212
|
+
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
1213
|
+
isTypeOnly: true
|
|
1214
|
+
})] }),
|
|
1295
1215
|
shouldUseClientPlugin && clientFile && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1296
1216
|
name: [resolvedClientName],
|
|
1297
1217
|
root: meta.file.path,
|
|
@@ -1426,4 +1346,4 @@ Object.defineProperty(exports, "suspenseQueryGenerator", {
|
|
|
1426
1346
|
}
|
|
1427
1347
|
});
|
|
1428
1348
|
|
|
1429
|
-
//# sourceMappingURL=generators-
|
|
1349
|
+
//# sourceMappingURL=generators-zGKP8yII.cjs.map
|