@replyke/core 5.1.6-beta.30 → 5.1.6-beta.31

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 (399) hide show
  1. package/dist/cjs/config/axios.d.ts +3 -0
  2. package/dist/cjs/config/axios.js +17 -0
  3. package/dist/cjs/config/axios.js.map +1 -0
  4. package/dist/cjs/config/useAxiosPrivate.d.ts +2 -0
  5. package/dist/cjs/config/useAxiosPrivate.js +82 -0
  6. package/dist/cjs/config/useAxiosPrivate.js.map +1 -0
  7. package/dist/cjs/constants/reportReasons.d.ts +12 -0
  8. package/dist/cjs/constants/reportReasons.js +15 -0
  9. package/dist/cjs/constants/reportReasons.js.map +1 -0
  10. package/dist/cjs/context/comment-section-context.d.ts +9 -0
  11. package/dist/cjs/context/comment-section-context.js +28 -0
  12. package/dist/cjs/context/comment-section-context.js.map +1 -0
  13. package/dist/cjs/context/entity-context.d.ts +9 -0
  14. package/dist/cjs/context/entity-context.js +38 -0
  15. package/dist/cjs/context/entity-context.js.map +1 -0
  16. package/dist/cjs/context/index.d.ts +4 -0
  17. package/dist/cjs/context/index.js +12 -0
  18. package/dist/cjs/context/index.js.map +1 -0
  19. package/dist/cjs/context/replyke-context.d.ts +10 -0
  20. package/dist/cjs/context/replyke-context.js +23 -0
  21. package/dist/cjs/context/replyke-context.js.map +1 -0
  22. package/dist/cjs/context/replyke-store-context.d.ts +13 -0
  23. package/dist/cjs/context/replyke-store-context.js +37 -0
  24. package/dist/cjs/context/replyke-store-context.js.map +1 -0
  25. package/dist/cjs/helpers/addCommentsToTree.d.ts +3 -0
  26. package/dist/cjs/helpers/addCommentsToTree.js +61 -0
  27. package/dist/cjs/helpers/addCommentsToTree.js.map +1 -0
  28. package/dist/cjs/helpers/addNotificationsMessages.d.ts +3 -0
  29. package/dist/cjs/helpers/addNotificationsMessages.js +91 -0
  30. package/dist/cjs/helpers/addNotificationsMessages.js.map +1 -0
  31. package/dist/cjs/helpers/getPublicFileUrl.d.ts +2 -0
  32. package/dist/cjs/helpers/getPublicFileUrl.js +10 -0
  33. package/dist/cjs/helpers/getPublicFileUrl.js.map +1 -0
  34. package/dist/cjs/helpers/getUserName.d.ts +2 -0
  35. package/dist/cjs/helpers/getUserName.js +23 -0
  36. package/dist/cjs/helpers/getUserName.js.map +1 -0
  37. package/dist/cjs/helpers/markCommentAsFailed.d.ts +2 -0
  38. package/dist/cjs/helpers/markCommentAsFailed.js +29 -0
  39. package/dist/cjs/helpers/markCommentAsFailed.js.map +1 -0
  40. package/dist/cjs/helpers/removeCommentFromTree.d.ts +2 -0
  41. package/dist/cjs/helpers/removeCommentFromTree.js +44 -0
  42. package/dist/cjs/helpers/removeCommentFromTree.js.map +1 -0
  43. package/dist/cjs/helpers/safeMergeStyleProps.d.ts +1 -0
  44. package/dist/cjs/helpers/safeMergeStyleProps.js +23 -0
  45. package/dist/cjs/helpers/safeMergeStyleProps.js.map +1 -0
  46. package/dist/cjs/hooks/app-notifications/index.d.ts +3 -0
  47. package/dist/cjs/hooks/app-notifications/index.js +12 -0
  48. package/dist/cjs/hooks/app-notifications/index.js.map +1 -0
  49. package/dist/cjs/hooks/app-notifications/useAppNotifications.d.ts +21 -0
  50. package/dist/cjs/hooks/app-notifications/useAppNotifications.js +108 -0
  51. package/dist/cjs/hooks/app-notifications/useAppNotifications.js.map +1 -0
  52. package/dist/cjs/hooks/app-notifications/useAppNotificationsActions.d.ts +13 -0
  53. package/dist/cjs/hooks/app-notifications/useAppNotificationsActions.js +266 -0
  54. package/dist/cjs/hooks/app-notifications/useAppNotificationsActions.js.map +1 -0
  55. package/dist/cjs/hooks/auth/index.d.ts +1 -0
  56. package/dist/cjs/hooks/auth/index.js +9 -0
  57. package/dist/cjs/hooks/auth/index.js.map +1 -0
  58. package/dist/cjs/hooks/auth/useAuth.d.ts +32 -0
  59. package/dist/cjs/hooks/auth/useAuth.js +180 -0
  60. package/dist/cjs/hooks/auth/useAuth.js.map +1 -0
  61. package/dist/cjs/hooks/comments/index.d.ts +12 -0
  62. package/dist/cjs/hooks/comments/index.js +31 -0
  63. package/dist/cjs/hooks/comments/index.js.map +1 -0
  64. package/dist/cjs/hooks/comments/useCommentSection.d.ts +2 -0
  65. package/dist/cjs/hooks/comments/useCommentSection.js +9 -0
  66. package/dist/cjs/hooks/comments/useCommentSection.js.map +1 -0
  67. package/dist/cjs/hooks/comments/useCommentSectionData.d.ts +60 -0
  68. package/dist/cjs/hooks/comments/useCommentSectionData.js +407 -0
  69. package/dist/cjs/hooks/comments/useCommentSectionData.js.map +1 -0
  70. package/dist/cjs/hooks/comments/useCommentVotes.d.ts +11 -0
  71. package/dist/cjs/hooks/comments/useCommentVotes.js +234 -0
  72. package/dist/cjs/hooks/comments/useCommentVotes.js.map +1 -0
  73. package/dist/cjs/hooks/comments/useCreateComment.d.ts +14 -0
  74. package/dist/cjs/hooks/comments/useCreateComment.js +90 -0
  75. package/dist/cjs/hooks/comments/useCreateComment.js.map +1 -0
  76. package/dist/cjs/hooks/comments/useDeleteComment.d.ts +4 -0
  77. package/dist/cjs/hooks/comments/useDeleteComment.js +70 -0
  78. package/dist/cjs/hooks/comments/useDeleteComment.js.map +1 -0
  79. package/dist/cjs/hooks/comments/useDownvoteComment.d.ts +5 -0
  80. package/dist/cjs/hooks/comments/useDownvoteComment.js +71 -0
  81. package/dist/cjs/hooks/comments/useDownvoteComment.js.map +1 -0
  82. package/dist/cjs/hooks/comments/useEntityComments.d.ts +22 -0
  83. package/dist/cjs/hooks/comments/useEntityComments.js +196 -0
  84. package/dist/cjs/hooks/comments/useEntityComments.js.map +1 -0
  85. package/dist/cjs/hooks/comments/useFetchComment.d.ts +9 -0
  86. package/dist/cjs/hooks/comments/useFetchComment.js +74 -0
  87. package/dist/cjs/hooks/comments/useFetchComment.js.map +1 -0
  88. package/dist/cjs/hooks/comments/useFetchCommentByForeignId.d.ts +9 -0
  89. package/dist/cjs/hooks/comments/useFetchCommentByForeignId.js +75 -0
  90. package/dist/cjs/hooks/comments/useFetchCommentByForeignId.js.map +1 -0
  91. package/dist/cjs/hooks/comments/useFetchManyComments.d.ts +12 -0
  92. package/dist/cjs/hooks/comments/useFetchManyComments.js +88 -0
  93. package/dist/cjs/hooks/comments/useFetchManyComments.js.map +1 -0
  94. package/dist/cjs/hooks/comments/useGroupReplies.d.ts +8 -0
  95. package/dist/cjs/hooks/comments/useGroupReplies.js +24 -0
  96. package/dist/cjs/hooks/comments/useGroupReplies.js.map +1 -0
  97. package/dist/cjs/hooks/comments/useProfileComments.d.ts +18 -0
  98. package/dist/cjs/hooks/comments/useProfileComments.js +179 -0
  99. package/dist/cjs/hooks/comments/useProfileComments.js.map +1 -0
  100. package/dist/cjs/hooks/comments/useRemoveCommentDownvote.d.ts +5 -0
  101. package/dist/cjs/hooks/comments/useRemoveCommentDownvote.js +71 -0
  102. package/dist/cjs/hooks/comments/useRemoveCommentDownvote.js.map +1 -0
  103. package/dist/cjs/hooks/comments/useRemoveCommentUpvote.d.ts +5 -0
  104. package/dist/cjs/hooks/comments/useRemoveCommentUpvote.js +71 -0
  105. package/dist/cjs/hooks/comments/useRemoveCommentUpvote.js.map +1 -0
  106. package/dist/cjs/hooks/comments/useReplies.d.ts +13 -0
  107. package/dist/cjs/hooks/comments/useReplies.js +107 -0
  108. package/dist/cjs/hooks/comments/useReplies.js.map +1 -0
  109. package/dist/cjs/hooks/comments/useUpdateComment.d.ts +6 -0
  110. package/dist/cjs/hooks/comments/useUpdateComment.js +73 -0
  111. package/dist/cjs/hooks/comments/useUpdateComment.js.map +1 -0
  112. package/dist/cjs/hooks/comments/useUpvoteComment.d.ts +5 -0
  113. package/dist/cjs/hooks/comments/useUpvoteComment.js +71 -0
  114. package/dist/cjs/hooks/comments/useUpvoteComment.js.map +1 -0
  115. package/dist/cjs/hooks/crypto/index.d.ts +1 -0
  116. package/dist/cjs/hooks/crypto/index.js +9 -0
  117. package/dist/cjs/hooks/crypto/index.js.map +1 -0
  118. package/dist/cjs/hooks/crypto/useSignTestingJwt.d.ts +6 -0
  119. package/dist/cjs/hooks/crypto/useSignTestingJwt.js +74 -0
  120. package/dist/cjs/hooks/crypto/useSignTestingJwt.js.map +1 -0
  121. package/dist/cjs/hooks/entities/index.d.ts +10 -0
  122. package/dist/cjs/hooks/entities/index.js +27 -0
  123. package/dist/cjs/hooks/entities/index.js.map +1 -0
  124. package/dist/cjs/hooks/entities/useCreateEntity.d.ts +18 -0
  125. package/dist/cjs/hooks/entities/useCreateEntity.js +79 -0
  126. package/dist/cjs/hooks/entities/useCreateEntity.js.map +1 -0
  127. package/dist/cjs/hooks/entities/useDeleteEntity.d.ts +4 -0
  128. package/dist/cjs/hooks/entities/useDeleteEntity.js +72 -0
  129. package/dist/cjs/hooks/entities/useDeleteEntity.js.map +1 -0
  130. package/dist/cjs/hooks/entities/useDownvoteEntity.d.ts +5 -0
  131. package/dist/cjs/hooks/entities/useDownvoteEntity.js +71 -0
  132. package/dist/cjs/hooks/entities/useDownvoteEntity.js.map +1 -0
  133. package/dist/cjs/hooks/entities/useEntity.d.ts +2 -0
  134. package/dist/cjs/hooks/entities/useEntity.js +9 -0
  135. package/dist/cjs/hooks/entities/useEntity.js.map +1 -0
  136. package/dist/cjs/hooks/entities/useEntityData.d.ts +24 -0
  137. package/dist/cjs/hooks/entities/useEntityData.js +246 -0
  138. package/dist/cjs/hooks/entities/useEntityData.js.map +1 -0
  139. package/dist/cjs/hooks/entities/useEntityVotes.d.ts +11 -0
  140. package/dist/cjs/hooks/entities/useEntityVotes.js +241 -0
  141. package/dist/cjs/hooks/entities/useEntityVotes.js.map +1 -0
  142. package/dist/cjs/hooks/entities/useFetchEntity.d.ts +5 -0
  143. package/dist/cjs/hooks/entities/useFetchEntity.js +70 -0
  144. package/dist/cjs/hooks/entities/useFetchEntity.js.map +1 -0
  145. package/dist/cjs/hooks/entities/useFetchEntityByForeignId.d.ts +6 -0
  146. package/dist/cjs/hooks/entities/useFetchEntityByForeignId.js +75 -0
  147. package/dist/cjs/hooks/entities/useFetchEntityByForeignId.js.map +1 -0
  148. package/dist/cjs/hooks/entities/useFetchEntityByShortId.d.ts +5 -0
  149. package/dist/cjs/hooks/entities/useFetchEntityByShortId.js +74 -0
  150. package/dist/cjs/hooks/entities/useFetchEntityByShortId.js.map +1 -0
  151. package/dist/cjs/hooks/entities/useIncrementEntityViews.d.ts +5 -0
  152. package/dist/cjs/hooks/entities/useIncrementEntityViews.js +73 -0
  153. package/dist/cjs/hooks/entities/useIncrementEntityViews.js.map +1 -0
  154. package/dist/cjs/hooks/entities/useRemoveEntityDownvote.d.ts +5 -0
  155. package/dist/cjs/hooks/entities/useRemoveEntityDownvote.js +71 -0
  156. package/dist/cjs/hooks/entities/useRemoveEntityDownvote.js.map +1 -0
  157. package/dist/cjs/hooks/entities/useRemoveEntityUpvote.d.ts +5 -0
  158. package/dist/cjs/hooks/entities/useRemoveEntityUpvote.js +71 -0
  159. package/dist/cjs/hooks/entities/useRemoveEntityUpvote.js.map +1 -0
  160. package/dist/cjs/hooks/entities/useUpdateEntity.d.ts +19 -0
  161. package/dist/cjs/hooks/entities/useUpdateEntity.js +77 -0
  162. package/dist/cjs/hooks/entities/useUpdateEntity.js.map +1 -0
  163. package/dist/cjs/hooks/entities/useUpvoteEntity.d.ts +5 -0
  164. package/dist/cjs/hooks/entities/useUpvoteEntity.js +71 -0
  165. package/dist/cjs/hooks/entities/useUpvoteEntity.js.map +1 -0
  166. package/dist/cjs/hooks/entity-lists/index.d.ts +4 -0
  167. package/dist/cjs/hooks/entity-lists/index.js +11 -0
  168. package/dist/cjs/hooks/entity-lists/index.js.map +1 -0
  169. package/dist/cjs/hooks/entity-lists/useEntityList.d.ts +53 -0
  170. package/dist/cjs/hooks/entity-lists/useEntityList.js +358 -0
  171. package/dist/cjs/hooks/entity-lists/useEntityList.js.map +1 -0
  172. package/dist/cjs/hooks/entity-lists/useEntityListActions.d.ts +51 -0
  173. package/dist/cjs/hooks/entity-lists/useEntityListActions.js +196 -0
  174. package/dist/cjs/hooks/entity-lists/useEntityListActions.js.map +1 -0
  175. package/dist/cjs/hooks/entity-lists/useInfusedData.d.ts +8 -0
  176. package/dist/cjs/hooks/entity-lists/useInfusedData.js +130 -0
  177. package/dist/cjs/hooks/entity-lists/useInfusedData.js.map +1 -0
  178. package/dist/cjs/hooks/lists/index.d.ts +3 -0
  179. package/dist/cjs/hooks/lists/index.js +14 -0
  180. package/dist/cjs/hooks/lists/index.js.map +1 -0
  181. package/dist/cjs/hooks/lists/useIsEntitySaved.d.ts +5 -0
  182. package/dist/cjs/hooks/lists/useIsEntitySaved.js +83 -0
  183. package/dist/cjs/hooks/lists/useIsEntitySaved.js.map +1 -0
  184. package/dist/cjs/hooks/lists/useLists.d.ts +36 -0
  185. package/dist/cjs/hooks/lists/useLists.js +239 -0
  186. package/dist/cjs/hooks/lists/useLists.js.map +1 -0
  187. package/dist/cjs/hooks/lists/useListsActions.d.ts +21 -0
  188. package/dist/cjs/hooks/lists/useListsActions.js +341 -0
  189. package/dist/cjs/hooks/lists/useListsActions.js.map +1 -0
  190. package/dist/cjs/hooks/projects/index.d.ts +2 -0
  191. package/dist/cjs/hooks/projects/index.js +11 -0
  192. package/dist/cjs/hooks/projects/index.js.map +1 -0
  193. package/dist/cjs/hooks/projects/useProject.d.ts +2 -0
  194. package/dist/cjs/hooks/projects/useProject.js +9 -0
  195. package/dist/cjs/hooks/projects/useProject.js.map +1 -0
  196. package/dist/cjs/hooks/projects/useProjectData.d.ts +10 -0
  197. package/dist/cjs/hooks/projects/useProjectData.js +78 -0
  198. package/dist/cjs/hooks/projects/useProjectData.js.map +1 -0
  199. package/dist/cjs/hooks/reports/index.d.ts +1 -0
  200. package/dist/cjs/hooks/reports/index.js +9 -0
  201. package/dist/cjs/hooks/reports/index.js.map +1 -0
  202. package/dist/cjs/hooks/reports/useCreateReport.d.ts +14 -0
  203. package/dist/cjs/hooks/reports/useCreateReport.js +108 -0
  204. package/dist/cjs/hooks/reports/useCreateReport.js.map +1 -0
  205. package/dist/cjs/hooks/storage/index.d.ts +1 -0
  206. package/dist/cjs/hooks/storage/index.js +9 -0
  207. package/dist/cjs/hooks/storage/index.js.map +1 -0
  208. package/dist/cjs/hooks/storage/useUploadFile.d.ts +14 -0
  209. package/dist/cjs/hooks/storage/useUploadFile.js +95 -0
  210. package/dist/cjs/hooks/storage/useUploadFile.js.map +1 -0
  211. package/dist/cjs/hooks/user/index.d.ts +2 -0
  212. package/dist/cjs/hooks/user/index.js +12 -0
  213. package/dist/cjs/hooks/user/index.js.map +1 -0
  214. package/dist/cjs/hooks/user/useUser.d.ts +18 -0
  215. package/dist/cjs/hooks/user/useUser.js +116 -0
  216. package/dist/cjs/hooks/user/useUser.js.map +1 -0
  217. package/dist/cjs/hooks/user/useUserActions.d.ts +12 -0
  218. package/dist/cjs/hooks/user/useUserActions.js +125 -0
  219. package/dist/cjs/hooks/user/useUserActions.js.map +1 -0
  220. package/dist/cjs/hooks/users/follows/index.d.ts +4 -0
  221. package/dist/cjs/hooks/users/follows/index.js +15 -0
  222. package/dist/cjs/hooks/users/follows/index.js.map +1 -0
  223. package/dist/cjs/hooks/users/follows/useFetchFollow.d.ts +6 -0
  224. package/dist/cjs/hooks/users/follows/useFetchFollow.js +81 -0
  225. package/dist/cjs/hooks/users/follows/useFetchFollow.js.map +1 -0
  226. package/dist/cjs/hooks/users/follows/useFollowManager.d.ts +9 -0
  227. package/dist/cjs/hooks/users/follows/useFollowManager.js +122 -0
  228. package/dist/cjs/hooks/users/follows/useFollowManager.js.map +1 -0
  229. package/dist/cjs/hooks/users/follows/useFollowUser.d.ts +4 -0
  230. package/dist/cjs/hooks/users/follows/useFollowUser.js +71 -0
  231. package/dist/cjs/hooks/users/follows/useFollowUser.js.map +1 -0
  232. package/dist/cjs/hooks/users/follows/useUnfollowUser.d.ts +4 -0
  233. package/dist/cjs/hooks/users/follows/useUnfollowUser.js +81 -0
  234. package/dist/cjs/hooks/users/follows/useUnfollowUser.js.map +1 -0
  235. package/dist/cjs/hooks/users/index.d.ts +9 -0
  236. package/dist/cjs/hooks/users/index.js +28 -0
  237. package/dist/cjs/hooks/users/index.js.map +1 -0
  238. package/dist/cjs/hooks/users/useCheckUsernameAvailability.d.ts +6 -0
  239. package/dist/cjs/hooks/users/useCheckUsernameAvailability.js +72 -0
  240. package/dist/cjs/hooks/users/useCheckUsernameAvailability.js.map +1 -0
  241. package/dist/cjs/hooks/users/useFetchUser.d.ts +5 -0
  242. package/dist/cjs/hooks/users/useFetchUser.js +70 -0
  243. package/dist/cjs/hooks/users/useFetchUser.js.map +1 -0
  244. package/dist/cjs/hooks/users/useFetchUserByForeignId.d.ts +5 -0
  245. package/dist/cjs/hooks/users/useFetchUserByForeignId.js +72 -0
  246. package/dist/cjs/hooks/users/useFetchUserByForeignId.js.map +1 -0
  247. package/dist/cjs/hooks/users/useFetchUserFollowersCount.d.ts +6 -0
  248. package/dist/cjs/hooks/users/useFetchUserFollowersCount.js +71 -0
  249. package/dist/cjs/hooks/users/useFetchUserFollowersCount.js.map +1 -0
  250. package/dist/cjs/hooks/users/useFetchUserFollowingCount.d.ts +6 -0
  251. package/dist/cjs/hooks/users/useFetchUserFollowingCount.js +71 -0
  252. package/dist/cjs/hooks/users/useFetchUserFollowingCount.js.map +1 -0
  253. package/dist/cjs/hooks/users/useFetchUserSuggestions.d.ts +5 -0
  254. package/dist/cjs/hooks/users/useFetchUserSuggestions.js +72 -0
  255. package/dist/cjs/hooks/users/useFetchUserSuggestions.js.map +1 -0
  256. package/dist/cjs/hooks/users/useMentions.d.ts +18 -0
  257. package/dist/cjs/hooks/users/useMentions.js +185 -0
  258. package/dist/cjs/hooks/users/useMentions.js.map +1 -0
  259. package/dist/cjs/hooks/users/useUpdateUser.d.ts +19 -0
  260. package/dist/cjs/hooks/users/useUpdateUser.js +73 -0
  261. package/dist/cjs/hooks/users/useUpdateUser.js.map +1 -0
  262. package/dist/cjs/hooks/utils/index.d.ts +1 -0
  263. package/dist/cjs/hooks/utils/index.js +9 -0
  264. package/dist/cjs/hooks/utils/index.js.map +1 -0
  265. package/dist/cjs/hooks/utils/useGetMetadata.d.ts +4 -0
  266. package/dist/cjs/hooks/utils/useGetMetadata.js +79 -0
  267. package/dist/cjs/hooks/utils/useGetMetadata.js.map +1 -0
  268. package/dist/cjs/index.d.ts +32 -0
  269. package/dist/cjs/index.js +142 -0
  270. package/dist/cjs/index.js.map +1 -0
  271. package/dist/cjs/interfaces/CommentsSortByOptions.d.ts +1 -0
  272. package/dist/cjs/interfaces/CommentsSortByOptions.js +3 -0
  273. package/dist/cjs/interfaces/CommentsSortByOptions.js.map +1 -0
  274. package/dist/cjs/interfaces/EntityCommentsTree.d.ts +13 -0
  275. package/dist/cjs/interfaces/EntityCommentsTree.js +3 -0
  276. package/dist/cjs/interfaces/EntityCommentsTree.js.map +1 -0
  277. package/dist/cjs/interfaces/EntityListSortByOptions.d.ts +1 -0
  278. package/dist/cjs/interfaces/EntityListSortByOptions.js +3 -0
  279. package/dist/cjs/interfaces/EntityListSortByOptions.js.map +1 -0
  280. package/dist/cjs/interfaces/TimeFrame.d.ts +1 -0
  281. package/dist/cjs/interfaces/TimeFrame.js +3 -0
  282. package/dist/cjs/interfaces/TimeFrame.js.map +1 -0
  283. package/dist/cjs/interfaces/entity-filters/AttachmentsFilters.d.ts +3 -0
  284. package/dist/cjs/interfaces/entity-filters/AttachmentsFilters.js +3 -0
  285. package/dist/cjs/interfaces/entity-filters/AttachmentsFilters.js.map +1 -0
  286. package/dist/cjs/interfaces/entity-filters/ContentFilters.d.ts +5 -0
  287. package/dist/cjs/interfaces/entity-filters/ContentFilters.js +3 -0
  288. package/dist/cjs/interfaces/entity-filters/ContentFilters.js.map +1 -0
  289. package/dist/cjs/interfaces/entity-filters/KeywordsFilters.d.ts +4 -0
  290. package/dist/cjs/interfaces/entity-filters/KeywordsFilters.js +3 -0
  291. package/dist/cjs/interfaces/entity-filters/KeywordsFilters.js.map +1 -0
  292. package/dist/cjs/interfaces/entity-filters/LocationFilters.d.ts +5 -0
  293. package/dist/cjs/interfaces/entity-filters/LocationFilters.js +3 -0
  294. package/dist/cjs/interfaces/entity-filters/LocationFilters.js.map +1 -0
  295. package/dist/cjs/interfaces/entity-filters/MetadataFilters.d.ts +7 -0
  296. package/dist/cjs/interfaces/entity-filters/MetadataFilters.js +3 -0
  297. package/dist/cjs/interfaces/entity-filters/MetadataFilters.js.map +1 -0
  298. package/dist/cjs/interfaces/entity-filters/TitleFilters.d.ts +5 -0
  299. package/dist/cjs/interfaces/entity-filters/TitleFilters.js +3 -0
  300. package/dist/cjs/interfaces/entity-filters/TitleFilters.js.map +1 -0
  301. package/dist/cjs/interfaces/models/AppNotification.d.ts +140 -0
  302. package/dist/cjs/interfaces/models/AppNotification.js +3 -0
  303. package/dist/cjs/interfaces/models/AppNotification.js.map +1 -0
  304. package/dist/cjs/interfaces/models/Comment.d.ts +32 -0
  305. package/dist/cjs/interfaces/models/Comment.js +3 -0
  306. package/dist/cjs/interfaces/models/Comment.js.map +1 -0
  307. package/dist/cjs/interfaces/models/Entity.d.ts +37 -0
  308. package/dist/cjs/interfaces/models/Entity.js +3 -0
  309. package/dist/cjs/interfaces/models/Entity.js.map +1 -0
  310. package/dist/cjs/interfaces/models/Follow.d.ts +5 -0
  311. package/dist/cjs/interfaces/models/Follow.js +3 -0
  312. package/dist/cjs/interfaces/models/Follow.js.map +1 -0
  313. package/dist/cjs/interfaces/models/List.d.ts +12 -0
  314. package/dist/cjs/interfaces/models/List.js +3 -0
  315. package/dist/cjs/interfaces/models/List.js.map +1 -0
  316. package/dist/cjs/interfaces/models/Mention.d.ts +4 -0
  317. package/dist/cjs/interfaces/models/Mention.js +3 -0
  318. package/dist/cjs/interfaces/models/Mention.js.map +1 -0
  319. package/dist/cjs/interfaces/models/Project.d.ts +14 -0
  320. package/dist/cjs/interfaces/models/Project.js +3 -0
  321. package/dist/cjs/interfaces/models/Project.js.map +1 -0
  322. package/dist/cjs/interfaces/models/User.d.ts +33 -0
  323. package/dist/cjs/interfaces/models/User.js +3 -0
  324. package/dist/cjs/interfaces/models/User.js.map +1 -0
  325. package/dist/cjs/store/api/appNotificationsApi.d.ts +2024 -0
  326. package/dist/cjs/store/api/appNotificationsApi.js +224 -0
  327. package/dist/cjs/store/api/appNotificationsApi.js.map +1 -0
  328. package/dist/cjs/store/api/baseApi.d.ts +1 -0
  329. package/dist/cjs/store/api/baseApi.js +43 -0
  330. package/dist/cjs/store/api/baseApi.js.map +1 -0
  331. package/dist/cjs/store/api/entityListsApi.d.ts +1719 -0
  332. package/dist/cjs/store/api/entityListsApi.js +237 -0
  333. package/dist/cjs/store/api/entityListsApi.js.map +1 -0
  334. package/dist/cjs/store/api/index.d.ts +4 -0
  335. package/dist/cjs/store/api/index.js +29 -0
  336. package/dist/cjs/store/api/index.js.map +1 -0
  337. package/dist/cjs/store/api/listsApi.d.ts +3044 -0
  338. package/dist/cjs/store/api/listsApi.js +288 -0
  339. package/dist/cjs/store/api/listsApi.js.map +1 -0
  340. package/dist/cjs/store/api/userApi.d.ts +183 -0
  341. package/dist/cjs/store/api/userApi.js +38 -0
  342. package/dist/cjs/store/api/userApi.js.map +1 -0
  343. package/dist/cjs/store/index.d.ts +21 -0
  344. package/dist/cjs/store/index.js +73 -0
  345. package/dist/cjs/store/index.js.map +1 -0
  346. package/dist/cjs/store/middleware.d.ts +4 -0
  347. package/dist/cjs/store/middleware.js +43 -0
  348. package/dist/cjs/store/middleware.js.map +1 -0
  349. package/dist/cjs/store/rootReducer.d.ts +16 -0
  350. package/dist/cjs/store/rootReducer.js +26 -0
  351. package/dist/cjs/store/rootReducer.js.map +1 -0
  352. package/dist/cjs/store/slices/appNotificationsSlice.d.ts +58 -0
  353. package/dist/cjs/store/slices/appNotificationsSlice.js +135 -0
  354. package/dist/cjs/store/slices/appNotificationsSlice.js.map +1 -0
  355. package/dist/cjs/store/slices/authSlice.d.ts +24 -0
  356. package/dist/cjs/store/slices/authSlice.js +79 -0
  357. package/dist/cjs/store/slices/authSlice.js.map +1 -0
  358. package/dist/cjs/store/slices/authThunks.d.ts +40 -0
  359. package/dist/cjs/store/slices/authThunks.js +363 -0
  360. package/dist/cjs/store/slices/authThunks.js.map +1 -0
  361. package/dist/cjs/store/slices/entityListsSlice.d.ts +364 -0
  362. package/dist/cjs/store/slices/entityListsSlice.js +295 -0
  363. package/dist/cjs/store/slices/entityListsSlice.js.map +1 -0
  364. package/dist/cjs/store/slices/index.d.ts +0 -0
  365. package/dist/cjs/store/slices/index.js +7 -0
  366. package/dist/cjs/store/slices/index.js.map +1 -0
  367. package/dist/cjs/store/slices/listsSlice.d.ts +147 -0
  368. package/dist/cjs/store/slices/listsSlice.js +211 -0
  369. package/dist/cjs/store/slices/listsSlice.js.map +1 -0
  370. package/dist/cjs/store/slices/userSlice.d.ts +29 -0
  371. package/dist/cjs/store/slices/userSlice.js +87 -0
  372. package/dist/cjs/store/slices/userSlice.js.map +1 -0
  373. package/dist/cjs/store/types/index.d.ts +8 -0
  374. package/dist/cjs/store/types/index.js +3 -0
  375. package/dist/cjs/store/types/index.js.map +1 -0
  376. package/dist/cjs/utils/constants.d.ts +1 -0
  377. package/dist/cjs/utils/constants.js +5 -0
  378. package/dist/cjs/utils/constants.js.map +1 -0
  379. package/dist/cjs/utils/env.d.ts +19 -0
  380. package/dist/cjs/utils/env.js +102 -0
  381. package/dist/cjs/utils/env.js.map +1 -0
  382. package/dist/cjs/utils/handleError.d.ts +1 -0
  383. package/dist/cjs/utils/handleError.js +24 -0
  384. package/dist/cjs/utils/handleError.js.map +1 -0
  385. package/dist/cjs/utils/isAbsoluteUrl.d.ts +1 -0
  386. package/dist/cjs/utils/isAbsoluteUrl.js +9 -0
  387. package/dist/cjs/utils/isAbsoluteUrl.js.map +1 -0
  388. package/dist/cjs/utils/isReactNative.d.ts +1 -0
  389. package/dist/cjs/utils/isReactNative.js +8 -0
  390. package/dist/cjs/utils/isReactNative.js.map +1 -0
  391. package/dist/cjs/utils/isUUID.d.ts +1 -0
  392. package/dist/cjs/utils/isUUID.js +8 -0
  393. package/dist/cjs/utils/isUUID.js.map +1 -0
  394. package/dist/cjs/utils/keywordHelpers.d.ts +30 -0
  395. package/dist/cjs/utils/keywordHelpers.js +101 -0
  396. package/dist/cjs/utils/keywordHelpers.js.map +1 -0
  397. package/dist/esm/hooks/users/follows/useFollowManager.js +4 -2
  398. package/dist/esm/hooks/users/follows/useFollowManager.js.map +1 -1
  399. package/package.json +1 -1
@@ -0,0 +1,125 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.useUserActions = useUserActions;
40
+ var react_1 = require("react");
41
+ var react_redux_1 = require("react-redux");
42
+ var userSlice_1 = require("../../store/slices/userSlice");
43
+ var userApi_1 = require("../../store/api/userApi");
44
+ /**
45
+ * Redux-powered hook that provides current user management actions
46
+ * Focused on current user operations only
47
+ */
48
+ function useUserActions() {
49
+ var _this = this;
50
+ var dispatch = (0, react_redux_1.useDispatch)();
51
+ // RTK Query mutations for current user
52
+ var updateUserMutation = (0, userApi_1.useUpdateUserMutation)()[0];
53
+ // User data management actions
54
+ var handleSetUser = (0, react_1.useCallback)(function (user) {
55
+ dispatch((0, userSlice_1.setUser)(user));
56
+ dispatch((0, userSlice_1.clearError)());
57
+ }, [dispatch]);
58
+ var handleClearUser = (0, react_1.useCallback)(function () {
59
+ dispatch((0, userSlice_1.clearUser)());
60
+ dispatch((0, userSlice_1.clearError)());
61
+ }, [dispatch]);
62
+ // Update user with optimistic updates for instant UI feedback
63
+ var updateUser = (0, react_1.useCallback)(function (projectId, userId, update, currentUser) { return __awaiter(_this, void 0, void 0, function () {
64
+ var originalUser, result, error_1, errorMessage;
65
+ return __generator(this, function (_a) {
66
+ switch (_a.label) {
67
+ case 0:
68
+ if (!projectId || !userId) {
69
+ throw new Error("Project ID and User ID are required");
70
+ }
71
+ dispatch((0, userSlice_1.setUpdating)(true));
72
+ dispatch((0, userSlice_1.clearError)());
73
+ originalUser = currentUser;
74
+ // OPTIMISTIC UPDATE: Apply changes immediately for instant UI feedback
75
+ dispatch((0, userSlice_1.updateUserOptimistic)(update));
76
+ _a.label = 1;
77
+ case 1:
78
+ _a.trys.push([1, 3, 4, 5]);
79
+ return [4 /*yield*/, updateUserMutation({
80
+ projectId: projectId,
81
+ userId: userId,
82
+ update: update
83
+ }).unwrap()];
84
+ case 2:
85
+ result = _a.sent();
86
+ // Replace optimistic update with real server data
87
+ dispatch((0, userSlice_1.setUser)(result));
88
+ return [2 /*return*/, result];
89
+ case 3:
90
+ error_1 = _a.sent();
91
+ // REVERT OPTIMISTIC UPDATE: Restore original user state on API failure
92
+ if (originalUser) {
93
+ dispatch((0, userSlice_1.setUser)(originalUser));
94
+ }
95
+ errorMessage = error_1 instanceof Error ? error_1.message : 'Failed to update user';
96
+ dispatch((0, userSlice_1.setError)(errorMessage));
97
+ throw error_1;
98
+ case 4:
99
+ dispatch((0, userSlice_1.setUpdating)(false));
100
+ return [7 /*endfinally*/];
101
+ case 5: return [2 /*return*/];
102
+ }
103
+ });
104
+ }); }, [updateUserMutation, dispatch]);
105
+ // Removed other-user methods - use existing legacy hooks instead:
106
+ // - useFetchUser
107
+ // - useFetchUserByForeignId
108
+ // - useCheckUsernameAvailability
109
+ // - useFetchUserSuggestions
110
+ // Error handling actions
111
+ var clearUserError = (0, react_1.useCallback)(function () {
112
+ dispatch((0, userSlice_1.clearError)());
113
+ }, [dispatch]);
114
+ return {
115
+ // Current user data management
116
+ setUser: handleSetUser,
117
+ clearUser: handleClearUser,
118
+ // Current user operations
119
+ updateUser: updateUser,
120
+ // Error handling
121
+ clearError: clearUserError,
122
+ };
123
+ }
124
+ exports.default = useUserActions;
125
+ //# sourceMappingURL=useUserActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUserActions.js","sourceRoot":"","sources":["../../../../src/hooks/user/useUserActions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,wCAiFC;AArGD,+BAAoC;AACpC,2CAA0C;AAE1C,0DAOsC;AACtC,mDAGiC;AAEjC;;;GAGG;AACH,SAAgB,cAAc;IAA9B,iBAiFC;IAhFC,IAAM,QAAQ,GAAG,IAAA,yBAAW,GAAe,CAAC;IAE5C,uCAAuC;IAChC,IAAA,kBAAkB,GAAI,IAAA,+BAAqB,GAAE,GAA3B,CAA4B;IAErD,+BAA+B;IAC/B,IAAM,aAAa,GAAG,IAAA,mBAAW,EAAC,UAAC,IAAS;QAC1C,QAAQ,CAAC,IAAA,mBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;QACxB,QAAQ,CAAC,IAAA,sBAAU,GAAE,CAAC,CAAC;IACzB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,IAAM,eAAe,GAAG,IAAA,mBAAW,EAAC;QAClC,QAAQ,CAAC,IAAA,qBAAS,GAAE,CAAC,CAAC;QACtB,QAAQ,CAAC,IAAA,sBAAU,GAAE,CAAC,CAAC;IACzB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,8DAA8D;IAC9D,IAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,UAAO,SAAiB,EAAE,MAAc,EAAE,MAAwB,EAAE,WAAiB;;;;;oBACnF,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM,EAAE,CAAC;wBAC1B,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;oBACzD,CAAC;oBAED,QAAQ,CAAC,IAAA,uBAAW,EAAC,IAAI,CAAC,CAAC,CAAC;oBAC5B,QAAQ,CAAC,IAAA,sBAAU,GAAE,CAAC,CAAC;oBAGjB,YAAY,GAAG,WAAW,CAAC;oBAEjC,uEAAuE;oBACvE,QAAQ,CAAC,IAAA,gCAAoB,EAAC,MAAM,CAAC,CAAC,CAAC;;;;oBAGtB,qBAAM,kBAAkB,CAAC;4BACtC,SAAS,WAAA;4BACT,MAAM,QAAA;4BACN,MAAM,QAAA;yBACP,CAAC,CAAC,MAAM,EAAE,EAAA;;oBAJL,MAAM,GAAG,SAIJ;oBAEX,kDAAkD;oBAClD,QAAQ,CAAC,IAAA,mBAAO,EAAC,MAAM,CAAC,CAAC,CAAC;oBAC1B,sBAAO,MAAM,EAAC;;;oBAEd,uEAAuE;oBACvE,IAAI,YAAY,EAAE,CAAC;wBACjB,QAAQ,CAAC,IAAA,mBAAO,EAAC,YAAY,CAAC,CAAC,CAAC;oBAClC,CAAC;oBAEK,YAAY,GAAG,OAAK,YAAY,KAAK,CAAC,CAAC,CAAC,OAAK,CAAC,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC;oBACtF,QAAQ,CAAC,IAAA,oBAAQ,EAAC,YAAY,CAAC,CAAC,CAAC;oBACjC,MAAM,OAAK,CAAC;;oBAEZ,QAAQ,CAAC,IAAA,uBAAW,EAAC,KAAK,CAAC,CAAC,CAAC;;;;;SAEhC,EACD,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAC/B,CAAC;IAEF,kEAAkE;IAClE,iBAAiB;IACjB,4BAA4B;IAC5B,mCAAmC;IACnC,4BAA4B;IAE5B,yBAAyB;IACzB,IAAM,cAAc,GAAG,IAAA,mBAAW,EAAC;QACjC,QAAQ,CAAC,IAAA,sBAAU,GAAE,CAAC,CAAC;IACzB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO;QACL,+BAA+B;QAC/B,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,eAAe;QAE1B,0BAA0B;QAC1B,UAAU,YAAA;QAEV,iBAAiB;QACjB,UAAU,EAAE,cAAc;KAC3B,CAAC;AACJ,CAAC;AAED,kBAAe,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { default as useFetchFollow } from "./useFetchFollow";
2
+ export { default as useFollowUser } from "./useFollowUser";
3
+ export { default as useUnfollowUser } from "./useUnfollowUser";
4
+ export { default as useFollowManager } from "./useFollowManager";
@@ -0,0 +1,15 @@
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.useFollowManager = exports.useUnfollowUser = exports.useFollowUser = exports.useFetchFollow = void 0;
7
+ var useFetchFollow_1 = require("./useFetchFollow");
8
+ Object.defineProperty(exports, "useFetchFollow", { enumerable: true, get: function () { return __importDefault(useFetchFollow_1).default; } });
9
+ var useFollowUser_1 = require("./useFollowUser");
10
+ Object.defineProperty(exports, "useFollowUser", { enumerable: true, get: function () { return __importDefault(useFollowUser_1).default; } });
11
+ var useUnfollowUser_1 = require("./useUnfollowUser");
12
+ Object.defineProperty(exports, "useUnfollowUser", { enumerable: true, get: function () { return __importDefault(useUnfollowUser_1).default; } });
13
+ var useFollowManager_1 = require("./useFollowManager");
14
+ Object.defineProperty(exports, "useFollowManager", { enumerable: true, get: function () { return __importDefault(useFollowManager_1).default; } });
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/hooks/users/follows/index.ts"],"names":[],"mappings":";;;;;;AAAA,mDAA6D;AAApD,iIAAA,OAAO,OAAkB;AAClC,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB;AACjC,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC,uDAAiE;AAAxD,qIAAA,OAAO,OAAoB"}
@@ -0,0 +1,6 @@
1
+ declare function useFetchFollow(): (props: {
2
+ userId: string;
3
+ }) => Promise<{
4
+ isFollowing: boolean;
5
+ }>;
6
+ export default useFetchFollow;
@@ -0,0 +1,81 @@
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("../../projects/useProject"));
45
+ var user_1 = require("../../user");
46
+ function useFetchFollow() {
47
+ var _this = this;
48
+ var axios = (0, useAxiosPrivate_1.default)();
49
+ var projectId = (0, useProject_1.default)().projectId;
50
+ var user = (0, user_1.useUser)().user;
51
+ var fetchFollow = (0, react_1.useCallback)(function (props) { return __awaiter(_this, void 0, void 0, function () {
52
+ var userId, response;
53
+ return __generator(this, function (_a) {
54
+ switch (_a.label) {
55
+ case 0:
56
+ userId = props.userId;
57
+ if (!projectId) {
58
+ throw new Error("No project specified");
59
+ }
60
+ if (!user) {
61
+ throw new Error("No user is logged in");
62
+ }
63
+ if (!userId) {
64
+ throw new Error("No user ID was provided");
65
+ }
66
+ if (userId === user.id) {
67
+ throw new Error("Users don't follow themselves");
68
+ }
69
+ return [4 /*yield*/, axios.get("/".concat(projectId, "/users/").concat(userId, "/follow"), {
70
+ withCredentials: true,
71
+ })];
72
+ case 1:
73
+ response = _a.sent();
74
+ return [2 /*return*/, response.data];
75
+ }
76
+ });
77
+ }); }, [axios, projectId, user]);
78
+ return fetchFollow;
79
+ }
80
+ exports.default = useFetchFollow;
81
+ //# sourceMappingURL=useFetchFollow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchFollow.js","sourceRoot":"","sources":["../../../../../src/hooks/users/follows/useFetchFollow.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,yEAAmD;AACnD,mCAAqC;AAErC,SAAS,cAAc;IAAvB,iBAiCC;IAhCC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IACxB,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,IAAA,cAAO,GAAE,KAAd,CAAe;IAE3B,IAAM,WAAW,GAAG,IAAA,mBAAW,EAC7B,UAAO,KAAyB;;;;;oBACtB,MAAM,GAAK,KAAK,OAAV,CAAW;oBACzB,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,MAAM,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;wBACvB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;oBACnD,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAAC,WAAI,SAAS,oBAAU,MAAM,YAAS,EAAE;4BACvE,eAAe,EAAE,IAAI;yBACtB,CAAC,EAAA;;oBAFI,QAAQ,GAAG,SAEf;oBACF,sBAAO,QAAQ,CAAC,IAAgC,EAAC;;;SAClD,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,kBAAe,cAAc,CAAC"}
@@ -0,0 +1,9 @@
1
+ interface UseFollowToggleProps {
2
+ userId: string;
3
+ }
4
+ declare function useFollowManager({ userId }: UseFollowToggleProps): {
5
+ isFollowing: boolean | null;
6
+ isLoading: boolean;
7
+ toggleFollow: () => Promise<void>;
8
+ };
9
+ export default useFollowManager;
@@ -0,0 +1,122 @@
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 useFollowUser_1 = __importDefault(require("./useFollowUser"));
44
+ var useUnfollowUser_1 = __importDefault(require("./useUnfollowUser"));
45
+ var useFetchFollow_1 = __importDefault(require("./useFetchFollow"));
46
+ var useUser_1 = __importDefault(require("../../user/useUser"));
47
+ function useFollowManager(_a) {
48
+ var _this = this;
49
+ var userId = _a.userId;
50
+ var user = (0, useUser_1.default)().user;
51
+ var _b = (0, react_1.useState)(null), isFollowing = _b[0], setIsFollowing = _b[1];
52
+ var _c = (0, react_1.useState)(true), isLoading = _c[0], setIsLoading = _c[1];
53
+ var followUser = (0, useFollowUser_1.default)();
54
+ var unfollowUser = (0, useUnfollowUser_1.default)();
55
+ var fetchFollow = (0, useFetchFollow_1.default)();
56
+ (0, react_1.useEffect)(function () {
57
+ var loadFollowStatus = function () { return __awaiter(_this, void 0, void 0, function () {
58
+ var result, error_1;
59
+ return __generator(this, function (_a) {
60
+ switch (_a.label) {
61
+ case 0:
62
+ _a.trys.push([0, 2, 3, 4]);
63
+ setIsLoading(true);
64
+ return [4 /*yield*/, fetchFollow({ userId: userId })];
65
+ case 1:
66
+ result = _a.sent();
67
+ setIsFollowing(result.isFollowing);
68
+ return [3 /*break*/, 4];
69
+ case 2:
70
+ error_1 = _a.sent();
71
+ console.error("Failed to fetch follow status:", error_1);
72
+ setIsFollowing(false);
73
+ return [3 /*break*/, 4];
74
+ case 3:
75
+ setIsLoading(false);
76
+ return [7 /*endfinally*/];
77
+ case 4: return [2 /*return*/];
78
+ }
79
+ });
80
+ }); };
81
+ if (userId && (user === null || user === void 0 ? void 0 : user.id) !== userId) {
82
+ loadFollowStatus();
83
+ }
84
+ }, [userId, fetchFollow]);
85
+ var toggleFollow = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
86
+ var error_2;
87
+ return __generator(this, function (_a) {
88
+ switch (_a.label) {
89
+ case 0:
90
+ if (isFollowing === null || isLoading || (user === null || user === void 0 ? void 0 : user.id) === userId)
91
+ return [2 /*return*/];
92
+ _a.label = 1;
93
+ case 1:
94
+ _a.trys.push([1, 6, , 7]);
95
+ if (!isFollowing) return [3 /*break*/, 3];
96
+ return [4 /*yield*/, unfollowUser({ userId: userId })];
97
+ case 2:
98
+ _a.sent();
99
+ setIsFollowing(false);
100
+ return [3 /*break*/, 5];
101
+ case 3: return [4 /*yield*/, followUser({ userId: userId })];
102
+ case 4:
103
+ _a.sent();
104
+ setIsFollowing(true);
105
+ _a.label = 5;
106
+ case 5: return [3 /*break*/, 7];
107
+ case 6:
108
+ error_2 = _a.sent();
109
+ console.error("Failed to toggle follow status:", error_2);
110
+ return [3 /*break*/, 7];
111
+ case 7: return [2 /*return*/];
112
+ }
113
+ });
114
+ }); }, [isFollowing, isLoading, userId, followUser, unfollowUser]);
115
+ return {
116
+ isFollowing: isFollowing,
117
+ isLoading: isLoading,
118
+ toggleFollow: toggleFollow,
119
+ };
120
+ }
121
+ exports.default = useFollowManager;
122
+ //# sourceMappingURL=useFollowManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFollowManager.js","sourceRoot":"","sources":["../../../../../src/hooks/users/follows/useFollowManager.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAyD;AACzD,kEAA4C;AAC5C,sEAAgD;AAChD,oEAA8C;AAC9C,+DAAyC;AAMzC,SAAS,gBAAgB,CAAC,EAAgC;IAA1D,iBAkDC;QAlD2B,MAAM,YAAA;IACxB,IAAA,IAAI,GAAK,IAAA,iBAAO,GAAE,KAAd,CAAe;IAErB,IAAA,KAAgC,IAAA,gBAAQ,EAAiB,IAAI,CAAC,EAA7D,WAAW,QAAA,EAAE,cAAc,QAAkC,CAAC;IAC/D,IAAA,KAA4B,IAAA,gBAAQ,EAAC,IAAI,CAAC,EAAzC,SAAS,QAAA,EAAE,YAAY,QAAkB,CAAC;IAEjD,IAAM,UAAU,GAAG,IAAA,uBAAa,GAAE,CAAC;IACnC,IAAM,YAAY,GAAG,IAAA,yBAAe,GAAE,CAAC;IACvC,IAAM,WAAW,GAAG,IAAA,wBAAc,GAAE,CAAC;IAErC,IAAA,iBAAS,EAAC;QACR,IAAM,gBAAgB,GAAG;;;;;;wBAErB,YAAY,CAAC,IAAI,CAAC,CAAC;wBACJ,qBAAM,WAAW,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC,EAAA;;wBAAtC,MAAM,GAAG,SAA6B;wBAC5C,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;;;;wBAEnC,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,OAAK,CAAC,CAAC;wBACvD,cAAc,CAAC,KAAK,CAAC,CAAC;;;wBAEtB,YAAY,CAAC,KAAK,CAAC,CAAC;;;;;aAEvB,CAAC;QAEF,IAAI,MAAM,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,MAAK,MAAM,EAAE,CAAC;YAClC,gBAAgB,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1B,IAAM,YAAY,GAAG,IAAA,mBAAW,EAAC;;;;;oBAC/B,IAAI,WAAW,KAAK,IAAI,IAAI,SAAS,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,MAAK,MAAM;wBAAE,sBAAO;;;;yBAG/D,WAAW,EAAX,wBAAW;oBACb,qBAAM,YAAY,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC,EAAA;;oBAA9B,SAA8B,CAAC;oBAC/B,cAAc,CAAC,KAAK,CAAC,CAAC;;wBAEtB,qBAAM,UAAU,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC,EAAA;;oBAA5B,SAA4B,CAAC;oBAC7B,cAAc,CAAC,IAAI,CAAC,CAAC;;;;;oBAGvB,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,OAAK,CAAC,CAAC;;;;;SAE3D,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC;IAE/D,OAAO;QACL,WAAW,aAAA;QACX,SAAS,WAAA;QACT,YAAY,cAAA;KACb,CAAC;AACJ,CAAC;AAED,kBAAe,gBAAgB,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare function useFollowUser(): (props: {
2
+ userId: string;
3
+ }) => Promise<void>;
4
+ export default useFollowUser;
@@ -0,0 +1,71 @@
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("../../projects/useProject"));
45
+ function useFollowUser() {
46
+ var _this = this;
47
+ var axios = (0, useAxiosPrivate_1.default)();
48
+ var projectId = (0, useProject_1.default)().projectId;
49
+ var followUser = (0, react_1.useCallback)(function (props) { return __awaiter(_this, void 0, void 0, function () {
50
+ var userId;
51
+ return __generator(this, function (_a) {
52
+ switch (_a.label) {
53
+ case 0:
54
+ userId = props.userId;
55
+ if (!projectId) {
56
+ throw new Error("No project specified");
57
+ }
58
+ if (!userId) {
59
+ throw new Error("No user ID was provided");
60
+ }
61
+ return [4 /*yield*/, axios.post("/".concat(projectId, "/users/").concat(userId, "/follow"), {}, { withCredentials: true })];
62
+ case 1:
63
+ _a.sent();
64
+ return [2 /*return*/];
65
+ }
66
+ });
67
+ }); }, [axios, projectId]);
68
+ return followUser;
69
+ }
70
+ exports.default = useFollowUser;
71
+ //# sourceMappingURL=useFollowUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFollowUser.js","sourceRoot":"","sources":["../../../../../src/hooks/users/follows/useFollowUser.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,yEAAmD;AAEnD,SAAS,aAAa;IAAtB,iBAyBC;IAxBC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IACxB,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAEnC,IAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,UAAO,KAAyB;;;;;oBACtB,MAAM,GAAK,KAAK,OAAV,CAAW;oBACzB,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,qBAAM,KAAK,CAAC,IAAI,CACd,WAAI,SAAS,oBAAU,MAAM,YAAS,EACtC,EAAE,EACF,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAJD,SAIC,CAAC;;;;SACH,EACD,CAAC,KAAK,EAAE,SAAS,CAAC,CACnB,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,kBAAe,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare function useUnfollowUser(): (props: {
2
+ userId: string;
3
+ }) => Promise<void>;
4
+ export default useUnfollowUser;
@@ -0,0 +1,81 @@
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("../../projects/useProject"));
45
+ var user_1 = require("../../user");
46
+ function useUnfollowUser() {
47
+ var _this = this;
48
+ var axios = (0, useAxiosPrivate_1.default)();
49
+ var projectId = (0, useProject_1.default)().projectId;
50
+ var user = (0, user_1.useUser)().user;
51
+ var unfollowUser = (0, react_1.useCallback)(function (props) { return __awaiter(_this, void 0, void 0, function () {
52
+ var userId;
53
+ return __generator(this, function (_a) {
54
+ switch (_a.label) {
55
+ case 0:
56
+ userId = props.userId;
57
+ if (!projectId) {
58
+ throw new Error("No project specified");
59
+ }
60
+ if (!user) {
61
+ throw new Error("No user is logged in");
62
+ }
63
+ if (!userId) {
64
+ throw new Error("No user ID was provided");
65
+ }
66
+ if (userId === user.id) {
67
+ throw new Error("Users can't unfollow themselves");
68
+ }
69
+ return [4 /*yield*/, axios.delete("/".concat(projectId, "/users/").concat(userId, "/follow"), {
70
+ withCredentials: true,
71
+ })];
72
+ case 1:
73
+ _a.sent();
74
+ return [2 /*return*/];
75
+ }
76
+ });
77
+ }); }, [axios, projectId, user]);
78
+ return unfollowUser;
79
+ }
80
+ exports.default = useUnfollowUser;
81
+ //# sourceMappingURL=useUnfollowUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUnfollowUser.js","sourceRoot":"","sources":["../../../../../src/hooks/users/follows/useUnfollowUser.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,yEAAmD;AACnD,mCAAqC;AAErC,SAAS,eAAe;IAAxB,iBAgCC;IA/BC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IACxB,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,IAAA,cAAO,GAAE,KAAd,CAAe;IAE3B,IAAM,YAAY,GAAG,IAAA,mBAAW,EAC9B,UAAO,KAAyB;;;;;oBACtB,MAAM,GAAK,KAAK,OAAV,CAAW;oBACzB,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,MAAM,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;wBACvB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;oBACrD,CAAC;oBAED,qBAAM,KAAK,CAAC,MAAM,CAAC,WAAI,SAAS,oBAAU,MAAM,YAAS,EAAE;4BACzD,eAAe,EAAE,IAAI;yBACtB,CAAC,EAAA;;oBAFF,SAEE,CAAC;;;;SACJ,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,kBAAe,eAAe,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { default as useFetchUser } from "./useFetchUser";
2
+ export { default as useFetchUserByForeignId } from "./useFetchUserByForeignId";
3
+ export { default as useFetchUserFollowersCount } from "./useFetchUserFollowersCount";
4
+ export { default as useFetchUserFollowingCount } from "./useFetchUserFollowingCount";
5
+ export { default as useCheckUsernameAvailability } from "./useCheckUsernameAvailability";
6
+ export { default as useFetchUserSuggestions } from "./useFetchUserSuggestions";
7
+ export { default as useMentions } from "./useMentions";
8
+ export { default as useUpdateUser } from "./useUpdateUser";
9
+ export { useFetchFollow, useFollowUser, useUnfollowUser, useFollowManager, } from "./follows";
@@ -0,0 +1,28 @@
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.useFollowManager = exports.useUnfollowUser = exports.useFollowUser = exports.useFetchFollow = exports.useUpdateUser = exports.useMentions = exports.useFetchUserSuggestions = exports.useCheckUsernameAvailability = exports.useFetchUserFollowingCount = exports.useFetchUserFollowersCount = exports.useFetchUserByForeignId = exports.useFetchUser = void 0;
7
+ var useFetchUser_1 = require("./useFetchUser");
8
+ Object.defineProperty(exports, "useFetchUser", { enumerable: true, get: function () { return __importDefault(useFetchUser_1).default; } });
9
+ var useFetchUserByForeignId_1 = require("./useFetchUserByForeignId");
10
+ Object.defineProperty(exports, "useFetchUserByForeignId", { enumerable: true, get: function () { return __importDefault(useFetchUserByForeignId_1).default; } });
11
+ var useFetchUserFollowersCount_1 = require("./useFetchUserFollowersCount");
12
+ Object.defineProperty(exports, "useFetchUserFollowersCount", { enumerable: true, get: function () { return __importDefault(useFetchUserFollowersCount_1).default; } });
13
+ var useFetchUserFollowingCount_1 = require("./useFetchUserFollowingCount");
14
+ Object.defineProperty(exports, "useFetchUserFollowingCount", { enumerable: true, get: function () { return __importDefault(useFetchUserFollowingCount_1).default; } });
15
+ var useCheckUsernameAvailability_1 = require("./useCheckUsernameAvailability");
16
+ Object.defineProperty(exports, "useCheckUsernameAvailability", { enumerable: true, get: function () { return __importDefault(useCheckUsernameAvailability_1).default; } });
17
+ var useFetchUserSuggestions_1 = require("./useFetchUserSuggestions");
18
+ Object.defineProperty(exports, "useFetchUserSuggestions", { enumerable: true, get: function () { return __importDefault(useFetchUserSuggestions_1).default; } });
19
+ var useMentions_1 = require("./useMentions");
20
+ Object.defineProperty(exports, "useMentions", { enumerable: true, get: function () { return __importDefault(useMentions_1).default; } });
21
+ var useUpdateUser_1 = require("./useUpdateUser");
22
+ Object.defineProperty(exports, "useUpdateUser", { enumerable: true, get: function () { return __importDefault(useUpdateUser_1).default; } });
23
+ var follows_1 = require("./follows");
24
+ Object.defineProperty(exports, "useFetchFollow", { enumerable: true, get: function () { return follows_1.useFetchFollow; } });
25
+ Object.defineProperty(exports, "useFollowUser", { enumerable: true, get: function () { return follows_1.useFollowUser; } });
26
+ Object.defineProperty(exports, "useUnfollowUser", { enumerable: true, get: function () { return follows_1.useUnfollowUser; } });
27
+ Object.defineProperty(exports, "useFollowManager", { enumerable: true, get: function () { return follows_1.useFollowManager; } });
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/users/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,qEAA+E;AAAtE,mJAAA,OAAO,OAA2B;AAC3C,2EAAqF;AAA5E,yJAAA,OAAO,OAA8B;AAC9C,2EAAqF;AAA5E,yJAAA,OAAO,OAA8B;AAC9C,+EAAyF;AAAhF,6JAAA,OAAO,OAAgC;AAChD,qEAA+E;AAAtE,mJAAA,OAAO,OAA2B;AAC3C,6CAAuD;AAA9C,2HAAA,OAAO,OAAe;AAC/B,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB;AAEjC,qCAKmB;AAJjB,yGAAA,cAAc,OAAA;AACd,wGAAA,aAAa,OAAA;AACb,0GAAA,eAAe,OAAA;AACf,2GAAA,gBAAgB,OAAA"}
@@ -0,0 +1,6 @@
1
+ declare function useCheckUsernameAvailability(): ({ username }: {
2
+ username: string;
3
+ }) => Promise<{
4
+ available: boolean;
5
+ }>;
6
+ export default useCheckUsernameAvailability;