@refinedev/core 4.46.0 → 4.46.2

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/dist/definitions/helpers/flatten-object-keys/index.d.ts.map +1 -1
  3. package/dist/esm/index.js +6 -6
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/hooks/accessControl/useCan/index.d.ts.map +1 -1
  6. package/dist/hooks/auditLog/useLogList/index.d.ts.map +1 -1
  7. package/dist/hooks/auth/useOnError/index.d.ts.map +1 -1
  8. package/dist/hooks/data/useCreate.d.ts.map +1 -1
  9. package/dist/hooks/data/useCreateMany.d.ts.map +1 -1
  10. package/dist/hooks/data/useDelete.d.ts.map +1 -1
  11. package/dist/hooks/data/useDeleteMany.d.ts.map +1 -1
  12. package/dist/hooks/data/useInfiniteList.d.ts.map +1 -1
  13. package/dist/hooks/data/useList.d.ts.map +1 -1
  14. package/dist/hooks/data/useMany.d.ts.map +1 -1
  15. package/dist/hooks/data/useOne.d.ts.map +1 -1
  16. package/dist/hooks/data/useUpdate.d.ts.map +1 -1
  17. package/dist/hooks/data/useUpdateMany.d.ts.map +1 -1
  18. package/dist/hooks/router/use-go/index.d.ts +2 -0
  19. package/dist/hooks/router/use-go/index.d.ts.map +1 -1
  20. package/dist/hooks/useMeta/index.d.ts +2 -0
  21. package/dist/hooks/useMeta/index.d.ts.map +1 -1
  22. package/dist/iife/index.js +6 -6
  23. package/dist/iife/index.js.map +1 -1
  24. package/dist/index.js +6 -6
  25. package/dist/index.js.map +1 -1
  26. package/dist/interfaces/auth.d.ts +6 -6
  27. package/dist/interfaces/auth.d.ts.map +1 -1
  28. package/dist/interfaces/metaData/graphqlQueryOptions.d.ts +6 -0
  29. package/dist/interfaces/metaData/graphqlQueryOptions.d.ts.map +1 -0
  30. package/dist/interfaces/metaData/metaQuery.d.ts +2 -1
  31. package/dist/interfaces/metaData/metaQuery.d.ts.map +1 -1
  32. package/package.json +2 -1
  33. package/src/definitions/helpers/flatten-object-keys/index.ts +2 -0
  34. package/src/hooks/accessControl/useCan/index.ts +10 -12
  35. package/src/hooks/auditLog/useLogList/index.ts +10 -12
  36. package/src/hooks/auth/useForgotPassword/index.ts +51 -54
  37. package/src/hooks/auth/useGetIdentity/index.ts +23 -26
  38. package/src/hooks/auth/useIsAuthenticated/index.ts +20 -20
  39. package/src/hooks/auth/useLogin/index.ts +33 -35
  40. package/src/hooks/auth/useLogout/index.ts +32 -34
  41. package/src/hooks/auth/useOnError/index.ts +29 -33
  42. package/src/hooks/auth/usePermissions/index.ts +19 -22
  43. package/src/hooks/auth/useRegister/index.ts +60 -66
  44. package/src/hooks/auth/useUpdatePassword/index.ts +51 -54
  45. package/src/hooks/data/useCreate.ts +115 -117
  46. package/src/hooks/data/useCreateMany.ts +113 -118
  47. package/src/hooks/data/useDelete.ts +212 -223
  48. package/src/hooks/data/useDeleteMany.ts +230 -244
  49. package/src/hooks/data/useInfiniteList.ts +36 -42
  50. package/src/hooks/data/useList.ts +56 -62
  51. package/src/hooks/data/useMany.ts +36 -37
  52. package/src/hooks/data/useOne.ts +54 -55
  53. package/src/hooks/data/useUpdate.ts +288 -311
  54. package/src/hooks/data/useUpdateMany.ts +294 -320
  55. package/src/hooks/menu/useMenu.tsx +1 -1
  56. package/src/hooks/router/use-go/index.tsx +3 -0
  57. package/src/interfaces/auth.tsx +6 -6
  58. package/src/interfaces/metaData/graphqlQueryOptions.ts +6 -0
  59. package/src/interfaces/metaData/metaQuery.ts +3 -1
@@ -122,7 +122,7 @@ export const useMenu = (
122
122
  ),
123
123
  };
124
124
  },
125
- [routerType, meta, translate, hideOnMissingParameter],
125
+ [routerType, meta, getToPath, translate, hideOnMissingParameter],
126
126
  );
127
127
 
128
128
  const treeItems = React.useMemo(() => {
@@ -16,6 +16,7 @@ type ResourceWithoutId = {
16
16
  resource: string;
17
17
  action: Extract<Action, "create" | "list">;
18
18
  id?: never;
19
+ meta?: Record<string, unknown>;
19
20
  };
20
21
 
21
22
  type ResourceWithId = {
@@ -25,6 +26,7 @@ type ResourceWithId = {
25
26
  resource: string;
26
27
  action: Extract<Action, "edit" | "show" | "clone">;
27
28
  id: BaseKey;
29
+ meta?: Record<string, unknown>;
28
30
  };
29
31
 
30
32
  export type Resource = ResourceWithoutId | ResourceWithId;
@@ -60,6 +62,7 @@ export const useGo = () => {
60
62
  action: config.to.action,
61
63
  meta: {
62
64
  id: config.to.id,
65
+ ...config.to.meta,
63
66
  },
64
67
  });
65
68
 
@@ -50,12 +50,6 @@ export type AuthPageProps<
50
50
  * @optional
51
51
  */
52
52
  providers?: OAuthProvider[];
53
- /**
54
- * @description Render a redirect to login page button node. If set to false, login button will not be rendered.
55
- * @default `"/login"`
56
- * @optional
57
- */
58
- loginLink?: React.ReactNode;
59
53
  /**
60
54
  * @description Render a redirect to register page button node. If set to false, register button will not be rendered.
61
55
  * @default `"/register"`
@@ -90,6 +84,12 @@ export type AuthPageProps<
90
84
  * @optional
91
85
  */
92
86
  providers?: OAuthProvider[];
87
+ /**
88
+ * @description Render a redirect to login page button node. If set to false, login button will not be rendered.
89
+ * @default `"/login"`
90
+ * @optional
91
+ */
92
+ loginLink?: React.ReactNode;
93
93
  /**
94
94
  * @description Can be used to hide the form components
95
95
  * @optional
@@ -0,0 +1,6 @@
1
+ import type { DocumentNode } from "graphql";
2
+
3
+ export type GraphQLQueryOptions = {
4
+ gqlQuery?: DocumentNode;
5
+ gqlMutation?: DocumentNode;
6
+ };
@@ -1,7 +1,9 @@
1
1
  import { QueryFunctionContext } from "@tanstack/react-query";
2
2
  import { QueryBuilderOptions } from "./queryBuilderOptions";
3
+ import { GraphQLQueryOptions } from "./graphqlQueryOptions";
3
4
 
4
5
  export type MetaQuery = {
5
6
  [k: string]: any;
6
7
  queryContext?: Omit<QueryFunctionContext, "meta">;
7
- } & QueryBuilderOptions;
8
+ } & QueryBuilderOptions &
9
+ GraphQLQueryOptions;