@kubb/plugin-react-query 5.0.0-beta.105 → 5.0.0-beta.106
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 +19 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -13
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
}
|
|
20
20
|
return to;
|
|
21
21
|
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
23
23
|
value: mod,
|
|
24
24
|
enumerable: true
|
|
25
25
|
}) : target, mod));
|
|
@@ -532,14 +532,16 @@ function buildGroupedRequestParam(node, options) {
|
|
|
532
532
|
*/
|
|
533
533
|
function buildQueryOptionsParams(node, options) {
|
|
534
534
|
const { resolver, memberTypeWrapper } = options;
|
|
535
|
-
|
|
535
|
+
const groupedParam = buildGroupedRequestParam(node, {
|
|
536
536
|
resolver,
|
|
537
537
|
memberTypeWrapper
|
|
538
|
-
})
|
|
538
|
+
});
|
|
539
|
+
const configParam = (0, _kubb_plugin_ts.createFunctionParameter)({
|
|
539
540
|
name: "config",
|
|
540
541
|
type: `Partial<Omit<RequestConfig, 'path' | 'query' | 'body' | 'headers' | 'url'>>`,
|
|
541
542
|
default: "{}"
|
|
542
|
-
})
|
|
543
|
+
});
|
|
544
|
+
return (0, _kubb_plugin_ts.createFunctionParameters)({ params: [groupedParam, configParam].filter((param) => param !== null) });
|
|
543
545
|
}
|
|
544
546
|
/**
|
|
545
547
|
* Builds the call to a client `<op>` function inside a query/mutation hook body. The function takes
|
|
@@ -1193,10 +1195,11 @@ function buildInfiniteQueryParamsNode(node, options) {
|
|
|
1193
1195
|
}`,
|
|
1194
1196
|
default: "{}"
|
|
1195
1197
|
});
|
|
1196
|
-
|
|
1198
|
+
const groupedParam = buildGroupedRequestParam(node, {
|
|
1197
1199
|
resolver,
|
|
1198
1200
|
memberTypeWrapper: maybeValueOrGetter
|
|
1199
|
-
})
|
|
1201
|
+
});
|
|
1202
|
+
return (0, _kubb_plugin_ts.createFunctionParameters)({ params: [groupedParam, optionsParam].filter((param) => param !== null) });
|
|
1200
1203
|
}
|
|
1201
1204
|
function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, node, tsResolver, initialPageParam, queryParam, customOptions, suspense }) {
|
|
1202
1205
|
const { TData: responseType, TError: errorType } = buildResponseTypes(node, tsResolver);
|
|
@@ -1309,15 +1312,16 @@ function resolveMutationRequestType(node, resolver) {
|
|
|
1309
1312
|
function buildMutationParamsNode(node, options) {
|
|
1310
1313
|
const { resolver } = options;
|
|
1311
1314
|
const { TData, TError } = buildResponseTypes(node, resolver);
|
|
1315
|
+
const generics = [
|
|
1316
|
+
TData,
|
|
1317
|
+
TError,
|
|
1318
|
+
resolveMutationRequestType(node, resolver),
|
|
1319
|
+
"TContext"
|
|
1320
|
+
].join(", ");
|
|
1312
1321
|
return (0, _kubb_plugin_ts.createFunctionParameters)({ params: [(0, _kubb_plugin_ts.createFunctionParameter)({
|
|
1313
1322
|
name: "options",
|
|
1314
1323
|
type: `{
|
|
1315
|
-
mutation?: UseMutationOptions<${
|
|
1316
|
-
TData,
|
|
1317
|
-
TError,
|
|
1318
|
-
resolveMutationRequestType(node, resolver),
|
|
1319
|
-
"TContext"
|
|
1320
|
-
].join(", ")}> & { client?: QueryClient },
|
|
1324
|
+
mutation?: UseMutationOptions<${generics}> & { client?: QueryClient },
|
|
1321
1325
|
client?: ${buildRequestConfigType(node)},
|
|
1322
1326
|
}`,
|
|
1323
1327
|
default: "{}"
|
|
@@ -1375,10 +1379,11 @@ function buildQueryParamsNode(node, options) {
|
|
|
1375
1379
|
}`,
|
|
1376
1380
|
default: "{}"
|
|
1377
1381
|
});
|
|
1378
|
-
|
|
1382
|
+
const groupedParam = buildGroupedRequestParam(node, {
|
|
1379
1383
|
resolver,
|
|
1380
1384
|
memberTypeWrapper: maybeValueOrGetter
|
|
1381
|
-
})
|
|
1385
|
+
});
|
|
1386
|
+
return (0, _kubb_plugin_ts.createFunctionParameters)({ params: [groupedParam, optionsParam].filter((param) => param !== null) });
|
|
1382
1387
|
}
|
|
1383
1388
|
function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, node, tsResolver, customOptions, suspense }) {
|
|
1384
1389
|
const { TData, TError } = buildResponseTypes(node, tsResolver);
|