@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.
- package/CHANGELOG.md +109 -0
- package/dist/definitions/helpers/flatten-object-keys/index.d.ts.map +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/hooks/accessControl/useCan/index.d.ts.map +1 -1
- package/dist/hooks/auditLog/useLogList/index.d.ts.map +1 -1
- package/dist/hooks/auth/useOnError/index.d.ts.map +1 -1
- package/dist/hooks/data/useCreate.d.ts.map +1 -1
- package/dist/hooks/data/useCreateMany.d.ts.map +1 -1
- package/dist/hooks/data/useDelete.d.ts.map +1 -1
- package/dist/hooks/data/useDeleteMany.d.ts.map +1 -1
- package/dist/hooks/data/useInfiniteList.d.ts.map +1 -1
- package/dist/hooks/data/useList.d.ts.map +1 -1
- package/dist/hooks/data/useMany.d.ts.map +1 -1
- package/dist/hooks/data/useOne.d.ts.map +1 -1
- package/dist/hooks/data/useUpdate.d.ts.map +1 -1
- package/dist/hooks/data/useUpdateMany.d.ts.map +1 -1
- package/dist/hooks/router/use-go/index.d.ts +2 -0
- package/dist/hooks/router/use-go/index.d.ts.map +1 -1
- package/dist/hooks/useMeta/index.d.ts +2 -0
- package/dist/hooks/useMeta/index.d.ts.map +1 -1
- package/dist/iife/index.js +6 -6
- package/dist/iife/index.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/interfaces/auth.d.ts +6 -6
- package/dist/interfaces/auth.d.ts.map +1 -1
- package/dist/interfaces/metaData/graphqlQueryOptions.d.ts +6 -0
- package/dist/interfaces/metaData/graphqlQueryOptions.d.ts.map +1 -0
- package/dist/interfaces/metaData/metaQuery.d.ts +2 -1
- package/dist/interfaces/metaData/metaQuery.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/definitions/helpers/flatten-object-keys/index.ts +2 -0
- package/src/hooks/accessControl/useCan/index.ts +10 -12
- package/src/hooks/auditLog/useLogList/index.ts +10 -12
- package/src/hooks/auth/useForgotPassword/index.ts +51 -54
- package/src/hooks/auth/useGetIdentity/index.ts +23 -26
- package/src/hooks/auth/useIsAuthenticated/index.ts +20 -20
- package/src/hooks/auth/useLogin/index.ts +33 -35
- package/src/hooks/auth/useLogout/index.ts +32 -34
- package/src/hooks/auth/useOnError/index.ts +29 -33
- package/src/hooks/auth/usePermissions/index.ts +19 -22
- package/src/hooks/auth/useRegister/index.ts +60 -66
- package/src/hooks/auth/useUpdatePassword/index.ts +51 -54
- package/src/hooks/data/useCreate.ts +115 -117
- package/src/hooks/data/useCreateMany.ts +113 -118
- package/src/hooks/data/useDelete.ts +212 -223
- package/src/hooks/data/useDeleteMany.ts +230 -244
- package/src/hooks/data/useInfiniteList.ts +36 -42
- package/src/hooks/data/useList.ts +56 -62
- package/src/hooks/data/useMany.ts +36 -37
- package/src/hooks/data/useOne.ts +54 -55
- package/src/hooks/data/useUpdate.ts +288 -311
- package/src/hooks/data/useUpdateMany.ts +294 -320
- package/src/hooks/menu/useMenu.tsx +1 -1
- package/src/hooks/router/use-go/index.tsx +3 -0
- package/src/interfaces/auth.tsx +6 -6
- package/src/interfaces/metaData/graphqlQueryOptions.ts +6 -0
- package/src/interfaces/metaData/metaQuery.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,114 @@
|
|
|
1
1
|
# @refinedev/core
|
|
2
2
|
|
|
3
|
+
## 4.46.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#5423](https://github.com/refinedev/refine/pull/5423) [`75bb61dd3b`](https://github.com/refinedev/refine/commit/75bb61dd3b781e69f198f4e928ccffddb997fdc5) Thanks [@aliemir](https://github.com/aliemir)! - Updated `flattenObjectKeys` method to support both nested and non-nested variables when propagating server side errors to form fields. Resolves [#5461](https://github.com/refinedev/refine/issues/5461)
|
|
8
|
+
|
|
9
|
+
- [#5401](https://github.com/refinedev/refine/pull/5401) [`93e00fd770`](https://github.com/refinedev/refine/commit/93e00fd7701bce9e7201d04a6dd8f1419baeb68d) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - fix: `queryKey` is not overrideable. To fix this, `useQuery` overloads refactored with single argument objects.
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
- useQuery(queryKey, queryFn, options);
|
|
13
|
+
+ useQuery({ queryKey, queryFn, ...options });
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
From now on, you can pass `queryKey` as an object property.
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
// all data hooks can be used with this syntax.
|
|
20
|
+
useList({
|
|
21
|
+
queryOptions: {
|
|
22
|
+
queryKey: ["my-query-key"],
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- [#5406](https://github.com/refinedev/refine/pull/5406) [`e5888b6b9c`](https://github.com/refinedev/refine/commit/e5888b6b9c9cc41546152f5b4d9adaf4405aa51c) Thanks [@aliemir](https://github.com/aliemir)! - `useMenu` hook was using outdated `meta` and router `params` due to missing dependency of the callback function. This was causing dynamic menu items to use wrong paths as links. (Resolves [#5432](https://github.com/refinedev/refine/issues/5432))
|
|
28
|
+
|
|
29
|
+
- [#5452](https://github.com/refinedev/refine/pull/5452) [`b621223bfb`](https://github.com/refinedev/refine/commit/b621223bfbc2bed569e41766f60b9687ddba9013) Thanks [@aliemir](https://github.com/aliemir)! - Added the ability to pass `meta` properties when using `useGo`'s `go` function with `to` as a resource object. This allows you to pass additional path parameters to the path defined in the resources array within the `<Refine />` component. Resolves [#5451](https://github.com/refinedev/refine/issues/5451)
|
|
30
|
+
|
|
31
|
+
Assume we have the following resource defined in the `<Refine />` component:
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
{
|
|
35
|
+
name: "posts",
|
|
36
|
+
list: "/posts",
|
|
37
|
+
edit: "/:foo/posts/:id/edit",
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { useGo } from "@refinedev/core";
|
|
43
|
+
|
|
44
|
+
const MyButton = () => {
|
|
45
|
+
const go = useGo();
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Button
|
|
49
|
+
onClick={() => {
|
|
50
|
+
go({
|
|
51
|
+
to: {
|
|
52
|
+
resource: "posts",
|
|
53
|
+
action: "edit",
|
|
54
|
+
id: "1",
|
|
55
|
+
meta: {
|
|
56
|
+
foo: "bar",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
type: "push",
|
|
60
|
+
});
|
|
61
|
+
// generated path will be "/bar/posts/1/edit"
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
Go Posts
|
|
65
|
+
</Button>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- [#5381](https://github.com/refinedev/refine/pull/5381) [`19ceffbe9f`](https://github.com/refinedev/refine/commit/19ceffbe9f217fd354207b96610c25e8a7f3dcf3) Thanks [@aberhamm](https://github.com/aberhamm)! - fix: Missing `loginLink` attribute in `AuthPageProps` for `<AuthPage type="register" />`. #5381
|
|
71
|
+
|
|
72
|
+
## 4.46.1
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- [#5409](https://github.com/refinedev/refine/pull/5409) [`0026fe34d0`](https://github.com/refinedev/refine/commit/0026fe34d0e46209f42e40834c6942ade22f242f) Thanks [@BatuhanW](https://github.com/BatuhanW)! - fix: exclude `gqlMutation` and `gqlQuery` from building query keys for `useUpdate`, `useUpdateMany`, `useDelete`, and `useDeleteMany` hooks.
|
|
77
|
+
|
|
78
|
+
- [#5409](https://github.com/refinedev/refine/pull/5409) [`0026fe34d0`](https://github.com/refinedev/refine/commit/0026fe34d0e46209f42e40834c6942ade22f242f) Thanks [@BatuhanW](https://github.com/BatuhanW)! - feat: add optional `gqlQuery` and `gqlMutation` fields to `MetaQuery` type to be used in `data hooks`.
|
|
79
|
+
|
|
80
|
+
We plan to utilize these fields on our GraphQL data providers in the future.
|
|
81
|
+
|
|
82
|
+
You can build your queries/mutations with `graphql-tag` package and pass it to the `gqlQuery`/`gqlMutation` fields.
|
|
83
|
+
|
|
84
|
+
For now, only `@refinedev/nestjs-query` package supports it.
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
import { useList } from "@refinedev/core";
|
|
88
|
+
import gql from "graphql-tag";
|
|
89
|
+
|
|
90
|
+
const PRODUCTS_QUERY = gql`
|
|
91
|
+
query ProductsList(
|
|
92
|
+
$paging: OffsetPaging!
|
|
93
|
+
$filter: BlogPostFilter
|
|
94
|
+
$sorting: [BlogPostSort!]!
|
|
95
|
+
) {
|
|
96
|
+
products(paging: $paging, filter: $filter, sorting: $sorting) {
|
|
97
|
+
nodes {
|
|
98
|
+
id
|
|
99
|
+
name
|
|
100
|
+
}
|
|
101
|
+
totalCount
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
105
|
+
|
|
106
|
+
const { data } = useList({
|
|
107
|
+
resource: "products",
|
|
108
|
+
meta: { gqlQuery: PRODUCTS_QUERY },
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
3
112
|
## 4.46.0
|
|
4
113
|
|
|
5
114
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/definitions/helpers/flatten-object-keys/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,QAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/definitions/helpers/flatten-object-keys/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,QAAS,GAAG,6CAkCzC,CAAC"}
|