@refinedev/core 4.56.0 → 4.57.1

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/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@refinedev/core",
3
- "version": "4.56.0",
3
+ "version": "4.57.1",
4
4
  "private": false,
5
- "description": "refine is a React-based framework for building internal tools, rapidly. It ships with Ant Design System, an enterprise-level UI toolkit.",
5
+ "description": "Refine is a React meta-framework for building enterprise-level, data-intensive applications rapidly with support for modern UI libraries and headless integrations.",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/refinedev/refine.git",
@@ -27,7 +27,7 @@
27
27
  "module": "dist/index.mjs",
28
28
  "typings": "dist/index.d.ts",
29
29
  "dependencies": {
30
- "@refinedev/devtools-internal": "1.1.14",
30
+ "@refinedev/devtools-internal": "1.1.16",
31
31
  "@tanstack/react-query": "^4.10.1",
32
32
  "lodash": "^4.17.21",
33
33
  "lodash-es": "^4.17.21",
@@ -11,6 +11,8 @@ import {
11
11
  } from "@hooks";
12
12
  import type { GoConfig } from "../../contexts/router/types";
13
13
 
14
+ export type AuthCheckParams = any;
15
+
14
16
  export type AuthenticatedCommonProps = {
15
17
  /**
16
18
  * Unique key to identify the component.
@@ -44,9 +46,13 @@ export type AuthenticatedCommonProps = {
44
46
  */
45
47
  loading?: React.ReactNode;
46
48
  /**
47
- * Content to show if user is logged in
49
+ * Content to show if user is logged in.
48
50
  */
49
51
  children?: React.ReactNode;
52
+ /**
53
+ * optional params to be passed to the Auth Provider's check method via the useIsAuthenticated hook.
54
+ */
55
+ params?: AuthCheckParams;
50
56
  };
51
57
 
52
58
  export type LegacyAuthenticatedProps = {
@@ -97,6 +103,7 @@ export function Authenticated({
97
103
  children,
98
104
  fallback: fallbackContent,
99
105
  loading: loadingContent,
106
+ params,
100
107
  }: AuthenticatedProps | LegacyAuthenticatedProps): JSX.Element | null {
101
108
  const activeAuthProvider = useActiveAuthProvider();
102
109
  const routerType = useRouterType();
@@ -119,6 +126,7 @@ export function Authenticated({
119
126
  } = {},
120
127
  } = useIsAuthenticated({
121
128
  v3LegacyAuthProviderCompatible: isLegacyAuth,
129
+ params,
122
130
  });
123
131
 
124
132
  // Authentication status
@@ -240,7 +240,7 @@ export const useUpdate = <
240
240
  metaData = metaDataFromProps,
241
241
  dataProviderName = dataProviderNameFromProps,
242
242
  }) => {
243
- if (!id) throw missingIdError;
243
+ if (typeof id === "undefined") throw missingIdError;
244
244
  if (!values) throw missingValuesError;
245
245
  if (!resourceName) throw missingResourceError;
246
246
 
@@ -321,7 +321,7 @@ export const useUpdate = <
321
321
  detail: true,
322
322
  },
323
323
  }) => {
324
- if (!id) throw missingIdError;
324
+ if (typeof id === "undefined") throw missingIdError;
325
325
  if (!values) throw missingValuesError;
326
326
  if (!resourceName) throw missingResourceError;
327
327
 
@@ -462,7 +462,7 @@ export const useUpdate = <
462
462
  dataProviderName = dataProviderNameFromProps,
463
463
  invalidates = invalidatesFromProps ?? ["list", "many", "detail"],
464
464
  } = variables;
465
- if (!id) throw missingIdError;
465
+ if (typeof id === "undefined") throw missingIdError;
466
466
  if (!resourceName) throw missingResourceError;
467
467
 
468
468
  const { identifier } = select(resourceName);
@@ -495,7 +495,7 @@ export const useUpdate = <
495
495
  meta = metaFromProps,
496
496
  metaData = metaDataFromProps,
497
497
  } = variables;
498
- if (!id) throw missingIdError;
498
+ if (typeof id === "undefined") throw missingIdError;
499
499
  if (!values) throw missingValuesError;
500
500
  if (!resourceName) throw missingResourceError;
501
501
 
@@ -586,7 +586,7 @@ export const useUpdate = <
586
586
  errorNotification = errorNotificationFromProps,
587
587
  values = valuesFromProps,
588
588
  } = variables;
589
- if (!id) throw missingIdError;
589
+ if (typeof id === "undefined") throw missingIdError;
590
590
  if (!values) throw missingValuesError;
591
591
  if (!resourceName) throw missingResourceError;
592
592
 
@@ -85,6 +85,7 @@ export const useNavigation = () => {
85
85
  return go({
86
86
  to: composeRoute(createActionRoute, resourceItem?.meta, parsed, meta),
87
87
  type: "path",
88
+ query: meta.query,
88
89
  }) as string;
89
90
  };
90
91
 
@@ -138,6 +139,7 @@ export const useNavigation = () => {
138
139
  id: encodedId,
139
140
  }),
140
141
  type: "path",
142
+ query: meta.query,
141
143
  }) as string;
142
144
  };
143
145
 
@@ -192,6 +194,7 @@ export const useNavigation = () => {
192
194
  id: encodedId,
193
195
  }),
194
196
  type: "path",
197
+ query: meta.query,
195
198
  }) as string;
196
199
  };
197
200
 
@@ -245,6 +248,7 @@ export const useNavigation = () => {
245
248
  id: encodedId,
246
249
  }),
247
250
  type: "path",
251
+ query: meta.query,
248
252
  }) as string;
249
253
  };
250
254
 
@@ -295,6 +299,7 @@ export const useNavigation = () => {
295
299
  return go({
296
300
  to: composeRoute(listActionRoute, resourceItem?.meta, parsed, meta),
297
301
  type: "path",
302
+ query: meta.query,
298
303
  }) as string;
299
304
  };
300
305