@replyke/core 5.1.6-beta.0 → 5.1.6-beta.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/dist/cjs/context/index.d.ts +0 -1
- package/dist/cjs/context/index.js +3 -3
- package/dist/cjs/context/index.js.map +1 -1
- package/dist/cjs/helpers/addNotificationsMessages.js +7 -7
- package/dist/cjs/helpers/addNotificationsMessages.js.map +1 -1
- package/dist/cjs/hooks/app-notifications-redux/index.d.ts +1 -2
- package/dist/cjs/hooks/app-notifications-redux/index.js +1 -3
- package/dist/cjs/hooks/app-notifications-redux/index.js.map +1 -1
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsRedux.d.ts +18 -4
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsRedux.js +78 -8
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsRedux.js.map +1 -1
- package/dist/cjs/hooks/lists-redux/index.d.ts +2 -0
- package/dist/cjs/hooks/lists-redux/index.js +12 -0
- package/dist/cjs/hooks/lists-redux/index.js.map +1 -0
- package/dist/cjs/hooks/lists-redux/useListsActionsRedux.d.ts +21 -0
- package/dist/cjs/hooks/lists-redux/useListsActionsRedux.js +329 -0
- package/dist/cjs/hooks/lists-redux/useListsActionsRedux.js.map +1 -0
- package/dist/cjs/hooks/{lists/useListsData.d.ts → lists-redux/useListsRedux.d.ts} +9 -5
- package/dist/cjs/hooks/lists-redux/useListsRedux.js +239 -0
- package/dist/cjs/hooks/lists-redux/useListsRedux.js.map +1 -0
- package/dist/cjs/hooks/user-redux/index.d.ts +2 -0
- package/dist/cjs/hooks/user-redux/index.js +12 -0
- package/dist/cjs/hooks/user-redux/index.js.map +1 -0
- package/dist/cjs/hooks/user-redux/useUserActionsRedux.d.ts +12 -0
- package/dist/cjs/hooks/user-redux/useUserActionsRedux.js +125 -0
- package/dist/cjs/hooks/user-redux/useUserActionsRedux.js.map +1 -0
- package/dist/cjs/hooks/user-redux/useUserRedux.d.ts +18 -0
- package/dist/cjs/hooks/user-redux/useUserRedux.js +116 -0
- package/dist/cjs/hooks/user-redux/useUserRedux.js.map +1 -0
- package/dist/cjs/hooks/users/index.d.ts +0 -2
- package/dist/cjs/hooks/users/index.js +4 -5
- package/dist/cjs/hooks/users/index.js.map +1 -1
- package/dist/cjs/index.d.ts +7 -6
- package/dist/cjs/index.js +11 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/store/api/appNotificationsApi.d.ts +144 -141
- package/dist/cjs/store/api/appNotificationsApi.js +11 -0
- package/dist/cjs/store/api/appNotificationsApi.js.map +1 -1
- package/dist/cjs/store/api/baseApi.d.ts +1 -1
- package/dist/cjs/store/api/baseApi.js +2 -2
- package/dist/cjs/store/api/baseApi.js.map +1 -1
- package/dist/cjs/store/api/index.d.ts +1 -0
- package/dist/cjs/store/api/index.js +2 -1
- package/dist/cjs/store/api/index.js.map +1 -1
- package/dist/cjs/store/api/listsApi.d.ts +3044 -0
- package/dist/cjs/store/api/listsApi.js +288 -0
- package/dist/cjs/store/api/listsApi.js.map +1 -0
- package/dist/cjs/store/api/userApi.d.ts +183 -0
- package/dist/cjs/store/api/userApi.js +38 -0
- package/dist/cjs/store/api/userApi.js.map +1 -0
- package/dist/cjs/store/index.d.ts +6 -2
- package/dist/cjs/store/rootReducer.d.ts +6 -2
- package/dist/cjs/store/rootReducer.js +4 -0
- package/dist/cjs/store/rootReducer.js.map +1 -1
- package/dist/cjs/store/slices/authThunks.js +6 -0
- package/dist/cjs/store/slices/authThunks.js.map +1 -1
- package/dist/cjs/store/slices/listsSlice.d.ts +66 -0
- package/dist/cjs/store/slices/listsSlice.js +213 -0
- package/dist/cjs/store/slices/listsSlice.js.map +1 -0
- package/dist/cjs/store/slices/userSlice.d.ts +29 -0
- package/dist/cjs/store/slices/userSlice.js +87 -0
- package/dist/cjs/store/slices/userSlice.js.map +1 -0
- package/dist/esm/context/index.d.ts +0 -1
- package/dist/esm/context/index.js +2 -1
- package/dist/esm/context/index.js.map +1 -1
- package/dist/esm/helpers/addNotificationsMessages.js +7 -7
- package/dist/esm/helpers/addNotificationsMessages.js.map +1 -1
- package/dist/esm/hooks/app-notifications-redux/index.d.ts +1 -2
- package/dist/esm/hooks/app-notifications-redux/index.js +0 -1
- package/dist/esm/hooks/app-notifications-redux/index.js.map +1 -1
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsRedux.d.ts +18 -4
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsRedux.js +77 -9
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsRedux.js.map +1 -1
- package/dist/esm/hooks/lists-redux/index.d.ts +2 -0
- package/dist/esm/hooks/lists-redux/index.js +4 -0
- package/dist/esm/hooks/lists-redux/index.js.map +1 -0
- package/dist/esm/hooks/lists-redux/useListsActionsRedux.d.ts +21 -0
- package/dist/esm/hooks/lists-redux/useListsActionsRedux.js +326 -0
- package/dist/esm/hooks/lists-redux/useListsActionsRedux.js.map +1 -0
- package/dist/esm/hooks/{lists/useListsData.d.ts → lists-redux/useListsRedux.d.ts} +9 -5
- package/dist/esm/hooks/lists-redux/useListsRedux.js +234 -0
- package/dist/esm/hooks/lists-redux/useListsRedux.js.map +1 -0
- package/dist/esm/hooks/user-redux/index.d.ts +2 -0
- package/dist/esm/hooks/user-redux/index.js +4 -0
- package/dist/esm/hooks/user-redux/index.js.map +1 -0
- package/dist/esm/hooks/user-redux/useUserActionsRedux.d.ts +12 -0
- package/dist/esm/hooks/user-redux/useUserActionsRedux.js +122 -0
- package/dist/esm/hooks/user-redux/useUserActionsRedux.js.map +1 -0
- package/dist/esm/hooks/user-redux/useUserRedux.d.ts +18 -0
- package/dist/esm/hooks/user-redux/useUserRedux.js +111 -0
- package/dist/esm/hooks/user-redux/useUserRedux.js.map +1 -0
- package/dist/esm/hooks/users/index.d.ts +0 -2
- package/dist/esm/hooks/users/index.js +3 -2
- package/dist/esm/hooks/users/index.js.map +1 -1
- package/dist/esm/index.d.ts +7 -6
- package/dist/esm/index.js +9 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/store/api/appNotificationsApi.d.ts +144 -141
- package/dist/esm/store/api/appNotificationsApi.js +11 -0
- package/dist/esm/store/api/appNotificationsApi.js.map +1 -1
- package/dist/esm/store/api/baseApi.d.ts +1 -1
- package/dist/esm/store/api/baseApi.js +2 -2
- package/dist/esm/store/api/baseApi.js.map +1 -1
- package/dist/esm/store/api/index.d.ts +1 -0
- package/dist/esm/store/api/index.js +2 -1
- package/dist/esm/store/api/index.js.map +1 -1
- package/dist/esm/store/api/listsApi.d.ts +3044 -0
- package/dist/esm/store/api/listsApi.js +285 -0
- package/dist/esm/store/api/listsApi.js.map +1 -0
- package/dist/esm/store/api/userApi.d.ts +183 -0
- package/dist/esm/store/api/userApi.js +35 -0
- package/dist/esm/store/api/userApi.js.map +1 -0
- package/dist/esm/store/index.d.ts +6 -2
- package/dist/esm/store/rootReducer.d.ts +6 -2
- package/dist/esm/store/rootReducer.js +4 -0
- package/dist/esm/store/rootReducer.js.map +1 -1
- package/dist/esm/store/slices/authThunks.js +6 -0
- package/dist/esm/store/slices/authThunks.js.map +1 -1
- package/dist/esm/store/slices/listsSlice.d.ts +66 -0
- package/dist/esm/store/slices/listsSlice.js +203 -0
- package/dist/esm/store/slices/listsSlice.js.map +1 -0
- package/dist/esm/store/slices/userSlice.d.ts +29 -0
- package/dist/esm/store/slices/userSlice.js +78 -0
- package/dist/esm/store/slices/userSlice.js.map +1 -0
- package/package.json +1 -1
- package/dist/cjs/context/lists-context.d.ts +0 -9
- package/dist/cjs/context/lists-context.js +0 -17
- package/dist/cjs/context/lists-context.js.map +0 -1
- package/dist/cjs/context/user-context.d.ts +0 -8
- package/dist/cjs/context/user-context.js +0 -28
- package/dist/cjs/context/user-context.js.map +0 -1
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsDataRedux.d.ts +0 -21
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsDataRedux.js +0 -108
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsDataRedux.js.map +0 -1
- package/dist/cjs/hooks/lists/index.d.ts +0 -10
- package/dist/cjs/hooks/lists/index.js +0 -27
- package/dist/cjs/hooks/lists/index.js.map +0 -1
- package/dist/cjs/hooks/lists/useAddToList.d.ts +0 -6
- package/dist/cjs/hooks/lists/useAddToList.js +0 -70
- package/dist/cjs/hooks/lists/useAddToList.js.map +0 -1
- package/dist/cjs/hooks/lists/useCreateList.d.ts +0 -6
- package/dist/cjs/hooks/lists/useCreateList.js +0 -70
- package/dist/cjs/hooks/lists/useCreateList.js.map +0 -1
- package/dist/cjs/hooks/lists/useDeleteList.d.ts +0 -4
- package/dist/cjs/hooks/lists/useDeleteList.js +0 -69
- package/dist/cjs/hooks/lists/useDeleteList.js.map +0 -1
- package/dist/cjs/hooks/lists/useFetchRootList.d.ts +0 -3
- package/dist/cjs/hooks/lists/useFetchRootList.js +0 -69
- package/dist/cjs/hooks/lists/useFetchRootList.js.map +0 -1
- package/dist/cjs/hooks/lists/useFetchSubLists.d.ts +0 -5
- package/dist/cjs/hooks/lists/useFetchSubLists.js +0 -68
- package/dist/cjs/hooks/lists/useFetchSubLists.js.map +0 -1
- package/dist/cjs/hooks/lists/useIsEntitySaved.d.ts +0 -5
- package/dist/cjs/hooks/lists/useIsEntitySaved.js +0 -78
- package/dist/cjs/hooks/lists/useIsEntitySaved.js.map +0 -1
- package/dist/cjs/hooks/lists/useLists.d.ts +0 -2
- package/dist/cjs/hooks/lists/useLists.js +0 -9
- package/dist/cjs/hooks/lists/useLists.js.map +0 -1
- package/dist/cjs/hooks/lists/useListsData.js +0 -391
- package/dist/cjs/hooks/lists/useListsData.js.map +0 -1
- package/dist/cjs/hooks/lists/useRemoveFromList.d.ts +0 -6
- package/dist/cjs/hooks/lists/useRemoveFromList.js +0 -70
- package/dist/cjs/hooks/lists/useRemoveFromList.js.map +0 -1
- package/dist/cjs/hooks/lists/useUpdateList.d.ts +0 -8
- package/dist/cjs/hooks/lists/useUpdateList.js +0 -70
- package/dist/cjs/hooks/lists/useUpdateList.js.map +0 -1
- package/dist/cjs/hooks/users/useUser.d.ts +0 -2
- package/dist/cjs/hooks/users/useUser.js +0 -9
- package/dist/cjs/hooks/users/useUser.js.map +0 -1
- package/dist/cjs/hooks/users/useUserData.d.ts +0 -12
- package/dist/cjs/hooks/users/useUserData.js +0 -76
- package/dist/cjs/hooks/users/useUserData.js.map +0 -1
- package/dist/cjs/legacy/context/app-notifications-context.d.ts +0 -8
- package/dist/cjs/legacy/context/app-notifications-context.js +0 -28
- package/dist/cjs/legacy/context/app-notifications-context.js.map +0 -1
- package/dist/cjs/legacy/context/auth-context.d.ts +0 -8
- package/dist/cjs/legacy/context/auth-context.js +0 -29
- package/dist/cjs/legacy/context/auth-context.js.map +0 -1
- package/dist/cjs/legacy/hooks/app-notifications/index.d.ts +0 -5
- package/dist/cjs/legacy/hooks/app-notifications/index.js +0 -17
- package/dist/cjs/legacy/hooks/app-notifications/index.js.map +0 -1
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotifications.d.ts +0 -2
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotifications.js +0 -9
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotifications.js.map +0 -1
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotificationsData.d.ts +0 -16
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotificationsData.js +0 -225
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotificationsData.js.map +0 -1
- package/dist/cjs/legacy/hooks/app-notifications/useCountUnreadNotifications.d.ts +0 -2
- package/dist/cjs/legacy/hooks/app-notifications/useCountUnreadNotifications.js +0 -72
- package/dist/cjs/legacy/hooks/app-notifications/useCountUnreadNotifications.js.map +0 -1
- package/dist/cjs/legacy/hooks/app-notifications/useFetchAppNotifications.d.ts +0 -6
- package/dist/cjs/legacy/hooks/app-notifications/useFetchAppNotifications.js +0 -79
- package/dist/cjs/legacy/hooks/app-notifications/useFetchAppNotifications.js.map +0 -1
- package/dist/cjs/legacy/hooks/app-notifications/useMarkNotificationAsRead.d.ts +0 -2
- package/dist/cjs/legacy/hooks/app-notifications/useMarkNotificationAsRead.js +0 -74
- package/dist/cjs/legacy/hooks/app-notifications/useMarkNotificationAsRead.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/index.d.ts +0 -8
- package/dist/cjs/legacy/hooks/auth/index.js +0 -23
- package/dist/cjs/legacy/hooks/auth/index.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useAuth.d.ts +0 -2
- package/dist/cjs/legacy/hooks/auth/useAuth.js +0 -9
- package/dist/cjs/legacy/hooks/auth/useAuth.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useAuthData.d.ts +0 -41
- package/dist/cjs/legacy/hooks/auth/useAuthData.js +0 -271
- package/dist/cjs/legacy/hooks/auth/useAuthData.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useChangePassword.d.ts +0 -5
- package/dist/cjs/legacy/hooks/auth/useChangePassword.js +0 -70
- package/dist/cjs/legacy/hooks/auth/useChangePassword.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useRequestNewAccessToken.d.ts +0 -7
- package/dist/cjs/legacy/hooks/auth/useRequestNewAccessToken.js +0 -71
- package/dist/cjs/legacy/hooks/auth/useRequestNewAccessToken.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useSignInWithEmailAndPassword.d.ts +0 -9
- package/dist/cjs/legacy/hooks/auth/useSignInWithEmailAndPassword.js +0 -72
- package/dist/cjs/legacy/hooks/auth/useSignInWithEmailAndPassword.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useSignOut.d.ts +0 -4
- package/dist/cjs/legacy/hooks/auth/useSignOut.js +0 -67
- package/dist/cjs/legacy/hooks/auth/useSignOut.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useSignUpWithEmailAndPassword.d.ts +0 -20
- package/dist/cjs/legacy/hooks/auth/useSignUpWithEmailAndPassword.js +0 -80
- package/dist/cjs/legacy/hooks/auth/useSignUpWithEmailAndPassword.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useVerifyExternalUser.d.ts +0 -8
- package/dist/cjs/legacy/hooks/auth/useVerifyExternalUser.js +0 -70
- package/dist/cjs/legacy/hooks/auth/useVerifyExternalUser.js.map +0 -1
- package/dist/esm/context/lists-context.d.ts +0 -9
- package/dist/esm/context/lists-context.js +0 -10
- package/dist/esm/context/lists-context.js.map +0 -1
- package/dist/esm/context/user-context.d.ts +0 -8
- package/dist/esm/context/user-context.js +0 -21
- package/dist/esm/context/user-context.js.map +0 -1
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsDataRedux.d.ts +0 -21
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsDataRedux.js +0 -103
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsDataRedux.js.map +0 -1
- package/dist/esm/hooks/lists/index.d.ts +0 -10
- package/dist/esm/hooks/lists/index.js +0 -11
- package/dist/esm/hooks/lists/index.js.map +0 -1
- package/dist/esm/hooks/lists/useAddToList.d.ts +0 -6
- package/dist/esm/hooks/lists/useAddToList.js +0 -65
- package/dist/esm/hooks/lists/useAddToList.js.map +0 -1
- package/dist/esm/hooks/lists/useCreateList.d.ts +0 -6
- package/dist/esm/hooks/lists/useCreateList.js +0 -65
- package/dist/esm/hooks/lists/useCreateList.js.map +0 -1
- package/dist/esm/hooks/lists/useDeleteList.d.ts +0 -4
- package/dist/esm/hooks/lists/useDeleteList.js +0 -64
- package/dist/esm/hooks/lists/useDeleteList.js.map +0 -1
- package/dist/esm/hooks/lists/useFetchRootList.d.ts +0 -3
- package/dist/esm/hooks/lists/useFetchRootList.js +0 -64
- package/dist/esm/hooks/lists/useFetchRootList.js.map +0 -1
- package/dist/esm/hooks/lists/useFetchSubLists.d.ts +0 -5
- package/dist/esm/hooks/lists/useFetchSubLists.js +0 -63
- package/dist/esm/hooks/lists/useFetchSubLists.js.map +0 -1
- package/dist/esm/hooks/lists/useIsEntitySaved.d.ts +0 -5
- package/dist/esm/hooks/lists/useIsEntitySaved.js +0 -73
- package/dist/esm/hooks/lists/useIsEntitySaved.js.map +0 -1
- package/dist/esm/hooks/lists/useLists.d.ts +0 -2
- package/dist/esm/hooks/lists/useLists.js +0 -6
- package/dist/esm/hooks/lists/useLists.js.map +0 -1
- package/dist/esm/hooks/lists/useListsData.js +0 -386
- package/dist/esm/hooks/lists/useListsData.js.map +0 -1
- package/dist/esm/hooks/lists/useRemoveFromList.d.ts +0 -6
- package/dist/esm/hooks/lists/useRemoveFromList.js +0 -65
- package/dist/esm/hooks/lists/useRemoveFromList.js.map +0 -1
- package/dist/esm/hooks/lists/useUpdateList.d.ts +0 -8
- package/dist/esm/hooks/lists/useUpdateList.js +0 -65
- package/dist/esm/hooks/lists/useUpdateList.js.map +0 -1
- package/dist/esm/hooks/users/useUser.d.ts +0 -2
- package/dist/esm/hooks/users/useUser.js +0 -6
- package/dist/esm/hooks/users/useUser.js.map +0 -1
- package/dist/esm/hooks/users/useUserData.d.ts +0 -12
- package/dist/esm/hooks/users/useUserData.js +0 -71
- package/dist/esm/hooks/users/useUserData.js.map +0 -1
- package/dist/esm/legacy/context/app-notifications-context.d.ts +0 -8
- package/dist/esm/legacy/context/app-notifications-context.js +0 -21
- package/dist/esm/legacy/context/app-notifications-context.js.map +0 -1
- package/dist/esm/legacy/context/auth-context.d.ts +0 -8
- package/dist/esm/legacy/context/auth-context.js +0 -22
- package/dist/esm/legacy/context/auth-context.js.map +0 -1
- package/dist/esm/legacy/hooks/app-notifications/index.d.ts +0 -5
- package/dist/esm/legacy/hooks/app-notifications/index.js +0 -6
- package/dist/esm/legacy/hooks/app-notifications/index.js.map +0 -1
- package/dist/esm/legacy/hooks/app-notifications/useAppNotifications.d.ts +0 -2
- package/dist/esm/legacy/hooks/app-notifications/useAppNotifications.js +0 -6
- package/dist/esm/legacy/hooks/app-notifications/useAppNotifications.js.map +0 -1
- package/dist/esm/legacy/hooks/app-notifications/useAppNotificationsData.d.ts +0 -16
- package/dist/esm/legacy/hooks/app-notifications/useAppNotificationsData.js +0 -220
- package/dist/esm/legacy/hooks/app-notifications/useAppNotificationsData.js.map +0 -1
- package/dist/esm/legacy/hooks/app-notifications/useCountUnreadNotifications.d.ts +0 -2
- package/dist/esm/legacy/hooks/app-notifications/useCountUnreadNotifications.js +0 -67
- package/dist/esm/legacy/hooks/app-notifications/useCountUnreadNotifications.js.map +0 -1
- package/dist/esm/legacy/hooks/app-notifications/useFetchAppNotifications.d.ts +0 -6
- package/dist/esm/legacy/hooks/app-notifications/useFetchAppNotifications.js +0 -74
- package/dist/esm/legacy/hooks/app-notifications/useFetchAppNotifications.js.map +0 -1
- package/dist/esm/legacy/hooks/app-notifications/useMarkNotificationAsRead.d.ts +0 -2
- package/dist/esm/legacy/hooks/app-notifications/useMarkNotificationAsRead.js +0 -69
- package/dist/esm/legacy/hooks/app-notifications/useMarkNotificationAsRead.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/index.d.ts +0 -8
- package/dist/esm/legacy/hooks/auth/index.js +0 -9
- package/dist/esm/legacy/hooks/auth/index.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useAuth.d.ts +0 -2
- package/dist/esm/legacy/hooks/auth/useAuth.js +0 -6
- package/dist/esm/legacy/hooks/auth/useAuth.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useAuthData.d.ts +0 -41
- package/dist/esm/legacy/hooks/auth/useAuthData.js +0 -266
- package/dist/esm/legacy/hooks/auth/useAuthData.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useChangePassword.d.ts +0 -5
- package/dist/esm/legacy/hooks/auth/useChangePassword.js +0 -65
- package/dist/esm/legacy/hooks/auth/useChangePassword.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useRequestNewAccessToken.d.ts +0 -7
- package/dist/esm/legacy/hooks/auth/useRequestNewAccessToken.js +0 -66
- package/dist/esm/legacy/hooks/auth/useRequestNewAccessToken.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useSignInWithEmailAndPassword.d.ts +0 -9
- package/dist/esm/legacy/hooks/auth/useSignInWithEmailAndPassword.js +0 -67
- package/dist/esm/legacy/hooks/auth/useSignInWithEmailAndPassword.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useSignOut.d.ts +0 -4
- package/dist/esm/legacy/hooks/auth/useSignOut.js +0 -62
- package/dist/esm/legacy/hooks/auth/useSignOut.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useSignUpWithEmailAndPassword.d.ts +0 -20
- package/dist/esm/legacy/hooks/auth/useSignUpWithEmailAndPassword.js +0 -75
- package/dist/esm/legacy/hooks/auth/useSignUpWithEmailAndPassword.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useVerifyExternalUser.d.ts +0 -8
- package/dist/esm/legacy/hooks/auth/useVerifyExternalUser.js +0 -65
- package/dist/esm/legacy/hooks/auth/useVerifyExternalUser.js.map +0 -1
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { useEffect, useMemo, useCallback } from "react";
|
|
38
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
39
|
+
import { setProjectContext, selectCurrentList, selectSubLists, selectListsLoading, selectListHistory, selectSubListCache, selectCurrentProjectId, } from "../../store/slices/listsSlice";
|
|
40
|
+
import { useListsActionsRedux } from "./useListsActionsRedux";
|
|
41
|
+
import useProject from "../projects/useProject";
|
|
42
|
+
import { useUserRedux } from "../auth-redux";
|
|
43
|
+
/**
|
|
44
|
+
* Redux-powered hook that provides the exact same interface as useListsData()
|
|
45
|
+
* This is a drop-in replacement for the Context-based hook
|
|
46
|
+
*/
|
|
47
|
+
function useListsRedux(_) {
|
|
48
|
+
var _this = this;
|
|
49
|
+
if (_ === void 0) { _ = {}; }
|
|
50
|
+
var dispatch = useDispatch();
|
|
51
|
+
// Get external context
|
|
52
|
+
var projectId = useProject().projectId;
|
|
53
|
+
var user = useUserRedux().user;
|
|
54
|
+
// Get Redux state
|
|
55
|
+
var currentList = useSelector(function (state) {
|
|
56
|
+
return selectCurrentList(state);
|
|
57
|
+
});
|
|
58
|
+
var subLists = useSelector(function (state) {
|
|
59
|
+
return selectSubLists(state);
|
|
60
|
+
});
|
|
61
|
+
var loading = useSelector(function (state) {
|
|
62
|
+
return selectListsLoading(state);
|
|
63
|
+
});
|
|
64
|
+
var listHistory = useSelector(function (state) {
|
|
65
|
+
return selectListHistory(state);
|
|
66
|
+
});
|
|
67
|
+
var subListCache = useSelector(function (state) {
|
|
68
|
+
return selectSubListCache(state);
|
|
69
|
+
});
|
|
70
|
+
var currentProjectId = useSelector(function (state) {
|
|
71
|
+
return selectCurrentProjectId(state);
|
|
72
|
+
});
|
|
73
|
+
// Get actions
|
|
74
|
+
var _a = useListsActionsRedux(), openList = _a.openList, goBack = _a.goBack, goToRoot = _a.goToRoot, fetchRootList = _a.fetchRootList, fetchSubLists = _a.fetchSubLists, createListAction = _a.createList, updateListAction = _a.updateList, deleteListAction = _a.deleteList, addToListAction = _a.addToList, removeFromListAction = _a.removeFromList;
|
|
75
|
+
// Update Redux state when project changes
|
|
76
|
+
useEffect(function () {
|
|
77
|
+
if (projectId && projectId !== currentProjectId) {
|
|
78
|
+
dispatch(setProjectContext(projectId));
|
|
79
|
+
}
|
|
80
|
+
}, [dispatch, projectId, currentProjectId]);
|
|
81
|
+
// Fetch root list when user and project are available
|
|
82
|
+
useEffect(function () {
|
|
83
|
+
if (!user || !projectId)
|
|
84
|
+
return;
|
|
85
|
+
fetchRootList(projectId);
|
|
86
|
+
}, [fetchRootList, user, projectId]);
|
|
87
|
+
// Fetch sub-lists when current list changes
|
|
88
|
+
useEffect(function () {
|
|
89
|
+
if (!user || !projectId || !currentList)
|
|
90
|
+
return;
|
|
91
|
+
// Check if sub-lists for this list are already in the cache
|
|
92
|
+
if (subListCache[currentList.id]) {
|
|
93
|
+
return; // No need to fetch, we have cached data
|
|
94
|
+
}
|
|
95
|
+
fetchSubLists(projectId, currentList.id);
|
|
96
|
+
}, [fetchSubLists, user, projectId, currentList, subListCache]);
|
|
97
|
+
// Entity membership checker
|
|
98
|
+
var isEntityInList = useCallback(function (selectedEntityId) {
|
|
99
|
+
if (!currentList)
|
|
100
|
+
return false;
|
|
101
|
+
return currentList.entityIds.some(function (entityId) { return entityId === selectedEntityId; });
|
|
102
|
+
}, [currentList]);
|
|
103
|
+
// Wrapped CRUD operations that match the original interface
|
|
104
|
+
var handleCreateList = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
105
|
+
var listName = _b.listName;
|
|
106
|
+
return __generator(this, function (_c) {
|
|
107
|
+
switch (_c.label) {
|
|
108
|
+
case 0:
|
|
109
|
+
if (!listName) {
|
|
110
|
+
console.error("No listName provided.");
|
|
111
|
+
return [2 /*return*/];
|
|
112
|
+
}
|
|
113
|
+
if (!currentList) {
|
|
114
|
+
console.error("No current list.");
|
|
115
|
+
return [2 /*return*/];
|
|
116
|
+
}
|
|
117
|
+
if (!projectId) {
|
|
118
|
+
console.error("No projectId available.");
|
|
119
|
+
return [2 /*return*/];
|
|
120
|
+
}
|
|
121
|
+
return [4 /*yield*/, createListAction(projectId, currentList.id, listName)];
|
|
122
|
+
case 1:
|
|
123
|
+
_c.sent();
|
|
124
|
+
return [2 /*return*/];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}); }, [createListAction, currentList, projectId]);
|
|
128
|
+
var handleUpdateList = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
129
|
+
var listId = _b.listId, update = _b.update;
|
|
130
|
+
return __generator(this, function (_c) {
|
|
131
|
+
switch (_c.label) {
|
|
132
|
+
case 0:
|
|
133
|
+
if (!projectId) {
|
|
134
|
+
console.error("No projectId available.");
|
|
135
|
+
return [2 /*return*/];
|
|
136
|
+
}
|
|
137
|
+
return [4 /*yield*/, updateListAction(projectId, listId, update)];
|
|
138
|
+
case 1:
|
|
139
|
+
_c.sent();
|
|
140
|
+
return [2 /*return*/];
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}); }, [updateListAction, projectId]);
|
|
144
|
+
var handleDeleteList = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
145
|
+
var list = _b.list;
|
|
146
|
+
return __generator(this, function (_c) {
|
|
147
|
+
switch (_c.label) {
|
|
148
|
+
case 0:
|
|
149
|
+
if (!projectId) {
|
|
150
|
+
console.error("No projectId available.");
|
|
151
|
+
return [2 /*return*/];
|
|
152
|
+
}
|
|
153
|
+
return [4 /*yield*/, deleteListAction(projectId, list)];
|
|
154
|
+
case 1:
|
|
155
|
+
_c.sent();
|
|
156
|
+
return [2 /*return*/];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}); }, [deleteListAction, projectId]);
|
|
160
|
+
var handleAddToList = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
161
|
+
var entityId = _b.entityId;
|
|
162
|
+
return __generator(this, function (_c) {
|
|
163
|
+
switch (_c.label) {
|
|
164
|
+
case 0:
|
|
165
|
+
if (!entityId) {
|
|
166
|
+
console.error("No entityId provided.");
|
|
167
|
+
return [2 /*return*/];
|
|
168
|
+
}
|
|
169
|
+
if (!currentList) {
|
|
170
|
+
console.error("No current list.");
|
|
171
|
+
return [2 /*return*/];
|
|
172
|
+
}
|
|
173
|
+
if (!projectId) {
|
|
174
|
+
console.error("No projectId available.");
|
|
175
|
+
return [2 /*return*/];
|
|
176
|
+
}
|
|
177
|
+
return [4 /*yield*/, addToListAction(projectId, currentList.id, entityId)];
|
|
178
|
+
case 1:
|
|
179
|
+
_c.sent();
|
|
180
|
+
return [2 /*return*/];
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}); }, [addToListAction, currentList, projectId]);
|
|
184
|
+
var handleRemoveFromList = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
185
|
+
var entityId = _b.entityId;
|
|
186
|
+
return __generator(this, function (_c) {
|
|
187
|
+
switch (_c.label) {
|
|
188
|
+
case 0:
|
|
189
|
+
if (!currentList) {
|
|
190
|
+
console.error("No current list.");
|
|
191
|
+
return [2 /*return*/];
|
|
192
|
+
}
|
|
193
|
+
if (!projectId) {
|
|
194
|
+
console.error("No projectId available.");
|
|
195
|
+
return [2 /*return*/];
|
|
196
|
+
}
|
|
197
|
+
return [4 /*yield*/, removeFromListAction(projectId, currentList.id, entityId)];
|
|
198
|
+
case 1:
|
|
199
|
+
_c.sent();
|
|
200
|
+
return [2 /*return*/];
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}); }, [removeFromListAction, currentList, projectId]);
|
|
204
|
+
// Return the same interface as the original hook
|
|
205
|
+
return useMemo(function () { return ({
|
|
206
|
+
currentList: currentList,
|
|
207
|
+
subLists: subLists,
|
|
208
|
+
loading: loading,
|
|
209
|
+
openList: openList,
|
|
210
|
+
goBack: goBack,
|
|
211
|
+
goToRoot: goToRoot,
|
|
212
|
+
isEntityInList: isEntityInList,
|
|
213
|
+
createList: handleCreateList,
|
|
214
|
+
updateList: handleUpdateList,
|
|
215
|
+
deleteList: handleDeleteList,
|
|
216
|
+
addToList: handleAddToList,
|
|
217
|
+
removeFromList: handleRemoveFromList,
|
|
218
|
+
}); }, [
|
|
219
|
+
currentList,
|
|
220
|
+
subLists,
|
|
221
|
+
loading,
|
|
222
|
+
openList,
|
|
223
|
+
goBack,
|
|
224
|
+
goToRoot,
|
|
225
|
+
isEntityInList,
|
|
226
|
+
handleCreateList,
|
|
227
|
+
handleUpdateList,
|
|
228
|
+
handleDeleteList,
|
|
229
|
+
handleAddToList,
|
|
230
|
+
handleRemoveFromList,
|
|
231
|
+
]);
|
|
232
|
+
}
|
|
233
|
+
export default useListsRedux;
|
|
234
|
+
//# sourceMappingURL=useListsRedux.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useListsRedux.js","sourceRoot":"","sources":["../../../../src/hooks/lists-redux/useListsRedux.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGvD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,GAEvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA0B7C;;;GAGG;AACH,SAAS,aAAa,CAAC,CAA0B;IAAjD,iBAuMC;IAvMsB,kBAAA,EAAA,MAA0B;IAC/C,IAAM,QAAQ,GAAG,WAAW,EAAe,CAAC;IAE5C,uBAAuB;IACf,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,YAAY,EAAE,KAAnB,CAAoB;IAEhC,kBAAkB;IAClB,IAAM,WAAW,GAAG,WAAW,CAAC,UAAC,KAAgB;QAC/C,OAAA,iBAAiB,CAAC,KAAK,CAAC;IAAxB,CAAwB,CACzB,CAA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"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,OAAO,IAAI,YAAY,GAGxB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type UpdateUserParams } from "../../store/api/userApi";
|
|
2
|
+
/**
|
|
3
|
+
* Redux-powered hook that provides current user management actions
|
|
4
|
+
* Focused on current user operations only
|
|
5
|
+
*/
|
|
6
|
+
export declare function useUserActionsRedux(): {
|
|
7
|
+
setUser: (user: any) => void;
|
|
8
|
+
clearUser: () => void;
|
|
9
|
+
updateUser: (projectId: string, userId: string, update: UpdateUserParams, currentUser?: any) => Promise<import("../..").AuthUser>;
|
|
10
|
+
clearError: () => void;
|
|
11
|
+
};
|
|
12
|
+
export default useUserActionsRedux;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { useCallback } from "react";
|
|
38
|
+
import { useDispatch } from "react-redux";
|
|
39
|
+
import { setUser, clearUser, setUpdating, setError, clearError, updateUserOptimistic, } from "../../store/slices/userSlice";
|
|
40
|
+
import { useUpdateUserMutation, } from "../../store/api/userApi";
|
|
41
|
+
/**
|
|
42
|
+
* Redux-powered hook that provides current user management actions
|
|
43
|
+
* Focused on current user operations only
|
|
44
|
+
*/
|
|
45
|
+
export function useUserActionsRedux() {
|
|
46
|
+
var _this = this;
|
|
47
|
+
var dispatch = useDispatch();
|
|
48
|
+
// RTK Query mutations for current user
|
|
49
|
+
var updateUserMutation = useUpdateUserMutation()[0];
|
|
50
|
+
// User data management actions
|
|
51
|
+
var handleSetUser = useCallback(function (user) {
|
|
52
|
+
dispatch(setUser(user));
|
|
53
|
+
dispatch(clearError());
|
|
54
|
+
}, [dispatch]);
|
|
55
|
+
var handleClearUser = useCallback(function () {
|
|
56
|
+
dispatch(clearUser());
|
|
57
|
+
dispatch(clearError());
|
|
58
|
+
}, [dispatch]);
|
|
59
|
+
// Update user with optimistic updates for instant UI feedback
|
|
60
|
+
var updateUser = useCallback(function (projectId, userId, update, currentUser) { return __awaiter(_this, void 0, void 0, function () {
|
|
61
|
+
var originalUser, result, error_1, errorMessage;
|
|
62
|
+
return __generator(this, function (_a) {
|
|
63
|
+
switch (_a.label) {
|
|
64
|
+
case 0:
|
|
65
|
+
if (!projectId || !userId) {
|
|
66
|
+
throw new Error("Project ID and User ID are required");
|
|
67
|
+
}
|
|
68
|
+
dispatch(setUpdating(true));
|
|
69
|
+
dispatch(clearError());
|
|
70
|
+
originalUser = currentUser;
|
|
71
|
+
// OPTIMISTIC UPDATE: Apply changes immediately for instant UI feedback
|
|
72
|
+
dispatch(updateUserOptimistic(update));
|
|
73
|
+
_a.label = 1;
|
|
74
|
+
case 1:
|
|
75
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
76
|
+
return [4 /*yield*/, updateUserMutation({
|
|
77
|
+
projectId: projectId,
|
|
78
|
+
userId: userId,
|
|
79
|
+
update: update
|
|
80
|
+
}).unwrap()];
|
|
81
|
+
case 2:
|
|
82
|
+
result = _a.sent();
|
|
83
|
+
// Replace optimistic update with real server data
|
|
84
|
+
dispatch(setUser(result));
|
|
85
|
+
return [2 /*return*/, result];
|
|
86
|
+
case 3:
|
|
87
|
+
error_1 = _a.sent();
|
|
88
|
+
// REVERT OPTIMISTIC UPDATE: Restore original user state on API failure
|
|
89
|
+
if (originalUser) {
|
|
90
|
+
dispatch(setUser(originalUser));
|
|
91
|
+
}
|
|
92
|
+
errorMessage = error_1 instanceof Error ? error_1.message : 'Failed to update user';
|
|
93
|
+
dispatch(setError(errorMessage));
|
|
94
|
+
throw error_1;
|
|
95
|
+
case 4:
|
|
96
|
+
dispatch(setUpdating(false));
|
|
97
|
+
return [7 /*endfinally*/];
|
|
98
|
+
case 5: return [2 /*return*/];
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}); }, [updateUserMutation, dispatch]);
|
|
102
|
+
// Removed other-user methods - use existing legacy hooks instead:
|
|
103
|
+
// - useFetchUser
|
|
104
|
+
// - useFetchUserByForeignId
|
|
105
|
+
// - useCheckUsernameAvailability
|
|
106
|
+
// - useFetchUserSuggestions
|
|
107
|
+
// Error handling actions
|
|
108
|
+
var clearUserError = useCallback(function () {
|
|
109
|
+
dispatch(clearError());
|
|
110
|
+
}, [dispatch]);
|
|
111
|
+
return {
|
|
112
|
+
// Current user data management
|
|
113
|
+
setUser: handleSetUser,
|
|
114
|
+
clearUser: handleClearUser,
|
|
115
|
+
// Current user operations
|
|
116
|
+
updateUser: updateUser,
|
|
117
|
+
// Error handling
|
|
118
|
+
clearError: clearUserError,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
export default useUserActionsRedux;
|
|
122
|
+
//# sourceMappingURL=useUserActionsRedux.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUserActionsRedux.js","sourceRoot":"","sources":["../../../../src/hooks/user-redux/useUserActionsRedux.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EACL,OAAO,E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C,CAAC,MAAM,EAAE,EAAA;;oBAJL,MAAM,GAAG,SAIJ;oBAEX,kDAAkD;oBAClD,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC1B,sBAAO,MAAM,EAAC;;;oBAEd,uEAAuE;oBACvE,IAAI,YAAY,EAAE,CAAC;wBACjB,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;oBAClC,CAAC;oBAEK,YAAY,GAAG,OAAK,YAAY,KAAK,CAAC,CAAC,CAAC,OAAK,CAAC,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC;oBACtF,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;oBACjC,MAAM,OAAK,CAAC;;oBAEZ,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;;;;;SAEhC,EACD,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAC/B,CAAC;IAEF,kEAAkE;IAClE,iBAAiB;IACjB,4BAA4B;IAC5B,mCAAmC;IACnC,4BAA4B;IAE5B,yBAAyB;IACzB,IAAM,cAAc,GAAG,WAAW,CAAC;QACjC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IACzB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO;QACL,+BAA+B;QAC/B,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,eAAe;QAE1B,0BAA0B;QAC1B,UAAU,YAAA;QAEV,iBAAiB;QACjB,UAAU,EAAE,cAAc;KAC3B,CAAC;AACJ,CAAC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AuthUser } from "../../interfaces/models/User";
|
|
2
|
+
import type { UpdateUserParams } from "../../store/api/userApi";
|
|
3
|
+
export interface UseUserReduxProps {
|
|
4
|
+
}
|
|
5
|
+
export interface UseUserReduxValues {
|
|
6
|
+
user: AuthUser | null;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
updating: boolean;
|
|
9
|
+
error: string | null;
|
|
10
|
+
updateUser: (update: UpdateUserParams) => Promise<AuthUser>;
|
|
11
|
+
clearError: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Redux-powered hook that provides comprehensive user management
|
|
15
|
+
* This replaces useUserData and provides the same interface with Redux state management
|
|
16
|
+
*/
|
|
17
|
+
declare function useUserRedux(_?: UseUserReduxProps): UseUserReduxValues;
|
|
18
|
+
export default useUserRedux;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { useEffect, useMemo, useCallback } from "react";
|
|
38
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
39
|
+
import { setProjectContext, selectUser, selectUserLoading, selectUserUpdating, selectCurrentProjectId, selectUserError, } from "../../store/slices/userSlice";
|
|
40
|
+
import { useUserActionsRedux } from "./useUserActionsRedux";
|
|
41
|
+
import useProject from "../projects/useProject";
|
|
42
|
+
import { selectUser as selectAuthUser } from "../../store/slices/authSlice";
|
|
43
|
+
/**
|
|
44
|
+
* Redux-powered hook that provides comprehensive user management
|
|
45
|
+
* This replaces useUserData and provides the same interface with Redux state management
|
|
46
|
+
*/
|
|
47
|
+
function useUserRedux(_) {
|
|
48
|
+
var _this = this;
|
|
49
|
+
if (_ === void 0) { _ = {}; }
|
|
50
|
+
var dispatch = useDispatch();
|
|
51
|
+
// Get external context
|
|
52
|
+
var projectId = useProject().projectId;
|
|
53
|
+
// Get Redux state
|
|
54
|
+
var user = useSelector(function (state) { return selectUser(state); });
|
|
55
|
+
var authUser = useSelector(function (state) { return selectAuthUser(state); }); // Fallback to auth user
|
|
56
|
+
var loading = useSelector(function (state) { return selectUserLoading(state); });
|
|
57
|
+
var updating = useSelector(function (state) { return selectUserUpdating(state); });
|
|
58
|
+
var error = useSelector(function (state) { return selectUserError(state); });
|
|
59
|
+
var currentProjectId = useSelector(function (state) { return selectCurrentProjectId(state); });
|
|
60
|
+
// Get actions
|
|
61
|
+
var _a = useUserActionsRedux(), setUser = _a.setUser, updateUserAction = _a.updateUser, clearError = _a.clearError;
|
|
62
|
+
// Update Redux state when project changes
|
|
63
|
+
useEffect(function () {
|
|
64
|
+
if (projectId && projectId !== currentProjectId) {
|
|
65
|
+
dispatch(setProjectContext(projectId));
|
|
66
|
+
}
|
|
67
|
+
}, [dispatch, projectId, currentProjectId]);
|
|
68
|
+
// Sync auth user to user slice when auth user changes and we don't have a user yet
|
|
69
|
+
useEffect(function () {
|
|
70
|
+
if (authUser && !user) {
|
|
71
|
+
setUser(authUser);
|
|
72
|
+
}
|
|
73
|
+
}, [authUser, user, setUser]);
|
|
74
|
+
// Current user operations with projectId included automatically
|
|
75
|
+
var handleUpdateUser = useCallback(function (update) { return __awaiter(_this, void 0, void 0, function () {
|
|
76
|
+
return __generator(this, function (_a) {
|
|
77
|
+
switch (_a.label) {
|
|
78
|
+
case 0:
|
|
79
|
+
if (!user) {
|
|
80
|
+
throw new Error("No user available to update");
|
|
81
|
+
}
|
|
82
|
+
if (!projectId) {
|
|
83
|
+
throw new Error("No projectId available");
|
|
84
|
+
}
|
|
85
|
+
return [4 /*yield*/, updateUserAction(projectId, user.id, update, user)];
|
|
86
|
+
case 1:
|
|
87
|
+
// Pass current user for optimistic update reversion if needed
|
|
88
|
+
return [2 /*return*/, _a.sent()];
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}); }, [updateUserAction, user, projectId]);
|
|
92
|
+
// Return focused interface for current user management
|
|
93
|
+
return useMemo(function () { return ({
|
|
94
|
+
user: user || authUser, // Fallback to auth user if user slice is empty
|
|
95
|
+
loading: loading,
|
|
96
|
+
updating: updating,
|
|
97
|
+
error: error,
|
|
98
|
+
updateUser: handleUpdateUser,
|
|
99
|
+
clearError: clearError,
|
|
100
|
+
}); }, [
|
|
101
|
+
user,
|
|
102
|
+
authUser,
|
|
103
|
+
loading,
|
|
104
|
+
updating,
|
|
105
|
+
error,
|
|
106
|
+
handleUpdateUser,
|
|
107
|
+
clearError,
|
|
108
|
+
]);
|
|
109
|
+
}
|
|
110
|
+
export default useUserRedux;
|
|
111
|
+
//# sourceMappingURL=useUserRedux.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUserRedux.js","sourceRoot":"","sources":["../../../../src/hooks/user-redux/useUserRedux.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGvD,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAmB5E;;;GAGG;AACH,SAAS,YAAY,CAAC,CAAyB;IAA/C,iBA0EC;IA1EqB,kBAAA,EAAA,MAAyB;IAC7C,IAAM,QAAQ,GAAG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AAO,CAAC,QAAQ,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAE9B,gEAAgE;IAChE,IAAM,gBAAgB,GAAG,WAAW,CAClC,UAAO,MAAwB;;;;oBAC7B,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;oBACjD,CAAC;oBAED,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;oBAC5C,CAAC;oBAGM,qBAAM,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAA;;gBAD/D,8DAA8D;gBAC9D,sBAAO,SAAwD,EAAC;;;SACjE,EACD,CAAC,gBAAgB,EAAE,IAAI,EAAE,SAAS,CAAC,CACpC,CAAC;IAEF,uDAAuD;IACvD,OAAO,OAAO,CACZ,cAAM,OAAA,CAAC;QACL,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,+CAA+C;QACvE,OAAO,SAAA;QACP,QAAQ,UAAA;QACR,KAAK,OAAA;QAEL,UAAU,EAAE,gBAAgB;QAE5B,UAAU,YAAA;KACX,CAAC,EATI,CASJ,EACF;QACE,IAAI;QACJ,QAAQ;QACR,OAAO;QACP,QAAQ;QACR,KAAK;QACL,gBAAgB;QAChB,UAAU;KACX,CACF,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { default as useUser } from "./useUser";
|
|
2
|
-
export { default as useUserData } from "./useUserData";
|
|
3
1
|
export { default as useFetchUser } from "./useFetchUser";
|
|
4
2
|
export { default as useFetchUserByForeignId } from "./useFetchUserByForeignId";
|
|
5
3
|
export { default as useFetchUserFollowersCount } from "./useFetchUserFollowersCount";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as
|
|
1
|
+
// Legacy hooks moved to legacy folder
|
|
2
|
+
// export { default as useUser } from "./useUser";
|
|
3
|
+
// export { default as useUserData } from "./useUserData";
|
|
3
4
|
export { default as useFetchUser } from "./useFetchUser";
|
|
4
5
|
export { default as useFetchUserByForeignId } from "./useFetchUserByForeignId";
|
|
5
6
|
export { default as useFetchUserFollowersCount } from "./useFetchUserFollowersCount";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/users/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/users/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,kDAAkD;AAClD,0DAA0D;AAC1D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -4,17 +4,18 @@ export { getUserName } from "./helpers/getUserName";
|
|
|
4
4
|
export { default as getPublicFileUrl } from "./helpers/getPublicFileUrl";
|
|
5
5
|
export { reportReasons } from "./constants/reportReasons";
|
|
6
6
|
export type { ReportReasonKey } from "./constants/reportReasons";
|
|
7
|
-
export { ReplykeProvider, // Always includes Redux
|
|
7
|
+
export { ReplykeProvider, // Always includes Redux
|
|
8
8
|
ReplykeStoreProvider, // Advanced: standalone Redux provider
|
|
9
|
-
EntityListProvider, EntityProvider,
|
|
9
|
+
EntityListProvider, EntityProvider, CommentSectionProvider, } from "./context";
|
|
10
10
|
export { useProject, useProjectData } from "./hooks/projects";
|
|
11
11
|
export { useSignTestingJwt } from "./hooks/crypto";
|
|
12
|
-
export { useAuthRedux,
|
|
13
|
-
export { useAppNotificationsRedux,
|
|
12
|
+
export { useAuthRedux, type UseAuthReduxValues } from "./hooks/auth-redux";
|
|
13
|
+
export { useAppNotificationsRedux, useAppNotificationsActionsRedux, type UseAppNotificationsReduxProps, type UseAppNotificationsReduxValues, } from "./hooks/app-notifications-redux";
|
|
14
|
+
export { useListsRedux, useListsActionsRedux, type UseListsReduxProps, type UseListsReduxValues, } from "./hooks/lists-redux";
|
|
15
|
+
export { useUserRedux, useUserActionsRedux, type UseUserReduxProps, type UseUserReduxValues, } from "./hooks/user-redux";
|
|
14
16
|
export { useEntity, useEntityData, useCreateEntity, useFetchEntity, useFetchEntityByForeignId, useFetchEntityByShortId, useUpdateEntity, useEntityVotes, useDeleteEntity, useEntityList, useEntityListData, useInfusedData, } from "./hooks/entities";
|
|
15
17
|
export { useCommentSection, useCommentSectionData, useCreateComment, useFetchManyComments, useFetchComment, useFetchCommentByForeignId, useReplies, useUpdateComment, useCommentVotes, useDeleteComment, useEntityComments, useProfileComments, } from "./hooks/comments";
|
|
16
|
-
export {
|
|
17
|
-
export { useUserData, useFetchUser, useFetchUserByForeignId, useFetchUserFollowersCount, useFetchUserFollowingCount, useCheckUsernameAvailability, useFetchUserSuggestions, useMentions, useUpdateUser, useFetchFollow, useFollowUser, useUnfollowUser, } from "./hooks/users";
|
|
18
|
+
export { useFetchUser, useFetchUserByForeignId, useFetchUserFollowersCount, useFetchUserFollowingCount, useCheckUsernameAvailability, useFetchUserSuggestions, useMentions, useUpdateUser, useFetchFollow, useFollowUser, useUnfollowUser, } from "./hooks/users";
|
|
18
19
|
export { useCreateReport } from "./hooks/reports";
|
|
19
20
|
export { useGetMetadata } from "./hooks/utils";
|
|
20
21
|
export { useUploadFile } from "./hooks/storage";
|
package/dist/esm/index.js
CHANGED
|
@@ -6,25 +6,27 @@ export { default as getPublicFileUrl } from "./helpers/getPublicFileUrl";
|
|
|
6
6
|
// Constants
|
|
7
7
|
export { reportReasons } from "./constants/reportReasons";
|
|
8
8
|
// Context providers (Redux-powered by default)
|
|
9
|
-
export { ReplykeProvider, // Always includes Redux
|
|
9
|
+
export { ReplykeProvider, // Always includes Redux
|
|
10
10
|
ReplykeStoreProvider, // Advanced: standalone Redux provider
|
|
11
|
-
EntityListProvider, EntityProvider,
|
|
11
|
+
EntityListProvider, EntityProvider, CommentSectionProvider, } from "./context";
|
|
12
12
|
// -- projects
|
|
13
13
|
export { useProject, useProjectData } from "./hooks/projects";
|
|
14
14
|
// -- crypto
|
|
15
15
|
export { useSignTestingJwt } from "./hooks/crypto";
|
|
16
16
|
// -- authentication (Redux-powered)
|
|
17
|
-
export { useAuthRedux
|
|
17
|
+
export { useAuthRedux } from "./hooks/auth-redux";
|
|
18
18
|
// -- app notifications (Redux-powered)
|
|
19
|
-
export { useAppNotificationsRedux,
|
|
19
|
+
export { useAppNotificationsRedux, useAppNotificationsActionsRedux, } from "./hooks/app-notifications-redux";
|
|
20
|
+
// -- lists (Redux-powered)
|
|
21
|
+
export { useListsRedux, useListsActionsRedux, } from "./hooks/lists-redux";
|
|
22
|
+
// -- (current) user (Redux-powered)
|
|
23
|
+
export { useUserRedux, useUserActionsRedux, } from "./hooks/user-redux";
|
|
20
24
|
// -- entities
|
|
21
25
|
export { useEntity, useEntityData, useCreateEntity, useFetchEntity, useFetchEntityByForeignId, useFetchEntityByShortId, useUpdateEntity, useEntityVotes, useDeleteEntity, useEntityList, useEntityListData, useInfusedData, } from "./hooks/entities";
|
|
22
26
|
// -- comments
|
|
23
27
|
export { useCommentSection, useCommentSectionData, useCreateComment, useFetchManyComments, useFetchComment, useFetchCommentByForeignId, useReplies, useUpdateComment, useCommentVotes, useDeleteComment, useEntityComments, useProfileComments, } from "./hooks/comments";
|
|
24
|
-
// -- lists
|
|
25
|
-
export { useLists, useListsData, useCreateList, useFetchRootList, useFetchSubLists, useIsEntitySaved, useUpdateList, useAddToList, useRemoveFromList, useDeleteList, } from "./hooks/lists";
|
|
26
28
|
// -- users
|
|
27
|
-
export {
|
|
29
|
+
export { useFetchUser, useFetchUserByForeignId, useFetchUserFollowersCount, useFetchUserFollowingCount, useCheckUsernameAvailability, useFetchUserSuggestions, useMentions, useUpdateUser, useFetchFollow, useFollowUser, useUnfollowUser, } from "./hooks/users";
|
|
28
30
|
// -- reports
|
|
29
31
|
export { useCreateReport } from "./hooks/reports";
|
|
30
32
|
// -- general
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEzE,YAAY;AACZ,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,+CAA+C;AAC/C,OAAO,EACL,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA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