@replyke/core 6.0.0-beta.6 → 6.0.0-beta.9

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 (221) hide show
  1. package/dist/cjs/hooks/comments/useCommentSectionData.js +4 -1
  2. package/dist/cjs/hooks/comments/useCommentSectionData.js.map +1 -1
  3. package/dist/cjs/hooks/relationships/connections/index.d.ts +13 -0
  4. package/dist/cjs/hooks/relationships/connections/index.js +33 -0
  5. package/dist/cjs/hooks/relationships/connections/index.js.map +1 -0
  6. package/dist/cjs/hooks/relationships/connections/useAcceptConnection.d.ts +5 -0
  7. package/dist/cjs/hooks/relationships/connections/useAcceptConnection.js +76 -0
  8. package/dist/cjs/hooks/relationships/connections/useAcceptConnection.js.map +1 -0
  9. package/dist/cjs/hooks/relationships/connections/useConnectionManager.d.ts +26 -0
  10. package/dist/cjs/hooks/relationships/connections/useConnectionManager.js +342 -0
  11. package/dist/cjs/hooks/relationships/connections/useConnectionManager.js.map +1 -0
  12. package/dist/cjs/hooks/relationships/connections/useDeclineConnection.d.ts +5 -0
  13. package/dist/cjs/hooks/relationships/connections/useDeclineConnection.js +76 -0
  14. package/dist/cjs/hooks/relationships/connections/useDeclineConnection.js.map +1 -0
  15. package/dist/cjs/hooks/relationships/connections/useFetchConnectionStatus.d.ts +5 -0
  16. package/dist/cjs/hooks/relationships/connections/useFetchConnectionStatus.js +79 -0
  17. package/dist/cjs/hooks/relationships/connections/useFetchConnectionStatus.js.map +1 -0
  18. package/dist/cjs/hooks/relationships/connections/useFetchConnections.d.ts +7 -0
  19. package/dist/cjs/hooks/relationships/connections/useFetchConnections.js +95 -0
  20. package/dist/cjs/hooks/relationships/connections/useFetchConnections.js.map +1 -0
  21. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsByUserId.d.ts +8 -0
  22. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsByUserId.js +75 -0
  23. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsByUserId.js.map +1 -0
  24. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCount.d.ts +3 -0
  25. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCount.js +72 -0
  26. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCount.js.map +1 -0
  27. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCountByUserId.d.ts +6 -0
  28. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCountByUserId.js +70 -0
  29. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCountByUserId.js.map +1 -0
  30. package/dist/cjs/hooks/relationships/connections/useFetchReceivedPendingConnections.d.ts +7 -0
  31. package/dist/cjs/hooks/relationships/connections/useFetchReceivedPendingConnections.js +95 -0
  32. package/dist/cjs/hooks/relationships/connections/useFetchReceivedPendingConnections.js.map +1 -0
  33. package/dist/cjs/hooks/relationships/connections/useFetchSentPendingConnections.d.ts +7 -0
  34. package/dist/cjs/hooks/relationships/connections/useFetchSentPendingConnections.js +95 -0
  35. package/dist/cjs/hooks/relationships/connections/useFetchSentPendingConnections.js.map +1 -0
  36. package/dist/cjs/hooks/relationships/connections/useRemoveConnection.d.ts +5 -0
  37. package/dist/cjs/hooks/relationships/connections/useRemoveConnection.js +76 -0
  38. package/dist/cjs/hooks/relationships/connections/useRemoveConnection.js.map +1 -0
  39. package/dist/cjs/hooks/relationships/connections/useRemoveConnectionByUserId.d.ts +5 -0
  40. package/dist/cjs/hooks/relationships/connections/useRemoveConnectionByUserId.js +79 -0
  41. package/dist/cjs/hooks/relationships/connections/useRemoveConnectionByUserId.js.map +1 -0
  42. package/dist/cjs/hooks/relationships/connections/useRequestConnection.d.ts +3 -0
  43. package/dist/cjs/hooks/relationships/connections/useRequestConnection.js +71 -0
  44. package/dist/cjs/hooks/relationships/connections/useRequestConnection.js.map +1 -0
  45. package/dist/cjs/hooks/relationships/follows/index.d.ts +12 -3
  46. package/dist/cjs/hooks/relationships/follows/index.js +25 -7
  47. package/dist/cjs/hooks/relationships/follows/index.js.map +1 -1
  48. package/dist/cjs/hooks/relationships/follows/useFetchFollowStatus.d.ts +8 -0
  49. package/dist/cjs/hooks/relationships/follows/{useFetchFollow.js → useFetchFollowStatus.js} +5 -5
  50. package/dist/cjs/hooks/relationships/follows/useFetchFollowStatus.js.map +1 -0
  51. package/dist/cjs/hooks/relationships/follows/useFetchFollowers.d.ts +23 -0
  52. package/dist/cjs/hooks/relationships/follows/useFetchFollowers.js +91 -0
  53. package/dist/cjs/hooks/relationships/follows/useFetchFollowers.js.map +1 -0
  54. package/dist/cjs/hooks/relationships/follows/useFetchFollowersByUserId.d.ts +24 -0
  55. package/dist/cjs/hooks/relationships/follows/useFetchFollowersByUserId.js +70 -0
  56. package/dist/cjs/hooks/relationships/follows/useFetchFollowersByUserId.js.map +1 -0
  57. package/dist/cjs/hooks/relationships/follows/useFetchFollowersCount.d.ts +4 -0
  58. package/dist/cjs/hooks/relationships/follows/useFetchFollowersCount.js +72 -0
  59. package/dist/cjs/hooks/relationships/follows/useFetchFollowersCount.js.map +1 -0
  60. package/dist/cjs/hooks/relationships/follows/useFetchFollowersCountByUserId.d.ts +6 -0
  61. package/dist/cjs/hooks/{users/useFetchUserFollowersCount.js → relationships/follows/useFetchFollowersCountByUserId.js} +9 -10
  62. package/dist/cjs/hooks/relationships/follows/useFetchFollowersCountByUserId.js.map +1 -0
  63. package/dist/cjs/hooks/relationships/follows/useFetchFollowing.d.ts +23 -0
  64. package/dist/cjs/hooks/relationships/follows/useFetchFollowing.js +94 -0
  65. package/dist/cjs/hooks/relationships/follows/useFetchFollowing.js.map +1 -0
  66. package/dist/cjs/hooks/relationships/follows/useFetchFollowingByUserId.d.ts +24 -0
  67. package/dist/cjs/hooks/relationships/follows/useFetchFollowingByUserId.js +75 -0
  68. package/dist/cjs/hooks/relationships/follows/useFetchFollowingByUserId.js.map +1 -0
  69. package/dist/cjs/hooks/relationships/follows/useFetchFollowingCount.d.ts +4 -0
  70. package/dist/cjs/hooks/relationships/follows/useFetchFollowingCount.js +72 -0
  71. package/dist/cjs/hooks/relationships/follows/useFetchFollowingCount.js.map +1 -0
  72. package/dist/cjs/hooks/relationships/follows/useFetchFollowingCountByUserId.d.ts +6 -0
  73. package/dist/cjs/hooks/{users/useFetchUserFollowingCount.js → relationships/follows/useFetchFollowingCountByUserId.js} +9 -10
  74. package/dist/cjs/hooks/relationships/follows/useFetchFollowingCountByUserId.js.map +1 -0
  75. package/dist/cjs/hooks/relationships/follows/useFollowManager.js +8 -8
  76. package/dist/cjs/hooks/relationships/follows/useFollowManager.js.map +1 -1
  77. package/dist/cjs/hooks/relationships/follows/useUnfollowByFollowId.d.ts +4 -0
  78. package/dist/cjs/hooks/relationships/follows/useUnfollowByFollowId.js +78 -0
  79. package/dist/cjs/hooks/relationships/follows/useUnfollowByFollowId.js.map +1 -0
  80. package/dist/cjs/hooks/relationships/follows/useUnfollowUserByUserId.d.ts +4 -0
  81. package/dist/cjs/hooks/relationships/follows/{useUnfollowUser.js → useUnfollowUserByUserId.js} +5 -5
  82. package/dist/cjs/hooks/relationships/follows/useUnfollowUserByUserId.js.map +1 -0
  83. package/dist/cjs/hooks/useStableObject.d.ts +11 -0
  84. package/dist/cjs/hooks/useStableObject.js +26 -0
  85. package/dist/cjs/hooks/useStableObject.js.map +1 -0
  86. package/dist/cjs/hooks/users/index.d.ts +0 -2
  87. package/dist/cjs/hooks/users/index.js +1 -5
  88. package/dist/cjs/hooks/users/index.js.map +1 -1
  89. package/dist/cjs/hooks/users/useUpdateUser.d.ts +1 -2
  90. package/dist/cjs/hooks/users/useUpdateUser.js +7 -2
  91. package/dist/cjs/hooks/users/useUpdateUser.js.map +1 -1
  92. package/dist/cjs/index.d.ts +4 -2
  93. package/dist/cjs/index.js +28 -6
  94. package/dist/cjs/index.js.map +1 -1
  95. package/dist/cjs/interfaces/models/AppNotification.d.ts +26 -2
  96. package/dist/cjs/interfaces/models/Connection.d.ts +88 -0
  97. package/dist/cjs/interfaces/models/Connection.js +3 -0
  98. package/dist/cjs/interfaces/models/Connection.js.map +1 -0
  99. package/dist/cjs/interfaces/models/Follow.d.ts +2 -0
  100. package/dist/cjs/utils/objectComparison.d.ts +8 -0
  101. package/dist/cjs/utils/objectComparison.js +63 -0
  102. package/dist/cjs/utils/objectComparison.js.map +1 -0
  103. package/dist/esm/hooks/comments/useCommentSectionData.js +4 -1
  104. package/dist/esm/hooks/comments/useCommentSectionData.js.map +1 -1
  105. package/dist/esm/hooks/relationships/connections/index.d.ts +13 -0
  106. package/dist/esm/hooks/relationships/connections/index.js +14 -0
  107. package/dist/esm/hooks/relationships/connections/index.js.map +1 -0
  108. package/dist/esm/hooks/relationships/connections/useAcceptConnection.d.ts +5 -0
  109. package/dist/esm/hooks/relationships/connections/useAcceptConnection.js +71 -0
  110. package/dist/esm/hooks/relationships/connections/useAcceptConnection.js.map +1 -0
  111. package/dist/esm/hooks/relationships/connections/useConnectionManager.d.ts +26 -0
  112. package/dist/esm/hooks/relationships/connections/useConnectionManager.js +337 -0
  113. package/dist/esm/hooks/relationships/connections/useConnectionManager.js.map +1 -0
  114. package/dist/esm/hooks/relationships/connections/useDeclineConnection.d.ts +5 -0
  115. package/dist/esm/hooks/relationships/connections/useDeclineConnection.js +71 -0
  116. package/dist/esm/hooks/relationships/connections/useDeclineConnection.js.map +1 -0
  117. package/dist/esm/hooks/relationships/connections/useFetchConnectionStatus.d.ts +5 -0
  118. package/dist/esm/hooks/relationships/connections/useFetchConnectionStatus.js +74 -0
  119. package/dist/esm/hooks/relationships/connections/useFetchConnectionStatus.js.map +1 -0
  120. package/dist/esm/hooks/relationships/connections/useFetchConnections.d.ts +7 -0
  121. package/dist/esm/hooks/relationships/connections/useFetchConnections.js +90 -0
  122. package/dist/esm/hooks/relationships/connections/useFetchConnections.js.map +1 -0
  123. package/dist/esm/hooks/relationships/connections/useFetchConnectionsByUserId.d.ts +8 -0
  124. package/dist/esm/hooks/relationships/connections/useFetchConnectionsByUserId.js +70 -0
  125. package/dist/esm/hooks/relationships/connections/useFetchConnectionsByUserId.js.map +1 -0
  126. package/dist/esm/hooks/relationships/connections/useFetchConnectionsCount.d.ts +3 -0
  127. package/dist/esm/hooks/relationships/connections/useFetchConnectionsCount.js +67 -0
  128. package/dist/esm/hooks/relationships/connections/useFetchConnectionsCount.js.map +1 -0
  129. package/dist/esm/hooks/relationships/connections/useFetchConnectionsCountByUserId.d.ts +6 -0
  130. package/dist/esm/hooks/relationships/connections/useFetchConnectionsCountByUserId.js +65 -0
  131. package/dist/esm/hooks/relationships/connections/useFetchConnectionsCountByUserId.js.map +1 -0
  132. package/dist/esm/hooks/relationships/connections/useFetchReceivedPendingConnections.d.ts +7 -0
  133. package/dist/esm/hooks/relationships/connections/useFetchReceivedPendingConnections.js +90 -0
  134. package/dist/esm/hooks/relationships/connections/useFetchReceivedPendingConnections.js.map +1 -0
  135. package/dist/esm/hooks/relationships/connections/useFetchSentPendingConnections.d.ts +7 -0
  136. package/dist/esm/hooks/relationships/connections/useFetchSentPendingConnections.js +90 -0
  137. package/dist/esm/hooks/relationships/connections/useFetchSentPendingConnections.js.map +1 -0
  138. package/dist/esm/hooks/relationships/connections/useRemoveConnection.d.ts +5 -0
  139. package/dist/esm/hooks/relationships/connections/useRemoveConnection.js +71 -0
  140. package/dist/esm/hooks/relationships/connections/useRemoveConnection.js.map +1 -0
  141. package/dist/esm/hooks/relationships/connections/useRemoveConnectionByUserId.d.ts +5 -0
  142. package/dist/esm/hooks/relationships/connections/useRemoveConnectionByUserId.js +74 -0
  143. package/dist/esm/hooks/relationships/connections/useRemoveConnectionByUserId.js.map +1 -0
  144. package/dist/esm/hooks/relationships/connections/useRequestConnection.d.ts +3 -0
  145. package/dist/esm/hooks/relationships/connections/useRequestConnection.js +66 -0
  146. package/dist/esm/hooks/relationships/connections/useRequestConnection.js.map +1 -0
  147. package/dist/esm/hooks/relationships/follows/index.d.ts +12 -3
  148. package/dist/esm/hooks/relationships/follows/index.js +12 -3
  149. package/dist/esm/hooks/relationships/follows/index.js.map +1 -1
  150. package/dist/esm/hooks/relationships/follows/useFetchFollowStatus.d.ts +8 -0
  151. package/dist/esm/hooks/relationships/follows/{useFetchFollow.js → useFetchFollowStatus.js} +5 -5
  152. package/dist/esm/hooks/relationships/follows/useFetchFollowStatus.js.map +1 -0
  153. package/dist/esm/hooks/relationships/follows/useFetchFollowers.d.ts +23 -0
  154. package/dist/esm/hooks/relationships/follows/useFetchFollowers.js +86 -0
  155. package/dist/esm/hooks/relationships/follows/useFetchFollowers.js.map +1 -0
  156. package/dist/esm/hooks/relationships/follows/useFetchFollowersByUserId.d.ts +24 -0
  157. package/dist/esm/hooks/relationships/follows/useFetchFollowersByUserId.js +65 -0
  158. package/dist/esm/hooks/relationships/follows/useFetchFollowersByUserId.js.map +1 -0
  159. package/dist/esm/hooks/relationships/follows/useFetchFollowersCount.d.ts +4 -0
  160. package/dist/esm/hooks/relationships/follows/useFetchFollowersCount.js +67 -0
  161. package/dist/esm/hooks/relationships/follows/useFetchFollowersCount.js.map +1 -0
  162. package/dist/esm/hooks/relationships/follows/useFetchFollowersCountByUserId.d.ts +6 -0
  163. package/dist/esm/hooks/{users/useFetchUserFollowersCount.js → relationships/follows/useFetchFollowersCountByUserId.js} +8 -9
  164. package/dist/esm/hooks/relationships/follows/useFetchFollowersCountByUserId.js.map +1 -0
  165. package/dist/esm/hooks/relationships/follows/useFetchFollowing.d.ts +23 -0
  166. package/dist/esm/hooks/relationships/follows/useFetchFollowing.js +89 -0
  167. package/dist/esm/hooks/relationships/follows/useFetchFollowing.js.map +1 -0
  168. package/dist/esm/hooks/relationships/follows/useFetchFollowingByUserId.d.ts +24 -0
  169. package/dist/esm/hooks/relationships/follows/useFetchFollowingByUserId.js +70 -0
  170. package/dist/esm/hooks/relationships/follows/useFetchFollowingByUserId.js.map +1 -0
  171. package/dist/esm/hooks/relationships/follows/useFetchFollowingCount.d.ts +4 -0
  172. package/dist/esm/hooks/relationships/follows/useFetchFollowingCount.js +67 -0
  173. package/dist/esm/hooks/relationships/follows/useFetchFollowingCount.js.map +1 -0
  174. package/dist/esm/hooks/relationships/follows/useFetchFollowingCountByUserId.d.ts +6 -0
  175. package/dist/esm/hooks/{users/useFetchUserFollowingCount.js → relationships/follows/useFetchFollowingCountByUserId.js} +8 -9
  176. package/dist/esm/hooks/relationships/follows/useFetchFollowingCountByUserId.js.map +1 -0
  177. package/dist/esm/hooks/relationships/follows/useFollowManager.js +8 -8
  178. package/dist/esm/hooks/relationships/follows/useFollowManager.js.map +1 -1
  179. package/dist/esm/hooks/relationships/follows/useUnfollowByFollowId.d.ts +4 -0
  180. package/dist/esm/hooks/relationships/follows/useUnfollowByFollowId.js +73 -0
  181. package/dist/esm/hooks/relationships/follows/useUnfollowByFollowId.js.map +1 -0
  182. package/dist/esm/hooks/relationships/follows/useUnfollowUserByUserId.d.ts +4 -0
  183. package/dist/esm/hooks/relationships/follows/{useUnfollowUser.js → useUnfollowUserByUserId.js} +5 -5
  184. package/dist/esm/hooks/relationships/follows/useUnfollowUserByUserId.js.map +1 -0
  185. package/dist/esm/hooks/useStableObject.d.ts +11 -0
  186. package/dist/esm/hooks/useStableObject.js +23 -0
  187. package/dist/esm/hooks/useStableObject.js.map +1 -0
  188. package/dist/esm/hooks/users/index.d.ts +0 -2
  189. package/dist/esm/hooks/users/index.js +0 -2
  190. package/dist/esm/hooks/users/index.js.map +1 -1
  191. package/dist/esm/hooks/users/useUpdateUser.d.ts +1 -2
  192. package/dist/esm/hooks/users/useUpdateUser.js +7 -2
  193. package/dist/esm/hooks/users/useUpdateUser.js.map +1 -1
  194. package/dist/esm/index.d.ts +4 -2
  195. package/dist/esm/index.js +4 -2
  196. package/dist/esm/index.js.map +1 -1
  197. package/dist/esm/interfaces/models/AppNotification.d.ts +26 -2
  198. package/dist/esm/interfaces/models/Connection.d.ts +88 -0
  199. package/dist/esm/interfaces/models/Connection.js +2 -0
  200. package/dist/esm/interfaces/models/Connection.js.map +1 -0
  201. package/dist/esm/interfaces/models/Follow.d.ts +2 -0
  202. package/dist/esm/utils/objectComparison.d.ts +8 -0
  203. package/dist/esm/utils/objectComparison.js +59 -0
  204. package/dist/esm/utils/objectComparison.js.map +1 -0
  205. package/package.json +1 -1
  206. package/dist/cjs/hooks/relationships/follows/useFetchFollow.d.ts +0 -6
  207. package/dist/cjs/hooks/relationships/follows/useFetchFollow.js.map +0 -1
  208. package/dist/cjs/hooks/relationships/follows/useUnfollowUser.d.ts +0 -4
  209. package/dist/cjs/hooks/relationships/follows/useUnfollowUser.js.map +0 -1
  210. package/dist/cjs/hooks/users/useFetchUserFollowersCount.d.ts +0 -6
  211. package/dist/cjs/hooks/users/useFetchUserFollowersCount.js.map +0 -1
  212. package/dist/cjs/hooks/users/useFetchUserFollowingCount.d.ts +0 -6
  213. package/dist/cjs/hooks/users/useFetchUserFollowingCount.js.map +0 -1
  214. package/dist/esm/hooks/relationships/follows/useFetchFollow.d.ts +0 -6
  215. package/dist/esm/hooks/relationships/follows/useFetchFollow.js.map +0 -1
  216. package/dist/esm/hooks/relationships/follows/useUnfollowUser.d.ts +0 -4
  217. package/dist/esm/hooks/relationships/follows/useUnfollowUser.js.map +0 -1
  218. package/dist/esm/hooks/users/useFetchUserFollowersCount.d.ts +0 -6
  219. package/dist/esm/hooks/users/useFetchUserFollowersCount.js.map +0 -1
  220. package/dist/esm/hooks/users/useFetchUserFollowingCount.d.ts +0 -6
  221. package/dist/esm/hooks/users/useFetchUserFollowingCount.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchReceivedPendingConnections.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useFetchReceivedPendingConnections.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAQrC,SAAS,kCAAkC;IAA3C,iBAgCC;IA/BC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,+BAA+B,GAAG,WAAW,CACjD;;;;;mFACE,KAAiD;;YAAjD,sBAAA,EAAA,UAAiD;;;;wBAEzC,KAAyB,KAAK,KAAtB,EAAR,IAAI,mBAAG,CAAC,KAAA,EAAE,KAAe,KAAK,MAAV,EAAV,KAAK,mBAAG,EAAE,KAAA,CAAW;wBACvC,IAAI,CAAC,SAAS,EAAE,CAAC;4BACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;wBAC1C,CAAC;wBAED,IAAI,CAAC,IAAI,EAAE,CAAC;4BACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;wBAC1C,CAAC;wBAEgB,qBAAM,KAAK,CAAC,GAAG,CAAC,+BAA+B,EAAE;gCAChE,MAAM,EAAE;oCACN,IAAI,MAAA;oCACJ,KAAK,OAAA;iCACN;gCACD,eAAe,EAAE,IAAI;6BACtB,CAAC,EAAA;;wBANI,QAAQ,GAAG,SAMf;wBAEF,sBAAO,QAAQ,CAAC,IAAqC,EAAC;;;;KACvD,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,+BAA+B,CAAC;AACzC,CAAC;AAED,eAAe,kCAAkC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { PendingConnectionListResponse } from "../../../interfaces/models/Connection";
2
+ interface FetchSentPendingConnectionsParams {
3
+ page?: number;
4
+ limit?: number;
5
+ }
6
+ declare function useFetchSentPendingConnections(): (props?: FetchSentPendingConnectionsParams) => Promise<PendingConnectionListResponse>;
7
+ export default useFetchSentPendingConnections;
@@ -0,0 +1,90 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
38
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
39
+ if (ar || !(i in from)) {
40
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
41
+ ar[i] = from[i];
42
+ }
43
+ }
44
+ return to.concat(ar || Array.prototype.slice.call(from));
45
+ };
46
+ import { useCallback } from "react";
47
+ import useAxiosPrivate from "../../../config/useAxiosPrivate";
48
+ import useProject from "../../projects/useProject";
49
+ import { useUser } from "../../user";
50
+ function useFetchSentPendingConnections() {
51
+ var _this = this;
52
+ var axios = useAxiosPrivate();
53
+ var projectId = useProject().projectId;
54
+ var user = useUser().user;
55
+ var fetchSentPendingConnections = useCallback(function () {
56
+ var args_1 = [];
57
+ for (var _i = 0; _i < arguments.length; _i++) {
58
+ args_1[_i] = arguments[_i];
59
+ }
60
+ return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (props) {
61
+ var _a, page, _b, limit, response;
62
+ if (props === void 0) { props = {}; }
63
+ return __generator(this, function (_c) {
64
+ switch (_c.label) {
65
+ case 0:
66
+ _a = props.page, page = _a === void 0 ? 1 : _a, _b = props.limit, limit = _b === void 0 ? 20 : _b;
67
+ if (!projectId) {
68
+ throw new Error("No project specified");
69
+ }
70
+ if (!user) {
71
+ throw new Error("No user is logged in");
72
+ }
73
+ return [4 /*yield*/, axios.get("/connections/pending/sent", {
74
+ params: {
75
+ page: page,
76
+ limit: limit,
77
+ },
78
+ withCredentials: true,
79
+ })];
80
+ case 1:
81
+ response = _c.sent();
82
+ return [2 /*return*/, response.data];
83
+ }
84
+ });
85
+ });
86
+ }, [axios, projectId, user]);
87
+ return fetchSentPendingConnections;
88
+ }
89
+ export default useFetchSentPendingConnections;
90
+ //# sourceMappingURL=useFetchSentPendingConnections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchSentPendingConnections.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useFetchSentPendingConnections.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAQrC,SAAS,8BAA8B;IAAvC,iBAgCC;IA/BC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,2BAA2B,GAAG,WAAW,CAC7C;;;;;mFACE,KAA6C;;YAA7C,sBAAA,EAAA,UAA6C;;;;wBAErC,KAAyB,KAAK,KAAtB,EAAR,IAAI,mBAAG,CAAC,KAAA,EAAE,KAAe,KAAK,MAAV,EAAV,KAAK,mBAAG,EAAE,KAAA,CAAW;wBACvC,IAAI,CAAC,SAAS,EAAE,CAAC;4BACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;wBAC1C,CAAC;wBAED,IAAI,CAAC,IAAI,EAAE,CAAC;4BACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;wBAC1C,CAAC;wBAEgB,qBAAM,KAAK,CAAC,GAAG,CAAC,2BAA2B,EAAE;gCAC5D,MAAM,EAAE;oCACN,IAAI,MAAA;oCACJ,KAAK,OAAA;iCACN;gCACD,eAAe,EAAE,IAAI;6BACtB,CAAC,EAAA;;wBANI,QAAQ,GAAG,SAMf;wBAEF,sBAAO,QAAQ,CAAC,IAAqC,EAAC;;;;KACvD,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,2BAA2B,CAAC;AACrC,CAAC;AAED,eAAe,8BAA8B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ConnectionWithdrawResponse } from "../../../interfaces/models/Connection";
2
+ declare function useRemoveConnection(): (props: {
3
+ connectionId: string;
4
+ }) => Promise<ConnectionWithdrawResponse>;
5
+ export default useRemoveConnection;
@@ -0,0 +1,71 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { useCallback } from "react";
38
+ import useAxiosPrivate from "../../../config/useAxiosPrivate";
39
+ import useProject from "../../projects/useProject";
40
+ import { useUser } from "../../user";
41
+ function useRemoveConnection() {
42
+ var _this = this;
43
+ var axios = useAxiosPrivate();
44
+ var projectId = useProject().projectId;
45
+ var user = useUser().user;
46
+ var removeConnection = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
47
+ var connectionId, response;
48
+ return __generator(this, function (_a) {
49
+ switch (_a.label) {
50
+ case 0:
51
+ connectionId = props.connectionId;
52
+ if (!projectId) {
53
+ throw new Error("No project specified");
54
+ }
55
+ if (!user) {
56
+ throw new Error("No user is logged in");
57
+ }
58
+ if (!connectionId) {
59
+ throw new Error("No connection ID was provided");
60
+ }
61
+ return [4 /*yield*/, axios.delete("/connections/".concat(connectionId), { withCredentials: true })];
62
+ case 1:
63
+ response = _a.sent();
64
+ return [2 /*return*/, response.data];
65
+ }
66
+ });
67
+ }); }, [axios, projectId, user]);
68
+ return removeConnection;
69
+ }
70
+ export default useRemoveConnection;
71
+ //# sourceMappingURL=useRemoveConnection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRemoveConnection.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useRemoveConnection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,SAAS,mBAAmB;IAA5B,iBA+BC;IA9BC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,gBAAgB,GAAG,WAAW,CAClC,UAAO,KAA+B;;;;;oBAC5B,YAAY,GAAK,KAAK,aAAV,CAAW;oBAC/B,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,YAAY,EAAE,CAAC;wBAClB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;oBACnD,CAAC;oBAEgB,qBAAM,KAAK,CAAC,MAAM,CACjC,uBAAgB,YAAY,CAAE,EAC9B,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAkC,EAAC;;;SACpD,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { RemoveConnectionByUserIdResponse } from "../../../interfaces/models/Connection";
2
+ declare function useRemoveConnectionByUserId(): (props: {
3
+ userId: string;
4
+ }) => Promise<RemoveConnectionByUserIdResponse>;
5
+ export default useRemoveConnectionByUserId;
@@ -0,0 +1,74 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { useCallback } from "react";
38
+ import useAxiosPrivate from "../../../config/useAxiosPrivate";
39
+ import useProject from "../../projects/useProject";
40
+ import { useUser } from "../../user";
41
+ function useRemoveConnectionByUserId() {
42
+ var _this = this;
43
+ var axios = useAxiosPrivate();
44
+ var projectId = useProject().projectId;
45
+ var user = useUser().user;
46
+ var removeConnectionByUserId = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
47
+ var userId, response;
48
+ return __generator(this, function (_a) {
49
+ switch (_a.label) {
50
+ case 0:
51
+ userId = props.userId;
52
+ if (!projectId) {
53
+ throw new Error("No project specified");
54
+ }
55
+ if (!user) {
56
+ throw new Error("No user is logged in");
57
+ }
58
+ if (!userId) {
59
+ throw new Error("No user ID was provided");
60
+ }
61
+ if (userId === user.id) {
62
+ throw new Error("Cannot disconnect from yourself");
63
+ }
64
+ return [4 /*yield*/, axios.delete("/users/".concat(userId, "/connection"), { withCredentials: true })];
65
+ case 1:
66
+ response = _a.sent();
67
+ return [2 /*return*/, response.data];
68
+ }
69
+ });
70
+ }); }, [axios, projectId, user]);
71
+ return removeConnectionByUserId;
72
+ }
73
+ export default useRemoveConnectionByUserId;
74
+ //# sourceMappingURL=useRemoveConnectionByUserId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRemoveConnectionByUserId.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useRemoveConnectionByUserId.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,SAAS,2BAA2B;IAApC,iBAmCC;IAlCC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,wBAAwB,GAAG,WAAW,CAC1C,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;oBAEgB,qBAAM,KAAK,CAAC,MAAM,CACjC,iBAAU,MAAM,gBAAa,EAC7B,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAwC,EAAC;;;SAC1D,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAED,eAAe,2BAA2B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ConnectionRequestParams, ConnectionActionResponse } from "../../../interfaces/models/Connection";
2
+ declare function useRequestConnection(): (props: ConnectionRequestParams) => Promise<ConnectionActionResponse>;
3
+ export default useRequestConnection;
@@ -0,0 +1,66 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { useCallback } from "react";
38
+ import useAxiosPrivate from "../../../config/useAxiosPrivate";
39
+ import useProject from "../../projects/useProject";
40
+ function useRequestConnection() {
41
+ var _this = this;
42
+ var axios = useAxiosPrivate();
43
+ var projectId = useProject().projectId;
44
+ var requestConnection = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
45
+ var userId, message, response;
46
+ return __generator(this, function (_a) {
47
+ switch (_a.label) {
48
+ case 0:
49
+ userId = props.userId, message = props.message;
50
+ if (!projectId) {
51
+ throw new Error("No project specified");
52
+ }
53
+ if (!userId) {
54
+ throw new Error("No user ID was provided");
55
+ }
56
+ return [4 /*yield*/, axios.post("/users/".concat(userId, "/connection"), { message: message }, { withCredentials: true })];
57
+ case 1:
58
+ response = _a.sent();
59
+ return [2 /*return*/, response.data];
60
+ }
61
+ });
62
+ }); }, [axios, projectId]);
63
+ return requestConnection;
64
+ }
65
+ export default useRequestConnection;
66
+ //# sourceMappingURL=useRequestConnection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRequestConnection.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useRequestConnection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AAGnD,SAAS,oBAAoB;IAA7B,iBA2BC;IA1BC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAEnC,IAAM,iBAAiB,GAAG,WAAW,CACnC,UAAO,KAA8B;;;;;oBAC3B,MAAM,GAAc,KAAK,OAAnB,EAAE,OAAO,GAAK,KAAK,QAAV,CAAW;oBAClC,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;oBAEgB,qBAAM,KAAK,CAAC,IAAI,CAC/B,iBAAU,MAAM,gBAAa,EAC7B,EAAE,OAAO,SAAA,EAAE,EACX,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAJK,QAAQ,GAAG,SAIhB;oBAED,sBAAO,QAAQ,CAAC,IAAgC,EAAC;;;SAClD,EACD,CAAC,KAAK,EAAE,SAAS,CAAC,CACnB,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,eAAe,oBAAoB,CAAC"}
@@ -1,4 +1,13 @@
1
- export { default as useFetchFollow } from "./useFetchFollow";
2
- export { default as useFollowUser } from "./useFollowUser";
3
- export { default as useUnfollowUser } from "./useUnfollowUser";
1
+ export { default as useFetchFollowStatus } from "./useFetchFollowStatus";
2
+ export { default as useFetchFollowers } from "./useFetchFollowers";
3
+ export { default as useFetchFollowersByUserId } from "./useFetchFollowersByUserId";
4
+ export { default as useFetchFollowersCount } from "./useFetchFollowersCount";
5
+ export { default as useFetchFollowersCountByUserId } from "./useFetchFollowersCountByUserId";
6
+ export { default as useFetchFollowing } from "./useFetchFollowing";
7
+ export { default as useFetchFollowingByUserId } from "./useFetchFollowingByUserId";
8
+ export { default as useFetchFollowingCount } from "./useFetchFollowingCount";
9
+ export { default as useFetchFollowingCountByUserId } from "./useFetchFollowingCountByUserId";
4
10
  export { default as useFollowManager } from "./useFollowManager";
11
+ export { default as useFollowUser } from "./useFollowUser";
12
+ export { default as useUnfollowByFollowId } from "./useUnfollowByFollowId";
13
+ export { default as useUnfollowUserByUserId } from "./useUnfollowUserByUserId";
@@ -1,5 +1,14 @@
1
- export { default as useFetchFollow } from "./useFetchFollow";
2
- export { default as useFollowUser } from "./useFollowUser";
3
- export { default as useUnfollowUser } from "./useUnfollowUser";
1
+ export { default as useFetchFollowStatus } from "./useFetchFollowStatus";
2
+ export { default as useFetchFollowers } from "./useFetchFollowers";
3
+ export { default as useFetchFollowersByUserId } from "./useFetchFollowersByUserId";
4
+ export { default as useFetchFollowersCount } from "./useFetchFollowersCount";
5
+ export { default as useFetchFollowersCountByUserId } from "./useFetchFollowersCountByUserId";
6
+ export { default as useFetchFollowing } from "./useFetchFollowing";
7
+ export { default as useFetchFollowingByUserId } from "./useFetchFollowingByUserId";
8
+ export { default as useFetchFollowingCount } from "./useFetchFollowingCount";
9
+ export { default as useFetchFollowingCountByUserId } from "./useFetchFollowingCountByUserId";
4
10
  export { default as useFollowManager } from "./useFollowManager";
11
+ export { default as useFollowUser } from "./useFollowUser";
12
+ export { default as useUnfollowByFollowId } from "./useUnfollowByFollowId";
13
+ export { default as useUnfollowUserByUserId } from "./useUnfollowUserByUserId";
5
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,8 @@
1
+ declare function useFetchFollowStatus(): (props: {
2
+ userId: string;
3
+ }) => Promise<{
4
+ isFollowing: boolean;
5
+ followId?: string;
6
+ followedAt?: string;
7
+ }>;
8
+ export default useFetchFollowStatus;
@@ -38,12 +38,12 @@ import { useCallback } from "react";
38
38
  import useAxiosPrivate from "../../../config/useAxiosPrivate";
39
39
  import useProject from "../../projects/useProject";
40
40
  import { useUser } from "../../user";
41
- function useFetchFollow() {
41
+ function useFetchFollowStatus() {
42
42
  var _this = this;
43
43
  var axios = useAxiosPrivate();
44
44
  var projectId = useProject().projectId;
45
45
  var user = useUser().user;
46
- var fetchFollow = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
46
+ var fetchFollowStatus = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
47
47
  var userId, response;
48
48
  return __generator(this, function (_a) {
49
49
  switch (_a.label) {
@@ -70,7 +70,7 @@ function useFetchFollow() {
70
70
  }
71
71
  });
72
72
  }); }, [axios, projectId, user]);
73
- return fetchFollow;
73
+ return fetchFollowStatus;
74
74
  }
75
- export default useFetchFollow;
76
- //# sourceMappingURL=useFetchFollow.js.map
75
+ export default useFetchFollowStatus;
76
+ //# sourceMappingURL=useFetchFollowStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchFollowStatus.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/useFetchFollowStatus.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,SAAS,oBAAoB;IAA7B,iBAqCC;IApCC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,iBAAiB,GAAG,WAAW,CACnC,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,IAIf,EAAC;;;SACH,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { User } from "../../../interfaces/models/User";
2
+ export interface FollowerWithFollowInfo {
3
+ followId: string;
4
+ user: User;
5
+ followedAt: string;
6
+ }
7
+ export interface FollowersResponse {
8
+ followers: FollowerWithFollowInfo[];
9
+ pagination: {
10
+ currentPage: number;
11
+ totalPages: number;
12
+ totalCount: number;
13
+ hasNextPage: boolean;
14
+ hasPreviousPage: boolean;
15
+ limit: number;
16
+ };
17
+ }
18
+ export interface FetchFollowersParams {
19
+ page?: number;
20
+ limit?: number;
21
+ }
22
+ declare function useFetchFollowers(): ({ page, limit }?: FetchFollowersParams) => Promise<FollowersResponse>;
23
+ export default useFetchFollowers;
@@ -0,0 +1,86 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
38
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
39
+ if (ar || !(i in from)) {
40
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
41
+ ar[i] = from[i];
42
+ }
43
+ }
44
+ return to.concat(ar || Array.prototype.slice.call(from));
45
+ };
46
+ import { useCallback } from "react";
47
+ import useAxiosPrivate from "../../../config/useAxiosPrivate";
48
+ import useProject from "../../projects/useProject";
49
+ import { useUser } from "../../user";
50
+ function useFetchFollowers() {
51
+ var _this = this;
52
+ var axios = useAxiosPrivate();
53
+ var projectId = useProject().projectId;
54
+ var user = useUser().user;
55
+ var fetchFollowers = useCallback(function () {
56
+ var args_1 = [];
57
+ for (var _i = 0; _i < arguments.length; _i++) {
58
+ args_1[_i] = arguments[_i];
59
+ }
60
+ return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (_a) {
61
+ var response;
62
+ var _b = _a === void 0 ? {} : _a, _c = _b.page, page = _c === void 0 ? 1 : _c, _d = _b.limit, limit = _d === void 0 ? 20 : _d;
63
+ return __generator(this, function (_e) {
64
+ switch (_e.label) {
65
+ case 0:
66
+ if (!projectId) {
67
+ throw new Error("No projectId available.");
68
+ }
69
+ if (!user) {
70
+ throw new Error("No user is logged in.");
71
+ }
72
+ return [4 /*yield*/, axios.get("/".concat(projectId, "/follows/followers"), {
73
+ params: { page: page, limit: limit },
74
+ withCredentials: true,
75
+ })];
76
+ case 1:
77
+ response = _e.sent();
78
+ return [2 /*return*/, response.data];
79
+ }
80
+ });
81
+ });
82
+ }, [axios, projectId, user]);
83
+ return fetchFollowers;
84
+ }
85
+ export default useFetchFollowers;
86
+ //# sourceMappingURL=useFetchFollowers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchFollowers.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/useFetchFollowers.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA0BrC,SAAS,iBAAiB;IAA1B,iBA0BC;IAzBC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,cAAc,GAAG,WAAW,CAChC;;;;;mFAAO,EAAmD;;gBAAnD,qBAAiD,EAAE,KAAA,EAAjD,YAAQ,EAAR,IAAI,mBAAG,CAAC,KAAA,EAAE,aAAU,EAAV,KAAK,mBAAG,EAAE,KAAA;;;;wBAC3B,IAAI,CAAC,SAAS,EAAE,CAAC;4BACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;wBAC7C,CAAC;wBAED,IAAI,CAAC,IAAI,EAAE,CAAC;4BACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;wBAC3C,CAAC;wBAEgB,qBAAM,KAAK,CAAC,GAAG,CAAC,WAAI,SAAS,uBAAoB,EAAE;gCAClE,MAAM,EAAE,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE;gCACvB,eAAe,EAAE,IAAI;6BACtB,CAAC,EAAA;;wBAHI,QAAQ,GAAG,SAGf;wBAEF,sBAAO,QAAQ,CAAC,IAAyB,EAAC;;;;KAC3C,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { User } from "../../../interfaces/models/User";
2
+ export interface FollowerWithFollowInfo {
3
+ followId: string;
4
+ user: User;
5
+ followedAt: string;
6
+ }
7
+ export interface FollowersResponse {
8
+ followers: FollowerWithFollowInfo[];
9
+ pagination: {
10
+ currentPage: number;
11
+ totalPages: number;
12
+ totalCount: number;
13
+ hasNextPage: boolean;
14
+ hasPreviousPage: boolean;
15
+ limit: number;
16
+ };
17
+ }
18
+ export interface FetchFollowersByUserIdParams {
19
+ userId: string;
20
+ page?: number;
21
+ limit?: number;
22
+ }
23
+ declare function useFetchFollowersByUserId(): ({ userId, page, limit }: FetchFollowersByUserIdParams) => Promise<FollowersResponse>;
24
+ export default useFetchFollowersByUserId;