@kubb/plugin-react-query 5.0.0-alpha.31 → 5.0.0-alpha.33
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-DQiCnrXP.cjs → components-Cq0WNTay.cjs} +56 -55
- package/dist/components-Cq0WNTay.cjs.map +1 -0
- package/dist/{components-HG1bVVRU.js → components-DTiE-FKc.js} +4 -3
- package/dist/components-DTiE-FKc.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.ts +12 -12
- package/dist/components.js +1 -1
- package/dist/{generators-CeU3eFdF.cjs → generators-B5WzWWUx.cjs} +133 -133
- package/dist/{generators-CeU3eFdF.cjs.map → generators-B5WzWWUx.cjs.map} +1 -1
- package/dist/{generators-BZKMuZRH.js → generators-DnnpkRmx.js} +4 -4
- package/dist/{generators-BZKMuZRH.js.map → generators-DnnpkRmx.js.map} +1 -1
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +1 -1
- package/dist/index.cjs +15 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -19
- package/dist/index.js.map +1 -1
- package/dist/{types-DMLrT2SW.d.ts → types-Crg16xc2.d.ts} +5 -6
- package/package.json +10 -11
- package/src/components/InfiniteQuery.tsx +4 -3
- package/src/components/InfiniteQueryOptions.tsx +4 -3
- package/src/components/Mutation.tsx +4 -3
- package/src/components/MutationOptions.tsx +5 -3
- package/src/components/Query.tsx +4 -3
- package/src/components/QueryOptions.tsx +4 -12
- package/src/components/SuspenseInfiniteQuery.tsx +4 -3
- package/src/components/SuspenseInfiniteQueryOptions.tsx +4 -3
- package/src/components/SuspenseQuery.tsx +4 -3
- package/src/generators/customHookOptionsFileGenerator.tsx +1 -1
- package/src/generators/hookOptionsGenerator.tsx +1 -1
- package/src/generators/infiniteQueryGenerator.tsx +1 -1
- package/src/generators/mutationGenerator.tsx +1 -1
- package/src/generators/queryGenerator.tsx +1 -1
- package/src/generators/suspenseInfiniteQueryGenerator.tsx +1 -1
- package/src/generators/suspenseQueryGenerator.tsx +1 -1
- package/src/plugin.ts +31 -30
- package/dist/components-DQiCnrXP.cjs.map +0 -1
- package/dist/components-HG1bVVRU.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_components = require("./components-
|
|
1
|
+
const require_components = require("./components-Cq0WNTay.cjs");
|
|
2
2
|
let node_path = require("node:path");
|
|
3
3
|
node_path = require_components.__toESM(node_path);
|
|
4
4
|
let node_fs = require("node:fs");
|
|
@@ -7,8 +7,8 @@ let _kubb_plugin_client = require("@kubb/plugin-client");
|
|
|
7
7
|
let _kubb_plugin_ts = require("@kubb/plugin-ts");
|
|
8
8
|
let _kubb_plugin_zod = require("@kubb/plugin-zod");
|
|
9
9
|
let _kubb_plugin_oas_utils = require("@kubb/plugin-oas/utils");
|
|
10
|
-
let
|
|
11
|
-
let
|
|
10
|
+
let _kubb_renderer_jsx = require("@kubb/renderer-jsx");
|
|
11
|
+
let _kubb_renderer_jsx_jsx_runtime = require("@kubb/renderer-jsx/jsx-runtime");
|
|
12
12
|
let _kubb_core_hooks = require("@kubb/core/hooks");
|
|
13
13
|
let _kubb_plugin_oas_generators = require("@kubb/plugin-oas/generators");
|
|
14
14
|
let _kubb_plugin_oas_hooks = require("@kubb/plugin-oas/hooks");
|
|
@@ -48,29 +48,29 @@ const customHookOptionsFileGenerator = (0, _kubb_plugin_oas_generators.createRea
|
|
|
48
48
|
};
|
|
49
49
|
const file = getExternalFile(importPath, node_path.default.dirname(getHookFilePath(operations)));
|
|
50
50
|
if (node_fs.default.existsSync(file.path) && !override) return null;
|
|
51
|
-
return /* @__PURE__ */ (0,
|
|
51
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx.File, {
|
|
52
52
|
baseName: file.baseName,
|
|
53
53
|
path: file.path,
|
|
54
54
|
children: [
|
|
55
|
-
/* @__PURE__ */ (0,
|
|
55
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
56
56
|
name: ["QueryClient"],
|
|
57
57
|
path: reactQueryImportPath,
|
|
58
58
|
isTypeOnly: true
|
|
59
59
|
}),
|
|
60
|
-
/* @__PURE__ */ (0,
|
|
60
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
61
61
|
name: ["useQueryClient"],
|
|
62
62
|
path: reactQueryImportPath
|
|
63
63
|
}),
|
|
64
|
-
/* @__PURE__ */ (0,
|
|
64
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
65
65
|
name: ["HookOptions"],
|
|
66
66
|
root: file.path,
|
|
67
67
|
path: node_path.default.resolve(root, "./index.ts")
|
|
68
68
|
}),
|
|
69
|
-
/* @__PURE__ */ (0,
|
|
69
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx.File.Source, {
|
|
70
70
|
name: file.name,
|
|
71
71
|
isExportable: true,
|
|
72
72
|
isIndexable: true,
|
|
73
|
-
children: [/* @__PURE__ */ (0,
|
|
73
|
+
children: [/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.Function, {
|
|
74
74
|
name: "getCustomHookOptions",
|
|
75
75
|
params: "{ queryClient }: { queryClient: QueryClient }",
|
|
76
76
|
returnType: "Partial<HookOptions>",
|
|
@@ -83,7 +83,7 @@ const customHookOptionsFileGenerator = (0, _kubb_plugin_oas_generators.createRea
|
|
|
83
83
|
// }
|
|
84
84
|
// }
|
|
85
85
|
}`
|
|
86
|
-
}), /* @__PURE__ */ (0,
|
|
86
|
+
}), /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.Function, {
|
|
87
87
|
name,
|
|
88
88
|
generics: "T extends keyof HookOptions",
|
|
89
89
|
params: "{ hookName, operationId }: { hookName: T, operationId: string }",
|
|
@@ -152,7 +152,7 @@ const hookOptionsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
152
152
|
});
|
|
153
153
|
};
|
|
154
154
|
const getQueryHookOptionsImport = (operation) => {
|
|
155
|
-
return /* @__PURE__ */ (0,
|
|
155
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
156
156
|
name: [getQueryHookOptions(operation)],
|
|
157
157
|
root: file.path,
|
|
158
158
|
path: getHookFile(operation).path
|
|
@@ -165,7 +165,7 @@ const hookOptionsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
165
165
|
});
|
|
166
166
|
};
|
|
167
167
|
const getMutationHookOptionsImport = (operation) => {
|
|
168
|
-
return /* @__PURE__ */ (0,
|
|
168
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
169
169
|
name: [getMutationHookOptions(operation)],
|
|
170
170
|
root: file.path,
|
|
171
171
|
path: getHookFile(operation).path
|
|
@@ -191,7 +191,7 @@ const hookOptionsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
191
191
|
});
|
|
192
192
|
};
|
|
193
193
|
const getSuspenseHookOptionsImport = (operation) => {
|
|
194
|
-
return /* @__PURE__ */ (0,
|
|
194
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
195
195
|
name: [getSuspenseHookOptions(operation)],
|
|
196
196
|
root: file.path,
|
|
197
197
|
path: getSuspenseHookFile(operation).path
|
|
@@ -217,7 +217,7 @@ const hookOptionsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
217
217
|
});
|
|
218
218
|
};
|
|
219
219
|
const getInfiniteHookOptionsImport = (operation) => {
|
|
220
|
-
return /* @__PURE__ */ (0,
|
|
220
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
221
221
|
name: [getInfiniteHookOptions(operation)],
|
|
222
222
|
root: file.path,
|
|
223
223
|
path: getInfiniteHookFile(operation).path
|
|
@@ -243,7 +243,7 @@ const hookOptionsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
243
243
|
});
|
|
244
244
|
};
|
|
245
245
|
const getSuspenseInfiniteHookOptionsImport = (operation) => {
|
|
246
|
-
return /* @__PURE__ */ (0,
|
|
246
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
247
247
|
name: [getSuspenseInfiniteHookOptions(operation)],
|
|
248
248
|
root: file.path,
|
|
249
249
|
path: getSuspenseInfiniteHookFile(operation).path
|
|
@@ -269,7 +269,7 @@ const hookOptionsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
269
269
|
if (isMutation(operation)) acc[getHookName(operation)] = `Partial<ReturnType<typeof ${getMutationHookOptions(operation)}>>`;
|
|
270
270
|
return acc;
|
|
271
271
|
}, {});
|
|
272
|
-
return /* @__PURE__ */ (0,
|
|
272
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx.File, {
|
|
273
273
|
baseName: file.baseName,
|
|
274
274
|
path: file.path,
|
|
275
275
|
meta: file.meta,
|
|
@@ -282,12 +282,12 @@ const hookOptionsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerato
|
|
|
282
282
|
oas,
|
|
283
283
|
output
|
|
284
284
|
}),
|
|
285
|
-
children: [imports, /* @__PURE__ */ (0,
|
|
285
|
+
children: [imports, /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Source, {
|
|
286
286
|
name,
|
|
287
287
|
isExportable: true,
|
|
288
288
|
isIndexable: true,
|
|
289
289
|
isTypeOnly: true,
|
|
290
|
-
children: /* @__PURE__ */ (0,
|
|
290
|
+
children: /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.Type, {
|
|
291
291
|
export: true,
|
|
292
292
|
name,
|
|
293
293
|
children: `{ ${Object.keys(hookOptions).map((key) => `${JSON.stringify(key)}: ${hookOptions[key]}`)} }`
|
|
@@ -370,7 +370,7 @@ const infiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
370
370
|
const hasQueryParam = queryParam ? queryParamKeys.some((key) => normalizeKey(key) === queryParam) : false;
|
|
371
371
|
const hasCursorParam = cursorParam ? responseKeys.some((key) => normalizeKey(key) === cursorParam) : true;
|
|
372
372
|
if (!hasQueryParam || !hasCursorParam) return null;
|
|
373
|
-
return /* @__PURE__ */ (0,
|
|
373
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx.File, {
|
|
374
374
|
baseName: query.file.baseName,
|
|
375
375
|
path: query.file.path,
|
|
376
376
|
meta: query.file.meta,
|
|
@@ -384,17 +384,17 @@ const infiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
384
384
|
output
|
|
385
385
|
}),
|
|
386
386
|
children: [
|
|
387
|
-
options.parser === "zod" && /* @__PURE__ */ (0,
|
|
387
|
+
options.parser === "zod" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
388
388
|
name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
|
|
389
389
|
root: query.file.path,
|
|
390
390
|
path: zod.file.path
|
|
391
391
|
}),
|
|
392
|
-
options.client.importPath ? /* @__PURE__ */ (0,
|
|
393
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
392
|
+
options.client.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
393
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
394
394
|
name: "fetch",
|
|
395
395
|
path: options.client.importPath
|
|
396
396
|
}),
|
|
397
|
-
/* @__PURE__ */ (0,
|
|
397
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
398
398
|
name: [
|
|
399
399
|
"Client",
|
|
400
400
|
"RequestConfig",
|
|
@@ -403,18 +403,18 @@ const infiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
403
403
|
path: options.client.importPath,
|
|
404
404
|
isTypeOnly: true
|
|
405
405
|
}),
|
|
406
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
406
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
407
407
|
name: ["ResponseConfig"],
|
|
408
408
|
path: options.client.importPath,
|
|
409
409
|
isTypeOnly: true
|
|
410
410
|
})
|
|
411
|
-
] }) : /* @__PURE__ */ (0,
|
|
412
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
411
|
+
] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
412
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
413
413
|
name: ["fetch"],
|
|
414
414
|
root: query.file.path,
|
|
415
415
|
path: node_path.default.resolve(root, ".kubb/fetch.ts")
|
|
416
416
|
}),
|
|
417
|
-
/* @__PURE__ */ (0,
|
|
417
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
418
418
|
name: [
|
|
419
419
|
"Client",
|
|
420
420
|
"RequestConfig",
|
|
@@ -424,24 +424,24 @@ const infiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
424
424
|
path: node_path.default.resolve(root, ".kubb/fetch.ts"),
|
|
425
425
|
isTypeOnly: true
|
|
426
426
|
}),
|
|
427
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
427
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
428
428
|
name: ["ResponseConfig"],
|
|
429
429
|
root: query.file.path,
|
|
430
430
|
path: node_path.default.resolve(root, ".kubb/fetch.ts"),
|
|
431
431
|
isTypeOnly: true
|
|
432
432
|
})
|
|
433
433
|
] }),
|
|
434
|
-
shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
434
|
+
shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
435
435
|
name: [client.name],
|
|
436
436
|
root: query.file.path,
|
|
437
437
|
path: client.file.path
|
|
438
438
|
}),
|
|
439
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
439
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
440
440
|
name: ["buildFormData"],
|
|
441
441
|
root: query.file.path,
|
|
442
442
|
path: node_path.default.resolve(root, ".kubb/config.ts")
|
|
443
443
|
}),
|
|
444
|
-
/* @__PURE__ */ (0,
|
|
444
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
445
445
|
name: [
|
|
446
446
|
type.schemas.request?.name,
|
|
447
447
|
type.schemas.response.name,
|
|
@@ -454,7 +454,7 @@ const infiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
454
454
|
path: type.file.path,
|
|
455
455
|
isTypeOnly: true
|
|
456
456
|
}),
|
|
457
|
-
/* @__PURE__ */ (0,
|
|
457
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.QueryKey, {
|
|
458
458
|
name: queryKey.name,
|
|
459
459
|
typeName: queryKey.typeName,
|
|
460
460
|
operation,
|
|
@@ -463,7 +463,7 @@ const infiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
463
463
|
typeSchemas: type.schemas,
|
|
464
464
|
transformer: options.queryKey
|
|
465
465
|
}),
|
|
466
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
466
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_plugin_client.ClientLegacy, {
|
|
467
467
|
name: client.name,
|
|
468
468
|
baseURL: options.client.baseURL,
|
|
469
469
|
operation,
|
|
@@ -475,21 +475,21 @@ const infiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
475
475
|
pathParamsType: options.pathParamsType,
|
|
476
476
|
parser: options.parser
|
|
477
477
|
}),
|
|
478
|
-
options.customOptions && /* @__PURE__ */ (0,
|
|
478
|
+
options.customOptions && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
479
479
|
name: [options.customOptions.name],
|
|
480
480
|
path: options.customOptions.importPath
|
|
481
481
|
}),
|
|
482
|
-
infiniteOptions && /* @__PURE__ */ (0,
|
|
483
|
-
/* @__PURE__ */ (0,
|
|
482
|
+
infiniteOptions && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
483
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
484
484
|
name: ["InfiniteData"],
|
|
485
485
|
isTypeOnly: true,
|
|
486
486
|
path: importPath
|
|
487
487
|
}),
|
|
488
|
-
/* @__PURE__ */ (0,
|
|
488
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
489
489
|
name: ["infiniteQueryOptions"],
|
|
490
490
|
path: importPath
|
|
491
491
|
}),
|
|
492
|
-
/* @__PURE__ */ (0,
|
|
492
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.InfiniteQueryOptions, {
|
|
493
493
|
name: queryOptions.name,
|
|
494
494
|
clientName: client.name,
|
|
495
495
|
queryKeyName: queryKey.name,
|
|
@@ -505,12 +505,12 @@ const infiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
505
505
|
queryParam: infiniteOptions.queryParam
|
|
506
506
|
})
|
|
507
507
|
] }),
|
|
508
|
-
infiniteOptions && /* @__PURE__ */ (0,
|
|
509
|
-
/* @__PURE__ */ (0,
|
|
508
|
+
infiniteOptions && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
509
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
510
510
|
name: ["useInfiniteQuery"],
|
|
511
511
|
path: importPath
|
|
512
512
|
}),
|
|
513
|
-
/* @__PURE__ */ (0,
|
|
513
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
514
514
|
name: [
|
|
515
515
|
"QueryKey",
|
|
516
516
|
"QueryClient",
|
|
@@ -520,7 +520,7 @@ const infiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
520
520
|
path: importPath,
|
|
521
521
|
isTypeOnly: true
|
|
522
522
|
}),
|
|
523
|
-
/* @__PURE__ */ (0,
|
|
523
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.InfiniteQuery, {
|
|
524
524
|
name: query.name,
|
|
525
525
|
queryOptionsName: queryOptions.name,
|
|
526
526
|
typeSchemas: type.schemas,
|
|
@@ -598,7 +598,7 @@ const mutationGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)(
|
|
|
598
598
|
})
|
|
599
599
|
};
|
|
600
600
|
if (!isMutation) return null;
|
|
601
|
-
return /* @__PURE__ */ (0,
|
|
601
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx.File, {
|
|
602
602
|
baseName: mutation.file.baseName,
|
|
603
603
|
path: mutation.file.path,
|
|
604
604
|
meta: mutation.file.meta,
|
|
@@ -612,17 +612,17 @@ const mutationGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)(
|
|
|
612
612
|
output
|
|
613
613
|
}),
|
|
614
614
|
children: [
|
|
615
|
-
options.parser === "zod" && /* @__PURE__ */ (0,
|
|
615
|
+
options.parser === "zod" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
616
616
|
name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
|
|
617
617
|
root: mutation.file.path,
|
|
618
618
|
path: zod.file.path
|
|
619
619
|
}),
|
|
620
|
-
options.client.importPath ? /* @__PURE__ */ (0,
|
|
621
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
620
|
+
options.client.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
621
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
622
622
|
name: "fetch",
|
|
623
623
|
path: options.client.importPath
|
|
624
624
|
}),
|
|
625
|
-
/* @__PURE__ */ (0,
|
|
625
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
626
626
|
name: [
|
|
627
627
|
"Client",
|
|
628
628
|
"RequestConfig",
|
|
@@ -631,18 +631,18 @@ const mutationGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)(
|
|
|
631
631
|
path: options.client.importPath,
|
|
632
632
|
isTypeOnly: true
|
|
633
633
|
}),
|
|
634
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
634
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
635
635
|
name: ["ResponseConfig"],
|
|
636
636
|
path: options.client.importPath,
|
|
637
637
|
isTypeOnly: true
|
|
638
638
|
})
|
|
639
|
-
] }) : /* @__PURE__ */ (0,
|
|
640
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
639
|
+
] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
640
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
641
641
|
name: ["fetch"],
|
|
642
642
|
root: mutation.file.path,
|
|
643
643
|
path: node_path.default.resolve(root, ".kubb/fetch.ts")
|
|
644
644
|
}),
|
|
645
|
-
/* @__PURE__ */ (0,
|
|
645
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
646
646
|
name: [
|
|
647
647
|
"Client",
|
|
648
648
|
"RequestConfig",
|
|
@@ -652,28 +652,28 @@ const mutationGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)(
|
|
|
652
652
|
path: node_path.default.resolve(root, ".kubb/fetch.ts"),
|
|
653
653
|
isTypeOnly: true
|
|
654
654
|
}),
|
|
655
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
655
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
656
656
|
name: ["ResponseConfig"],
|
|
657
657
|
root: mutation.file.path,
|
|
658
658
|
path: node_path.default.resolve(root, ".kubb/fetch.ts"),
|
|
659
659
|
isTypeOnly: true
|
|
660
660
|
})
|
|
661
661
|
] }),
|
|
662
|
-
shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
662
|
+
shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
663
663
|
name: [client.name],
|
|
664
664
|
root: mutation.file.path,
|
|
665
665
|
path: client.file.path
|
|
666
666
|
}),
|
|
667
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
667
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
668
668
|
name: ["buildFormData"],
|
|
669
669
|
root: mutation.file.path,
|
|
670
670
|
path: node_path.default.resolve(root, ".kubb/config.ts")
|
|
671
671
|
}),
|
|
672
|
-
options.customOptions && /* @__PURE__ */ (0,
|
|
672
|
+
options.customOptions && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
673
673
|
name: [options.customOptions.name],
|
|
674
674
|
path: options.customOptions.importPath
|
|
675
675
|
}),
|
|
676
|
-
/* @__PURE__ */ (0,
|
|
676
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
677
677
|
name: [
|
|
678
678
|
type.schemas.request?.name,
|
|
679
679
|
type.schemas.response.name,
|
|
@@ -686,7 +686,7 @@ const mutationGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)(
|
|
|
686
686
|
path: type.file.path,
|
|
687
687
|
isTypeOnly: true
|
|
688
688
|
}),
|
|
689
|
-
/* @__PURE__ */ (0,
|
|
689
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.MutationKey, {
|
|
690
690
|
name: mutationKey.name,
|
|
691
691
|
typeName: mutationKey.typeName,
|
|
692
692
|
operation,
|
|
@@ -695,7 +695,7 @@ const mutationGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)(
|
|
|
695
695
|
paramsCasing: options.paramsCasing,
|
|
696
696
|
transformer: options.mutationKey
|
|
697
697
|
}),
|
|
698
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
698
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_plugin_client.ClientLegacy, {
|
|
699
699
|
name: client.name,
|
|
700
700
|
baseURL: options.client.baseURL,
|
|
701
701
|
operation,
|
|
@@ -707,11 +707,11 @@ const mutationGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)(
|
|
|
707
707
|
pathParamsType: options.pathParamsType,
|
|
708
708
|
parser: options.parser
|
|
709
709
|
}),
|
|
710
|
-
/* @__PURE__ */ (0,
|
|
710
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
711
711
|
name: ["mutationOptions"],
|
|
712
712
|
path: importPath
|
|
713
713
|
}),
|
|
714
|
-
/* @__PURE__ */ (0,
|
|
714
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.MutationOptions, {
|
|
715
715
|
name: mutationOptions.name,
|
|
716
716
|
clientName: client.name,
|
|
717
717
|
mutationKeyName: mutationKey.name,
|
|
@@ -721,12 +721,12 @@ const mutationGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)(
|
|
|
721
721
|
pathParamsType: options.pathParamsType,
|
|
722
722
|
dataReturnType: options.client.dataReturnType || "data"
|
|
723
723
|
}),
|
|
724
|
-
options.mutation && /* @__PURE__ */ (0,
|
|
725
|
-
/* @__PURE__ */ (0,
|
|
724
|
+
options.mutation && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
725
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
726
726
|
name: ["useMutation"],
|
|
727
727
|
path: importPath
|
|
728
728
|
}),
|
|
729
|
-
/* @__PURE__ */ (0,
|
|
729
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
730
730
|
name: [
|
|
731
731
|
"UseMutationOptions",
|
|
732
732
|
"UseMutationResult",
|
|
@@ -735,7 +735,7 @@ const mutationGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)(
|
|
|
735
735
|
path: importPath,
|
|
736
736
|
isTypeOnly: true
|
|
737
737
|
}),
|
|
738
|
-
/* @__PURE__ */ (0,
|
|
738
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.Mutation, {
|
|
739
739
|
name: mutation.name,
|
|
740
740
|
mutationOptionsName: mutationOptions.name,
|
|
741
741
|
typeName: mutation.typeName,
|
|
@@ -810,7 +810,7 @@ const queryGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
810
810
|
})
|
|
811
811
|
};
|
|
812
812
|
if (!isQuery || isMutation) return null;
|
|
813
|
-
return /* @__PURE__ */ (0,
|
|
813
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx.File, {
|
|
814
814
|
baseName: query.file.baseName,
|
|
815
815
|
path: query.file.path,
|
|
816
816
|
meta: query.file.meta,
|
|
@@ -824,17 +824,17 @@ const queryGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
824
824
|
output
|
|
825
825
|
}),
|
|
826
826
|
children: [
|
|
827
|
-
options.parser === "zod" && /* @__PURE__ */ (0,
|
|
827
|
+
options.parser === "zod" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
828
828
|
name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
|
|
829
829
|
root: query.file.path,
|
|
830
830
|
path: zod.file.path
|
|
831
831
|
}),
|
|
832
|
-
options.client.importPath ? /* @__PURE__ */ (0,
|
|
833
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
832
|
+
options.client.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
833
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
834
834
|
name: "fetch",
|
|
835
835
|
path: options.client.importPath
|
|
836
836
|
}),
|
|
837
|
-
/* @__PURE__ */ (0,
|
|
837
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
838
838
|
name: [
|
|
839
839
|
"Client",
|
|
840
840
|
"RequestConfig",
|
|
@@ -843,18 +843,18 @@ const queryGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
843
843
|
path: options.client.importPath,
|
|
844
844
|
isTypeOnly: true
|
|
845
845
|
}),
|
|
846
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
846
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
847
847
|
name: ["ResponseConfig"],
|
|
848
848
|
path: options.client.importPath,
|
|
849
849
|
isTypeOnly: true
|
|
850
850
|
})
|
|
851
|
-
] }) : /* @__PURE__ */ (0,
|
|
852
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
851
|
+
] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
852
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
853
853
|
name: ["fetch"],
|
|
854
854
|
root: query.file.path,
|
|
855
855
|
path: node_path.default.resolve(root, ".kubb/fetch.ts")
|
|
856
856
|
}),
|
|
857
|
-
/* @__PURE__ */ (0,
|
|
857
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
858
858
|
name: [
|
|
859
859
|
"Client",
|
|
860
860
|
"RequestConfig",
|
|
@@ -864,28 +864,28 @@ const queryGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
864
864
|
path: node_path.default.resolve(root, ".kubb/fetch.ts"),
|
|
865
865
|
isTypeOnly: true
|
|
866
866
|
}),
|
|
867
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
867
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
868
868
|
name: ["ResponseConfig"],
|
|
869
869
|
root: query.file.path,
|
|
870
870
|
path: node_path.default.resolve(root, ".kubb/fetch.ts"),
|
|
871
871
|
isTypeOnly: true
|
|
872
872
|
})
|
|
873
873
|
] }),
|
|
874
|
-
shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
874
|
+
shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
875
875
|
name: [client.name],
|
|
876
876
|
root: query.file.path,
|
|
877
877
|
path: client.file.path
|
|
878
878
|
}),
|
|
879
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
879
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
880
880
|
name: ["buildFormData"],
|
|
881
881
|
root: query.file.path,
|
|
882
882
|
path: node_path.default.resolve(root, ".kubb/config.ts")
|
|
883
883
|
}),
|
|
884
|
-
options.customOptions && /* @__PURE__ */ (0,
|
|
884
|
+
options.customOptions && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
885
885
|
name: [options.customOptions.name],
|
|
886
886
|
path: options.customOptions.importPath
|
|
887
887
|
}),
|
|
888
|
-
/* @__PURE__ */ (0,
|
|
888
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
889
889
|
name: [
|
|
890
890
|
type.schemas.request?.name,
|
|
891
891
|
type.schemas.response.name,
|
|
@@ -898,7 +898,7 @@ const queryGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
898
898
|
path: type.file.path,
|
|
899
899
|
isTypeOnly: true
|
|
900
900
|
}),
|
|
901
|
-
/* @__PURE__ */ (0,
|
|
901
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.QueryKey, {
|
|
902
902
|
name: queryKey.name,
|
|
903
903
|
typeName: queryKey.typeName,
|
|
904
904
|
operation,
|
|
@@ -907,7 +907,7 @@ const queryGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
907
907
|
paramsCasing: options.paramsCasing,
|
|
908
908
|
transformer: options.queryKey
|
|
909
909
|
}),
|
|
910
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
910
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_plugin_client.ClientLegacy, {
|
|
911
911
|
name: client.name,
|
|
912
912
|
baseURL: options.client.baseURL,
|
|
913
913
|
operation,
|
|
@@ -919,11 +919,11 @@ const queryGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
919
919
|
pathParamsType: options.pathParamsType,
|
|
920
920
|
parser: options.parser
|
|
921
921
|
}),
|
|
922
|
-
/* @__PURE__ */ (0,
|
|
922
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
923
923
|
name: ["queryOptions"],
|
|
924
924
|
path: importPath
|
|
925
925
|
}),
|
|
926
|
-
/* @__PURE__ */ (0,
|
|
926
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.QueryOptions, {
|
|
927
927
|
name: queryOptions.name,
|
|
928
928
|
clientName: client.name,
|
|
929
929
|
queryKeyName: queryKey.name,
|
|
@@ -933,12 +933,12 @@ const queryGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
933
933
|
pathParamsType: options.pathParamsType,
|
|
934
934
|
dataReturnType: options.client.dataReturnType || "data"
|
|
935
935
|
}),
|
|
936
|
-
options.query && /* @__PURE__ */ (0,
|
|
937
|
-
/* @__PURE__ */ (0,
|
|
936
|
+
options.query && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
937
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
938
938
|
name: ["useQuery"],
|
|
939
939
|
path: importPath
|
|
940
940
|
}),
|
|
941
|
-
/* @__PURE__ */ (0,
|
|
941
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
942
942
|
name: [
|
|
943
943
|
"QueryKey",
|
|
944
944
|
"QueryClient",
|
|
@@ -949,7 +949,7 @@ const queryGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
|
|
|
949
949
|
path: importPath,
|
|
950
950
|
isTypeOnly: true
|
|
951
951
|
}),
|
|
952
|
-
/* @__PURE__ */ (0,
|
|
952
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.Query, {
|
|
953
953
|
name: query.name,
|
|
954
954
|
queryOptionsName: queryOptions.name,
|
|
955
955
|
typeSchemas: type.schemas,
|
|
@@ -1034,7 +1034,7 @@ const suspenseInfiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createRea
|
|
|
1034
1034
|
})
|
|
1035
1035
|
};
|
|
1036
1036
|
if (!isQuery || isMutation || !isSuspense || !infiniteOptions) return null;
|
|
1037
|
-
return /* @__PURE__ */ (0,
|
|
1037
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx.File, {
|
|
1038
1038
|
baseName: query.file.baseName,
|
|
1039
1039
|
path: query.file.path,
|
|
1040
1040
|
meta: query.file.meta,
|
|
@@ -1048,17 +1048,17 @@ const suspenseInfiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createRea
|
|
|
1048
1048
|
output
|
|
1049
1049
|
}),
|
|
1050
1050
|
children: [
|
|
1051
|
-
options.parser === "zod" && /* @__PURE__ */ (0,
|
|
1051
|
+
options.parser === "zod" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1052
1052
|
name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
|
|
1053
1053
|
root: query.file.path,
|
|
1054
1054
|
path: zod.file.path
|
|
1055
1055
|
}),
|
|
1056
|
-
options.client.importPath ? /* @__PURE__ */ (0,
|
|
1057
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
1056
|
+
options.client.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
1057
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1058
1058
|
name: "fetch",
|
|
1059
1059
|
path: options.client.importPath
|
|
1060
1060
|
}),
|
|
1061
|
-
/* @__PURE__ */ (0,
|
|
1061
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1062
1062
|
name: [
|
|
1063
1063
|
"Client",
|
|
1064
1064
|
"RequestConfig",
|
|
@@ -1067,18 +1067,18 @@ const suspenseInfiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createRea
|
|
|
1067
1067
|
path: options.client.importPath,
|
|
1068
1068
|
isTypeOnly: true
|
|
1069
1069
|
}),
|
|
1070
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
1070
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1071
1071
|
name: ["ResponseConfig"],
|
|
1072
1072
|
path: options.client.importPath,
|
|
1073
1073
|
isTypeOnly: true
|
|
1074
1074
|
})
|
|
1075
|
-
] }) : /* @__PURE__ */ (0,
|
|
1076
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
1075
|
+
] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
1076
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1077
1077
|
name: ["fetch"],
|
|
1078
1078
|
root: query.file.path,
|
|
1079
1079
|
path: node_path.default.resolve(root, ".kubb/fetch.ts")
|
|
1080
1080
|
}),
|
|
1081
|
-
/* @__PURE__ */ (0,
|
|
1081
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1082
1082
|
name: [
|
|
1083
1083
|
"Client",
|
|
1084
1084
|
"RequestConfig",
|
|
@@ -1088,28 +1088,28 @@ const suspenseInfiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createRea
|
|
|
1088
1088
|
path: node_path.default.resolve(root, ".kubb/fetch.ts"),
|
|
1089
1089
|
isTypeOnly: true
|
|
1090
1090
|
}),
|
|
1091
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
1091
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1092
1092
|
name: ["ResponseConfig"],
|
|
1093
1093
|
root: query.file.path,
|
|
1094
1094
|
path: node_path.default.resolve(root, ".kubb/fetch.ts"),
|
|
1095
1095
|
isTypeOnly: true
|
|
1096
1096
|
})
|
|
1097
1097
|
] }),
|
|
1098
|
-
shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
1098
|
+
shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1099
1099
|
name: [client.name],
|
|
1100
1100
|
root: query.file.path,
|
|
1101
1101
|
path: client.file.path
|
|
1102
1102
|
}),
|
|
1103
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
1103
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1104
1104
|
name: ["buildFormData"],
|
|
1105
1105
|
root: query.file.path,
|
|
1106
1106
|
path: node_path.default.resolve(root, ".kubb/config.ts")
|
|
1107
1107
|
}),
|
|
1108
|
-
options.customOptions && /* @__PURE__ */ (0,
|
|
1108
|
+
options.customOptions && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1109
1109
|
name: [options.customOptions.name],
|
|
1110
1110
|
path: options.customOptions.importPath
|
|
1111
1111
|
}),
|
|
1112
|
-
/* @__PURE__ */ (0,
|
|
1112
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1113
1113
|
name: [
|
|
1114
1114
|
type.schemas.request?.name,
|
|
1115
1115
|
type.schemas.response.name,
|
|
@@ -1122,7 +1122,7 @@ const suspenseInfiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createRea
|
|
|
1122
1122
|
path: type.file.path,
|
|
1123
1123
|
isTypeOnly: true
|
|
1124
1124
|
}),
|
|
1125
|
-
/* @__PURE__ */ (0,
|
|
1125
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.QueryKey, {
|
|
1126
1126
|
name: queryKey.name,
|
|
1127
1127
|
typeName: queryKey.typeName,
|
|
1128
1128
|
operation,
|
|
@@ -1131,7 +1131,7 @@ const suspenseInfiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createRea
|
|
|
1131
1131
|
typeSchemas: type.schemas,
|
|
1132
1132
|
transformer: options.queryKey
|
|
1133
1133
|
}),
|
|
1134
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
1134
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_plugin_client.ClientLegacy, {
|
|
1135
1135
|
name: client.name,
|
|
1136
1136
|
baseURL: options.client.baseURL,
|
|
1137
1137
|
operation,
|
|
@@ -1143,17 +1143,17 @@ const suspenseInfiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createRea
|
|
|
1143
1143
|
pathParamsType: options.pathParamsType,
|
|
1144
1144
|
parser: options.parser
|
|
1145
1145
|
}),
|
|
1146
|
-
infiniteOptions && /* @__PURE__ */ (0,
|
|
1147
|
-
/* @__PURE__ */ (0,
|
|
1146
|
+
infiniteOptions && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
1147
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1148
1148
|
name: ["InfiniteData"],
|
|
1149
1149
|
isTypeOnly: true,
|
|
1150
1150
|
path: importPath
|
|
1151
1151
|
}),
|
|
1152
|
-
/* @__PURE__ */ (0,
|
|
1152
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1153
1153
|
name: ["infiniteQueryOptions"],
|
|
1154
1154
|
path: importPath
|
|
1155
1155
|
}),
|
|
1156
|
-
/* @__PURE__ */ (0,
|
|
1156
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.SuspenseInfiniteQueryOptions, {
|
|
1157
1157
|
name: queryOptions.name,
|
|
1158
1158
|
clientName: client.name,
|
|
1159
1159
|
queryKeyName: queryKey.name,
|
|
@@ -1169,12 +1169,12 @@ const suspenseInfiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createRea
|
|
|
1169
1169
|
queryParam: infiniteOptions.queryParam
|
|
1170
1170
|
})
|
|
1171
1171
|
] }),
|
|
1172
|
-
infiniteOptions && /* @__PURE__ */ (0,
|
|
1173
|
-
/* @__PURE__ */ (0,
|
|
1172
|
+
infiniteOptions && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
1173
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1174
1174
|
name: ["useSuspenseInfiniteQuery"],
|
|
1175
1175
|
path: importPath
|
|
1176
1176
|
}),
|
|
1177
|
-
/* @__PURE__ */ (0,
|
|
1177
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1178
1178
|
name: [
|
|
1179
1179
|
"QueryKey",
|
|
1180
1180
|
"QueryClient",
|
|
@@ -1184,7 +1184,7 @@ const suspenseInfiniteQueryGenerator = (0, _kubb_plugin_oas_generators.createRea
|
|
|
1184
1184
|
path: importPath,
|
|
1185
1185
|
isTypeOnly: true
|
|
1186
1186
|
}),
|
|
1187
|
-
/* @__PURE__ */ (0,
|
|
1187
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.SuspenseInfiniteQuery, {
|
|
1188
1188
|
name: query.name,
|
|
1189
1189
|
queryOptionsName: queryOptions.name,
|
|
1190
1190
|
typeSchemas: type.schemas,
|
|
@@ -1270,7 +1270,7 @@ const suspenseQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
1270
1270
|
})
|
|
1271
1271
|
};
|
|
1272
1272
|
if (!isQuery || isMutation || !isSuspense) return null;
|
|
1273
|
-
return /* @__PURE__ */ (0,
|
|
1273
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx.File, {
|
|
1274
1274
|
baseName: query.file.baseName,
|
|
1275
1275
|
path: query.file.path,
|
|
1276
1276
|
meta: query.file.meta,
|
|
@@ -1284,17 +1284,17 @@ const suspenseQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
1284
1284
|
output
|
|
1285
1285
|
}),
|
|
1286
1286
|
children: [
|
|
1287
|
-
options.parser === "zod" && /* @__PURE__ */ (0,
|
|
1287
|
+
options.parser === "zod" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1288
1288
|
name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
|
|
1289
1289
|
root: query.file.path,
|
|
1290
1290
|
path: zod.file.path
|
|
1291
1291
|
}),
|
|
1292
|
-
options.client.importPath ? /* @__PURE__ */ (0,
|
|
1293
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
1292
|
+
options.client.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
1293
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1294
1294
|
name: "fetch",
|
|
1295
1295
|
path: options.client.importPath
|
|
1296
1296
|
}),
|
|
1297
|
-
/* @__PURE__ */ (0,
|
|
1297
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1298
1298
|
name: [
|
|
1299
1299
|
"Client",
|
|
1300
1300
|
"RequestConfig",
|
|
@@ -1303,18 +1303,18 @@ const suspenseQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
1303
1303
|
path: options.client.importPath,
|
|
1304
1304
|
isTypeOnly: true
|
|
1305
1305
|
}),
|
|
1306
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
1306
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1307
1307
|
name: ["ResponseConfig"],
|
|
1308
1308
|
path: options.client.importPath,
|
|
1309
1309
|
isTypeOnly: true
|
|
1310
1310
|
})
|
|
1311
|
-
] }) : /* @__PURE__ */ (0,
|
|
1312
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
1311
|
+
] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
1312
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1313
1313
|
name: ["fetch"],
|
|
1314
1314
|
root: query.file.path,
|
|
1315
1315
|
path: node_path.default.resolve(root, ".kubb/fetch.ts")
|
|
1316
1316
|
}),
|
|
1317
|
-
/* @__PURE__ */ (0,
|
|
1317
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1318
1318
|
name: [
|
|
1319
1319
|
"Client",
|
|
1320
1320
|
"RequestConfig",
|
|
@@ -1324,28 +1324,28 @@ const suspenseQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
1324
1324
|
path: node_path.default.resolve(root, ".kubb/fetch.ts"),
|
|
1325
1325
|
isTypeOnly: true
|
|
1326
1326
|
}),
|
|
1327
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ (0,
|
|
1327
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1328
1328
|
name: ["ResponseConfig"],
|
|
1329
1329
|
root: query.file.path,
|
|
1330
1330
|
path: node_path.default.resolve(root, ".kubb/fetch.ts"),
|
|
1331
1331
|
isTypeOnly: true
|
|
1332
1332
|
})
|
|
1333
1333
|
] }),
|
|
1334
|
-
shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
1334
|
+
shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1335
1335
|
name: [client.name],
|
|
1336
1336
|
root: query.file.path,
|
|
1337
1337
|
path: client.file.path
|
|
1338
1338
|
}),
|
|
1339
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
1339
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1340
1340
|
name: ["buildFormData"],
|
|
1341
1341
|
root: query.file.path,
|
|
1342
1342
|
path: node_path.default.resolve(root, ".kubb/config.ts")
|
|
1343
1343
|
}),
|
|
1344
|
-
options.customOptions && /* @__PURE__ */ (0,
|
|
1344
|
+
options.customOptions && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1345
1345
|
name: [options.customOptions.name],
|
|
1346
1346
|
path: options.customOptions.importPath
|
|
1347
1347
|
}),
|
|
1348
|
-
/* @__PURE__ */ (0,
|
|
1348
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1349
1349
|
name: [
|
|
1350
1350
|
type.schemas.request?.name,
|
|
1351
1351
|
type.schemas.response.name,
|
|
@@ -1358,7 +1358,7 @@ const suspenseQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
1358
1358
|
path: type.file.path,
|
|
1359
1359
|
isTypeOnly: true
|
|
1360
1360
|
}),
|
|
1361
|
-
/* @__PURE__ */ (0,
|
|
1361
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.QueryKey, {
|
|
1362
1362
|
name: queryKey.name,
|
|
1363
1363
|
typeName: queryKey.typeName,
|
|
1364
1364
|
operation,
|
|
@@ -1367,7 +1367,7 @@ const suspenseQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
1367
1367
|
typeSchemas: type.schemas,
|
|
1368
1368
|
transformer: options.queryKey
|
|
1369
1369
|
}),
|
|
1370
|
-
!shouldUseClientPlugin && /* @__PURE__ */ (0,
|
|
1370
|
+
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_plugin_client.ClientLegacy, {
|
|
1371
1371
|
name: client.name,
|
|
1372
1372
|
baseURL: options.client.baseURL,
|
|
1373
1373
|
operation,
|
|
@@ -1379,11 +1379,11 @@ const suspenseQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
1379
1379
|
pathParamsType: options.pathParamsType,
|
|
1380
1380
|
parser: options.parser
|
|
1381
1381
|
}),
|
|
1382
|
-
/* @__PURE__ */ (0,
|
|
1382
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1383
1383
|
name: ["queryOptions"],
|
|
1384
1384
|
path: importPath
|
|
1385
1385
|
}),
|
|
1386
|
-
/* @__PURE__ */ (0,
|
|
1386
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.QueryOptions, {
|
|
1387
1387
|
name: queryOptions.name,
|
|
1388
1388
|
clientName: client.name,
|
|
1389
1389
|
queryKeyName: queryKey.name,
|
|
@@ -1393,12 +1393,12 @@ const suspenseQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
1393
1393
|
pathParamsType: options.pathParamsType,
|
|
1394
1394
|
dataReturnType: options.client.dataReturnType
|
|
1395
1395
|
}),
|
|
1396
|
-
options.suspense && /* @__PURE__ */ (0,
|
|
1397
|
-
/* @__PURE__ */ (0,
|
|
1396
|
+
options.suspense && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
1397
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1398
1398
|
name: ["useSuspenseQuery"],
|
|
1399
1399
|
path: importPath
|
|
1400
1400
|
}),
|
|
1401
|
-
/* @__PURE__ */ (0,
|
|
1401
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
1402
1402
|
name: [
|
|
1403
1403
|
"QueryKey",
|
|
1404
1404
|
"QueryClient",
|
|
@@ -1408,7 +1408,7 @@ const suspenseQueryGenerator = (0, _kubb_plugin_oas_generators.createReactGenera
|
|
|
1408
1408
|
path: importPath,
|
|
1409
1409
|
isTypeOnly: true
|
|
1410
1410
|
}),
|
|
1411
|
-
/* @__PURE__ */ (0,
|
|
1411
|
+
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.SuspenseQuery, {
|
|
1412
1412
|
name: query.name,
|
|
1413
1413
|
queryOptionsName: queryOptions.name,
|
|
1414
1414
|
typeSchemas: type.schemas,
|
|
@@ -1470,4 +1470,4 @@ Object.defineProperty(exports, "suspenseQueryGenerator", {
|
|
|
1470
1470
|
}
|
|
1471
1471
|
});
|
|
1472
1472
|
|
|
1473
|
-
//# sourceMappingURL=generators-
|
|
1473
|
+
//# sourceMappingURL=generators-B5WzWWUx.cjs.map
|