@replyke/core 5.1.6-beta.1 → 5.1.6-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/dist/cjs/context/index.d.ts +0 -1
  2. package/dist/cjs/context/index.js +3 -3
  3. package/dist/cjs/context/index.js.map +1 -1
  4. package/dist/cjs/helpers/addNotificationsMessages.js +1 -1
  5. package/dist/cjs/helpers/addNotificationsMessages.js.map +1 -1
  6. package/dist/cjs/hooks/app-notifications-redux/index.d.ts +1 -2
  7. package/dist/cjs/hooks/app-notifications-redux/index.js +1 -3
  8. package/dist/cjs/hooks/app-notifications-redux/index.js.map +1 -1
  9. package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsRedux.d.ts +18 -4
  10. package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsRedux.js +78 -8
  11. package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsRedux.js.map +1 -1
  12. package/dist/cjs/hooks/lists-redux/index.d.ts +3 -0
  13. package/dist/cjs/hooks/lists-redux/index.js +14 -0
  14. package/dist/cjs/hooks/lists-redux/index.js.map +1 -0
  15. package/dist/cjs/hooks/lists-redux/useIsEntitySaved.js.map +1 -0
  16. package/dist/cjs/hooks/lists-redux/useListsActionsRedux.d.ts +21 -0
  17. package/dist/cjs/hooks/lists-redux/useListsActionsRedux.js +329 -0
  18. package/dist/cjs/hooks/lists-redux/useListsActionsRedux.js.map +1 -0
  19. package/dist/cjs/hooks/{lists/useListsData.d.ts → lists-redux/useListsRedux.d.ts} +9 -5
  20. package/dist/cjs/hooks/lists-redux/useListsRedux.js +239 -0
  21. package/dist/cjs/hooks/lists-redux/useListsRedux.js.map +1 -0
  22. package/dist/cjs/hooks/user-redux/index.d.ts +2 -0
  23. package/dist/cjs/hooks/user-redux/index.js +12 -0
  24. package/dist/cjs/hooks/user-redux/index.js.map +1 -0
  25. package/dist/cjs/hooks/user-redux/useUserActionsRedux.d.ts +12 -0
  26. package/dist/cjs/hooks/user-redux/useUserActionsRedux.js +125 -0
  27. package/dist/cjs/hooks/user-redux/useUserActionsRedux.js.map +1 -0
  28. package/dist/cjs/hooks/user-redux/useUserRedux.d.ts +18 -0
  29. package/dist/cjs/hooks/user-redux/useUserRedux.js +116 -0
  30. package/dist/cjs/hooks/user-redux/useUserRedux.js.map +1 -0
  31. package/dist/cjs/hooks/users/index.d.ts +0 -2
  32. package/dist/cjs/hooks/users/index.js +4 -5
  33. package/dist/cjs/hooks/users/index.js.map +1 -1
  34. package/dist/cjs/index.d.ts +7 -6
  35. package/dist/cjs/index.js +12 -18
  36. package/dist/cjs/index.js.map +1 -1
  37. package/dist/cjs/store/api/appNotificationsApi.d.ts +144 -141
  38. package/dist/cjs/store/api/appNotificationsApi.js +11 -0
  39. package/dist/cjs/store/api/appNotificationsApi.js.map +1 -1
  40. package/dist/cjs/store/api/baseApi.d.ts +1 -1
  41. package/dist/cjs/store/api/baseApi.js +2 -2
  42. package/dist/cjs/store/api/baseApi.js.map +1 -1
  43. package/dist/cjs/store/api/index.d.ts +1 -0
  44. package/dist/cjs/store/api/index.js +2 -1
  45. package/dist/cjs/store/api/index.js.map +1 -1
  46. package/dist/cjs/store/api/listsApi.d.ts +3044 -0
  47. package/dist/cjs/store/api/listsApi.js +288 -0
  48. package/dist/cjs/store/api/listsApi.js.map +1 -0
  49. package/dist/cjs/store/api/userApi.d.ts +183 -0
  50. package/dist/cjs/store/api/userApi.js +38 -0
  51. package/dist/cjs/store/api/userApi.js.map +1 -0
  52. package/dist/cjs/store/index.d.ts +6 -2
  53. package/dist/cjs/store/rootReducer.d.ts +6 -2
  54. package/dist/cjs/store/rootReducer.js +4 -0
  55. package/dist/cjs/store/rootReducer.js.map +1 -1
  56. package/dist/cjs/store/slices/authThunks.js +6 -0
  57. package/dist/cjs/store/slices/authThunks.js.map +1 -1
  58. package/dist/cjs/store/slices/listsSlice.d.ts +63 -0
  59. package/dist/cjs/store/slices/listsSlice.js +204 -0
  60. package/dist/cjs/store/slices/listsSlice.js.map +1 -0
  61. package/dist/cjs/store/slices/userSlice.d.ts +29 -0
  62. package/dist/cjs/store/slices/userSlice.js +87 -0
  63. package/dist/cjs/store/slices/userSlice.js.map +1 -0
  64. package/dist/esm/context/index.d.ts +0 -1
  65. package/dist/esm/context/index.js +2 -1
  66. package/dist/esm/context/index.js.map +1 -1
  67. package/dist/esm/helpers/addNotificationsMessages.js +1 -1
  68. package/dist/esm/helpers/addNotificationsMessages.js.map +1 -1
  69. package/dist/esm/hooks/app-notifications-redux/index.d.ts +1 -2
  70. package/dist/esm/hooks/app-notifications-redux/index.js +0 -1
  71. package/dist/esm/hooks/app-notifications-redux/index.js.map +1 -1
  72. package/dist/esm/hooks/app-notifications-redux/useAppNotificationsRedux.d.ts +18 -4
  73. package/dist/esm/hooks/app-notifications-redux/useAppNotificationsRedux.js +77 -9
  74. package/dist/esm/hooks/app-notifications-redux/useAppNotificationsRedux.js.map +1 -1
  75. package/dist/esm/hooks/lists-redux/index.d.ts +3 -0
  76. package/dist/esm/hooks/lists-redux/index.js +5 -0
  77. package/dist/esm/hooks/lists-redux/index.js.map +1 -0
  78. package/dist/esm/hooks/lists-redux/useIsEntitySaved.js.map +1 -0
  79. package/dist/esm/hooks/lists-redux/useListsActionsRedux.d.ts +21 -0
  80. package/dist/esm/hooks/lists-redux/useListsActionsRedux.js +326 -0
  81. package/dist/esm/hooks/lists-redux/useListsActionsRedux.js.map +1 -0
  82. package/dist/esm/hooks/{lists/useListsData.d.ts → lists-redux/useListsRedux.d.ts} +9 -5
  83. package/dist/esm/hooks/lists-redux/useListsRedux.js +234 -0
  84. package/dist/esm/hooks/lists-redux/useListsRedux.js.map +1 -0
  85. package/dist/esm/hooks/user-redux/index.d.ts +2 -0
  86. package/dist/esm/hooks/user-redux/index.js +4 -0
  87. package/dist/esm/hooks/user-redux/index.js.map +1 -0
  88. package/dist/esm/hooks/user-redux/useUserActionsRedux.d.ts +12 -0
  89. package/dist/esm/hooks/user-redux/useUserActionsRedux.js +122 -0
  90. package/dist/esm/hooks/user-redux/useUserActionsRedux.js.map +1 -0
  91. package/dist/esm/hooks/user-redux/useUserRedux.d.ts +18 -0
  92. package/dist/esm/hooks/user-redux/useUserRedux.js +111 -0
  93. package/dist/esm/hooks/user-redux/useUserRedux.js.map +1 -0
  94. package/dist/esm/hooks/users/index.d.ts +0 -2
  95. package/dist/esm/hooks/users/index.js +3 -2
  96. package/dist/esm/hooks/users/index.js.map +1 -1
  97. package/dist/esm/index.d.ts +7 -6
  98. package/dist/esm/index.js +9 -7
  99. package/dist/esm/index.js.map +1 -1
  100. package/dist/esm/store/api/appNotificationsApi.d.ts +144 -141
  101. package/dist/esm/store/api/appNotificationsApi.js +11 -0
  102. package/dist/esm/store/api/appNotificationsApi.js.map +1 -1
  103. package/dist/esm/store/api/baseApi.d.ts +1 -1
  104. package/dist/esm/store/api/baseApi.js +2 -2
  105. package/dist/esm/store/api/baseApi.js.map +1 -1
  106. package/dist/esm/store/api/index.d.ts +1 -0
  107. package/dist/esm/store/api/index.js +2 -1
  108. package/dist/esm/store/api/index.js.map +1 -1
  109. package/dist/esm/store/api/listsApi.d.ts +3044 -0
  110. package/dist/esm/store/api/listsApi.js +285 -0
  111. package/dist/esm/store/api/listsApi.js.map +1 -0
  112. package/dist/esm/store/api/userApi.d.ts +183 -0
  113. package/dist/esm/store/api/userApi.js +35 -0
  114. package/dist/esm/store/api/userApi.js.map +1 -0
  115. package/dist/esm/store/index.d.ts +6 -2
  116. package/dist/esm/store/rootReducer.d.ts +6 -2
  117. package/dist/esm/store/rootReducer.js +4 -0
  118. package/dist/esm/store/rootReducer.js.map +1 -1
  119. package/dist/esm/store/slices/authThunks.js +6 -0
  120. package/dist/esm/store/slices/authThunks.js.map +1 -1
  121. package/dist/esm/store/slices/listsSlice.d.ts +63 -0
  122. package/dist/esm/store/slices/listsSlice.js +195 -0
  123. package/dist/esm/store/slices/listsSlice.js.map +1 -0
  124. package/dist/esm/store/slices/userSlice.d.ts +29 -0
  125. package/dist/esm/store/slices/userSlice.js +78 -0
  126. package/dist/esm/store/slices/userSlice.js.map +1 -0
  127. package/package.json +1 -1
  128. package/dist/cjs/context/lists-context.d.ts +0 -9
  129. package/dist/cjs/context/lists-context.js +0 -17
  130. package/dist/cjs/context/lists-context.js.map +0 -1
  131. package/dist/cjs/context/user-context.d.ts +0 -8
  132. package/dist/cjs/context/user-context.js +0 -28
  133. package/dist/cjs/context/user-context.js.map +0 -1
  134. package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsDataRedux.d.ts +0 -21
  135. package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsDataRedux.js +0 -108
  136. package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsDataRedux.js.map +0 -1
  137. package/dist/cjs/hooks/lists/index.d.ts +0 -10
  138. package/dist/cjs/hooks/lists/index.js +0 -27
  139. package/dist/cjs/hooks/lists/index.js.map +0 -1
  140. package/dist/cjs/hooks/lists/useAddToList.d.ts +0 -6
  141. package/dist/cjs/hooks/lists/useAddToList.js +0 -70
  142. package/dist/cjs/hooks/lists/useAddToList.js.map +0 -1
  143. package/dist/cjs/hooks/lists/useCreateList.d.ts +0 -6
  144. package/dist/cjs/hooks/lists/useCreateList.js +0 -70
  145. package/dist/cjs/hooks/lists/useCreateList.js.map +0 -1
  146. package/dist/cjs/hooks/lists/useDeleteList.d.ts +0 -4
  147. package/dist/cjs/hooks/lists/useDeleteList.js +0 -69
  148. package/dist/cjs/hooks/lists/useDeleteList.js.map +0 -1
  149. package/dist/cjs/hooks/lists/useFetchRootList.d.ts +0 -3
  150. package/dist/cjs/hooks/lists/useFetchRootList.js +0 -69
  151. package/dist/cjs/hooks/lists/useFetchRootList.js.map +0 -1
  152. package/dist/cjs/hooks/lists/useFetchSubLists.d.ts +0 -5
  153. package/dist/cjs/hooks/lists/useFetchSubLists.js +0 -68
  154. package/dist/cjs/hooks/lists/useFetchSubLists.js.map +0 -1
  155. package/dist/cjs/hooks/lists/useIsEntitySaved.js.map +0 -1
  156. package/dist/cjs/hooks/lists/useLists.d.ts +0 -2
  157. package/dist/cjs/hooks/lists/useLists.js +0 -9
  158. package/dist/cjs/hooks/lists/useLists.js.map +0 -1
  159. package/dist/cjs/hooks/lists/useListsData.js +0 -391
  160. package/dist/cjs/hooks/lists/useListsData.js.map +0 -1
  161. package/dist/cjs/hooks/lists/useRemoveFromList.d.ts +0 -6
  162. package/dist/cjs/hooks/lists/useRemoveFromList.js +0 -70
  163. package/dist/cjs/hooks/lists/useRemoveFromList.js.map +0 -1
  164. package/dist/cjs/hooks/lists/useUpdateList.d.ts +0 -8
  165. package/dist/cjs/hooks/lists/useUpdateList.js +0 -70
  166. package/dist/cjs/hooks/lists/useUpdateList.js.map +0 -1
  167. package/dist/cjs/hooks/users/useUser.d.ts +0 -2
  168. package/dist/cjs/hooks/users/useUser.js +0 -9
  169. package/dist/cjs/hooks/users/useUser.js.map +0 -1
  170. package/dist/cjs/hooks/users/useUserData.d.ts +0 -12
  171. package/dist/cjs/hooks/users/useUserData.js +0 -76
  172. package/dist/cjs/hooks/users/useUserData.js.map +0 -1
  173. package/dist/cjs/legacy/context/app-notifications-context.d.ts +0 -8
  174. package/dist/cjs/legacy/context/app-notifications-context.js +0 -28
  175. package/dist/cjs/legacy/context/app-notifications-context.js.map +0 -1
  176. package/dist/cjs/legacy/context/auth-context.d.ts +0 -8
  177. package/dist/cjs/legacy/context/auth-context.js +0 -29
  178. package/dist/cjs/legacy/context/auth-context.js.map +0 -1
  179. package/dist/cjs/legacy/hooks/app-notifications/index.d.ts +0 -5
  180. package/dist/cjs/legacy/hooks/app-notifications/index.js +0 -17
  181. package/dist/cjs/legacy/hooks/app-notifications/index.js.map +0 -1
  182. package/dist/cjs/legacy/hooks/app-notifications/useAppNotifications.d.ts +0 -2
  183. package/dist/cjs/legacy/hooks/app-notifications/useAppNotifications.js +0 -9
  184. package/dist/cjs/legacy/hooks/app-notifications/useAppNotifications.js.map +0 -1
  185. package/dist/cjs/legacy/hooks/app-notifications/useAppNotificationsData.d.ts +0 -16
  186. package/dist/cjs/legacy/hooks/app-notifications/useAppNotificationsData.js +0 -225
  187. package/dist/cjs/legacy/hooks/app-notifications/useAppNotificationsData.js.map +0 -1
  188. package/dist/cjs/legacy/hooks/app-notifications/useCountUnreadNotifications.d.ts +0 -2
  189. package/dist/cjs/legacy/hooks/app-notifications/useCountUnreadNotifications.js +0 -72
  190. package/dist/cjs/legacy/hooks/app-notifications/useCountUnreadNotifications.js.map +0 -1
  191. package/dist/cjs/legacy/hooks/app-notifications/useFetchAppNotifications.d.ts +0 -6
  192. package/dist/cjs/legacy/hooks/app-notifications/useFetchAppNotifications.js +0 -79
  193. package/dist/cjs/legacy/hooks/app-notifications/useFetchAppNotifications.js.map +0 -1
  194. package/dist/cjs/legacy/hooks/app-notifications/useMarkNotificationAsRead.d.ts +0 -2
  195. package/dist/cjs/legacy/hooks/app-notifications/useMarkNotificationAsRead.js +0 -74
  196. package/dist/cjs/legacy/hooks/app-notifications/useMarkNotificationAsRead.js.map +0 -1
  197. package/dist/cjs/legacy/hooks/auth/index.d.ts +0 -8
  198. package/dist/cjs/legacy/hooks/auth/index.js +0 -23
  199. package/dist/cjs/legacy/hooks/auth/index.js.map +0 -1
  200. package/dist/cjs/legacy/hooks/auth/useAuth.d.ts +0 -2
  201. package/dist/cjs/legacy/hooks/auth/useAuth.js +0 -9
  202. package/dist/cjs/legacy/hooks/auth/useAuth.js.map +0 -1
  203. package/dist/cjs/legacy/hooks/auth/useAuthData.d.ts +0 -41
  204. package/dist/cjs/legacy/hooks/auth/useAuthData.js +0 -271
  205. package/dist/cjs/legacy/hooks/auth/useAuthData.js.map +0 -1
  206. package/dist/cjs/legacy/hooks/auth/useChangePassword.d.ts +0 -5
  207. package/dist/cjs/legacy/hooks/auth/useChangePassword.js +0 -70
  208. package/dist/cjs/legacy/hooks/auth/useChangePassword.js.map +0 -1
  209. package/dist/cjs/legacy/hooks/auth/useRequestNewAccessToken.d.ts +0 -7
  210. package/dist/cjs/legacy/hooks/auth/useRequestNewAccessToken.js +0 -71
  211. package/dist/cjs/legacy/hooks/auth/useRequestNewAccessToken.js.map +0 -1
  212. package/dist/cjs/legacy/hooks/auth/useSignInWithEmailAndPassword.d.ts +0 -9
  213. package/dist/cjs/legacy/hooks/auth/useSignInWithEmailAndPassword.js +0 -72
  214. package/dist/cjs/legacy/hooks/auth/useSignInWithEmailAndPassword.js.map +0 -1
  215. package/dist/cjs/legacy/hooks/auth/useSignOut.d.ts +0 -4
  216. package/dist/cjs/legacy/hooks/auth/useSignOut.js +0 -67
  217. package/dist/cjs/legacy/hooks/auth/useSignOut.js.map +0 -1
  218. package/dist/cjs/legacy/hooks/auth/useSignUpWithEmailAndPassword.d.ts +0 -20
  219. package/dist/cjs/legacy/hooks/auth/useSignUpWithEmailAndPassword.js +0 -80
  220. package/dist/cjs/legacy/hooks/auth/useSignUpWithEmailAndPassword.js.map +0 -1
  221. package/dist/cjs/legacy/hooks/auth/useVerifyExternalUser.d.ts +0 -8
  222. package/dist/cjs/legacy/hooks/auth/useVerifyExternalUser.js +0 -70
  223. package/dist/cjs/legacy/hooks/auth/useVerifyExternalUser.js.map +0 -1
  224. package/dist/esm/context/lists-context.d.ts +0 -9
  225. package/dist/esm/context/lists-context.js +0 -10
  226. package/dist/esm/context/lists-context.js.map +0 -1
  227. package/dist/esm/context/user-context.d.ts +0 -8
  228. package/dist/esm/context/user-context.js +0 -21
  229. package/dist/esm/context/user-context.js.map +0 -1
  230. package/dist/esm/hooks/app-notifications-redux/useAppNotificationsDataRedux.d.ts +0 -21
  231. package/dist/esm/hooks/app-notifications-redux/useAppNotificationsDataRedux.js +0 -103
  232. package/dist/esm/hooks/app-notifications-redux/useAppNotificationsDataRedux.js.map +0 -1
  233. package/dist/esm/hooks/lists/index.d.ts +0 -10
  234. package/dist/esm/hooks/lists/index.js +0 -11
  235. package/dist/esm/hooks/lists/index.js.map +0 -1
  236. package/dist/esm/hooks/lists/useAddToList.d.ts +0 -6
  237. package/dist/esm/hooks/lists/useAddToList.js +0 -65
  238. package/dist/esm/hooks/lists/useAddToList.js.map +0 -1
  239. package/dist/esm/hooks/lists/useCreateList.d.ts +0 -6
  240. package/dist/esm/hooks/lists/useCreateList.js +0 -65
  241. package/dist/esm/hooks/lists/useCreateList.js.map +0 -1
  242. package/dist/esm/hooks/lists/useDeleteList.d.ts +0 -4
  243. package/dist/esm/hooks/lists/useDeleteList.js +0 -64
  244. package/dist/esm/hooks/lists/useDeleteList.js.map +0 -1
  245. package/dist/esm/hooks/lists/useFetchRootList.d.ts +0 -3
  246. package/dist/esm/hooks/lists/useFetchRootList.js +0 -64
  247. package/dist/esm/hooks/lists/useFetchRootList.js.map +0 -1
  248. package/dist/esm/hooks/lists/useFetchSubLists.d.ts +0 -5
  249. package/dist/esm/hooks/lists/useFetchSubLists.js +0 -63
  250. package/dist/esm/hooks/lists/useFetchSubLists.js.map +0 -1
  251. package/dist/esm/hooks/lists/useIsEntitySaved.js.map +0 -1
  252. package/dist/esm/hooks/lists/useLists.d.ts +0 -2
  253. package/dist/esm/hooks/lists/useLists.js +0 -6
  254. package/dist/esm/hooks/lists/useLists.js.map +0 -1
  255. package/dist/esm/hooks/lists/useListsData.js +0 -386
  256. package/dist/esm/hooks/lists/useListsData.js.map +0 -1
  257. package/dist/esm/hooks/lists/useRemoveFromList.d.ts +0 -6
  258. package/dist/esm/hooks/lists/useRemoveFromList.js +0 -65
  259. package/dist/esm/hooks/lists/useRemoveFromList.js.map +0 -1
  260. package/dist/esm/hooks/lists/useUpdateList.d.ts +0 -8
  261. package/dist/esm/hooks/lists/useUpdateList.js +0 -65
  262. package/dist/esm/hooks/lists/useUpdateList.js.map +0 -1
  263. package/dist/esm/hooks/users/useUser.d.ts +0 -2
  264. package/dist/esm/hooks/users/useUser.js +0 -6
  265. package/dist/esm/hooks/users/useUser.js.map +0 -1
  266. package/dist/esm/hooks/users/useUserData.d.ts +0 -12
  267. package/dist/esm/hooks/users/useUserData.js +0 -71
  268. package/dist/esm/hooks/users/useUserData.js.map +0 -1
  269. package/dist/esm/legacy/context/app-notifications-context.d.ts +0 -8
  270. package/dist/esm/legacy/context/app-notifications-context.js +0 -21
  271. package/dist/esm/legacy/context/app-notifications-context.js.map +0 -1
  272. package/dist/esm/legacy/context/auth-context.d.ts +0 -8
  273. package/dist/esm/legacy/context/auth-context.js +0 -22
  274. package/dist/esm/legacy/context/auth-context.js.map +0 -1
  275. package/dist/esm/legacy/hooks/app-notifications/index.d.ts +0 -5
  276. package/dist/esm/legacy/hooks/app-notifications/index.js +0 -6
  277. package/dist/esm/legacy/hooks/app-notifications/index.js.map +0 -1
  278. package/dist/esm/legacy/hooks/app-notifications/useAppNotifications.d.ts +0 -2
  279. package/dist/esm/legacy/hooks/app-notifications/useAppNotifications.js +0 -6
  280. package/dist/esm/legacy/hooks/app-notifications/useAppNotifications.js.map +0 -1
  281. package/dist/esm/legacy/hooks/app-notifications/useAppNotificationsData.d.ts +0 -16
  282. package/dist/esm/legacy/hooks/app-notifications/useAppNotificationsData.js +0 -220
  283. package/dist/esm/legacy/hooks/app-notifications/useAppNotificationsData.js.map +0 -1
  284. package/dist/esm/legacy/hooks/app-notifications/useCountUnreadNotifications.d.ts +0 -2
  285. package/dist/esm/legacy/hooks/app-notifications/useCountUnreadNotifications.js +0 -67
  286. package/dist/esm/legacy/hooks/app-notifications/useCountUnreadNotifications.js.map +0 -1
  287. package/dist/esm/legacy/hooks/app-notifications/useFetchAppNotifications.d.ts +0 -6
  288. package/dist/esm/legacy/hooks/app-notifications/useFetchAppNotifications.js +0 -74
  289. package/dist/esm/legacy/hooks/app-notifications/useFetchAppNotifications.js.map +0 -1
  290. package/dist/esm/legacy/hooks/app-notifications/useMarkNotificationAsRead.d.ts +0 -2
  291. package/dist/esm/legacy/hooks/app-notifications/useMarkNotificationAsRead.js +0 -69
  292. package/dist/esm/legacy/hooks/app-notifications/useMarkNotificationAsRead.js.map +0 -1
  293. package/dist/esm/legacy/hooks/auth/index.d.ts +0 -8
  294. package/dist/esm/legacy/hooks/auth/index.js +0 -9
  295. package/dist/esm/legacy/hooks/auth/index.js.map +0 -1
  296. package/dist/esm/legacy/hooks/auth/useAuth.d.ts +0 -2
  297. package/dist/esm/legacy/hooks/auth/useAuth.js +0 -6
  298. package/dist/esm/legacy/hooks/auth/useAuth.js.map +0 -1
  299. package/dist/esm/legacy/hooks/auth/useAuthData.d.ts +0 -41
  300. package/dist/esm/legacy/hooks/auth/useAuthData.js +0 -266
  301. package/dist/esm/legacy/hooks/auth/useAuthData.js.map +0 -1
  302. package/dist/esm/legacy/hooks/auth/useChangePassword.d.ts +0 -5
  303. package/dist/esm/legacy/hooks/auth/useChangePassword.js +0 -65
  304. package/dist/esm/legacy/hooks/auth/useChangePassword.js.map +0 -1
  305. package/dist/esm/legacy/hooks/auth/useRequestNewAccessToken.d.ts +0 -7
  306. package/dist/esm/legacy/hooks/auth/useRequestNewAccessToken.js +0 -66
  307. package/dist/esm/legacy/hooks/auth/useRequestNewAccessToken.js.map +0 -1
  308. package/dist/esm/legacy/hooks/auth/useSignInWithEmailAndPassword.d.ts +0 -9
  309. package/dist/esm/legacy/hooks/auth/useSignInWithEmailAndPassword.js +0 -67
  310. package/dist/esm/legacy/hooks/auth/useSignInWithEmailAndPassword.js.map +0 -1
  311. package/dist/esm/legacy/hooks/auth/useSignOut.d.ts +0 -4
  312. package/dist/esm/legacy/hooks/auth/useSignOut.js +0 -62
  313. package/dist/esm/legacy/hooks/auth/useSignOut.js.map +0 -1
  314. package/dist/esm/legacy/hooks/auth/useSignUpWithEmailAndPassword.d.ts +0 -20
  315. package/dist/esm/legacy/hooks/auth/useSignUpWithEmailAndPassword.js +0 -75
  316. package/dist/esm/legacy/hooks/auth/useSignUpWithEmailAndPassword.js.map +0 -1
  317. package/dist/esm/legacy/hooks/auth/useVerifyExternalUser.d.ts +0 -8
  318. package/dist/esm/legacy/hooks/auth/useVerifyExternalUser.js +0 -65
  319. package/dist/esm/legacy/hooks/auth/useVerifyExternalUser.js.map +0 -1
  320. /package/dist/cjs/hooks/{lists → lists-redux}/useIsEntitySaved.d.ts +0 -0
  321. /package/dist/cjs/hooks/{lists → lists-redux}/useIsEntitySaved.js +0 -0
  322. /package/dist/esm/hooks/{lists → lists-redux}/useIsEntitySaved.d.ts +0 -0
  323. /package/dist/esm/hooks/{lists → lists-redux}/useIsEntitySaved.js +0 -0
@@ -1,76 +0,0 @@
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
- var react_1 = require("react");
43
- var useUpdateUser_1 = __importDefault(require("./useUpdateUser"));
44
- var handleError_1 = require("../../utils/handleError");
45
- function useUserData(_a) {
46
- var _this = this;
47
- var user = _a.user, setUser = _a.setUser;
48
- var updateUser = (0, useUpdateUser_1.default)();
49
- var handleUpdateUser = (0, react_1.useCallback)(function (update) { return __awaiter(_this, void 0, void 0, function () {
50
- var newUser, err_1;
51
- return __generator(this, function (_a) {
52
- switch (_a.label) {
53
- case 0:
54
- if (!user)
55
- return [2 /*return*/];
56
- _a.label = 1;
57
- case 1:
58
- _a.trys.push([1, 3, , 4]);
59
- return [4 /*yield*/, updateUser({ userId: user.id, update: update })];
60
- case 2:
61
- newUser = _a.sent();
62
- if (newUser)
63
- setUser === null || setUser === void 0 ? void 0 : setUser(newUser);
64
- return [3 /*break*/, 4];
65
- case 3:
66
- err_1 = _a.sent();
67
- (0, handleError_1.handleError)(err_1, "Updating user failed");
68
- return [3 /*break*/, 4];
69
- case 4: return [2 /*return*/];
70
- }
71
- });
72
- }); }, [user, updateUser, setUser]);
73
- return { user: user, updateUser: handleUpdateUser };
74
- }
75
- exports.default = useUserData;
76
- //# sourceMappingURL=useUserData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useUserData.js","sourceRoot":"","sources":["../../../../src/hooks/users/useUserData.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AAEpC,kEAAkE;AAClE,uDAAsD;AAYtD,SAAS,WAAW,CAAC,EAAmC;IAAxD,iBAgBC;QAhBsB,IAAI,UAAA,EAAE,OAAO,aAAA;IAClC,IAAM,UAAU,GAAG,IAAA,uBAAa,GAAE,CAAC;IAEnC,IAAM,gBAAgB,GAAG,IAAA,mBAAW,EAClC,UAAO,MAAwB;;;;;oBAC7B,IAAI,CAAC,IAAI;wBAAE,sBAAO;;;;oBAEA,qBAAM,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,EAAA;;oBAAvD,OAAO,GAAG,SAA6C;oBAC7D,IAAI,OAAO;wBAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,OAAO,CAAC,CAAC;;;;oBAEhC,IAAA,yBAAW,EAAC,KAAG,EAAE,sBAAsB,CAAC,CAAC;;;;;SAE5C,EACD,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAC5B,CAAC;IACF,OAAO,EAAE,IAAI,MAAA,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;AAChD,CAAC;AAED,kBAAe,WAAW,CAAC"}
@@ -1,8 +0,0 @@
1
- import { UseAppNotificationsDataValues, UseAppNotificationsDataProps } from "../hooks/app-notifications/useAppNotificationsData";
2
- export interface AppNotificationsContextProps extends UseAppNotificationsDataProps {
3
- children: React.ReactNode;
4
- }
5
- export interface AppNotificationsContextValues extends UseAppNotificationsDataValues {
6
- }
7
- export declare const AppNotificationsContext: import("react").Context<Partial<AppNotificationsContextValues>>;
8
- export declare const AppNotificationsProvider: React.FC<AppNotificationsContextProps>;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.AppNotificationsProvider = exports.AppNotificationsContext = void 0;
18
- var jsx_runtime_1 = require("react/jsx-runtime");
19
- var react_1 = require("react");
20
- var useAppNotificationsData_1 = __importDefault(require("../hooks/app-notifications/useAppNotificationsData"));
21
- exports.AppNotificationsContext = (0, react_1.createContext)({});
22
- var AppNotificationsProvider = function (_a) {
23
- var children = _a.children, restOfProps = __rest(_a, ["children"]);
24
- var data = (0, useAppNotificationsData_1.default)(restOfProps);
25
- return ((0, jsx_runtime_1.jsx)(exports.AppNotificationsContext.Provider, { value: data, children: children }));
26
- };
27
- exports.AppNotificationsProvider = AppNotificationsProvider;
28
- //# sourceMappingURL=app-notifications-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app-notifications-context.js","sourceRoot":"","sources":["../../../../src/legacy/context/app-notifications-context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,+BAAsC;AACtC,+GAG4D;AAU/C,QAAA,uBAAuB,GAAG,IAAA,qBAAa,EAElD,EAAE,CAAC,CAAC;AAEC,IAAM,wBAAwB,GAEjC,UAAC,EAA0D;IAAxD,IAAA,QAAQ,cAAA,EAAK,WAAW,cAA1B,YAA4B,CAAF;IAC7B,IAAM,IAAI,GAAG,IAAA,iCAAuB,EAAC,WAAW,CAAC,CAAC;IAClD,OAAO,CACL,uBAAC,+BAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,YAC1C,QAAQ,GACwB,CACpC,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,wBAAwB,4BASnC"}
@@ -1,8 +0,0 @@
1
- import { UseAuthDataProps, UseAuthDataValues } from "../hooks/auth/useAuthData";
2
- export interface AuthContextProps extends UseAuthDataProps {
3
- children: React.ReactNode;
4
- }
5
- export interface AuthContextValues extends Omit<UseAuthDataValues, "user" | "setUser"> {
6
- }
7
- export declare const AuthContext: import("react").Context<Partial<AuthContextValues>>;
8
- export declare const AuthProvider: React.FC<AuthContextProps>;
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.AuthProvider = exports.AuthContext = void 0;
18
- var jsx_runtime_1 = require("react/jsx-runtime");
19
- var react_1 = require("react");
20
- var useAuthData_1 = __importDefault(require("../hooks/auth/useAuthData"));
21
- var user_context_1 = require("../../context/user-context");
22
- exports.AuthContext = (0, react_1.createContext)({});
23
- var AuthProvider = function (_a) {
24
- var children = _a.children, restOfProps = __rest(_a, ["children"]);
25
- var _b = (0, useAuthData_1.default)(restOfProps), user = _b.user, setUser = _b.setUser, restOfValues = __rest(_b, ["user", "setUser"]);
26
- return ((0, jsx_runtime_1.jsx)(exports.AuthContext.Provider, { value: restOfValues, children: (0, jsx_runtime_1.jsx)(user_context_1.UserProvider, { user: user, setUser: setUser, children: children }) }));
27
- };
28
- exports.AuthProvider = AuthProvider;
29
- //# sourceMappingURL=auth-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-context.js","sourceRoot":"","sources":["../../../../src/legacy/context/auth-context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,+BAAsC;AACtC,0EAGmC;AACnC,2DAA0D;AAS7C,QAAA,WAAW,GAAG,IAAA,qBAAa,EAA6B,EAAE,CAAC,CAAC;AAElE,IAAM,YAAY,GAA+B,UAAC,EAGtC;IAFjB,IAAA,QAAQ,cAAA,EACL,WAAW,cAFyC,YAGxD,CADe;IAEd,IAAM,KAAqC,IAAA,qBAAW,EAAC,WAAW,CAAC,EAA3D,IAAI,UAAA,EAAE,OAAO,aAAA,EAAK,YAAY,cAAhC,mBAAkC,CAA2B,CAAC;IAEpE,OAAO,CACL,uBAAC,mBAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YACvC,uBAAC,2BAAY,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,YACvC,QAAQ,GACI,GACM,CACxB,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,YAAY,gBAavB"}
@@ -1,5 +0,0 @@
1
- export { default as useAppNotifications } from "./useAppNotifications";
2
- export { default as useAppNotificationsData } from "./useAppNotificationsData";
3
- export { default as useCountUnreadNotifications } from "./useCountUnreadNotifications";
4
- export { default as useFetchAppNotifications } from "./useFetchAppNotifications";
5
- export { default as useMarkNotificationAsRead } from "./useMarkNotificationAsRead";
@@ -1,17 +0,0 @@
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.useMarkNotificationAsRead = exports.useFetchAppNotifications = exports.useCountUnreadNotifications = exports.useAppNotificationsData = exports.useAppNotifications = void 0;
7
- var useAppNotifications_1 = require("./useAppNotifications");
8
- Object.defineProperty(exports, "useAppNotifications", { enumerable: true, get: function () { return __importDefault(useAppNotifications_1).default; } });
9
- var useAppNotificationsData_1 = require("./useAppNotificationsData");
10
- Object.defineProperty(exports, "useAppNotificationsData", { enumerable: true, get: function () { return __importDefault(useAppNotificationsData_1).default; } });
11
- var useCountUnreadNotifications_1 = require("./useCountUnreadNotifications");
12
- Object.defineProperty(exports, "useCountUnreadNotifications", { enumerable: true, get: function () { return __importDefault(useCountUnreadNotifications_1).default; } });
13
- var useFetchAppNotifications_1 = require("./useFetchAppNotifications");
14
- Object.defineProperty(exports, "useFetchAppNotifications", { enumerable: true, get: function () { return __importDefault(useFetchAppNotifications_1).default; } });
15
- var useMarkNotificationAsRead_1 = require("./useMarkNotificationAsRead");
16
- Object.defineProperty(exports, "useMarkNotificationAsRead", { enumerable: true, get: function () { return __importDefault(useMarkNotificationAsRead_1).default; } });
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/legacy/hooks/app-notifications/index.ts"],"names":[],"mappings":";;;;;;AAAA,6DAAuE;AAA9D,2IAAA,OAAO,OAAuB;AACvC,qEAA+E;AAAtE,mJAAA,OAAO,OAA2B;AAC3C,6EAAuF;AAA9E,2JAAA,OAAO,OAA+B;AAC/C,uEAAiF;AAAxE,qJAAA,OAAO,OAA4B;AAC5C,yEAAmF;AAA1E,uJAAA,OAAO,OAA6B"}
@@ -1,2 +0,0 @@
1
- import { AppNotificationsContextValues } from "../../context/app-notifications-context";
2
- export default function useAppNotifications(): Partial<AppNotificationsContextValues>;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = useAppNotifications;
4
- var react_1 = require("react");
5
- var app_notifications_context_1 = require("../../context/app-notifications-context");
6
- function useAppNotifications() {
7
- return (0, react_1.useContext)(app_notifications_context_1.AppNotificationsContext);
8
- }
9
- //# sourceMappingURL=useAppNotifications.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAppNotifications.js","sourceRoot":"","sources":["../../../../../src/legacy/hooks/app-notifications/useAppNotifications.tsx"],"names":[],"mappings":";;AAMA,sCAEC;AARD,+BAAmC;AACnC,qFAGiD;AAEjD,SAAwB,mBAAmB;IACzC,OAAO,IAAA,kBAAU,EAAC,mDAAuB,CAAC,CAAC;AAC7C,CAAC"}
@@ -1,16 +0,0 @@
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
- resetAppNotifications: () => Promise<void>;
14
- }
15
- declare function useAppNotificationsData({ limit, notificationTemplates, }: UseAppNotificationsDataProps): UseAppNotificationsDataValues;
16
- export default useAppNotificationsData;
@@ -1,225 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- 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);
24
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- 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;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
50
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
51
- if (ar || !(i in from)) {
52
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
53
- ar[i] = from[i];
54
- }
55
- }
56
- return to.concat(ar || Array.prototype.slice.call(from));
57
- };
58
- var __importDefault = (this && this.__importDefault) || function (mod) {
59
- return (mod && mod.__esModule) ? mod : { "default": mod };
60
- };
61
- Object.defineProperty(exports, "__esModule", { value: true });
62
- var react_1 = require("react");
63
- var useFetchAppNotifications_1 = __importDefault(require("./useFetchAppNotifications"));
64
- var useCountUnreadNotifications_1 = __importDefault(require("./useCountUnreadNotifications"));
65
- var useMarkNotificationAsRead_1 = __importDefault(require("./useMarkNotificationAsRead"));
66
- var handleError_1 = require("../../../utils/handleError");
67
- var addNotificationsMessages_1 = __importDefault(require("../../../helpers/addNotificationsMessages"));
68
- function useAppNotificationsData(_a) {
69
- var _this = this;
70
- var _b = _a.limit, limit = _b === void 0 ? 10 : _b, notificationTemplates = _a.notificationTemplates;
71
- var _c = (0, react_1.useState)([]), appNotifications = _c[0], setAppNotifications = _c[1];
72
- var _d = (0, react_1.useState)(0), unreadAppNotificationsCount = _d[0], setUnreadAppNotificationsCount = _d[1];
73
- var _e = (0, react_1.useState)(1), page = _e[0], setPage = _e[1];
74
- var loading = (0, react_1.useRef)(true);
75
- var _f = (0, react_1.useState)(true), loadingState = _f[0], setLoadingState = _f[1];
76
- var hasMore = (0, react_1.useRef)(true);
77
- var _g = (0, react_1.useState)(true), hasMoreState = _g[0], setHasMoreState = _g[1];
78
- var fetchAppNotifications = (0, useFetchAppNotifications_1.default)();
79
- var countUnreadNotifications = (0, useCountUnreadNotifications_1.default)();
80
- var markNotificationAsRead = (0, useMarkNotificationAsRead_1.default)();
81
- var resetAppNotifications = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
82
- var newAppNotifications, completeNotifications, err_1;
83
- return __generator(this, function (_a) {
84
- switch (_a.label) {
85
- case 0:
86
- _a.trys.push([0, 2, 3, 4]);
87
- loading.current = true;
88
- setLoadingState(true);
89
- hasMore.current = true;
90
- setHasMoreState(true);
91
- setPage(1);
92
- setAppNotifications([]);
93
- return [4 /*yield*/, fetchAppNotifications({
94
- page: 1,
95
- limit: limit,
96
- })];
97
- case 1:
98
- newAppNotifications = _a.sent();
99
- if (newAppNotifications) {
100
- completeNotifications = (0, addNotificationsMessages_1.default)(newAppNotifications, notificationTemplates);
101
- setAppNotifications(completeNotifications);
102
- if (newAppNotifications.length < limit) {
103
- hasMore.current = false;
104
- setHasMoreState(false);
105
- }
106
- }
107
- return [3 /*break*/, 4];
108
- case 2:
109
- err_1 = _a.sent();
110
- (0, handleError_1.handleError)(err_1, "Failed to refesh notifications:");
111
- return [3 /*break*/, 4];
112
- case 3:
113
- loading.current = false;
114
- setLoadingState(false);
115
- return [7 /*endfinally*/];
116
- case 4: return [2 /*return*/];
117
- }
118
- });
119
- }); }, [fetchAppNotifications, limit, notificationTemplates]);
120
- var loadMore = function () {
121
- if (loading.current || !hasMore.current)
122
- return;
123
- setPage(function (prevPage) {
124
- return prevPage + 1;
125
- });
126
- };
127
- var handleMarkNotificationAsRead = function (notificationId) { return __awaiter(_this, void 0, void 0, function () {
128
- var err_2;
129
- return __generator(this, function (_a) {
130
- switch (_a.label) {
131
- case 0:
132
- _a.trys.push([0, 2, , 3]);
133
- return [4 /*yield*/, markNotificationAsRead(notificationId)];
134
- case 1:
135
- _a.sent();
136
- setUnreadAppNotificationsCount(function (prevCount) { return Math.max(prevCount - 1, 0); });
137
- setAppNotifications(function (prevNotifs) {
138
- return prevNotifs.map(function (notif) {
139
- return notif.id === notificationId ? __assign(__assign({}, notif), { isRead: true }) : notif;
140
- });
141
- });
142
- return [3 /*break*/, 3];
143
- case 2:
144
- err_2 = _a.sent();
145
- (0, handleError_1.handleError)(err_2, "Failed to mark notification as read:");
146
- return [3 /*break*/, 3];
147
- case 3: return [2 /*return*/];
148
- }
149
- });
150
- }); };
151
- // Check how many unread notifications we have
152
- (0, react_1.useEffect)(function () {
153
- (function () { return __awaiter(_this, void 0, void 0, function () {
154
- var newCount;
155
- return __generator(this, function (_a) {
156
- switch (_a.label) {
157
- case 0: return [4 /*yield*/, countUnreadNotifications()];
158
- case 1:
159
- newCount = _a.sent();
160
- if (typeof newCount === "number")
161
- setUnreadAppNotificationsCount(newCount);
162
- return [2 /*return*/];
163
- }
164
- });
165
- }); })();
166
- }, [countUnreadNotifications]);
167
- (0, react_1.useEffect)(function () {
168
- resetAppNotifications === null || resetAppNotifications === void 0 ? void 0 : resetAppNotifications();
169
- }, [resetAppNotifications]);
170
- // useEffect to get a new batch of app notifications
171
- (0, react_1.useEffect)(function () {
172
- var loadMoreNotifications = function () { return __awaiter(_this, void 0, void 0, function () {
173
- var newAppNotifications, completeNotifications_1, err_3;
174
- return __generator(this, function (_a) {
175
- switch (_a.label) {
176
- case 0:
177
- _a.trys.push([0, 2, 3, 4]);
178
- loading.current = true;
179
- return [4 /*yield*/, fetchAppNotifications({
180
- page: page,
181
- limit: limit,
182
- })];
183
- case 1:
184
- newAppNotifications = _a.sent();
185
- if (newAppNotifications) {
186
- completeNotifications_1 = (0, addNotificationsMessages_1.default)(newAppNotifications, notificationTemplates);
187
- setAppNotifications(function (prevEntities) {
188
- return __spreadArray(__spreadArray([], prevEntities, true), completeNotifications_1, true);
189
- });
190
- if (newAppNotifications.length < limit) {
191
- hasMore.current = false;
192
- }
193
- }
194
- return [3 /*break*/, 4];
195
- case 2:
196
- err_3 = _a.sent();
197
- (0, handleError_1.handleError)(err_3, "Loading more app notifications failed:");
198
- return [3 /*break*/, 4];
199
- case 3:
200
- loading.current = false;
201
- return [7 /*endfinally*/];
202
- case 4: return [2 /*return*/];
203
- }
204
- });
205
- }); };
206
- // We only load more if the page changed
207
- // We rmoved this && hasMore.current && !loading.current because i caused us to skip page 2 (as request came to soon). Still not sure if it's issue that we don't check if we're loading
208
- // Maybe we can do something with debounce? So it will only allow the page state to increase by 1 until it finsihed loading?
209
- // EDIT: 've added it back aftr checking that indeed this is the issue. Let's keep it safe and find a way to fix it after
210
- if (page > 1 && hasMore.current && !loading.current) {
211
- loadMoreNotifications();
212
- }
213
- }, [page]);
214
- return {
215
- appNotifications: appNotifications,
216
- unreadAppNotificationsCount: unreadAppNotificationsCount,
217
- loading: loadingState,
218
- hasMore: hasMoreState,
219
- loadMore: loadMore,
220
- markNotificationAsRead: handleMarkNotificationAsRead,
221
- resetAppNotifications: resetAppNotifications,
222
- };
223
- }
224
- exports.default = useAppNotificationsData;
225
- //# sourceMappingURL=useAppNotificationsData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAppNotificationsData.js","sourceRoot":"","sources":["../../../../../src/legacy/hooks/app-notifications/useAppNotificationsData.tsx"],"names":[],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- declare function useCountUnreadNotifications(): () => Promise<number>;
2
- export default useCountUnreadNotifications;
@@ -1,72 +0,0 @@
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
- var react_1 = require("react");
43
- var useAxiosPrivate_1 = __importDefault(require("../../../config/useAxiosPrivate"));
44
- var useProject_1 = __importDefault(require("../../../hooks/projects/useProject"));
45
- var auth_redux_1 = require("../../../hooks/auth-redux");
46
- function useCountUnreadNotifications() {
47
- var _this = this;
48
- var axios = (0, useAxiosPrivate_1.default)();
49
- var projectId = (0, useProject_1.default)().projectId;
50
- var user = (0, auth_redux_1.useUserRedux)().user;
51
- var countUnreadNotifications = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
52
- var response;
53
- return __generator(this, function (_a) {
54
- switch (_a.label) {
55
- case 0:
56
- if (!user) {
57
- throw new Error("No authenticated user");
58
- }
59
- if (!projectId) {
60
- throw new Error("No projectId available.");
61
- }
62
- return [4 /*yield*/, axios.get("/".concat(projectId, "/app-notifications/count"), { withCredentials: true })];
63
- case 1:
64
- response = _a.sent();
65
- return [2 /*return*/, response.data];
66
- }
67
- });
68
- }); }, [projectId, user, axios]);
69
- return countUnreadNotifications;
70
- }
71
- exports.default = useCountUnreadNotifications;
72
- //# sourceMappingURL=useCountUnreadNotifications.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCountUnreadNotifications.js","sourceRoot":"","sources":["../../../../../src/legacy/hooks/app-notifications/useCountUnreadNotifications.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,kFAA4D;AAC5D,wDAAyD;AAEzD,SAAS,2BAA2B;IAApC,iBAsBC;IArBC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IACxB,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,IAAA,yBAAY,GAAE,KAAnB,CAAoB;IAEhC,IAAM,wBAAwB,GAAG,IAAA,mBAAW,EAAC;;;;;oBAC3C,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;oBAC3C,CAAC;oBAED,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,6BAA0B,EACvC,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBACD,sBAAO,QAAQ,CAAC,IAAc,EAAC;;;SAChC,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAE7B,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAED,kBAAe,2BAA2B,CAAC"}
@@ -1,6 +0,0 @@
1
- import { UnifiedAppNotification } from "../../../interfaces/models/AppNotification";
2
- declare function useFetchAppNotifications(): ({ page, limit }: {
3
- page: number;
4
- limit: number;
5
- }) => Promise<UnifiedAppNotification[]>;
6
- export default useFetchAppNotifications;