@replyke/core 5.1.5 → 5.1.6-beta.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.
- package/dist/cjs/config/useAxiosPrivate.js +2 -5
- package/dist/cjs/config/useAxiosPrivate.js.map +1 -1
- package/dist/cjs/context/index.d.ts +1 -2
- package/dist/cjs/context/index.js +3 -5
- package/dist/cjs/context/index.js.map +1 -1
- package/dist/cjs/context/replyke-context.js +2 -2
- package/dist/cjs/context/replyke-context.js.map +1 -1
- package/dist/cjs/context/replyke-store-context.d.ts +13 -0
- package/dist/cjs/context/replyke-store-context.js +37 -0
- package/dist/cjs/context/replyke-store-context.js.map +1 -0
- package/dist/cjs/helpers/addNotificationsMessages.js +7 -9
- package/dist/cjs/helpers/addNotificationsMessages.js.map +1 -1
- package/dist/cjs/hooks/app-notifications-redux/index.d.ts +4 -0
- package/dist/cjs/hooks/app-notifications-redux/index.js +14 -0
- package/dist/cjs/hooks/app-notifications-redux/index.js.map +1 -0
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsActionsRedux.d.ts +13 -0
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsActionsRedux.js +266 -0
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsActionsRedux.js.map +1 -0
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsDataRedux.d.ts +21 -0
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsDataRedux.js +108 -0
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsDataRedux.js.map +1 -0
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsRedux.d.ts +7 -0
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsRedux.js +38 -0
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsRedux.js.map +1 -0
- package/dist/cjs/hooks/auth-redux/index.d.ts +2 -0
- package/dist/cjs/hooks/auth-redux/index.js +11 -0
- package/dist/cjs/hooks/auth-redux/index.js.map +1 -0
- package/dist/cjs/hooks/auth-redux/useAuthRedux.d.ts +32 -0
- package/dist/cjs/hooks/auth-redux/useAuthRedux.js +180 -0
- package/dist/cjs/hooks/auth-redux/useAuthRedux.js.map +1 -0
- package/dist/cjs/hooks/auth-redux/useUserRedux.d.ts +6 -0
- package/dist/cjs/hooks/auth-redux/useUserRedux.js +20 -0
- package/dist/cjs/hooks/auth-redux/useUserRedux.js.map +1 -0
- package/dist/cjs/hooks/comments/useCommentSectionData.js +2 -2
- package/dist/cjs/hooks/comments/useCommentSectionData.js.map +1 -1
- package/dist/cjs/hooks/comments/useCommentVotes.js +2 -2
- package/dist/cjs/hooks/comments/useCommentVotes.js.map +1 -1
- package/dist/cjs/hooks/comments/useCreateComment.js +2 -2
- package/dist/cjs/hooks/comments/useCreateComment.js.map +1 -1
- package/dist/cjs/hooks/entities/useEntityData.js +2 -2
- package/dist/cjs/hooks/entities/useEntityData.js.map +1 -1
- package/dist/cjs/hooks/entities/useEntityVotes.js +2 -2
- package/dist/cjs/hooks/entities/useEntityVotes.js.map +1 -1
- package/dist/cjs/hooks/lists/useIsEntitySaved.js +2 -2
- package/dist/cjs/hooks/lists/useIsEntitySaved.js.map +1 -1
- package/dist/cjs/hooks/lists/useListsData.js +2 -2
- package/dist/cjs/hooks/lists/useListsData.js.map +1 -1
- package/dist/cjs/hooks/reports/useCreateReport.js +2 -2
- package/dist/cjs/hooks/reports/useCreateReport.js.map +1 -1
- package/dist/cjs/hooks/users/follows/useFetchFollow.js +2 -2
- package/dist/cjs/hooks/users/follows/useFetchFollow.js.map +1 -1
- package/dist/cjs/hooks/users/follows/useUnfollowUser.js +2 -2
- package/dist/cjs/hooks/users/follows/useUnfollowUser.js.map +1 -1
- package/dist/cjs/index.d.ts +6 -4
- package/dist/cjs/index.js +12 -22
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces/models/AppNotification.d.ts +1 -1
- package/dist/cjs/legacy/context/app-notifications-context.js.map +1 -0
- package/dist/cjs/{context → legacy/context}/auth-context.js +1 -1
- package/dist/cjs/legacy/context/auth-context.js.map +1 -0
- package/dist/cjs/legacy/hooks/app-notifications/index.js.map +1 -0
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotifications.js.map +1 -0
- package/dist/{esm → cjs/legacy}/hooks/app-notifications/useAppNotificationsData.d.ts +1 -1
- package/dist/cjs/{hooks → legacy/hooks}/app-notifications/useAppNotificationsData.js +2 -2
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotificationsData.js.map +1 -0
- package/dist/cjs/{hooks → legacy/hooks}/app-notifications/useCountUnreadNotifications.js +4 -4
- package/dist/cjs/legacy/hooks/app-notifications/useCountUnreadNotifications.js.map +1 -0
- package/dist/cjs/{hooks → legacy/hooks}/app-notifications/useFetchAppNotifications.d.ts +1 -1
- package/dist/cjs/{hooks → legacy/hooks}/app-notifications/useFetchAppNotifications.js +4 -4
- package/dist/cjs/legacy/hooks/app-notifications/useFetchAppNotifications.js.map +1 -0
- package/dist/cjs/{hooks → legacy/hooks}/app-notifications/useMarkNotificationAsRead.js +4 -4
- package/dist/cjs/legacy/hooks/app-notifications/useMarkNotificationAsRead.js.map +1 -0
- package/dist/cjs/legacy/hooks/auth/index.js.map +1 -0
- package/dist/cjs/legacy/hooks/auth/useAuth.js.map +1 -0
- package/dist/cjs/{hooks → legacy/hooks}/auth/useAuthData.d.ts +1 -1
- package/dist/cjs/{hooks → legacy/hooks}/auth/useAuthData.js +2 -2
- package/dist/cjs/legacy/hooks/auth/useAuthData.js.map +1 -0
- package/dist/cjs/{hooks → legacy/hooks}/auth/useChangePassword.js +3 -3
- package/dist/cjs/legacy/hooks/auth/useChangePassword.js.map +1 -0
- package/dist/cjs/{hooks → legacy/hooks}/auth/useRequestNewAccessToken.js +3 -3
- package/dist/cjs/legacy/hooks/auth/useRequestNewAccessToken.js.map +1 -0
- package/dist/cjs/{hooks → legacy/hooks}/auth/useSignInWithEmailAndPassword.js +3 -3
- package/dist/cjs/legacy/hooks/auth/useSignInWithEmailAndPassword.js.map +1 -0
- package/dist/cjs/{hooks → legacy/hooks}/auth/useSignOut.js +3 -3
- package/dist/cjs/legacy/hooks/auth/useSignOut.js.map +1 -0
- package/dist/cjs/{hooks → legacy/hooks}/auth/useSignUpWithEmailAndPassword.js +3 -3
- package/dist/cjs/legacy/hooks/auth/useSignUpWithEmailAndPassword.js.map +1 -0
- package/dist/cjs/{hooks → legacy/hooks}/auth/useVerifyExternalUser.js +2 -2
- package/dist/cjs/legacy/hooks/auth/useVerifyExternalUser.js.map +1 -0
- package/dist/cjs/store/api/appNotificationsApi.d.ts +2021 -0
- package/dist/cjs/store/api/appNotificationsApi.js +213 -0
- package/dist/cjs/store/api/appNotificationsApi.js.map +1 -0
- package/dist/cjs/store/api/baseApi.d.ts +1 -0
- package/dist/cjs/store/api/baseApi.js +42 -0
- package/dist/cjs/store/api/baseApi.js.map +1 -0
- package/dist/cjs/store/api/index.d.ts +2 -0
- package/dist/cjs/store/api/index.js +27 -0
- package/dist/cjs/store/api/index.js.map +1 -0
- package/dist/cjs/store/index.d.ts +15 -0
- package/dist/cjs/store/index.js +72 -0
- package/dist/cjs/store/index.js.map +1 -0
- package/dist/cjs/store/middleware.d.ts +4 -0
- package/dist/cjs/store/middleware.js +42 -0
- package/dist/cjs/store/middleware.js.map +1 -0
- package/dist/cjs/store/rootReducer.d.ts +10 -0
- package/dist/cjs/store/rootReducer.js +20 -0
- package/dist/cjs/store/rootReducer.js.map +1 -0
- package/dist/cjs/store/slices/appNotificationsSlice.d.ts +58 -0
- package/dist/cjs/store/slices/appNotificationsSlice.js +135 -0
- package/dist/cjs/store/slices/appNotificationsSlice.js.map +1 -0
- package/dist/cjs/store/slices/authSlice.d.ts +24 -0
- package/dist/cjs/store/slices/authSlice.js +79 -0
- package/dist/cjs/store/slices/authSlice.js.map +1 -0
- package/dist/cjs/store/slices/authThunks.d.ts +40 -0
- package/dist/cjs/store/slices/authThunks.js +357 -0
- package/dist/cjs/store/slices/authThunks.js.map +1 -0
- package/dist/cjs/store/slices/index.d.ts +1 -0
- package/dist/cjs/store/slices/index.js +23 -0
- package/dist/cjs/store/slices/index.js.map +1 -0
- package/dist/cjs/store/types/index.d.ts +8 -0
- package/dist/cjs/store/types/index.js +3 -0
- package/dist/cjs/store/types/index.js.map +1 -0
- package/dist/esm/config/useAxiosPrivate.js +2 -2
- package/dist/esm/config/useAxiosPrivate.js.map +1 -1
- package/dist/esm/context/index.d.ts +1 -2
- package/dist/esm/context/index.js +1 -2
- package/dist/esm/context/index.js.map +1 -1
- package/dist/esm/context/replyke-context.js +2 -2
- package/dist/esm/context/replyke-context.js.map +1 -1
- package/dist/esm/context/replyke-store-context.d.ts +13 -0
- package/dist/esm/context/replyke-store-context.js +33 -0
- package/dist/esm/context/replyke-store-context.js.map +1 -0
- package/dist/esm/helpers/addNotificationsMessages.js +7 -9
- package/dist/esm/helpers/addNotificationsMessages.js.map +1 -1
- package/dist/esm/hooks/app-notifications-redux/index.d.ts +4 -0
- package/dist/esm/hooks/app-notifications-redux/index.js +5 -0
- package/dist/esm/hooks/app-notifications-redux/index.js.map +1 -0
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsActionsRedux.d.ts +13 -0
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsActionsRedux.js +260 -0
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsActionsRedux.js.map +1 -0
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsDataRedux.d.ts +21 -0
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsDataRedux.js +103 -0
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsDataRedux.js.map +1 -0
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsRedux.d.ts +7 -0
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsRedux.js +35 -0
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsRedux.js.map +1 -0
- package/dist/esm/hooks/auth-redux/index.d.ts +2 -0
- package/dist/esm/hooks/auth-redux/index.js +3 -0
- package/dist/esm/hooks/auth-redux/index.js.map +1 -0
- package/dist/esm/hooks/auth-redux/useAuthRedux.d.ts +32 -0
- package/dist/esm/hooks/auth-redux/useAuthRedux.js +174 -0
- package/dist/esm/hooks/auth-redux/useAuthRedux.js.map +1 -0
- package/dist/esm/hooks/auth-redux/useUserRedux.d.ts +6 -0
- package/dist/esm/hooks/auth-redux/useUserRedux.js +17 -0
- package/dist/esm/hooks/auth-redux/useUserRedux.js.map +1 -0
- package/dist/esm/hooks/comments/useCommentSectionData.js +2 -2
- package/dist/esm/hooks/comments/useCommentSectionData.js.map +1 -1
- package/dist/esm/hooks/comments/useCommentVotes.js +2 -2
- package/dist/esm/hooks/comments/useCommentVotes.js.map +1 -1
- package/dist/esm/hooks/comments/useCreateComment.js +2 -2
- package/dist/esm/hooks/comments/useCreateComment.js.map +1 -1
- package/dist/esm/hooks/entities/useEntityData.js +2 -2
- package/dist/esm/hooks/entities/useEntityData.js.map +1 -1
- package/dist/esm/hooks/entities/useEntityVotes.js +2 -2
- package/dist/esm/hooks/entities/useEntityVotes.js.map +1 -1
- package/dist/esm/hooks/lists/useIsEntitySaved.js +2 -2
- package/dist/esm/hooks/lists/useIsEntitySaved.js.map +1 -1
- package/dist/esm/hooks/lists/useListsData.js +2 -2
- package/dist/esm/hooks/lists/useListsData.js.map +1 -1
- package/dist/esm/hooks/reports/useCreateReport.js +2 -2
- package/dist/esm/hooks/reports/useCreateReport.js.map +1 -1
- package/dist/esm/hooks/users/follows/useFetchFollow.js +2 -2
- package/dist/esm/hooks/users/follows/useFetchFollow.js.map +1 -1
- package/dist/esm/hooks/users/follows/useUnfollowUser.js +2 -2
- package/dist/esm/hooks/users/follows/useUnfollowUser.js.map +1 -1
- package/dist/esm/index.d.ts +6 -4
- package/dist/esm/index.js +9 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces/models/AppNotification.d.ts +1 -1
- package/dist/esm/legacy/context/app-notifications-context.js.map +1 -0
- package/dist/esm/{context → legacy/context}/auth-context.js +1 -1
- package/dist/esm/legacy/context/auth-context.js.map +1 -0
- package/dist/esm/legacy/hooks/app-notifications/index.js.map +1 -0
- package/dist/esm/legacy/hooks/app-notifications/useAppNotifications.js.map +1 -0
- package/dist/{cjs → esm/legacy}/hooks/app-notifications/useAppNotificationsData.d.ts +1 -1
- package/dist/esm/{hooks → legacy/hooks}/app-notifications/useAppNotificationsData.js +2 -2
- package/dist/esm/legacy/hooks/app-notifications/useAppNotificationsData.js.map +1 -0
- package/dist/esm/{hooks → legacy/hooks}/app-notifications/useCountUnreadNotifications.js +4 -4
- package/dist/esm/legacy/hooks/app-notifications/useCountUnreadNotifications.js.map +1 -0
- package/dist/esm/{hooks → legacy/hooks}/app-notifications/useFetchAppNotifications.d.ts +1 -1
- package/dist/esm/{hooks → legacy/hooks}/app-notifications/useFetchAppNotifications.js +4 -4
- package/dist/esm/legacy/hooks/app-notifications/useFetchAppNotifications.js.map +1 -0
- package/dist/esm/{hooks → legacy/hooks}/app-notifications/useMarkNotificationAsRead.js +4 -4
- package/dist/esm/legacy/hooks/app-notifications/useMarkNotificationAsRead.js.map +1 -0
- package/dist/esm/legacy/hooks/auth/index.js.map +1 -0
- package/dist/esm/legacy/hooks/auth/useAuth.js.map +1 -0
- package/dist/esm/{hooks → legacy/hooks}/auth/useAuthData.d.ts +1 -1
- package/dist/esm/{hooks → legacy/hooks}/auth/useAuthData.js +2 -2
- package/dist/esm/legacy/hooks/auth/useAuthData.js.map +1 -0
- package/dist/esm/{hooks → legacy/hooks}/auth/useChangePassword.js +3 -3
- package/dist/esm/legacy/hooks/auth/useChangePassword.js.map +1 -0
- package/dist/esm/{hooks → legacy/hooks}/auth/useRequestNewAccessToken.js +3 -3
- package/dist/esm/legacy/hooks/auth/useRequestNewAccessToken.js.map +1 -0
- package/dist/esm/{hooks → legacy/hooks}/auth/useSignInWithEmailAndPassword.js +3 -3
- package/dist/esm/legacy/hooks/auth/useSignInWithEmailAndPassword.js.map +1 -0
- package/dist/esm/{hooks → legacy/hooks}/auth/useSignOut.js +3 -3
- package/dist/esm/legacy/hooks/auth/useSignOut.js.map +1 -0
- package/dist/esm/{hooks → legacy/hooks}/auth/useSignUpWithEmailAndPassword.js +3 -3
- package/dist/esm/legacy/hooks/auth/useSignUpWithEmailAndPassword.js.map +1 -0
- package/dist/esm/{hooks → legacy/hooks}/auth/useVerifyExternalUser.js +2 -2
- package/dist/esm/legacy/hooks/auth/useVerifyExternalUser.js.map +1 -0
- package/dist/esm/store/api/appNotificationsApi.d.ts +2021 -0
- package/dist/esm/store/api/appNotificationsApi.js +210 -0
- package/dist/esm/store/api/appNotificationsApi.js.map +1 -0
- package/dist/esm/store/api/baseApi.d.ts +1 -0
- package/dist/esm/store/api/baseApi.js +39 -0
- package/dist/esm/store/api/baseApi.js.map +1 -0
- package/dist/esm/store/api/index.d.ts +2 -0
- package/dist/esm/store/api/index.js +9 -0
- package/dist/esm/store/api/index.js.map +1 -0
- package/dist/esm/store/index.d.ts +15 -0
- package/dist/esm/store/index.js +55 -0
- package/dist/esm/store/index.js.map +1 -0
- package/dist/esm/store/middleware.d.ts +4 -0
- package/dist/esm/store/middleware.js +37 -0
- package/dist/esm/store/middleware.js.map +1 -0
- package/dist/esm/store/rootReducer.d.ts +10 -0
- package/dist/esm/store/rootReducer.js +14 -0
- package/dist/esm/store/rootReducer.js.map +1 -0
- package/dist/esm/store/slices/appNotificationsSlice.d.ts +58 -0
- package/dist/esm/store/slices/appNotificationsSlice.js +124 -0
- package/dist/esm/store/slices/appNotificationsSlice.js.map +1 -0
- package/dist/esm/store/slices/authSlice.d.ts +24 -0
- package/dist/esm/store/slices/authSlice.js +69 -0
- package/dist/esm/store/slices/authSlice.js.map +1 -0
- package/dist/esm/store/slices/authThunks.d.ts +40 -0
- package/dist/esm/store/slices/authThunks.js +351 -0
- package/dist/esm/store/slices/authThunks.js.map +1 -0
- package/dist/esm/store/slices/index.d.ts +1 -0
- package/dist/esm/store/slices/index.js +7 -0
- package/dist/esm/store/slices/index.js.map +1 -0
- package/dist/esm/store/types/index.d.ts +8 -0
- package/dist/esm/store/types/index.js +2 -0
- package/dist/esm/store/types/index.js.map +1 -0
- package/package.json +4 -2
- package/dist/cjs/context/app-notifications-context.js.map +0 -1
- package/dist/cjs/context/auth-context.js.map +0 -1
- package/dist/cjs/hooks/app-notifications/index.js.map +0 -1
- package/dist/cjs/hooks/app-notifications/useAppNotifications.js.map +0 -1
- package/dist/cjs/hooks/app-notifications/useAppNotificationsData.js.map +0 -1
- package/dist/cjs/hooks/app-notifications/useCountUnreadNotifications.js.map +0 -1
- package/dist/cjs/hooks/app-notifications/useFetchAppNotifications.js.map +0 -1
- package/dist/cjs/hooks/app-notifications/useMarkNotificationAsRead.js.map +0 -1
- package/dist/cjs/hooks/auth/index.js.map +0 -1
- package/dist/cjs/hooks/auth/useAuth.js.map +0 -1
- package/dist/cjs/hooks/auth/useAuthData.js.map +0 -1
- package/dist/cjs/hooks/auth/useChangePassword.js.map +0 -1
- package/dist/cjs/hooks/auth/useRequestNewAccessToken.js.map +0 -1
- package/dist/cjs/hooks/auth/useSignInWithEmailAndPassword.js.map +0 -1
- package/dist/cjs/hooks/auth/useSignOut.js.map +0 -1
- package/dist/cjs/hooks/auth/useSignUpWithEmailAndPassword.js.map +0 -1
- package/dist/cjs/hooks/auth/useVerifyExternalUser.js.map +0 -1
- package/dist/esm/context/app-notifications-context.js.map +0 -1
- package/dist/esm/context/auth-context.js.map +0 -1
- package/dist/esm/hooks/app-notifications/index.js.map +0 -1
- package/dist/esm/hooks/app-notifications/useAppNotifications.js.map +0 -1
- package/dist/esm/hooks/app-notifications/useAppNotificationsData.js.map +0 -1
- package/dist/esm/hooks/app-notifications/useCountUnreadNotifications.js.map +0 -1
- package/dist/esm/hooks/app-notifications/useFetchAppNotifications.js.map +0 -1
- package/dist/esm/hooks/app-notifications/useMarkNotificationAsRead.js.map +0 -1
- package/dist/esm/hooks/auth/index.js.map +0 -1
- package/dist/esm/hooks/auth/useAuth.js.map +0 -1
- package/dist/esm/hooks/auth/useAuthData.js.map +0 -1
- package/dist/esm/hooks/auth/useChangePassword.js.map +0 -1
- package/dist/esm/hooks/auth/useRequestNewAccessToken.js.map +0 -1
- package/dist/esm/hooks/auth/useSignInWithEmailAndPassword.js.map +0 -1
- package/dist/esm/hooks/auth/useSignOut.js.map +0 -1
- package/dist/esm/hooks/auth/useSignUpWithEmailAndPassword.js.map +0 -1
- package/dist/esm/hooks/auth/useVerifyExternalUser.js.map +0 -1
- /package/dist/cjs/{context → legacy/context}/app-notifications-context.d.ts +0 -0
- /package/dist/cjs/{context → legacy/context}/app-notifications-context.js +0 -0
- /package/dist/cjs/{context → legacy/context}/auth-context.d.ts +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/app-notifications/index.d.ts +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/app-notifications/index.js +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/app-notifications/useAppNotifications.d.ts +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/app-notifications/useAppNotifications.js +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/app-notifications/useCountUnreadNotifications.d.ts +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/app-notifications/useMarkNotificationAsRead.d.ts +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/auth/index.d.ts +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/auth/index.js +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/auth/useAuth.d.ts +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/auth/useAuth.js +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/auth/useChangePassword.d.ts +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/auth/useRequestNewAccessToken.d.ts +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/auth/useSignInWithEmailAndPassword.d.ts +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/auth/useSignOut.d.ts +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/auth/useSignUpWithEmailAndPassword.d.ts +0 -0
- /package/dist/cjs/{hooks → legacy/hooks}/auth/useVerifyExternalUser.d.ts +0 -0
- /package/dist/esm/{context → legacy/context}/app-notifications-context.d.ts +0 -0
- /package/dist/esm/{context → legacy/context}/app-notifications-context.js +0 -0
- /package/dist/esm/{context → legacy/context}/auth-context.d.ts +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/app-notifications/index.d.ts +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/app-notifications/index.js +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/app-notifications/useAppNotifications.d.ts +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/app-notifications/useAppNotifications.js +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/app-notifications/useCountUnreadNotifications.d.ts +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/app-notifications/useMarkNotificationAsRead.d.ts +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/auth/index.d.ts +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/auth/index.js +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/auth/useAuth.d.ts +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/auth/useAuth.js +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/auth/useChangePassword.d.ts +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/auth/useRequestNewAccessToken.d.ts +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/auth/useSignInWithEmailAndPassword.d.ts +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/auth/useSignOut.d.ts +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/auth/useSignUpWithEmailAndPassword.d.ts +0 -0
- /package/dist/esm/{hooks → legacy/hooks}/auth/useVerifyExternalUser.d.ts +0 -0
|
@@ -35,15 +35,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
39
|
var react_1 = require("react");
|
|
43
40
|
var axios_1 = require("./axios");
|
|
44
|
-
var
|
|
41
|
+
var auth_redux_1 = require("../hooks/auth-redux");
|
|
45
42
|
var useAxiosPrivate = function () {
|
|
46
|
-
var _a = (0,
|
|
43
|
+
var _a = (0, auth_redux_1.useAuthRedux)(), accessToken = _a.accessToken, requestNewAccessToken = _a.requestNewAccessToken;
|
|
47
44
|
(0, react_1.useEffect)(function () {
|
|
48
45
|
var requestIntercept = axios_1.axiosPrivate.interceptors.request.use(function (config) {
|
|
49
46
|
// If we have no value for access token return the config as is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAxiosPrivate.js","sourceRoot":"","sources":["../../../src/config/useAxiosPrivate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAxiosPrivate.js","sourceRoot":"","sources":["../../../src/config/useAxiosPrivate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAkC;AAClC,iCAAuC;AACvC,kDAAmD;AAEnD,IAAM,eAAe,GAAG;IAChB,IAAA,KAAyC,IAAA,yBAAY,GAAE,EAArD,WAAW,iBAAA,EAAE,qBAAqB,2BAAmB,CAAC;IAE9D,IAAA,iBAAS,EAAC;QACR,IAAM,gBAAgB,GAAG,oBAAY,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAC5D,UAAC,MAAM;YACL,+DAA+D;YAC/D,sFAAsF;YACtF,mCAAmC;YAEnC,kEAAkE;YAClE,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;gBAAE,OAAO,MAAM,CAAC;YAEnD,6CAA6C;YAC7C,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,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
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { ReplykeProvider } from "./replyke-context";
|
|
2
|
-
export {
|
|
2
|
+
export { ReplykeStoreProvider } from "./replyke-store-context";
|
|
3
3
|
export { EntityListProvider } from "./entity-list-context";
|
|
4
4
|
export { EntityProvider } from "./entity-context";
|
|
5
5
|
export { ListsProvider } from "./lists-context";
|
|
6
|
-
export { AppNotificationsProvider } from "./app-notifications-context";
|
|
7
6
|
export { CommentSectionProvider } from "./comment-section-context";
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommentSectionProvider = exports.
|
|
3
|
+
exports.CommentSectionProvider = exports.ListsProvider = exports.EntityProvider = exports.EntityListProvider = exports.ReplykeStoreProvider = exports.ReplykeProvider = void 0;
|
|
4
4
|
var replyke_context_1 = require("./replyke-context");
|
|
5
5
|
Object.defineProperty(exports, "ReplykeProvider", { enumerable: true, get: function () { return replyke_context_1.ReplykeProvider; } });
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(exports, "
|
|
6
|
+
var replyke_store_context_1 = require("./replyke-store-context");
|
|
7
|
+
Object.defineProperty(exports, "ReplykeStoreProvider", { enumerable: true, get: function () { return replyke_store_context_1.ReplykeStoreProvider; } });
|
|
8
8
|
var entity_list_context_1 = require("./entity-list-context");
|
|
9
9
|
Object.defineProperty(exports, "EntityListProvider", { enumerable: true, get: function () { return entity_list_context_1.EntityListProvider; } });
|
|
10
10
|
var entity_context_1 = require("./entity-context");
|
|
11
11
|
Object.defineProperty(exports, "EntityProvider", { enumerable: true, get: function () { return entity_context_1.EntityProvider; } });
|
|
12
12
|
var lists_context_1 = require("./lists-context");
|
|
13
13
|
Object.defineProperty(exports, "ListsProvider", { enumerable: true, get: function () { return lists_context_1.ListsProvider; } });
|
|
14
|
-
var app_notifications_context_1 = require("./app-notifications-context");
|
|
15
|
-
Object.defineProperty(exports, "AppNotificationsProvider", { enumerable: true, get: function () { return app_notifications_context_1.AppNotificationsProvider; } });
|
|
16
14
|
var comment_section_context_1 = require("./comment-section-context");
|
|
17
15
|
Object.defineProperty(exports, "CommentSectionProvider", { enumerable: true, get: function () { return comment_section_context_1.CommentSectionProvider; } });
|
|
18
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/context/index.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/context/index.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,iEAA+D;AAAtD,6HAAA,oBAAoB,OAAA;AAC7B,6DAA2D;AAAlD,yHAAA,kBAAkB,OAAA;AAC3B,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,qEAAmE;AAA1D,iIAAA,sBAAsB,OAAA"}
|
|
@@ -7,7 +7,7 @@ exports.ReplykeProvider = exports.ReplykeContext = void 0;
|
|
|
7
7
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
var react_1 = require("react");
|
|
9
9
|
var useProjectData_1 = __importDefault(require("../hooks/projects/useProjectData"));
|
|
10
|
-
var
|
|
10
|
+
var replyke_store_context_1 = require("./replyke-store-context");
|
|
11
11
|
exports.ReplykeContext = (0, react_1.createContext)({
|
|
12
12
|
projectId: "",
|
|
13
13
|
project: null,
|
|
@@ -17,7 +17,7 @@ var ReplykeProvider = function (_a) {
|
|
|
17
17
|
var data = (0, useProjectData_1.default)({ projectId: projectId });
|
|
18
18
|
if (!projectId)
|
|
19
19
|
throw new Error("projectId in ReplykeProvider is " + typeof projectId);
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)(exports.ReplykeContext.Provider, { value: data, children: (0, jsx_runtime_1.jsx)(
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(exports.ReplykeContext.Provider, { value: data, children: (0, jsx_runtime_1.jsx)(replyke_store_context_1.ReplykeStoreProvider, { projectId: projectId, signedToken: signedToken, children: children }) }));
|
|
21
21
|
};
|
|
22
22
|
exports.ReplykeProvider = ReplykeProvider;
|
|
23
23
|
//# sourceMappingURL=replyke-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replyke-context.js","sourceRoot":"","sources":["../../../src/context/replyke-context.tsx"],"names":[],"mappings":";;;;;;;AAAA,+BAA6C;AAC7C,oFAG0C;AAC1C
|
|
1
|
+
{"version":3,"file":"replyke-context.js","sourceRoot":"","sources":["../../../src/context/replyke-context.tsx"],"names":[],"mappings":";;;;;;;AAAA,+BAA6C;AAC7C,oFAG0C;AAC1C,iEAA+D;AASlD,QAAA,cAAc,GAAG,IAAA,qBAAa,EAAuB;IAChE,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,IAAI;CACd,CAAC,CAAC;AAEI,IAAM,eAAe,GAAkC,UAAC,EAIzC;QAHpB,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,QAAQ,cAAA;IAER,IAAM,IAAI,GAAG,IAAA,wBAAc,EAAC,EAAE,SAAS,WAAA,EAAE,CAAC,CAAC;IAE3C,IAAI,CAAC,SAAS;QACZ,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,OAAO,SAAS,CAAC,CAAC;IAEzE,OAAO,CACL,uBAAC,sBAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,YAClC,uBAAC,4CAAoB,IAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,YACjE,QAAQ,GACY,GACC,CAC3B,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,eAAe,mBAiB1B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export interface ReplykeStoreProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
projectId: string;
|
|
6
|
+
signedToken?: string | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Redux store provider for Replyke
|
|
10
|
+
* This component provides the Redux store and initializes auth state
|
|
11
|
+
*/
|
|
12
|
+
export declare const ReplykeStoreProvider: React.FC<ReplykeStoreProviderProps>;
|
|
13
|
+
export default ReplykeStoreProvider;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReplykeStoreProvider = void 0;
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var react_redux_1 = require("react-redux");
|
|
7
|
+
var store_1 = require("../store");
|
|
8
|
+
var authThunks_1 = require("../store/slices/authThunks");
|
|
9
|
+
/**
|
|
10
|
+
* Component that initializes auth state in Redux
|
|
11
|
+
* Must be inside the Redux Provider to dispatch actions
|
|
12
|
+
*/
|
|
13
|
+
var AuthInitializer = function (_a) {
|
|
14
|
+
var children = _a.children, projectId = _a.projectId, signedToken = _a.signedToken;
|
|
15
|
+
var dispatch = (0, react_redux_1.useDispatch)();
|
|
16
|
+
(0, react_1.useEffect)(function () {
|
|
17
|
+
// Initialize auth with project and signed token
|
|
18
|
+
dispatch((0, authThunks_1.initializeAuthThunk)({
|
|
19
|
+
projectId: projectId,
|
|
20
|
+
signedToken: signedToken
|
|
21
|
+
}));
|
|
22
|
+
}, [dispatch, projectId, signedToken]);
|
|
23
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Redux store provider for Replyke
|
|
27
|
+
* This component provides the Redux store and initializes auth state
|
|
28
|
+
*/
|
|
29
|
+
var ReplykeStoreProvider = function (_a) {
|
|
30
|
+
var children = _a.children, projectId = _a.projectId, signedToken = _a.signedToken;
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(react_redux_1.Provider, { store: store_1.replykeStore, children: (0, jsx_runtime_1.jsx)(AuthInitializer, { projectId: projectId, signedToken: signedToken, children: children }) }));
|
|
32
|
+
};
|
|
33
|
+
exports.ReplykeStoreProvider = ReplykeStoreProvider;
|
|
34
|
+
// Clean Redux-only architecture
|
|
35
|
+
// Always integrated with ReplykeProvider
|
|
36
|
+
exports.default = exports.ReplykeStoreProvider;
|
|
37
|
+
//# sourceMappingURL=replyke-store-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replyke-store-context.js","sourceRoot":"","sources":["../../../src/context/replyke-store-context.tsx"],"names":[],"mappings":";;;;AAAA,+BAAyC;AACzC,2CAAoD;AACpD,kCAAwC;AAGxC,yDAAiE;AAQjE;;;GAGG;AACH,IAAM,eAAe,GAIhB,UAAC,EAAoC;QAAlC,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAE,WAAW,iBAAA;IACtC,IAAM,QAAQ,GAAG,IAAA,yBAAW,GAAe,CAAC;IAE5C,IAAA,iBAAS,EAAC;QACR,gDAAgD;QAChD,QAAQ,CAAC,IAAA,gCAAmB,EAAC;YAC3B,SAAS,WAAA;YACT,WAAW,aAAA;SACZ,CAAC,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IAEvC,OAAO,2DAAG,QAAQ,GAAI,CAAC;AACzB,CAAC,CAAC;AAEF;;;GAGG;AACI,IAAM,oBAAoB,GAAwC,UAAC,EAIzE;QAHC,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,WAAW,iBAAA;IAEX,OAAO,CACL,uBAAC,sBAAQ,IAAC,KAAK,EAAE,oBAAY,YAC3B,uBAAC,eAAe,IAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,YAC5D,QAAQ,GACO,GACT,CACZ,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B;AAEF,gCAAgC;AAChC,yCAAyC;AAEzC,kBAAe,4BAAoB,CAAC"}
|
|
@@ -22,17 +22,15 @@ var replaceTemplateVariables = function (template, variables) {
|
|
|
22
22
|
// Centralized logic to build variable replacements
|
|
23
23
|
var getReplacementVariables = function (notification) {
|
|
24
24
|
return {
|
|
25
|
-
|
|
25
|
+
initiatorName: (0, getUserName_1.getUserName)({
|
|
26
26
|
id: notification.metadata.initiatorId,
|
|
27
27
|
name: notification.metadata.initiatorName,
|
|
28
28
|
username: notification.metadata.initiatorUsername,
|
|
29
|
-
avatar: notification.metadata.initiatorAvatar,
|
|
30
29
|
}, "name"),
|
|
31
|
-
|
|
30
|
+
initiatorUsername: (0, getUserName_1.getUserName)({
|
|
32
31
|
id: notification.metadata.initiatorId,
|
|
33
32
|
name: notification.metadata.initiatorName,
|
|
34
33
|
username: notification.metadata.initiatorUsername,
|
|
35
|
-
avatar: notification.metadata.initiatorAvatar,
|
|
36
34
|
}, "username"),
|
|
37
35
|
entityTitle: notification.metadata.entityTitle || "",
|
|
38
36
|
entityContent: notification.metadata.entityContent || "",
|
|
@@ -60,22 +58,22 @@ exports.default = (function (notifications, notificationTemplates) {
|
|
|
60
58
|
var content;
|
|
61
59
|
switch (notification.type) {
|
|
62
60
|
case "entity-comment":
|
|
63
|
-
(_a = configureMessage(notification, "$userName commented on your post
|
|
61
|
+
(_a = configureMessage(notification, "$userName commented on your post", "$commentContent", notificationTemplates === null || notificationTemplates === void 0 ? void 0 : notificationTemplates.entityComment), title = _a.title, content = _a.content);
|
|
64
62
|
break;
|
|
65
63
|
case "comment-reply":
|
|
66
|
-
(_b = configureMessage(notification, "$userName replied to your comment
|
|
64
|
+
(_b = configureMessage(notification, "$userName replied to your comment", "$replyContent", notificationTemplates === null || notificationTemplates === void 0 ? void 0 : notificationTemplates.commentReply), title = _b.title, content = _b.content);
|
|
67
65
|
break;
|
|
68
66
|
case "entity-mention":
|
|
69
67
|
(_c = configureMessage(notification, "$userName mentioned you in their post", "$entityTitle", notificationTemplates === null || notificationTemplates === void 0 ? void 0 : notificationTemplates.entityMention), title = _c.title, content = _c.content);
|
|
70
68
|
break;
|
|
71
69
|
case "comment-mention":
|
|
72
|
-
(_d = configureMessage(notification, "$userName mentioned you in their comment
|
|
70
|
+
(_d = configureMessage(notification, "$userName mentioned you in their comment", "$commentContent", notificationTemplates === null || notificationTemplates === void 0 ? void 0 : notificationTemplates.commentMention), title = _d.title, content = _d.content);
|
|
73
71
|
break;
|
|
74
72
|
case "entity-upvote":
|
|
75
|
-
(_e = configureMessage(notification, "$userName upvoted your post
|
|
73
|
+
(_e = configureMessage(notification, "$userName upvoted your post", "", notificationTemplates === null || notificationTemplates === void 0 ? void 0 : notificationTemplates.entityUpvote), title = _e.title, content = _e.content);
|
|
76
74
|
break;
|
|
77
75
|
case "comment-upvote":
|
|
78
|
-
(_f = configureMessage(notification, "$userName upvoted your comment on
|
|
76
|
+
(_f = configureMessage(notification, "$userName upvoted your comment on", "$commentContent", notificationTemplates === null || notificationTemplates === void 0 ? void 0 : notificationTemplates.commentUpvote), title = _f.title, content = _f.content);
|
|
79
77
|
break;
|
|
80
78
|
case "new-follow":
|
|
81
79
|
(_g = configureMessage(notification, "$userName started following you", "", notificationTemplates === null || notificationTemplates === void 0 ? void 0 : notificationTemplates.newFollow), title = _g.title, content = _g.content);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addNotificationsMessages.js","sourceRoot":"","sources":["../../../src/helpers/addNotificationsMessages.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAKA,6CAA4C;AAE5C,sDAAsD;AACtD,IAAM,wBAAwB,GAAG,UAC/B,QAAgB,EAChB,SAAiC;IAEjC,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CACrC,UAAC,MAAM,EAAE,EAAY;YAAX,GAAG,QAAA,EAAE,KAAK,QAAA;QAClB,OAAA,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,aAAM,GAAG,CAAE,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC;IAAnD,CAAmD,EACrD,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,mDAAmD;AACnD,IAAM,uBAAuB,GAAG,UAAC,YAAiB;IAChD,OAAO;QACL,
|
|
1
|
+
{"version":3,"file":"addNotificationsMessages.js","sourceRoot":"","sources":["../../../src/helpers/addNotificationsMessages.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAKA,6CAA4C;AAE5C,sDAAsD;AACtD,IAAM,wBAAwB,GAAG,UAC/B,QAAgB,EAChB,SAAiC;IAEjC,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CACrC,UAAC,MAAM,EAAE,EAAY;YAAX,GAAG,QAAA,EAAE,KAAK,QAAA;QAClB,OAAA,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,aAAM,GAAG,CAAE,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC;IAAnD,CAAmD,EACrD,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,mDAAmD;AACnD,IAAM,uBAAuB,GAAG,UAAC,YAAiB;IAChD,OAAO;QACL,aAAa,EAAE,IAAA,yBAAW,EACxB;YACE,EAAE,EAAE,YAAY,CAAC,QAAQ,CAAC,WAAW;YACrC,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC,aAAa;YACzC,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,iBAAiB;SAClD,EACD,MAAM,CACP;QACD,iBAAiB,EAAE,IAAA,yBAAW,EAC5B;YACE,EAAE,EAAE,YAAY,CAAC,QAAQ,CAAC,WAAW;YACrC,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC,aAAa;YACzC,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,iBAAiB;SAClD,EACD,UAAU,CACX;QACD,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAC,WAAW,IAAI,EAAE;QAC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qBAAqB,uBAArB,qBAAqB,CAAE,SAAS,CACjC,EALE,KAAK,WAAA,EAAE,OAAO,aAAA,CAKf,CAAC;gBACH,MAAM;YACR;gBACE,MAAM;QACV,CAAC;QAED,OAAO,sBACF,YAAY,KACf,KAAK,OAAA,EACL,OAAO,SAAA,GACkB,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC,EAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as useAppNotificationsRedux } from "./useAppNotificationsRedux";
|
|
2
|
+
export { default as useAppNotificationsDataRedux } from "./useAppNotificationsDataRedux";
|
|
3
|
+
export { default as useAppNotificationsActionsRedux } from "./useAppNotificationsActionsRedux";
|
|
4
|
+
export type { UseAppNotificationsDataProps, UseAppNotificationsDataValues, } from "./useAppNotificationsDataRedux";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useAppNotificationsActionsRedux = exports.useAppNotificationsDataRedux = exports.useAppNotificationsRedux = void 0;
|
|
7
|
+
// Export Redux-powered app notifications hooks
|
|
8
|
+
var useAppNotificationsRedux_1 = require("./useAppNotificationsRedux");
|
|
9
|
+
Object.defineProperty(exports, "useAppNotificationsRedux", { enumerable: true, get: function () { return __importDefault(useAppNotificationsRedux_1).default; } });
|
|
10
|
+
var useAppNotificationsDataRedux_1 = require("./useAppNotificationsDataRedux");
|
|
11
|
+
Object.defineProperty(exports, "useAppNotificationsDataRedux", { enumerable: true, get: function () { return __importDefault(useAppNotificationsDataRedux_1).default; } });
|
|
12
|
+
var useAppNotificationsActionsRedux_1 = require("./useAppNotificationsActionsRedux");
|
|
13
|
+
Object.defineProperty(exports, "useAppNotificationsActionsRedux", { enumerable: true, get: function () { return __importDefault(useAppNotificationsActionsRedux_1).default; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/app-notifications-redux/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAA+C;AAC/C,uEAAiF;AAAxE,qJAAA,OAAO,OAA4B;AAC5C,+EAAyF;AAAhF,6JAAA,OAAO,OAAgC;AAChD,qFAA+F;AAAtF,mKAAA,OAAO,OAAmC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook that provides Redux-powered actions for app notifications
|
|
3
|
+
* Integrates RTK Query with Redux slice actions
|
|
4
|
+
*/
|
|
5
|
+
export declare function useAppNotificationsActionsRedux(): {
|
|
6
|
+
loadMore: () => void;
|
|
7
|
+
markNotificationAsRead: (notificationId: string) => Promise<void>;
|
|
8
|
+
markAllNotificationsAsRead: () => Promise<void>;
|
|
9
|
+
resetAppNotifications: () => Promise<void>;
|
|
10
|
+
fetchMoreNotifications: (pageToFetch: number) => Promise<void>;
|
|
11
|
+
updateUnreadCount: () => Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export default useAppNotificationsActionsRedux;
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
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);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.useAppNotificationsActionsRedux = useAppNotificationsActionsRedux;
|
|
43
|
+
var react_1 = require("react");
|
|
44
|
+
var react_redux_1 = require("react-redux");
|
|
45
|
+
var appNotificationsSlice_1 = require("../../store/slices/appNotificationsSlice");
|
|
46
|
+
var appNotificationsApi_1 = require("../../store/api/appNotificationsApi");
|
|
47
|
+
var handleError_1 = require("../../utils/handleError");
|
|
48
|
+
var addNotificationsMessages_1 = __importDefault(require("../../helpers/addNotificationsMessages"));
|
|
49
|
+
var useProject_1 = __importDefault(require("../projects/useProject"));
|
|
50
|
+
var auth_redux_1 = require("../auth-redux");
|
|
51
|
+
/**
|
|
52
|
+
* Hook that provides Redux-powered actions for app notifications
|
|
53
|
+
* Integrates RTK Query with Redux slice actions
|
|
54
|
+
*/
|
|
55
|
+
function useAppNotificationsActionsRedux() {
|
|
56
|
+
var _this = this;
|
|
57
|
+
var dispatch = (0, react_redux_1.useDispatch)();
|
|
58
|
+
// Get current state for actions
|
|
59
|
+
var projectIdFromSlice = (0, react_redux_1.useSelector)(function (state) {
|
|
60
|
+
return (0, appNotificationsSlice_1.selectCurrentProjectId)(state);
|
|
61
|
+
});
|
|
62
|
+
var page = (0, react_redux_1.useSelector)(function (state) {
|
|
63
|
+
return (0, appNotificationsSlice_1.selectAppNotificationsPage)(state);
|
|
64
|
+
});
|
|
65
|
+
var limit = (0, react_redux_1.useSelector)(function (state) {
|
|
66
|
+
return (0, appNotificationsSlice_1.selectAppNotificationsLimit)(state);
|
|
67
|
+
});
|
|
68
|
+
var notificationTemplates = (0, react_redux_1.useSelector)(function (state) {
|
|
69
|
+
return (0, appNotificationsSlice_1.selectNotificationTemplates)(state);
|
|
70
|
+
});
|
|
71
|
+
// Get project and user context (fallback to current hooks)
|
|
72
|
+
var projectIdFromHook = (0, useProject_1.default)().projectId;
|
|
73
|
+
var user = (0, auth_redux_1.useUserRedux)().user;
|
|
74
|
+
// Use project ID from slice if available, otherwise from hook
|
|
75
|
+
var projectId = projectIdFromSlice || projectIdFromHook;
|
|
76
|
+
// RTK Query hooks
|
|
77
|
+
var triggerFetchNotifications = (0, appNotificationsApi_1.useLazyFetchAppNotificationsQuery)()[0];
|
|
78
|
+
var markNotificationAsReadMutation = (0, appNotificationsApi_1.useMarkNotificationAsReadMutation)()[0];
|
|
79
|
+
var markAllNotificationsAsReadMutation = (0, appNotificationsApi_1.useMarkAllNotificationsAsReadMutation)()[0];
|
|
80
|
+
var triggerCountUnread = (0, appNotificationsApi_1.useLazyCountUnreadNotificationsQuery)()[0];
|
|
81
|
+
// Load more action
|
|
82
|
+
var loadMore = (0, react_1.useCallback)(function () {
|
|
83
|
+
dispatch((0, appNotificationsSlice_1.loadMore)());
|
|
84
|
+
}, [dispatch]);
|
|
85
|
+
// Mark notification as read action
|
|
86
|
+
var markNotificationAsRead = (0, react_1.useCallback)(function (notificationId) { return __awaiter(_this, void 0, void 0, function () {
|
|
87
|
+
var error_1;
|
|
88
|
+
return __generator(this, function (_a) {
|
|
89
|
+
switch (_a.label) {
|
|
90
|
+
case 0:
|
|
91
|
+
if (!projectId || !user) {
|
|
92
|
+
throw new Error("No project ID or authenticated user available");
|
|
93
|
+
}
|
|
94
|
+
_a.label = 1;
|
|
95
|
+
case 1:
|
|
96
|
+
_a.trys.push([1, 3, , 4]);
|
|
97
|
+
// Optimistic update
|
|
98
|
+
dispatch((0, appNotificationsSlice_1.markAsReadLocally)(notificationId));
|
|
99
|
+
// Make API call
|
|
100
|
+
return [4 /*yield*/, markNotificationAsReadMutation({
|
|
101
|
+
projectId: projectId,
|
|
102
|
+
notificationId: notificationId,
|
|
103
|
+
}).unwrap()];
|
|
104
|
+
case 2:
|
|
105
|
+
// Make API call
|
|
106
|
+
_a.sent();
|
|
107
|
+
return [3 /*break*/, 4];
|
|
108
|
+
case 3:
|
|
109
|
+
error_1 = _a.sent();
|
|
110
|
+
(0, handleError_1.handleError)(error_1, "Failed to mark notification as read:");
|
|
111
|
+
throw error_1;
|
|
112
|
+
case 4: return [2 /*return*/];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}); }, [dispatch, projectId, user, markNotificationAsReadMutation]);
|
|
116
|
+
// Reset notifications action
|
|
117
|
+
var resetAppNotifications = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
118
|
+
var result, completeNotifications, error_2;
|
|
119
|
+
return __generator(this, function (_a) {
|
|
120
|
+
switch (_a.label) {
|
|
121
|
+
case 0:
|
|
122
|
+
if (!projectId || !user) {
|
|
123
|
+
throw new Error("No project ID or authenticated user available");
|
|
124
|
+
}
|
|
125
|
+
_a.label = 1;
|
|
126
|
+
case 1:
|
|
127
|
+
_a.trys.push([1, 3, , 4]);
|
|
128
|
+
dispatch((0, appNotificationsSlice_1.setLoading)(true));
|
|
129
|
+
dispatch((0, appNotificationsSlice_1.resetNotifications)());
|
|
130
|
+
return [4 /*yield*/, triggerFetchNotifications({
|
|
131
|
+
projectId: projectId,
|
|
132
|
+
page: 1,
|
|
133
|
+
limit: limit,
|
|
134
|
+
}).unwrap()];
|
|
135
|
+
case 2:
|
|
136
|
+
result = _a.sent();
|
|
137
|
+
if (result) {
|
|
138
|
+
completeNotifications = (0, addNotificationsMessages_1.default)(result, notificationTemplates);
|
|
139
|
+
dispatch((0, appNotificationsSlice_1.addNotifications)({
|
|
140
|
+
notifications: completeNotifications,
|
|
141
|
+
isFirstPage: true,
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
return [3 /*break*/, 4];
|
|
145
|
+
case 3:
|
|
146
|
+
error_2 = _a.sent();
|
|
147
|
+
(0, handleError_1.handleError)(error_2, "Failed to refresh notifications:");
|
|
148
|
+
throw error_2;
|
|
149
|
+
case 4: return [2 /*return*/];
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}); }, [
|
|
153
|
+
dispatch,
|
|
154
|
+
projectId,
|
|
155
|
+
user,
|
|
156
|
+
triggerFetchNotifications,
|
|
157
|
+
limit,
|
|
158
|
+
notificationTemplates,
|
|
159
|
+
]);
|
|
160
|
+
// Fetch more notifications (internal action triggered by page changes)
|
|
161
|
+
var fetchMoreNotifications = (0, react_1.useCallback)(function (pageToFetch) { return __awaiter(_this, void 0, void 0, function () {
|
|
162
|
+
var result, completeNotifications, error_3;
|
|
163
|
+
return __generator(this, function (_a) {
|
|
164
|
+
switch (_a.label) {
|
|
165
|
+
case 0:
|
|
166
|
+
if (!projectId || !user)
|
|
167
|
+
return [2 /*return*/];
|
|
168
|
+
_a.label = 1;
|
|
169
|
+
case 1:
|
|
170
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
171
|
+
dispatch((0, appNotificationsSlice_1.setLoading)(true));
|
|
172
|
+
return [4 /*yield*/, triggerFetchNotifications({
|
|
173
|
+
projectId: projectId,
|
|
174
|
+
page: pageToFetch,
|
|
175
|
+
limit: limit,
|
|
176
|
+
}).unwrap()];
|
|
177
|
+
case 2:
|
|
178
|
+
result = _a.sent();
|
|
179
|
+
if (result) {
|
|
180
|
+
completeNotifications = (0, addNotificationsMessages_1.default)(result, notificationTemplates);
|
|
181
|
+
dispatch((0, appNotificationsSlice_1.addNotifications)({ notifications: completeNotifications }));
|
|
182
|
+
}
|
|
183
|
+
return [3 /*break*/, 5];
|
|
184
|
+
case 3:
|
|
185
|
+
error_3 = _a.sent();
|
|
186
|
+
(0, handleError_1.handleError)(error_3, "Loading more app notifications failed:");
|
|
187
|
+
return [3 /*break*/, 5];
|
|
188
|
+
case 4:
|
|
189
|
+
dispatch((0, appNotificationsSlice_1.setLoading)(false));
|
|
190
|
+
return [7 /*endfinally*/];
|
|
191
|
+
case 5: return [2 /*return*/];
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}); }, [
|
|
195
|
+
dispatch,
|
|
196
|
+
projectId,
|
|
197
|
+
user,
|
|
198
|
+
triggerFetchNotifications,
|
|
199
|
+
limit,
|
|
200
|
+
notificationTemplates,
|
|
201
|
+
]);
|
|
202
|
+
// Update unread count
|
|
203
|
+
var updateUnreadCount = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
204
|
+
var count, error_4;
|
|
205
|
+
return __generator(this, function (_a) {
|
|
206
|
+
switch (_a.label) {
|
|
207
|
+
case 0:
|
|
208
|
+
if (!projectId || !user)
|
|
209
|
+
return [2 /*return*/];
|
|
210
|
+
_a.label = 1;
|
|
211
|
+
case 1:
|
|
212
|
+
_a.trys.push([1, 3, , 4]);
|
|
213
|
+
return [4 /*yield*/, triggerCountUnread({ projectId: projectId }).unwrap()];
|
|
214
|
+
case 2:
|
|
215
|
+
count = _a.sent();
|
|
216
|
+
if (typeof count === "number") {
|
|
217
|
+
dispatch((0, appNotificationsSlice_1.setUnreadCount)(count));
|
|
218
|
+
}
|
|
219
|
+
return [3 /*break*/, 4];
|
|
220
|
+
case 3:
|
|
221
|
+
error_4 = _a.sent();
|
|
222
|
+
(0, handleError_1.handleError)(error_4, "Failed to fetch unread count:");
|
|
223
|
+
return [3 /*break*/, 4];
|
|
224
|
+
case 4: return [2 /*return*/];
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}); }, [dispatch, projectId, user, triggerCountUnread]);
|
|
228
|
+
// Mark all notifications as read action
|
|
229
|
+
var markAllNotificationsAsRead = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
230
|
+
var error_5;
|
|
231
|
+
return __generator(this, function (_a) {
|
|
232
|
+
switch (_a.label) {
|
|
233
|
+
case 0:
|
|
234
|
+
if (!projectId || !user) {
|
|
235
|
+
throw new Error("No project ID or authenticated user available");
|
|
236
|
+
}
|
|
237
|
+
_a.label = 1;
|
|
238
|
+
case 1:
|
|
239
|
+
_a.trys.push([1, 3, , 4]);
|
|
240
|
+
// Optimistic update
|
|
241
|
+
dispatch((0, appNotificationsSlice_1.markAllAsReadLocally)());
|
|
242
|
+
// Make API call
|
|
243
|
+
return [4 /*yield*/, markAllNotificationsAsReadMutation({ projectId: projectId }).unwrap()];
|
|
244
|
+
case 2:
|
|
245
|
+
// Make API call
|
|
246
|
+
_a.sent();
|
|
247
|
+
return [3 /*break*/, 4];
|
|
248
|
+
case 3:
|
|
249
|
+
error_5 = _a.sent();
|
|
250
|
+
(0, handleError_1.handleError)(error_5, "Failed to mark all notifications as read:");
|
|
251
|
+
throw error_5;
|
|
252
|
+
case 4: return [2 /*return*/];
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
}); }, [dispatch, projectId, user, markAllNotificationsAsReadMutation]);
|
|
256
|
+
return {
|
|
257
|
+
loadMore: loadMore,
|
|
258
|
+
markNotificationAsRead: markNotificationAsRead,
|
|
259
|
+
markAllNotificationsAsRead: markAllNotificationsAsRead,
|
|
260
|
+
resetAppNotifications: resetAppNotifications,
|
|
261
|
+
fetchMoreNotifications: fetchMoreNotifications, // Internal action
|
|
262
|
+
updateUnreadCount: updateUnreadCount,
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
exports.default = useAppNotificationsActionsRedux;
|
|
266
|
+
//# sourceMappingURL=useAppNotificationsActionsRedux.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAppNotificationsActionsRedux.js","sourceRoot":"","sources":["../../../../src/hooks/app-notifications-redux/useAppNotificationsActionsRedux.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,0EAqLC;AApND,+BAAoC;AACpC,2CAAuD;AAEvD,kFAYkD;AAClD,2EAK6C;AAC7C,uDAAsD;AACtD,oGAA8E;AAC9E,sEAAgD;AAChD,4CAA6C;AAE7C;;;GAGG;AACH,SAAgB,+BAA+B;IAA/C,iBAqLC;IApLC,IAAM,QAAQ,GAAG,IAAA,yBAAW,G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xD,KAAK,GAAG,SAAgD;oBAC9D,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;wBAC9B,QAAQ,CAAC,IAAA,sCAAc,EAAC,KAAK,CAAC,CAAC,CAAC;oBAClC,CAAC;;;;oBAED,IAAA,yBAAW,EAAC,OAAK,EAAE,+BAA+B,CAAC,CAAC;;;;;SAEvD,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEpD,wCAAwC;IACxC,IAAM,0BAA0B,GAAG,IAAA,mBAAW,EAAC;;;;;oBAC7C,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE,CAAC;wBACxB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;oBACnE,CAAC;;;;oBAGC,oBAAoB;oBACpB,QAAQ,CAAC,IAAA,4CAAoB,GAAE,CAAC,CAAC;oBAEjC,gBAAgB;oBAChB,qBAAM,kCAAkC,CAAC,EAAE,SAAS,WAAA,EAAE,CAAC,CAAC,MAAM,EAAE,EAAA;;oBADhE,gBAAgB;oBAChB,SAAgE,CAAC;;;;oBAEjE,IAAA,yBAAW,EAAC,OAAK,EAAE,2CAA2C,CAAC,CAAC;oBAChE,MAAM,OAAK,CAAC;;;;SAEf,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,kCAAkC,CAAC,CAAC,CAAC;IAEpE,OAAO;QACL,QAAQ,UAAA;QACR,sBAAsB,wBAAA;QACtB,0BAA0B,4BAAA;QAC1B,qBAAqB,uBAAA;QACrB,sBAAsB,wBAAA,EAAE,kBAAkB;QAC1C,iBAAiB,mBAAA;KAClB,CAAC;AACJ,CAAC;AAED,kBAAe,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NotificationTemplates, UnifiedAppNotification } from "../../interfaces/models/AppNotification";
|
|
2
|
+
export interface UseAppNotificationsDataProps {
|
|
3
|
+
limit?: number;
|
|
4
|
+
notificationTemplates?: Partial<NotificationTemplates>;
|
|
5
|
+
}
|
|
6
|
+
export interface UseAppNotificationsDataValues {
|
|
7
|
+
appNotifications: UnifiedAppNotification[];
|
|
8
|
+
unreadAppNotificationsCount: number;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
hasMore: boolean;
|
|
11
|
+
loadMore: () => void;
|
|
12
|
+
markNotificationAsRead: (notificationId: string) => Promise<void>;
|
|
13
|
+
markAllNotificationsAsRead: () => Promise<void>;
|
|
14
|
+
resetAppNotifications: () => Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Redux-powered hook that provides the exact same interface as useAppNotificationsData()
|
|
18
|
+
* This is a drop-in replacement for the Context-based hook
|
|
19
|
+
*/
|
|
20
|
+
declare function useAppNotificationsDataRedux({ limit, notificationTemplates, }?: UseAppNotificationsDataProps): UseAppNotificationsDataValues;
|
|
21
|
+
export default useAppNotificationsDataRedux;
|