@kubb/plugin-react-query 5.8.0-canary.20261028T230157 → 5.8.0-canary.20261029T082701
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/index.cjs +33 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -1
- package/dist/index.d.ts +57 -1
- package/dist/index.js +33 -29
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -510,7 +510,7 @@ var compatibility = {
|
|
|
510
510
|
"node": ">=22.22"
|
|
511
511
|
};
|
|
512
512
|
// package.json
|
|
513
|
-
var version = "5.8.0-canary.
|
|
513
|
+
var version = "5.8.0-canary.20261029T082701";
|
|
514
514
|
// ../../internals/client/src/resolveOperationTypes.ts
|
|
515
515
|
/**
|
|
516
516
|
* A `plugin-ts` shaped resolver whose operation type names point at the types `pluginZod({ inferred })`
|
|
@@ -551,32 +551,34 @@ function toZodTypeResolver(resolver) {
|
|
|
551
551
|
* ```
|
|
552
552
|
*/
|
|
553
553
|
function resolveOperationTypes(driver, pluginName) {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
554
|
+
return driver.memo(`operationTypes:${pluginName}`, () => {
|
|
555
|
+
const pluginTs = driver.getPlugin(_kubb_plugin_ts.pluginTsName);
|
|
556
|
+
const pluginZod = driver.getPlugin(_kubb_plugin_zod.pluginZodName);
|
|
557
|
+
if (pluginTs && pluginZod?.options?.inferred !== "codec") {
|
|
558
|
+
const resolver = driver.getResolver(_kubb_plugin_ts.pluginTsName);
|
|
559
|
+
return {
|
|
560
|
+
response: resolver.response,
|
|
561
|
+
resolver,
|
|
562
|
+
output: pluginTs.options?.output,
|
|
563
|
+
group: pluginTs.options?.group ?? void 0
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
if (!pluginZod?.options?.inferred) throw new kubb_kit.Diagnostics.Error({
|
|
567
|
+
code: kubb_kit.Diagnostics.code.missingDependency,
|
|
568
|
+
severity: "error",
|
|
569
|
+
message: `Plugin "${pluginName}" has no source for operation types.`,
|
|
570
|
+
help: `Add \`pluginTs()\` before "${pluginName}", or add \`pluginZod({ inferred: true })\`.`,
|
|
571
|
+
location: { kind: "config" },
|
|
572
|
+
plugin: pluginName
|
|
573
|
+
});
|
|
574
|
+
const resolver = toZodTypeResolver(driver.getResolver(_kubb_plugin_zod.pluginZodName));
|
|
558
575
|
return {
|
|
559
576
|
response: resolver.response,
|
|
560
577
|
resolver,
|
|
561
|
-
output:
|
|
562
|
-
group:
|
|
578
|
+
output: pluginZod.options.output,
|
|
579
|
+
group: pluginZod.options.group ?? void 0
|
|
563
580
|
};
|
|
564
|
-
}
|
|
565
|
-
if (!pluginZod?.options?.inferred) throw new kubb_kit.Diagnostics.Error({
|
|
566
|
-
code: kubb_kit.Diagnostics.code.missingDependency,
|
|
567
|
-
severity: "error",
|
|
568
|
-
message: `Plugin "${pluginName}" has no source for operation types.`,
|
|
569
|
-
help: `Add \`pluginTs()\` before "${pluginName}", or add \`pluginZod({ inferred: true })\`.`,
|
|
570
|
-
location: { kind: "config" },
|
|
571
|
-
plugin: pluginName
|
|
572
581
|
});
|
|
573
|
-
const resolver = toZodTypeResolver(driver.getResolver(_kubb_plugin_zod.pluginZodName));
|
|
574
|
-
return {
|
|
575
|
-
response: resolver.response,
|
|
576
|
-
resolver,
|
|
577
|
-
output: pluginZod.options.output,
|
|
578
|
-
group: pluginZod.options.group ?? void 0
|
|
579
|
-
};
|
|
580
582
|
}
|
|
581
583
|
// ../../internals/client/src/resolveClient.ts
|
|
582
584
|
/**
|
|
@@ -977,13 +979,15 @@ function buildCallResultBody(call, options = {}) {
|
|
|
977
979
|
* success responses into `TData` and wrapping the error responses in `ResponseErrorConfig<...>`.
|
|
978
980
|
*/
|
|
979
981
|
function buildResponseTypes(node, resolver) {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
982
|
+
return resolver.memo(`responseTypes:${node.method}\0${node.path}`, () => {
|
|
983
|
+
const successNames = resolveSuccessNames(node, resolver);
|
|
984
|
+
const responseName = successNames.length > 0 ? successNames.join(" | ") : resolver.response.response(node);
|
|
985
|
+
const errorNames = resolveErrorNames(node, resolver);
|
|
986
|
+
return {
|
|
987
|
+
TData: responseName,
|
|
988
|
+
TError: `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`
|
|
989
|
+
};
|
|
990
|
+
});
|
|
987
991
|
}
|
|
988
992
|
function resolveFallbackPageParamType(initialPageParam) {
|
|
989
993
|
if (typeof initialPageParam === "number") return "number";
|