@kubb/plugin-react-query 5.6.0-canary.20261016T150304 → 5.6.0-canary.20261019T174546
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 +28 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +27 -2
- package/dist/index.js.map +1 -1
- package/docs/options.md +20 -4
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -347,7 +347,7 @@ var compatibility = {
|
|
|
347
347
|
};
|
|
348
348
|
//#endregion
|
|
349
349
|
//#region package.json
|
|
350
|
-
var version = "5.6.0-canary.
|
|
350
|
+
var version = "5.6.0-canary.20261019T174546";
|
|
351
351
|
//#endregion
|
|
352
352
|
//#region ../../internals/client/src/resolveClient.ts
|
|
353
353
|
/**
|
|
@@ -873,6 +873,11 @@ function getDefaultPageParamsWarning(node, infinite) {
|
|
|
873
873
|
return `${node.operationId}: the default infinite page params expect an array response and never end for this one. Set \`infinite.getNextPageParam\` (or \`nextParam\`) to read the next page from the response.`;
|
|
874
874
|
}
|
|
875
875
|
function matchesPattern(node, ov) {
|
|
876
|
+
if ("key" in ov) {
|
|
877
|
+
const extensions = node.extensions;
|
|
878
|
+
if (!extensions || !(ov.key in extensions)) return false;
|
|
879
|
+
return ov.value === void 0 || extensions[ov.key] === ov.value;
|
|
880
|
+
}
|
|
876
881
|
const { type, pattern } = ov;
|
|
877
882
|
const matches = (value) => typeof pattern === "string" ? value === pattern : pattern.test(value);
|
|
878
883
|
if (type === "operationId") return matches(node.operationId);
|
|
@@ -1037,6 +1042,16 @@ return infiniteQueryOptions<${queryFnDataType}, ${errorType}, InfiniteData<${que
|
|
|
1037
1042
|
//#endregion
|
|
1038
1043
|
//#region ../../internals/tanstack-query/src/components/MutationKey.tsx
|
|
1039
1044
|
const declarationPrinter$5 = (0, _kubb_plugin_ts.functionPrinter)({ mode: "declaration" });
|
|
1045
|
+
/**
|
|
1046
|
+
* Default `mutationKey` builder. Call it from a custom builder to extend the default key.
|
|
1047
|
+
*
|
|
1048
|
+
* @remarks The returned segments may change between releases. Spread them instead of reading single entries.
|
|
1049
|
+
*
|
|
1050
|
+
* @example
|
|
1051
|
+
* ```ts
|
|
1052
|
+
* mutationKey: (props) => [JSON.stringify(props.node.operationId), ...mutationKeyTransformer(props)]
|
|
1053
|
+
* ```
|
|
1054
|
+
*/
|
|
1040
1055
|
const mutationKeyTransformer = ({ node }) => {
|
|
1041
1056
|
if (!node.path) return [];
|
|
1042
1057
|
return [`{ url: '${kubb_kit.Url.toPath(node.path)}' }`];
|
|
@@ -1128,6 +1143,16 @@ function createMutationResolver() {
|
|
|
1128
1143
|
//#endregion
|
|
1129
1144
|
//#region ../../internals/tanstack-query/src/components/QueryKey.tsx
|
|
1130
1145
|
const declarationPrinter$4 = (0, _kubb_plugin_ts.functionPrinter)({ mode: "declaration" });
|
|
1146
|
+
/**
|
|
1147
|
+
* Default `queryKey` builder. Call it from a custom builder to extend the default key.
|
|
1148
|
+
*
|
|
1149
|
+
* @remarks The returned segments may change between releases. Spread them instead of reading single entries.
|
|
1150
|
+
*
|
|
1151
|
+
* @example
|
|
1152
|
+
* ```ts
|
|
1153
|
+
* queryKey: (props) => [JSON.stringify(props.node.operationId), ...queryKeyTransformer(props)]
|
|
1154
|
+
* ```
|
|
1155
|
+
*/
|
|
1131
1156
|
const queryKeyTransformer = ({ node, variant }) => {
|
|
1132
1157
|
if (!node.path) return [];
|
|
1133
1158
|
const { path, query } = getOperationParameters(node);
|
|
@@ -2108,8 +2133,10 @@ const pluginReactQuery = (0, kubb_kit.defineExtension)({
|
|
|
2108
2133
|
//#endregion
|
|
2109
2134
|
exports.default = pluginReactQuery;
|
|
2110
2135
|
exports.definePageParam = definePageParam;
|
|
2136
|
+
exports.mutationKeyTransformer = mutationKeyTransformer;
|
|
2111
2137
|
exports.pluginReactQuery = pluginReactQuery;
|
|
2112
2138
|
exports.pluginReactQueryName = pluginReactQueryName;
|
|
2139
|
+
exports.queryKeyTransformer = queryKeyTransformer;
|
|
2113
2140
|
exports.resolverReactQuery = resolverReactQuery;
|
|
2114
2141
|
|
|
2115
2142
|
//# sourceMappingURL=index.cjs.map
|