@refinedev/core 4.16.4 → 4.18.0

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 (91) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/dist/components/containers/refine/index.d.ts +2 -2
  3. package/dist/components/pages/auth/index.d.ts +1 -1
  4. package/dist/components/pages/error/index.d.ts +1 -1
  5. package/dist/components/pages/login/index.d.ts +1 -1
  6. package/dist/components/pages/ready/index.d.ts +0 -1
  7. package/dist/components/pages/ready/index.d.ts.map +1 -1
  8. package/dist/esm/index.js +6 -6
  9. package/dist/esm/index.js.map +1 -1
  10. package/dist/hooks/accessControl/useCan/index.d.ts +1 -1
  11. package/dist/hooks/auditLog/useLog/index.d.ts +1 -1
  12. package/dist/hooks/auditLog/useLogList/index.d.ts +1 -1
  13. package/dist/hooks/data/useCreate.d.ts +3 -3
  14. package/dist/hooks/data/useCreateMany.d.ts +1 -1
  15. package/dist/hooks/data/useCustom.d.ts +1 -1
  16. package/dist/hooks/data/useCustomMutation.d.ts +3 -3
  17. package/dist/hooks/data/useDelete.d.ts +3 -3
  18. package/dist/hooks/data/useDeleteMany.d.ts +1 -1
  19. package/dist/hooks/data/useInfiniteList.d.ts +1 -1
  20. package/dist/hooks/data/useList.d.ts +1 -1
  21. package/dist/hooks/data/useMany.d.ts +1 -1
  22. package/dist/hooks/data/useOne.d.ts +1 -1
  23. package/dist/hooks/data/useUpdate.d.ts +3 -3
  24. package/dist/hooks/data/useUpdateMany.d.ts +1 -1
  25. package/dist/hooks/export/index.d.ts +2 -2
  26. package/dist/hooks/form/useForm.d.ts +10 -2
  27. package/dist/hooks/form/useForm.d.ts.map +1 -1
  28. package/dist/hooks/import/index.d.ts +3 -3
  29. package/dist/hooks/menu/useMenu.d.ts +1 -1
  30. package/dist/hooks/navigation/index.d.ts +2 -2
  31. package/dist/hooks/refine/useSyncWithLocation.d.ts +1 -1
  32. package/dist/hooks/refine/useTitle.d.ts +1 -1
  33. package/dist/hooks/refine/useWarnAboutChange/index.d.ts +1 -1
  34. package/dist/hooks/show/useShow.d.ts +1 -1
  35. package/dist/hooks/translate/useGetLocale.d.ts +1 -1
  36. package/dist/hooks/translate/useSetLocale.d.ts +1 -1
  37. package/dist/hooks/translate/useTranslate.d.ts +1 -1
  38. package/dist/hooks/useSelect/index.d.ts +1 -1
  39. package/dist/iife/index.js +5 -5
  40. package/dist/iife/index.js.map +1 -1
  41. package/dist/index.js +5 -5
  42. package/dist/index.js.map +1 -1
  43. package/package.json +1 -1
  44. package/src/components/authenticated/index.tsx +1 -1
  45. package/src/components/containers/refine/index.tsx +2 -2
  46. package/src/components/pages/auth/index.tsx +1 -1
  47. package/src/components/pages/error/index.tsx +1 -1
  48. package/src/components/pages/login/index.tsx +1 -1
  49. package/src/components/pages/ready/index.tsx +0 -1
  50. package/src/definitions/helpers/legacy-resource-transform/index.ts +1 -1
  51. package/src/definitions/helpers/router/__tests__/compose-route.ts +6 -0
  52. package/src/hooks/accessControl/useCan/index.ts +1 -1
  53. package/src/hooks/auditLog/useLog/index.ts +1 -1
  54. package/src/hooks/auditLog/useLogList/index.ts +1 -1
  55. package/src/hooks/auth/useForgotPassword/index.ts +2 -2
  56. package/src/hooks/auth/useGetIdentity/index.ts +1 -1
  57. package/src/hooks/auth/useIsAuthenticated/index.ts +1 -1
  58. package/src/hooks/auth/useLogin/index.ts +2 -2
  59. package/src/hooks/auth/useLogout/index.ts +2 -2
  60. package/src/hooks/auth/useOnError/index.ts +1 -1
  61. package/src/hooks/auth/usePermissions/index.ts +1 -1
  62. package/src/hooks/auth/useRegister/index.ts +2 -2
  63. package/src/hooks/auth/useUpdatePassword/index.ts +2 -2
  64. package/src/hooks/breadcrumb/index.ts +1 -1
  65. package/src/hooks/data/useCreate.ts +3 -3
  66. package/src/hooks/data/useCreateMany.ts +1 -1
  67. package/src/hooks/data/useCustom.ts +1 -1
  68. package/src/hooks/data/useCustomMutation.ts +3 -3
  69. package/src/hooks/data/useDelete.ts +3 -3
  70. package/src/hooks/data/useDeleteMany.ts +1 -1
  71. package/src/hooks/data/useInfiniteList.ts +1 -1
  72. package/src/hooks/data/useList.ts +1 -1
  73. package/src/hooks/data/useMany.ts +1 -1
  74. package/src/hooks/data/useOne.ts +1 -1
  75. package/src/hooks/data/useUpdate.ts +3 -3
  76. package/src/hooks/data/useUpdateMany.ts +1 -1
  77. package/src/hooks/export/index.ts +2 -2
  78. package/src/hooks/form/useForm.ts +20 -10
  79. package/src/hooks/import/index.tsx +3 -3
  80. package/src/hooks/menu/useMenu.tsx +1 -1
  81. package/src/hooks/navigation/index.ts +2 -2
  82. package/src/hooks/refine/useSyncWithLocation.ts +1 -1
  83. package/src/hooks/refine/useTitle.tsx +1 -1
  84. package/src/hooks/refine/useWarnAboutChange/index.ts +1 -1
  85. package/src/hooks/resource/useResource/index.ts +1 -1
  86. package/src/hooks/show/useShow.ts +1 -1
  87. package/src/hooks/translate/useGetLocale.ts +1 -1
  88. package/src/hooks/translate/useSetLocale.ts +1 -1
  89. package/src/hooks/translate/useTranslate.ts +1 -1
  90. package/src/hooks/useSelect/index.ts +1 -1
  91. package/src/hooks/useTable/index.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinedev/core",
3
- "version": "4.16.4",
3
+ "version": "4.18.0",
4
4
  "description": "refine is a React-based framework for building internal tools, rapidly. It ships with Ant Design System, an enterprise-level UI toolkit.",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -86,7 +86,7 @@ export function Authenticated(
86
86
  export function Authenticated(props: AuthenticatedProps): JSX.Element | null;
87
87
 
88
88
  /**
89
- * `<Authenticated>` is the component form of {@link https://refine.dev/docs/core/hooks/auth/useAuthenticated `useAuthenticated`}. It internally uses `useAuthenticated` to provide it's functionality.
89
+ * `<Authenticated>` is the component form of {@link https://refine.dev/docs/api-reference/core/hooks/auth/useAuthenticated `useAuthenticated`}. It internally uses `useAuthenticated` to provide it's functionality.
90
90
  *
91
91
  * @see {@link https://refine.dev/docs/core/components/auth/authenticated `<Authenticated>`} component for more details.
92
92
  */
@@ -179,11 +179,11 @@ export interface RefineProps {
179
179
  }
180
180
 
181
181
  /**
182
- * {@link https://refine.dev/docs/api-references/components/refine-config `<Refine> component`} is the entry point of a refine app.
182
+ * {@link https://refine.dev/docs/api-reference/core/components/refine-config `<Refine> component`} is the entry point of a refine app.
183
183
  * It is where the highest level of configuration of the app occurs.
184
184
  * Only a dataProvider is required to bootstrap the app. After adding a dataProvider, resources can be added as property.
185
185
  *
186
- * @see {@link https://refine.dev/docs/api-references/components/refine-config} for more details.
186
+ * @see {@link https://refine.dev/docs/api-reference/core/components/refine-config} for more details.
187
187
  */
188
188
  export const Refine: React.FC<RefineProps> = ({
189
189
  legacyAuthProvider,
@@ -31,7 +31,7 @@ export type AuthProps = AuthPageProps<
31
31
  /**
32
32
  * **refine** has a default auth page form which is served on `/login` route when the `authProvider` configuration is provided.
33
33
  * @param title is not implemented yet.
34
- * @see {@link https://refine.dev/docs/api-references/components/refine-config#authpage} for more details.
34
+ * @see {@link https://refine.dev/docs/api-reference/core/components/auth-page/} for more details.
35
35
  */
36
36
  export const AuthPage: React.FC<AuthProps> = (props) => {
37
37
  const { type } = props;
@@ -12,7 +12,7 @@ import {
12
12
  * When the app is navigated to a non-existent route, refine shows a default error page.
13
13
  * A custom error component can be used for this error page.
14
14
  *
15
- * @see {@link https://refine.dev/docs/api-references/components/refine-config#catchall} for more details.
15
+ * @see {@link https://refine.dev/docs/packages/documentation/routers/} for more details.
16
16
  */
17
17
  export const ErrorComponent: React.FC = () => {
18
18
  const [errorMessage, setErrorMessage] = useState<string>();
@@ -11,7 +11,7 @@ export interface ILoginForm {
11
11
  * @deprecated LoginPage is deprecated. Use AuthPage instead. @see {@link https://refine.dev/docs/core/components/auth-page} for more details.
12
12
  * **refine** has a default login page form which is served on `/login` route when the `authProvider` configuration is provided.
13
13
  *
14
- * @see {@link https://refine.dev/docs/api-references/components/refine-config#loginpage} for more details.
14
+ * @see {@link https://refine.dev/docs/api-reference/core/components/refine-config/#loginpage} for more details.
15
15
  */
16
16
  export const LoginPage: React.FC = () => {
17
17
  const [username, setUsername] = useState("");
@@ -3,7 +3,6 @@ import React from "react";
3
3
  /**
4
4
  * **refine** shows a default ready page on root route when no `resources` is passed to the `<Refine>` component as a property.
5
5
  *
6
- * @see {@link https://refine.dev/docs/api-references/components/refine-config#readypage} for more details.
7
6
  * @deprecated `ReadyPage` is deprecated and will be removed in the next major release.
8
7
  */
9
8
  export const ReadyPage: React.FC = () => {
@@ -14,7 +14,7 @@ import { routeGenerator } from "../routeGenerator";
14
14
  export const legacyResourceTransform = (resources: ResourceProps[]) => {
15
15
  const _resources: IResourceItem[] = [];
16
16
 
17
- resources?.forEach((resource) => {
17
+ resources.forEach((resource) => {
18
18
  _resources.push({
19
19
  ...resource,
20
20
  label: resource.meta?.label ?? resource.options?.label,
@@ -43,4 +43,10 @@ describe("composeRoute", () => {
43
43
 
44
44
  expect(result).toEqual("/users/1/Doe");
45
45
  });
46
+
47
+ it("should return route when not match object", () => {
48
+ const result = composeRoute("/users/:other", {});
49
+
50
+ expect(result).toEqual("/users/:other");
51
+ });
46
52
  });
@@ -18,7 +18,7 @@ export type UseCanProps = CanParams & {
18
18
 
19
19
  /**
20
20
  * `useCan` uses the `can` as the query function for `react-query`'s {@link https://react-query.tanstack.com/guides/queries `useQuery`}. It takes the parameters that `can` takes. It can also be configured with `queryOptions` for `useQuery`. Returns the result of `useQuery`.
21
- * @see {@link https://refine.dev/docs/core/hooks/accessControl/useCan} for more details.
21
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/accessControl/useCan} for more details.
22
22
  *
23
23
  * @typeParam CanParams {@link https://refine.dev/docs/core/interfaceReferences#canparams}
24
24
  * @typeParam CanReturnType {@link https://refine.dev/docs/core/interfaceReferences#canreturntype}
@@ -57,7 +57,7 @@ export type UseLogMutationProps<
57
57
 
58
58
  /**
59
59
  * useLog is used to `create` a new and `rename` the existing audit log.
60
- * @see {@link https://refine.dev/docs/core/hooks/audit-log/useLog} for more details.
60
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/audit-log/useLog} for more details.
61
61
  */
62
62
 
63
63
  export const useLog = <
@@ -21,7 +21,7 @@ export type UseLogProps<TQueryFnData, TError, TData> = {
21
21
  /**
22
22
  * useLogList is used to get and filter audit logs.
23
23
  *
24
- * @see {@link https://refine.dev/docs/core/hooks/audit-log/useLogList} for more details.
24
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/audit-log/useLogList} for more details.
25
25
  *
26
26
  * @typeParam TQueryFnData - Result data returned by the query function.
27
27
  * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#httperror `HttpError`}
@@ -87,9 +87,9 @@ export function useForgotPassword<TVariables = {}>(
87
87
  ): UseForgotPasswordCombinedReturnType<TVariables>;
88
88
 
89
89
  /**
90
- * `useForgotPassword` calls `forgotPassword` method from {@link https://refine.dev/docs/api-references/providers/auth-provider `authProvider`} under the hood.
90
+ * `useForgotPassword` calls `forgotPassword` method from {@link https://refine.dev/docs/api-reference/core/providers/auth-provider `authProvider`} under the hood.
91
91
  *
92
- * @see {@link https://refine.dev/docs/core/hooks/auth/useForgotPassword} for more details.
92
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/auth/useForgotPassword} for more details.
93
93
  *
94
94
  * @typeParam TData - Result data of the query
95
95
  * @typeParam TVariables - Values for mutation function. default `{}`
@@ -51,7 +51,7 @@ export function useGetIdentity<TData = any>(
51
51
  /**
52
52
  * `useGetIdentity` calls the `getUserIdentity` method from the {@link https://refine.dev/docs/core/providers/auth-provider `authProvider`} under the hood.
53
53
  *
54
- * @see {@link https://refine.dev/docs/core/hooks/auth/useGetIdentity} for more details.
54
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/auth/useGetIdentity} for more details.
55
55
  *
56
56
  * @typeParam TData - Result data of the query
57
57
  *
@@ -42,7 +42,7 @@ export function useIsAuthenticated(
42
42
  /**
43
43
  * `useIsAuthenticated` calls the `checkAuth` method from the {@link https://refine.dev/docs/core/providers/auth-provider `authProvider`} under the hood.
44
44
  *
45
- * @see {@link https://refine.dev/docs/core/hooks/auth/useAuthenticated} for more details.
45
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/auth/useAuthenticated} for more details.
46
46
  */
47
47
  export function useIsAuthenticated({
48
48
  v3LegacyAuthProviderCompatible = false,
@@ -97,9 +97,9 @@ export function useLogin<TVariables = {}>(
97
97
  ): UseLoginCombinedReturnType<TVariables>;
98
98
 
99
99
  /**
100
- * `useLogin` calls `login` method from {@link https://refine.dev/docs/api-references/providers/auth-provider `authProvider`} under the hood.
100
+ * `useLogin` calls `login` method from {@link https://refine.dev/docs/api-reference/core/providers/auth-provider `authProvider`} under the hood.
101
101
  *
102
- * @see {@link https://refine.dev/docs/core/hooks/auth/useLogin} for more details.
102
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/auth/useLogin} for more details.
103
103
  *
104
104
  * @typeParam TData - Result data of the query
105
105
  * @typeParam TVariables - Values for mutation function. default `{}`
@@ -91,9 +91,9 @@ export function useLogout<TVariables = {}>(
91
91
  ): UseLogoutCombinedReturnType<TVariables>;
92
92
 
93
93
  /**
94
- * `useLogout` calls the `logout` method from the {@link https://refine.dev/docs/api-references/providers/auth-provider `authProvider`} under the hood.
94
+ * `useLogout` calls the `logout` method from the {@link https://refine.dev/docs/api-reference/core/providers/auth-provider `authProvider`} under the hood.
95
95
  *
96
- * @see {@link https://refine.dev/docs/core/hooks/auth/useLogout} for more details.
96
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/auth/useLogout} for more details.
97
97
  *
98
98
  */
99
99
  export function useLogout<TVariables = {}>({
@@ -49,7 +49,7 @@ export function useOnError(
49
49
  /**
50
50
  * `useOnError` calls the `checkError` method from the {@link https://refine.dev/docs/core/providers/auth-provider `authProvider`} under the hood.
51
51
  *
52
- * @see {@link https://refine.dev/docs/core/hooks/auth/useCheckError} for more details.
52
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/auth/useCheckError} for more details.
53
53
  *
54
54
  */
55
55
  export function useOnError({
@@ -48,7 +48,7 @@ export function usePermissions<TData = any>(
48
48
  /**
49
49
  * `usePermissions` calls the `getPermissions` method from the {@link https://refine.dev/docs/core/providers/auth-provider `authProvider`} under the hood.
50
50
  *
51
- * @see {@link https://refine.dev/docs/core/hooks/auth/usePermissions} for more details.
51
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/auth/usePermissions} for more details.
52
52
  *
53
53
  * @typeParam TData - Result data of the query
54
54
  *
@@ -89,9 +89,9 @@ export function useRegister<TVariables = {}>(
89
89
  ): UseRegisterCombinedReturnType<TVariables>;
90
90
 
91
91
  /**
92
- * `useRegister` calls `register` method from {@link https://refine.dev/docs/api-references/providers/auth-provider `authProvider`} under the hood.
92
+ * `useRegister` calls `register` method from {@link https://refine.dev/docs/api-reference/core/providers/auth-provider `authProvider`} under the hood.
93
93
  *
94
- * @see {@link https://refine.dev/docs/core/hooks/auth/useRegister} for more details.
94
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/auth/useRegister} for more details.
95
95
  *
96
96
  * @typeParam TData - Result data of the query
97
97
  * @typeParam TVariables - Values for mutation function. default `{}`
@@ -107,9 +107,9 @@ export function useUpdatePassword<TVariables extends UpdatePasswordFormTypes>(
107
107
  ): UseUpdatePasswordCombinedReturnType<TVariables>;
108
108
 
109
109
  /**
110
- * `useUpdatePassword` calls `updatePassword` method from {@link https://refine.dev/docs/api-references/providers/auth-provider `authProvider`} under the hood.
110
+ * `useUpdatePassword` calls `updatePassword` method from {@link https://refine.dev/docs/api-reference/core/providers/auth-provider `authProvider`} under the hood.
111
111
  *
112
- * @see {@link https://refine.dev/docs/core/hooks/auth/useUpdatePassword} for more details.
112
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/auth/useUpdatePassword} for more details.
113
113
  *
114
114
  * @typeParam TData - Result data of the query
115
115
  * @typeParam TVariables - Values for mutation function. default `{}`
@@ -113,7 +113,7 @@ export const useBreadcrumb = ({
113
113
  if (typeof i18nProvider !== "undefined" && actionLabel === key) {
114
114
  warnOnce(
115
115
  true,
116
- `[useBreadcrumb]: Breadcrumb missing translate key for the "${action}" action. Please add "actions.${action}" key to your translation file.\nFor more information, see https://refine.dev/docs/core/hooks/useBreadcrumb/#i18n-support`,
116
+ `[useBreadcrumb]: Breadcrumb missing translate key for the "${action}" action. Please add "actions.${action}" key to your translation file.\nFor more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`,
117
117
  );
118
118
  breadcrumbs.push({
119
119
  label: translate(`buttons.${action}`, humanizeString(action)),
@@ -90,10 +90,10 @@ export type UseCreateProps<
90
90
  *
91
91
  * It uses `create` method as mutation function from the `dataProvider` which is passed to `<Refine>`.
92
92
  *
93
- * @see {@link https://refine.dev/docs/api-references/hooks/data/useCreate} for more details.
93
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useCreate} for more details.
94
94
  *
95
- * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-references/interfaceReferences#baserecord `BaseRecord`}
96
- * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-references/interfaceReferences#httperror `HttpError`}
95
+ * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
96
+ * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences/#httperror `HttpError`}
97
97
  * @typeParam TVariables - Values for mutation function
98
98
  *
99
99
  */
@@ -69,7 +69,7 @@ export type UseCreateManyProps<
69
69
  *
70
70
  * It uses `createMany` method as mutation function from the `dataProvider` which is passed to `<Refine>`.
71
71
  *
72
- * @see {@link https://refine.dev/docs/core/hooks/data/useCreateMany} for more details.
72
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useCreateMany} for more details.
73
73
  *
74
74
  * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/core/interfaceReferences#baserecord `BaseRecord`}
75
75
  * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/core/interfaceReferences#httperror `HttpError`}
@@ -80,7 +80,7 @@ export type UseCustomProps<TQueryFnData, TError, TQuery, TPayload, TData> = {
80
80
  *
81
81
  * It uses the `custom` method from the `dataProvider` which is passed to `<Refine>`.
82
82
  *
83
- * @see {@link https://refine.dev/docs/core/hooks/data/useCustom} for more details.
83
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useCustom} for more details.
84
84
  *
85
85
  * @typeParam TQueryFnData - Result data returned by the query function. Extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
86
86
  * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#httperror `HttpError`}
@@ -78,10 +78,10 @@ export type UseCustomMutationProps<
78
78
  *
79
79
  * It uses the `custom` method from the `dataProvider` which is passed to `<Refine>`.
80
80
  *
81
- * @see {@link https://refine.dev/docs/api-references/hooks/data/useCustomMutation} for more details.
81
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useCustomMutation} for more details.
82
82
  *
83
- * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-references/interfaceReferences#baserecord `BaseRecord`}
84
- * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-references/interfaceReferences#httperror `HttpError`}
83
+ * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
84
+ * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences/#httperror `HttpError`}
85
85
  * @typeParam TVariables - Values for mutation function
86
86
  *
87
87
  */
@@ -88,10 +88,10 @@ export type UseDeleteProps<
88
88
  *
89
89
  * It uses `deleteOne` method as mutation function from the `dataProvider` which is passed to `<Refine>`.
90
90
  *
91
- * @see {@link https://refine.dev/docs/api-references/hooks/data/useDelete} for more details.
91
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useDelete} for more details.
92
92
  *
93
- * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-references/interfaceReferences#baserecord `BaseRecord`}
94
- * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-references/interfaceReferences#httperror `HttpError`}
93
+ * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
94
+ * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences/#httperror `HttpError`}
95
95
  * @typeParam TVariables - Values for params. default `{}`
96
96
  *
97
97
  */
@@ -89,7 +89,7 @@ export type UseDeleteManyProps<
89
89
  *
90
90
  * It uses `deleteMany` method as mutation function from the `dataProvider` which is passed to `<Refine>`.
91
91
  *
92
- * @see {@link https://refine.dev/docs/core/hooks/data/useDeleteMany} for more details.
92
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useDeleteMany} for more details.
93
93
  *
94
94
  * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/core/interfaceReferences#baserecord `BaseRecord`}
95
95
  * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/core/interfaceReferences#httperror `HttpError`}
@@ -107,7 +107,7 @@ export type UseInfiniteListProps<TQueryFnData, TError, TData> = {
107
107
  *
108
108
  * It uses the `getList` method as the query function from the `dataProvider` which is passed to `<Refine>`.
109
109
  *
110
- * @see {@link https://refine.dev/docs/core/hooks/data/useInfiniteList} for more details.
110
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useInfiniteList} for more details.
111
111
  *
112
112
  * @typeParam TQueryFnData - Result data returned by the query function. Extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
113
113
  * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#httperror `HttpError`}
@@ -105,7 +105,7 @@ export type UseListProps<TQueryFnData, TError, TData> = {
105
105
  *
106
106
  * It uses the `getList` method as the query function from the `dataProvider` which is passed to `<Refine>`.
107
107
  *
108
- * @see {@link https://refine.dev/docs/core/hooks/data/useList} for more details.
108
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useList} for more details.
109
109
  *
110
110
  * @typeParam TQueryFnData - Result data returned by the query function. Extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
111
111
  * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#httperror `HttpError`}
@@ -70,7 +70,7 @@ export type UseManyProps<TQueryFnData, TError, TData> = {
70
70
  *
71
71
  * It uses `getMany` method as query function from the `dataProvider` which is passed to `<Refine>`.
72
72
  *
73
- * @see {@link https://refine.dev/docs/core/hooks/data/useMany} for more details.
73
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useMany} for more details.
74
74
  *
75
75
  * @typeParam TQueryFnData - Result data returned by the query function. Extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
76
76
  * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#httperror `HttpError`}
@@ -74,7 +74,7 @@ export type UseOneProps<TQueryFnData, TError, TData> = {
74
74
  *
75
75
  * It uses `getOne` method as query function from the `dataProvider` which is passed to `<Refine>`.
76
76
  *
77
- * @see {@link https://refine.dev/docs/core/hooks/data/useOne} for more details.
77
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useOne} for more details.
78
78
  *
79
79
  * @typeParam TQueryFnData - Result data returned by the query function. Extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
80
80
  * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#httperror `HttpError`}
@@ -121,10 +121,10 @@ export type UseUpdateProps<
121
121
  *
122
122
  * It uses `update` method as mutation function from the `dataProvider` which is passed to `<Refine>`.
123
123
  *
124
- * @see {@link https://refine.dev/docs/api-references/hooks/data/useUpdate} for more details.
124
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useUpdate} for more details.
125
125
  *
126
- * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-references/interfaceReferences#baserecord `BaseRecord`}
127
- * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-references/interfaceReferences#httperror `HttpError`}
126
+ * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
127
+ * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences/#httperror `HttpError`}
128
128
  * @typeParam TVariables - Values for mutation function
129
129
  *
130
130
  */
@@ -97,7 +97,7 @@ export type UseUpdateManyProps<
97
97
  *
98
98
  * It uses `updateMany` method as mutation function from the `dataProvider` which is passed to `<Refine>`.
99
99
  *
100
- * @see {@link https://refine.dev/docs/core/hooks/data/useUpdateMany} for more details.
100
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/data/useUpdateMany} for more details.
101
101
  *
102
102
  * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/core/interfaceReferences#baserecord `BaseRecord`}
103
103
  * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/core/interfaceReferences#httperror `HttpError`}
@@ -83,9 +83,9 @@ type UseExportReturnType = {
83
83
  /**
84
84
  * `useExport` hook allows you to make your resources exportable.
85
85
  *
86
- * @see {@link https://refine.dev/docs/core/hooks/import-export/useExport} for more details.
86
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/import-export/useExport} for more details.
87
87
  *
88
- * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-references/interfaceReferences#baserecord `BaseRecord`}
88
+ * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
89
89
  * @typeParam TVariables - Values for params.
90
90
  *
91
91
  */
@@ -86,6 +86,14 @@ type ActionFormProps<
86
86
  * @deprecated `metaData` is deprecated with refine@4, refine will pass `meta` instead, however, we still support `metaData` for backward compatibility.
87
87
  */
88
88
  metaData?: MetaQuery;
89
+ /**
90
+ * Metadata to pass for the `useOne` query
91
+ */
92
+ queryMeta?: MetaQuery;
93
+ /**
94
+ * Metadata to pass for the mutation (`useCreate` for `create` and `clone` actions, `useUpdate` for `edit` action)
95
+ */
96
+ mutationMeta?: MetaQuery;
89
97
  /**
90
98
  * [Determines when mutations are executed](/advanced-tutorials/mutation-mode.md)
91
99
  * @default `"pessimistic"*`
@@ -200,7 +208,7 @@ export type UseFormReturnType<
200
208
  /**
201
209
  * `useForm` is used to manage forms. It uses Ant Design {@link https://ant.design/components/form/ Form} data scope management under the hood and returns the required props for managing the form actions.
202
210
  *
203
- * @see {@link https://refine.dev/docs/api-references/hooks/form/useForm} for more details.
211
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/useForm} for more details.
204
212
  *
205
213
  * @typeParam TQueryFnData - Result data returned by the query function. Extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
206
214
  * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#httperror `HttpError`}
@@ -228,6 +236,8 @@ export const useForm = <
228
236
  errorNotification,
229
237
  meta,
230
238
  metaData,
239
+ queryMeta,
240
+ mutationMeta,
231
241
  mutationMode: mutationModeProp,
232
242
  liveMode,
233
243
  onLiveEvent,
@@ -402,8 +412,8 @@ export const useForm = <
402
412
  liveMode,
403
413
  onLiveEvent,
404
414
  liveParams,
405
- meta: combinedMeta,
406
- metaData: combinedMeta,
415
+ meta: { ...combinedMeta, ...queryMeta },
416
+ metaData: { ...combinedMeta, ...queryMeta },
407
417
  dataProviderName,
408
418
  });
409
419
 
@@ -441,7 +451,7 @@ export const useForm = <
441
451
  redirect: designatedRedirectAction,
442
452
  resource,
443
453
  id,
444
- meta: metaData,
454
+ meta: pickNotDeprecated(meta, metaData),
445
455
  });
446
456
  };
447
457
 
@@ -465,8 +475,8 @@ export const useForm = <
465
475
  resource: resource.name,
466
476
  successNotification,
467
477
  errorNotification,
468
- meta: combinedMeta,
469
- metaData: combinedMeta,
478
+ meta: { ...combinedMeta, ...mutationMeta },
479
+ metaData: { ...combinedMeta, ...mutationMeta },
470
480
  dataProviderName,
471
481
  invalidates,
472
482
  },
@@ -507,8 +517,8 @@ export const useForm = <
507
517
  undoableTimeout,
508
518
  successNotification,
509
519
  errorNotification,
510
- meta: combinedMeta,
511
- metaData: combinedMeta,
520
+ meta: { ...combinedMeta, ...mutationMeta },
521
+ metaData: { ...combinedMeta, ...mutationMeta },
512
522
  dataProviderName,
513
523
  invalidates,
514
524
  };
@@ -518,7 +528,7 @@ export const useForm = <
518
528
  redirect: designatedRedirectAction,
519
529
  resource,
520
530
  id,
521
- meta: metaData,
531
+ meta: pickNotDeprecated(meta, metaData),
522
532
  });
523
533
  };
524
534
 
@@ -589,7 +599,7 @@ export const useForm = <
589
599
  : "edit",
590
600
  resource,
591
601
  id: idFromFunction ?? id,
592
- meta: metaData,
602
+ meta: pickNotDeprecated(meta, metaData),
593
603
  });
594
604
  },
595
605
  };
@@ -118,11 +118,11 @@ export type UseImportReturnType<
118
118
  /**
119
119
  * `useImport` hook allows you to handle your csv import logic easily.
120
120
  *
121
- * @see {@link https://refine.dev/docs/core/hooks/import-export/useImport} for more details.
121
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/import-export/useImport} for more details.
122
122
  *
123
123
  * @typeParam TItem - Interface of parsed csv data
124
- * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-references/interfaceReferences#baserecord `BaseRecord`}
125
- * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-references/interfaceReferences#httperror `HttpError`}
124
+ * @typeParam TData - Result data of the query extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
125
+ * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences/#httperror `HttpError`}
126
126
  * @typeParam TVariables - Values for mutation function
127
127
  *
128
128
  */
@@ -41,7 +41,7 @@ const getCleanPath = (pathname: string) => {
41
41
  * (passed as children to {@link https://refine.dev/docs/core/components/refine-config `<Refine>`}).
42
42
  * This hook can also be used to build custom menus, which is also used by default sidebar to show menu items.
43
43
  *
44
- * @see {@link https://refine.dev/docs/core/hooks/ui/useMenu} for more details.
44
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/ui/useMenu} for more details.
45
45
  */
46
46
  export const useMenu = (
47
47
  { meta, hideOnMissingParameter }: UseMenuProps = {
@@ -11,13 +11,13 @@ import { useBack } from "@hooks/router/use-back";
11
11
  export type HistoryType = "push" | "replace";
12
12
 
13
13
  /**
14
- * `refine` uses {@link https://reactrouter.com/web/api/Hooks `React Router`} and comes with all redirects out of the box.
14
+ * `refine` uses {@link https://reactrouter.com/en/hooks/use-navigate `React Router`} and comes with all redirects out of the box.
15
15
  * It allows you to manage your routing operations in refine.
16
16
  * Using this hook, you can manage all the routing operations of your application very easily.
17
17
  *
18
18
  * @internal This is an internal hook of refine. Do not use it directly.
19
19
  *
20
- * @see {@link https://refine.dev/docs/core/hooks/navigation/useNavigation} for more details.
20
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/navigation/useNavigation} for more details.
21
21
  */
22
22
  export const useNavigation = () => {
23
23
  const { resources } = useResource();
@@ -11,7 +11,7 @@ type UseSyncWithLocationType = () => {
11
11
  * List query parameter values can be edited manually by typing directly in the URL.
12
12
  * To activate this feature `syncWithLocation` needs to be set to `true`.
13
13
  *
14
- * @see {@link https://refine.dev/docs/api-references/components/refine-config#syncwithlocation} for more details.
14
+ * @see {@link https://refine.dev/docs/api-reference/core/components/refine-config/#syncwithlocation} for more details.
15
15
  */
16
16
  export const useSyncWithLocation: UseSyncWithLocationType = () => {
17
17
  const { syncWithLocation } = useContext(RefineContext);
@@ -6,7 +6,7 @@ import { TitleProps } from "../../interfaces";
6
6
  * `useTitle` returns a component that calls the `<Title>` passed to the `<Refine>`.
7
7
  * In this way, it becomes easier for us to access this component in various parts of the application.
8
8
  *
9
- * @see {@link https://refine.dev/docs/core/hooks/refine/useTitle} for more details.
9
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/refine/useTitle} for more details.
10
10
  */
11
11
  export const useTitle: () => React.FC<TitleProps> | undefined = () => {
12
12
  const { Title } = useContext(RefineContext);
@@ -17,7 +17,7 @@ type UseWarnAboutChangeType = () => {
17
17
  * When you have unsaved changes and try to leave the current page, **refine** shows a confirmation modal box.
18
18
  * To activate this feature, set the `warnWhenUnsavedChanges` to `true`.
19
19
  *
20
- * @see {@link https://refine.dev/docs/api-references/components/refine-config#warnwhenunsavedchanges} for more details.
20
+ * @see {@link https://refine.dev/docs/api-reference/core/components/refine-config#warnwhenunsavedchanges} for more details.
21
21
  */
22
22
  export const useWarnAboutChange: UseWarnAboutChangeType = () => {
23
23
  const { warnWhenUnsavedChanges } = useContext(RefineContext);
@@ -67,7 +67,7 @@ export function useResource<TIdentifier = UseResourceParam>(
67
67
  /**
68
68
  * `useResource` is used to get `resources` that are defined as property of the `<Refine>` component.
69
69
  *
70
- * @see {@link https://refine.dev/docs/core/hooks/resource/useResource} for more details.
70
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/resource/useResource} for more details.
71
71
  */
72
72
  export function useResource(
73
73
  args?: UseResourceLegacyProps | UseResourceParam,
@@ -82,7 +82,7 @@ export type useShowProps<
82
82
  * It uses `getOne` method as query function from the dataProvider that is
83
83
  * passed to {@link https://refine.dev/docs/api-reference/core/components/refine-config/ `<Refine>`}.
84
84
  *
85
- * @see {@link https://refine.dev/docs/core/hooks/show/useShow} for more details.
85
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/show/useShow} for more details.
86
86
  *
87
87
  * @typeParam TQueryFnData - Result data returned by the query function. Extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#baserecord `BaseRecord`}
88
88
  * @typeParam TError - Custom error object that extends {@link https://refine.dev/docs/api-reference/core/interfaceReferences#httperror `HttpError`}
@@ -7,7 +7,7 @@ export type UseGetLocaleType = () => () => string | undefined;
7
7
  * If you need to know the current locale, refine provides the `useGetLocale` hook.
8
8
  * It returns the `getLocale` method from `i18nProvider` under the hood.
9
9
  *
10
- * @see {@link https://refine.dev/docs/core/hooks/translate/useGetLocale} for more details.
10
+ * @see {@link https://refine.dev/docs/api-reference/core/hooks/translate/useGetLocale} for more details.
11
11
  */
12
12
  export const useGetLocale: UseGetLocaleType = () => {
13
13
  const { i18nProvider } = useContext(TranslationContext);