@kubb/plugin-swr 5.4.3 → 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 +23 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +22 -2
- package/dist/index.js.map +1 -1
- package/docs/options.md +20 -4
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -35,6 +35,32 @@ type Transformer = (props: {
|
|
|
35
35
|
variant: KeyVariant;
|
|
36
36
|
}) => Array<unknown>;
|
|
37
37
|
//#endregion
|
|
38
|
+
//#region ../../internals/tanstack-query/src/components/MutationKey.d.ts
|
|
39
|
+
/**
|
|
40
|
+
* Default `mutationKey` builder. Call it from a custom builder to extend the default key.
|
|
41
|
+
*
|
|
42
|
+
* @remarks The returned segments may change between releases. Spread them instead of reading single entries.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* mutationKey: (props) => [JSON.stringify(props.node.operationId), ...mutationKeyTransformer(props)]
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare const mutationKeyTransformer: Transformer;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region ../../internals/tanstack-query/src/components/QueryKey.d.ts
|
|
52
|
+
/**
|
|
53
|
+
* Default `queryKey` builder. Call it from a custom builder to extend the default key.
|
|
54
|
+
*
|
|
55
|
+
* @remarks The returned segments may change between releases. Spread them instead of reading single entries.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* queryKey: (props) => [JSON.stringify(props.node.operationId), ...queryKeyTransformer(props)]
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare const queryKeyTransformer: Transformer;
|
|
63
|
+
//#endregion
|
|
38
64
|
//#region src/types.d.ts
|
|
39
65
|
/**
|
|
40
66
|
* The concrete resolver type for `@kubb/plugin-swr`.
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,32 @@ type Transformer = (props: {
|
|
|
35
35
|
variant: KeyVariant;
|
|
36
36
|
}) => Array<unknown>;
|
|
37
37
|
//#endregion
|
|
38
|
+
//#region ../../internals/tanstack-query/src/components/MutationKey.d.ts
|
|
39
|
+
/**
|
|
40
|
+
* Default `mutationKey` builder. Call it from a custom builder to extend the default key.
|
|
41
|
+
*
|
|
42
|
+
* @remarks The returned segments may change between releases. Spread them instead of reading single entries.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* mutationKey: (props) => [JSON.stringify(props.node.operationId), ...mutationKeyTransformer(props)]
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare const mutationKeyTransformer: Transformer;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region ../../internals/tanstack-query/src/components/QueryKey.d.ts
|
|
52
|
+
/**
|
|
53
|
+
* Default `queryKey` builder. Call it from a custom builder to extend the default key.
|
|
54
|
+
*
|
|
55
|
+
* @remarks The returned segments may change between releases. Spread them instead of reading single entries.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* queryKey: (props) => [JSON.stringify(props.node.operationId), ...queryKeyTransformer(props)]
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare const queryKeyTransformer: Transformer;
|
|
63
|
+
//#endregion
|
|
38
64
|
//#region src/types.d.ts
|
|
39
65
|
/**
|
|
40
66
|
* The concrete resolver type for `@kubb/plugin-swr`.
|
package/dist/index.js
CHANGED
|
@@ -302,7 +302,7 @@ var compatibility = {
|
|
|
302
302
|
};
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region package.json
|
|
305
|
-
var version = "5.4.
|
|
305
|
+
var version = "5.4.4";
|
|
306
306
|
//#endregion
|
|
307
307
|
//#region ../../internals/client/src/resolveClient.ts
|
|
308
308
|
/**
|
|
@@ -785,6 +785,16 @@ function buildHookParams(node, options) {
|
|
|
785
785
|
//#endregion
|
|
786
786
|
//#region ../../internals/tanstack-query/src/components/MutationKey.tsx
|
|
787
787
|
const declarationPrinter$4 = functionPrinter({ mode: "declaration" });
|
|
788
|
+
/**
|
|
789
|
+
* Default `mutationKey` builder. Call it from a custom builder to extend the default key.
|
|
790
|
+
*
|
|
791
|
+
* @remarks The returned segments may change between releases. Spread them instead of reading single entries.
|
|
792
|
+
*
|
|
793
|
+
* @example
|
|
794
|
+
* ```ts
|
|
795
|
+
* mutationKey: (props) => [JSON.stringify(props.node.operationId), ...mutationKeyTransformer(props)]
|
|
796
|
+
* ```
|
|
797
|
+
*/
|
|
788
798
|
const mutationKeyTransformer = ({ node }) => {
|
|
789
799
|
if (!node.path) return [];
|
|
790
800
|
return [`{ url: '${Url.toPath(node.path)}' }`];
|
|
@@ -876,6 +886,16 @@ function createMutationResolver() {
|
|
|
876
886
|
//#endregion
|
|
877
887
|
//#region ../../internals/tanstack-query/src/components/QueryKey.tsx
|
|
878
888
|
const declarationPrinter$3 = functionPrinter({ mode: "declaration" });
|
|
889
|
+
/**
|
|
890
|
+
* Default `queryKey` builder. Call it from a custom builder to extend the default key.
|
|
891
|
+
*
|
|
892
|
+
* @remarks The returned segments may change between releases. Spread them instead of reading single entries.
|
|
893
|
+
*
|
|
894
|
+
* @example
|
|
895
|
+
* ```ts
|
|
896
|
+
* queryKey: (props) => [JSON.stringify(props.node.operationId), ...queryKeyTransformer(props)]
|
|
897
|
+
* ```
|
|
898
|
+
*/
|
|
879
899
|
const queryKeyTransformer = ({ node, variant }) => {
|
|
880
900
|
if (!node.path) return [];
|
|
881
901
|
const { path, query } = getOperationParameters(node);
|
|
@@ -1326,6 +1346,6 @@ const pluginSwr = defineExtension({
|
|
|
1326
1346
|
}
|
|
1327
1347
|
});
|
|
1328
1348
|
//#endregion
|
|
1329
|
-
export { pluginSwr as default, pluginSwr, pluginSwrName, resolverSwr };
|
|
1349
|
+
export { pluginSwr as default, pluginSwr, mutationKeyTransformer, pluginSwrName, queryKeyTransformer, resolverSwr };
|
|
1330
1350
|
|
|
1331
1351
|
//# sourceMappingURL=index.js.map
|