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