@kubb/plugin-swr 5.4.1 → 5.4.4
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 +24 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +317 -0
- package/dist/index.d.ts +28 -3
- package/dist/index.js +24 -4
- package/dist/index.js.map +1 -1
- package/docs/options.md +20 -4
- package/kubb-extension.json +1 -1
- package/package.json +13 -8
- package/dist/rolldown-runtime-C0LytTxp.js +0 -8
package/dist/index.cjs
CHANGED
|
@@ -324,11 +324,11 @@ function createGroupConfig(group) {
|
|
|
324
324
|
//#region kubb-extension.json
|
|
325
325
|
var compatibility = {
|
|
326
326
|
"kubb": ">=5.8.3",
|
|
327
|
-
"node": ">=22"
|
|
327
|
+
"node": ">=22.12"
|
|
328
328
|
};
|
|
329
329
|
//#endregion
|
|
330
330
|
//#region package.json
|
|
331
|
-
var version = "5.4.
|
|
331
|
+
var version = "5.4.4";
|
|
332
332
|
//#endregion
|
|
333
333
|
//#region ../../internals/client/src/resolveClient.ts
|
|
334
334
|
/**
|
|
@@ -811,6 +811,16 @@ function buildHookParams(node, options) {
|
|
|
811
811
|
//#endregion
|
|
812
812
|
//#region ../../internals/tanstack-query/src/components/MutationKey.tsx
|
|
813
813
|
const declarationPrinter$4 = (0, _kubb_plugin_ts.functionPrinter)({ mode: "declaration" });
|
|
814
|
+
/**
|
|
815
|
+
* Default `mutationKey` builder. Call it from a custom builder to extend the default key.
|
|
816
|
+
*
|
|
817
|
+
* @remarks The returned segments may change between releases. Spread them instead of reading single entries.
|
|
818
|
+
*
|
|
819
|
+
* @example
|
|
820
|
+
* ```ts
|
|
821
|
+
* mutationKey: (props) => [JSON.stringify(props.node.operationId), ...mutationKeyTransformer(props)]
|
|
822
|
+
* ```
|
|
823
|
+
*/
|
|
814
824
|
const mutationKeyTransformer = ({ node }) => {
|
|
815
825
|
if (!node.path) return [];
|
|
816
826
|
return [`{ url: '${kubb_kit.Url.toPath(node.path)}' }`];
|
|
@@ -902,6 +912,16 @@ function createMutationResolver() {
|
|
|
902
912
|
//#endregion
|
|
903
913
|
//#region ../../internals/tanstack-query/src/components/QueryKey.tsx
|
|
904
914
|
const declarationPrinter$3 = (0, _kubb_plugin_ts.functionPrinter)({ mode: "declaration" });
|
|
915
|
+
/**
|
|
916
|
+
* Default `queryKey` builder. Call it from a custom builder to extend the default key.
|
|
917
|
+
*
|
|
918
|
+
* @remarks The returned segments may change between releases. Spread them instead of reading single entries.
|
|
919
|
+
*
|
|
920
|
+
* @example
|
|
921
|
+
* ```ts
|
|
922
|
+
* queryKey: (props) => [JSON.stringify(props.node.operationId), ...queryKeyTransformer(props)]
|
|
923
|
+
* ```
|
|
924
|
+
*/
|
|
905
925
|
const queryKeyTransformer = ({ node, variant }) => {
|
|
906
926
|
if (!node.path) return [];
|
|
907
927
|
const { path, query } = getOperationParameters(node);
|
|
@@ -1353,8 +1373,10 @@ const pluginSwr = (0, kubb_kit.defineExtension)({
|
|
|
1353
1373
|
});
|
|
1354
1374
|
//#endregion
|
|
1355
1375
|
exports.default = pluginSwr;
|
|
1376
|
+
exports.mutationKeyTransformer = mutationKeyTransformer;
|
|
1356
1377
|
exports.pluginSwr = pluginSwr;
|
|
1357
1378
|
exports.pluginSwrName = pluginSwrName;
|
|
1379
|
+
exports.queryKeyTransformer = queryKeyTransformer;
|
|
1358
1380
|
exports.resolverSwr = resolverSwr;
|
|
1359
1381
|
|
|
1360
1382
|
//# sourceMappingURL=index.cjs.map
|