@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":"useFetchFollowingCount.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/useFetchFollowingCount.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,yEAAmD;AACnD,mCAAqC;AAErC,SAAS,sBAAsB;IAA/B,iBA0BC;IAzBC,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,mBAAmB,GAAG,IAAA,mBAAW,EACrC;;;;;oBACE,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;oBAC3C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,6BAA0B,EACvC,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAyB,EAAC;;;SAC3C,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED,kBAAe,sBAAsB,CAAC"}
@@ -0,0 +1,6 @@
1
+ declare function useFetchFollowingCountByUserId(): ({ userId }: {
2
+ userId: string;
3
+ }) => Promise<{
4
+ count: number;
5
+ }>;
6
+ export default useFetchFollowingCountByUserId;
@@ -40,13 +40,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  var react_1 = require("react");
43
- var useAxiosPrivate_1 = __importDefault(require("../../config/useAxiosPrivate"));
44
- var useProject_1 = __importDefault(require("../projects/useProject"));
45
- function useFetchUserFollowingCount() {
43
+ var useProject_1 = __importDefault(require("../../projects/useProject"));
44
+ var axios_1 = __importDefault(require("../../../config/axios"));
45
+ function useFetchFollowingCountByUserId() {
46
46
  var _this = this;
47
- var axios = (0, useAxiosPrivate_1.default)();
48
47
  var projectId = (0, useProject_1.default)().projectId;
49
- var fetchUserFollowingCount = (0, react_1.useCallback)(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
48
+ var fetchFollowingCountByUserId = (0, react_1.useCallback)(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
50
49
  var response;
51
50
  var userId = _b.userId;
52
51
  return __generator(this, function (_c) {
@@ -58,14 +57,14 @@ function useFetchUserFollowingCount() {
58
57
  if (!projectId) {
59
58
  throw new Error("No projectId available.");
60
59
  }
61
- return [4 /*yield*/, axios.get("/".concat(projectId, "/users/").concat(userId, "/following-count"))];
60
+ return [4 /*yield*/, axios_1.default.get("/".concat(projectId, "/users/").concat(userId, "/following-count"))];
62
61
  case 1:
63
62
  response = _c.sent();
64
63
  return [2 /*return*/, response.data];
65
64
  }
66
65
  });
67
- }); }, [axios, projectId]);
68
- return fetchUserFollowingCount;
66
+ }); }, [projectId]);
67
+ return fetchFollowingCountByUserId;
69
68
  }
70
- exports.default = useFetchUserFollowingCount;
71
- //# sourceMappingURL=useFetchUserFollowingCount.js.map
69
+ exports.default = useFetchFollowingCountByUserId;
70
+ //# sourceMappingURL=useFetchFollowingCountByUserId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchFollowingCountByUserId.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/useFetchFollowingCountByUserId.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,yEAAmD;AACnD,gEAA0C;AAE1C,SAAS,8BAA8B;IAAvC,iBAuBC;IAtBS,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAEnC,IAAM,2BAA2B,GAAG,IAAA,mBAAW,EAC7C,gEAAO,EAA8B;;YAA5B,MAAM,YAAA;;;;oBACb,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;oBACzC,CAAC;oBAED,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAEgB,qBAAM,eAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,oBAAU,MAAM,qBAAkB,CAChD,EAAA;;oBAFK,QAAQ,GAAG,SAEhB;oBAED,sBAAO,QAAQ,CAAC,IAAyB,EAAC;;;SAC3C,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,OAAO,2BAA2B,CAAC;AACrC,CAAC;AAED,kBAAe,8BAA8B,CAAC"}
@@ -41,8 +41,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  var react_1 = require("react");
43
43
  var useFollowUser_1 = __importDefault(require("./useFollowUser"));
44
- var useUnfollowUser_1 = __importDefault(require("./useUnfollowUser"));
45
- var useFetchFollow_1 = __importDefault(require("./useFetchFollow"));
44
+ var useUnfollowUserByUserId_1 = __importDefault(require("./useUnfollowUserByUserId"));
45
+ var useFetchFollowStatus_1 = __importDefault(require("./useFetchFollowStatus"));
46
46
  var useUser_1 = __importDefault(require("../../user/useUser"));
47
47
  function useFollowManager(_a) {
48
48
  var _this = this;
@@ -51,8 +51,8 @@ function useFollowManager(_a) {
51
51
  var _b = (0, react_1.useState)(null), isFollowing = _b[0], setIsFollowing = _b[1];
52
52
  var _c = (0, react_1.useState)(true), isLoading = _c[0], setIsLoading = _c[1];
53
53
  var followUser = (0, useFollowUser_1.default)();
54
- var unfollowUser = (0, useUnfollowUser_1.default)();
55
- var fetchFollow = (0, useFetchFollow_1.default)();
54
+ var unfollowUserByUserId = (0, useUnfollowUserByUserId_1.default)();
55
+ var fetchFollowStatus = (0, useFetchFollowStatus_1.default)();
56
56
  (0, react_1.useEffect)(function () {
57
57
  var loadFollowStatus = function () { return __awaiter(_this, void 0, void 0, function () {
58
58
  var result, error_1;
@@ -61,7 +61,7 @@ function useFollowManager(_a) {
61
61
  case 0:
62
62
  _a.trys.push([0, 2, 3, 4]);
63
63
  setIsLoading(true);
64
- return [4 /*yield*/, fetchFollow({ userId: userId })];
64
+ return [4 /*yield*/, fetchFollowStatus({ userId: userId })];
65
65
  case 1:
66
66
  result = _a.sent();
67
67
  setIsFollowing(result.isFollowing);
@@ -81,7 +81,7 @@ function useFollowManager(_a) {
81
81
  if (userId && (user === null || user === void 0 ? void 0 : user.id) !== userId) {
82
82
  loadFollowStatus();
83
83
  }
84
- }, [userId, fetchFollow]);
84
+ }, [userId, fetchFollowStatus]);
85
85
  var toggleFollow = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
86
86
  var error_2;
87
87
  return __generator(this, function (_a) {
@@ -93,7 +93,7 @@ function useFollowManager(_a) {
93
93
  case 1:
94
94
  _a.trys.push([1, 6, , 7]);
95
95
  if (!isFollowing) return [3 /*break*/, 3];
96
- return [4 /*yield*/, unfollowUser({ userId: userId })];
96
+ return [4 /*yield*/, unfollowUserByUserId({ userId: userId })];
97
97
  case 2:
98
98
  _a.sent();
99
99
  setIsFollowing(false);
@@ -111,7 +111,7 @@ function useFollowManager(_a) {
111
111
  case 7: return [2 /*return*/];
112
112
  }
113
113
  });
114
- }); }, [isFollowing, isLoading, userId, followUser, unfollowUser]);
114
+ }); }, [isFollowing, isLoading, userId, followUser, unfollowUserByUserId]);
115
115
  return {
116
116
  isFollowing: isFollowing,
117
117
  isLoading: isLoading,
@@ -1 +1 @@
1
- {"version":3,"file":"useFollowManager.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/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,CAA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are function useUnfollowByFollowId(): (props: {
2
+ followId: string;
3
+ }) => Promise<void>;
4
+ export default useUnfollowByFollowId;
@@ -0,0 +1,78 @@
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 useUnfollowByFollowId() {
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 unfollowByFollowId = (0, react_1.useCallback)(function (props) { return __awaiter(_this, void 0, void 0, function () {
52
+ var followId;
53
+ return __generator(this, function (_a) {
54
+ switch (_a.label) {
55
+ case 0:
56
+ followId = props.followId;
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 (!followId) {
64
+ throw new Error("No follow ID was provided");
65
+ }
66
+ return [4 /*yield*/, axios.delete("/".concat(projectId, "/follows/").concat(followId), {
67
+ withCredentials: true,
68
+ })];
69
+ case 1:
70
+ _a.sent();
71
+ return [2 /*return*/];
72
+ }
73
+ });
74
+ }); }, [axios, projectId, user]);
75
+ return unfollowByFollowId;
76
+ }
77
+ exports.default = useUnfollowByFollowId;
78
+ //# sourceMappingURL=useUnfollowByFollowId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUnfollowByFollowId.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/useUnfollowByFollowId.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,yEAAmD;AACnD,mCAAqC;AAErC,SAAS,qBAAqB;IAA9B,iBA4BC;IA3BC,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,kBAAkB,GAAG,IAAA,mBAAW,EACpC,UAAO,KAA2B;;;;;oBACxB,QAAQ,GAAK,KAAK,SAAV,CAAW;oBAC3B,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,QAAQ,EAAE,CAAC;wBACd,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;oBAC/C,CAAC;oBAED,qBAAM,KAAK,CAAC,MAAM,CAAC,WAAI,SAAS,sBAAY,QAAQ,CAAE,EAAE;4BACtD,eAAe,EAAE,IAAI;yBACtB,CAAC,EAAA;;oBAFF,SAEE,CAAC;;;;SACJ,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,kBAAe,qBAAqB,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare function useUnfollowUserByUserId(): (props: {
2
+ userId: string;
3
+ }) => Promise<void>;
4
+ export default useUnfollowUserByUserId;
@@ -43,12 +43,12 @@ var react_1 = require("react");
43
43
  var useAxiosPrivate_1 = __importDefault(require("../../../config/useAxiosPrivate"));
44
44
  var useProject_1 = __importDefault(require("../../projects/useProject"));
45
45
  var user_1 = require("../../user");
46
- function useUnfollowUser() {
46
+ function useUnfollowUserByUserId() {
47
47
  var _this = this;
48
48
  var axios = (0, useAxiosPrivate_1.default)();
49
49
  var projectId = (0, useProject_1.default)().projectId;
50
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 () {
51
+ var unfollowUserByUserId = (0, react_1.useCallback)(function (props) { return __awaiter(_this, void 0, void 0, function () {
52
52
  var userId;
53
53
  return __generator(this, function (_a) {
54
54
  switch (_a.label) {
@@ -75,7 +75,7 @@ function useUnfollowUser() {
75
75
  }
76
76
  });
77
77
  }); }, [axios, projectId, user]);
78
- return unfollowUser;
78
+ return unfollowUserByUserId;
79
79
  }
80
- exports.default = useUnfollowUser;
81
- //# sourceMappingURL=useUnfollowUser.js.map
80
+ exports.default = useUnfollowUserByUserId;
81
+ //# sourceMappingURL=useUnfollowUserByUserId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUnfollowUserByUserId.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/useUnfollowUserByUserId.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,yEAAmD;AACnD,mCAAqC;AAErC,SAAS,uBAAuB;IAAhC,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,oBAAoB,GAAG,IAAA,mBAAW,EACtC,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,oBAAoB,CAAC;AAC9B,CAAC;AAED,kBAAe,uBAAuB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Hook that returns a stable reference to an object that only changes
3
+ * when the content of the object actually changes (deep comparison).
4
+ *
5
+ * This is useful for preventing unnecessary re-renders when objects are
6
+ * recreated with the same content on every render.
7
+ *
8
+ * @param obj - The object to stabilize
9
+ * @returns A stable reference to the object
10
+ */
11
+ export declare function useStableObject<T extends Record<string, any> | undefined>(obj: T): T;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useStableObject = useStableObject;
4
+ var react_1 = require("react");
5
+ var objectComparison_1 = require("../utils/objectComparison");
6
+ /**
7
+ * Hook that returns a stable reference to an object that only changes
8
+ * when the content of the object actually changes (deep comparison).
9
+ *
10
+ * This is useful for preventing unnecessary re-renders when objects are
11
+ * recreated with the same content on every render.
12
+ *
13
+ * @param obj - The object to stabilize
14
+ * @returns A stable reference to the object
15
+ */
16
+ function useStableObject(obj) {
17
+ var ref = (0, react_1.useRef)(obj);
18
+ // If the new object is deeply equal to the previous one, return the previous reference
19
+ if ((0, objectComparison_1.deepEqual)(ref.current, obj)) {
20
+ return ref.current;
21
+ }
22
+ // Otherwise, update the ref and return the new object
23
+ ref.current = obj;
24
+ return obj;
25
+ }
26
+ //# sourceMappingURL=useStableObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStableObject.js","sourceRoot":"","sources":["../../../src/hooks/useStableObject.ts"],"names":[],"mappings":";;AAaA,0CAaC;AA1BD,+BAA+B;AAC/B,8DAAsD;AAEtD;;;;;;;;;GASG;AACH,SAAgB,eAAe,CAC7B,GAAM;IAEN,IAAM,GAAG,GAAG,IAAA,cAAM,EAAI,GAAG,CAAC,CAAC;IAE3B,uFAAuF;IACvF,IAAI,IAAA,4BAAS,EAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC;QAChC,OAAO,GAAG,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,sDAAsD;IACtD,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC;IAClB,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1,7 +1,5 @@
1
1
  export { default as useFetchUser } from "./useFetchUser";
2
2
  export { default as useFetchUserByForeignId } from "./useFetchUserByForeignId";
3
- export { default as useFetchUserFollowersCount } from "./useFetchUserFollowersCount";
4
- export { default as useFetchUserFollowingCount } from "./useFetchUserFollowingCount";
5
3
  export { default as useCheckUsernameAvailability } from "./useCheckUsernameAvailability";
6
4
  export { default as useFetchUserSuggestions } from "./useFetchUserSuggestions";
7
5
  export { default as useMentions } from "./useMentions";
@@ -3,15 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.useUpdateUser = exports.useMentions = exports.useFetchUserSuggestions = exports.useCheckUsernameAvailability = exports.useFetchUserFollowingCount = exports.useFetchUserFollowersCount = exports.useFetchUserByForeignId = exports.useFetchUser = void 0;
6
+ exports.useUpdateUser = exports.useMentions = exports.useFetchUserSuggestions = exports.useCheckUsernameAvailability = exports.useFetchUserByForeignId = exports.useFetchUser = void 0;
7
7
  var useFetchUser_1 = require("./useFetchUser");
8
8
  Object.defineProperty(exports, "useFetchUser", { enumerable: true, get: function () { return __importDefault(useFetchUser_1).default; } });
9
9
  var useFetchUserByForeignId_1 = require("./useFetchUserByForeignId");
10
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
11
  var useCheckUsernameAvailability_1 = require("./useCheckUsernameAvailability");
16
12
  Object.defineProperty(exports, "useCheckUsernameAvailability", { enumerable: true, get: function () { return __importDefault(useCheckUsernameAvailability_1).default; } });
17
13
  var useFetchUserSuggestions_1 = require("./useFetchUserSuggestions");
@@ -1 +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"}
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,+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"}
@@ -12,8 +12,7 @@ export type UpdateUserParams = {
12
12
  metadata?: Record<string, any>;
13
13
  secureMetadata?: Record<string, any>;
14
14
  };
15
- declare function useUpdateUser(): ({ userId, update, }: {
16
- userId: string;
15
+ declare function useUpdateUser(): ({ update }: {
17
16
  update: UpdateUserParams;
18
17
  }) => Promise<AuthUser>;
19
18
  export default useUpdateUser;
@@ -42,23 +42,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
42
42
  var react_1 = require("react");
43
43
  var useAxiosPrivate_1 = __importDefault(require("../../config/useAxiosPrivate"));
44
44
  var useProject_1 = __importDefault(require("../projects/useProject"));
45
+ var useUser_1 = __importDefault(require("../user/useUser"));
45
46
  function useUpdateUser() {
46
47
  var _this = this;
47
48
  var axios = (0, useAxiosPrivate_1.default)();
48
49
  var projectId = (0, useProject_1.default)().projectId;
50
+ var user = (0, useUser_1.default)().user;
49
51
  var updateUser = (0, react_1.useCallback)(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
50
52
  var response;
51
- var userId = _b.userId, update = _b.update;
53
+ var update = _b.update;
52
54
  return __generator(this, function (_c) {
53
55
  switch (_c.label) {
54
56
  case 0:
55
57
  if (!projectId) {
56
58
  throw new Error("No project specified");
57
59
  }
60
+ if (!user) {
61
+ throw new Error("No user is logged in.");
62
+ }
58
63
  if (!update || Object.keys(update).length == 0) {
59
64
  console.error("Update object is empty");
60
65
  }
61
- return [4 /*yield*/, axios.patch("/".concat(projectId, "/users/").concat(userId), {
66
+ return [4 /*yield*/, axios.patch("/".concat(projectId, "/users/").concat(user.id), {
62
67
  update: update,
63
68
  }, { withCredentials: true })];
64
69
  case 1:
@@ -1 +1 @@
1
- {"version":3,"file":"useUpdateUser.js","sourceRoot":"","sources":["../../../../src/hooks/users/useUpdateUser.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,iFAA2D;AAC3D,sEAAgD;AAiBhD,SAAS,aAAa;IAAtB,iBAkCC;IAjCC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IACxB,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAEnC,IAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,gEAAO,EAMN;;YALC,MAAM,YAAA,EACN,MAAM,YAAA;;;;oBAKN,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;wBAC/C,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;oBAC1C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,KAAK,CAChC,WAAI,SAAS,oBAAU,MAAM,CAAE,EAC/B;4BACE,MAAM,QAAA;yBACP,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBANK,QAAQ,GAAG,SAMhB;oBAED,sBAAO,QAAQ,CAAC,IAAgB,EAAC;;;SAClC,EACD,CAAC,SAAS,EAAE,KAAK,CAAC,CACnB,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,kBAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"useUpdateUser.js","sourceRoot":"","sources":["../../../../src/hooks/users/useUpdateUser.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,iFAA2D;AAC3D,sEAAgD;AAEhD,4DAAsC;AAgBtC,SAAS,aAAa;IAAtB,iBAiCC;IAhCC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IACxB,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,IAAA,iBAAO,GAAE,KAAd,CAAe;IAE3B,IAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,gEAAO,EAAwC;;YAAtC,MAAM,YAAA;;;;oBACb,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,uBAAuB,CAAC,CAAC;oBAC3C,CAAC;oBAED,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;wBAC/C,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;oBAC1C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,KAAK,CAChC,WAAI,SAAS,oBAAU,IAAI,CAAC,EAAE,CAAE,EAChC;4BACE,MAAM,QAAA;yBACP,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBANK,QAAQ,GAAG,SAMhB;oBAED,sBAAO,QAAQ,CAAC,IAAgB,EAAC;;;SAClC,EACD,CAAC,SAAS,EAAE,KAAK,CAAC,CACnB,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,kBAAe,aAAa,CAAC"}
@@ -16,8 +16,9 @@ export { useLists, useListsActions, useIsEntitySaved, type UseListsProps, type U
16
16
  export { useEntity, useEntityData, useCreateEntity, useDeleteEntity, useDownvoteEntity, useEntityVotes, useFetchEntity, useFetchEntityByForeignId, useFetchEntityByShortId, useIncrementEntityViews, useRemoveEntityDownvote, useRemoveEntityUpvote, useUpdateEntity, useUpvoteEntity, } from "./hooks/entities";
17
17
  export { useEntityList, useEntityListActions, type UseEntityListProps, type UseEntityListValues, type EntityListFilters, type EntityListFetchOptions, } from "./hooks/entity-lists";
18
18
  export { useCommentSection, useCommentSectionData, useCreateComment, useFetchManyComments, useFetchComment, useFetchCommentByForeignId, useReplies, useUpdateComment, useCommentVotes, useDeleteComment, useEntityComments, useProfileComments, } from "./hooks/comments";
19
- export { useFetchUser, useFetchUserByForeignId, useFetchUserFollowersCount, useFetchUserFollowingCount, useCheckUsernameAvailability, useFetchUserSuggestions, useMentions, useUpdateUser, } from "./hooks/users";
20
- export { useFetchFollow, useFollowUser, useUnfollowUser, useFollowManager, } from "./hooks/relationships/follows";
19
+ export { useFetchUser, useFetchUserByForeignId, useCheckUsernameAvailability, useFetchUserSuggestions, useMentions, useUpdateUser, } from "./hooks/users";
20
+ export { useFetchFollowStatus, useFetchFollowers, useFetchFollowersByUserId, useFetchFollowersCount, useFetchFollowersCountByUserId, useFetchFollowing, useFetchFollowingByUserId, useFetchFollowingCount, useFetchFollowingCountByUserId, useFollowManager, useFollowUser, useUnfollowByFollowId, useUnfollowUserByUserId, } from "./hooks/relationships/follows";
21
+ export { useRequestConnection, useAcceptConnection, useDeclineConnection, useRemoveConnection, useFetchConnections, useFetchConnectionStatus, useRemoveConnectionByUserId, useFetchConnectionsCount, useFetchSentPendingConnections, useFetchReceivedPendingConnections, useFetchConnectionsByUserId, useFetchConnectionsCountByUserId, useConnectionManager, } from "./hooks/relationships/connections";
21
22
  export { useCreateReport } from "./hooks/reports";
22
23
  export { useGetMetadata } from "./hooks/utils";
23
24
  export { useUploadFile } from "./hooks/storage";
@@ -31,3 +32,4 @@ export type { Mention } from "./interfaces/models/Mention";
31
32
  export type { CommentsSortByOptions } from "./interfaces/CommentsSortByOptions";
32
33
  export type { EntityListSortByOptions } from "./interfaces/EntityListSortByOptions";
33
34
  export type { TimeFrame } from "./interfaces/TimeFrame";
35
+ export type { Connection, EstablishedConnection, PendingConnection, ConnectionsResponse, PendingConnectionsResponse, PendingConnectionListResponse, ConnectionRequestParams, ConnectionActionResponse, ConnectionWithdrawResponse, ConnectionCountResponse, RemoveConnectionByUserIdResponse, ConnectionStatusResponse, ConnectionStatus, } from "./interfaces/models/Connection";
package/dist/cjs/index.js CHANGED
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.useDeleteComment = exports.useCommentVotes = exports.useUpdateComment = exports.useReplies = exports.useFetchCommentByForeignId = exports.useFetchComment = exports.useFetchManyComments = exports.useCreateComment = exports.useCommentSectionData = exports.useCommentSection = exports.useEntityListActions = exports.useEntityList = exports.useUpvoteEntity = exports.useUpdateEntity = exports.useRemoveEntityUpvote = exports.useRemoveEntityDownvote = exports.useIncrementEntityViews = exports.useFetchEntityByShortId = exports.useFetchEntityByForeignId = exports.useFetchEntity = exports.useEntityVotes = exports.useDownvoteEntity = exports.useDeleteEntity = exports.useCreateEntity = exports.useEntityData = exports.useEntity = exports.useIsEntitySaved = exports.useListsActions = exports.useLists = exports.useAppNotificationsActions = exports.useAppNotifications = exports.useUserActions = exports.useUser = exports.useAuth = exports.useSignTestingJwt = exports.useProjectData = exports.useProject = exports.CommentSectionProvider = exports.EntityProvider = exports.ReplykeProvider = exports.reportReasons = exports.getEnvVar = exports.getApiBaseUrl = exports.isProduction = exports.isDevelopment = exports.getPublicFileUrl = exports.getUserName = exports.safeMergeStyleProps = exports.keywordHelpers = exports.handleError = void 0;
40
- exports.AppNotification = exports.useUploadFile = exports.useGetMetadata = exports.useCreateReport = exports.useFollowManager = exports.useUnfollowUser = exports.useFollowUser = exports.useFetchFollow = exports.useUpdateUser = exports.useMentions = exports.useFetchUserSuggestions = exports.useCheckUsernameAvailability = exports.useFetchUserFollowingCount = exports.useFetchUserFollowersCount = exports.useFetchUserByForeignId = exports.useFetchUser = exports.useProfileComments = exports.useEntityComments = void 0;
40
+ exports.AppNotification = exports.useUploadFile = exports.useGetMetadata = exports.useCreateReport = exports.useConnectionManager = exports.useFetchConnectionsCountByUserId = exports.useFetchConnectionsByUserId = exports.useFetchReceivedPendingConnections = exports.useFetchSentPendingConnections = exports.useFetchConnectionsCount = exports.useRemoveConnectionByUserId = exports.useFetchConnectionStatus = exports.useFetchConnections = exports.useRemoveConnection = exports.useDeclineConnection = exports.useAcceptConnection = exports.useRequestConnection = exports.useUnfollowUserByUserId = exports.useUnfollowByFollowId = exports.useFollowUser = exports.useFollowManager = exports.useFetchFollowingCountByUserId = exports.useFetchFollowingCount = exports.useFetchFollowingByUserId = exports.useFetchFollowing = exports.useFetchFollowersCountByUserId = exports.useFetchFollowersCount = exports.useFetchFollowersByUserId = exports.useFetchFollowers = exports.useFetchFollowStatus = exports.useUpdateUser = exports.useMentions = exports.useFetchUserSuggestions = exports.useCheckUsernameAvailability = exports.useFetchUserByForeignId = exports.useFetchUser = exports.useProfileComments = exports.useEntityComments = void 0;
41
41
  // Helpers & Utilities
42
42
  var handleError_1 = require("./utils/handleError");
43
43
  Object.defineProperty(exports, "handleError", { enumerable: true, get: function () { return handleError_1.handleError; } });
@@ -123,18 +123,40 @@ Object.defineProperty(exports, "useProfileComments", { enumerable: true, get: fu
123
123
  var users_1 = require("./hooks/users");
124
124
  Object.defineProperty(exports, "useFetchUser", { enumerable: true, get: function () { return users_1.useFetchUser; } });
125
125
  Object.defineProperty(exports, "useFetchUserByForeignId", { enumerable: true, get: function () { return users_1.useFetchUserByForeignId; } });
126
- Object.defineProperty(exports, "useFetchUserFollowersCount", { enumerable: true, get: function () { return users_1.useFetchUserFollowersCount; } });
127
- Object.defineProperty(exports, "useFetchUserFollowingCount", { enumerable: true, get: function () { return users_1.useFetchUserFollowingCount; } });
128
126
  Object.defineProperty(exports, "useCheckUsernameAvailability", { enumerable: true, get: function () { return users_1.useCheckUsernameAvailability; } });
129
127
  Object.defineProperty(exports, "useFetchUserSuggestions", { enumerable: true, get: function () { return users_1.useFetchUserSuggestions; } });
130
128
  Object.defineProperty(exports, "useMentions", { enumerable: true, get: function () { return users_1.useMentions; } });
131
129
  Object.defineProperty(exports, "useUpdateUser", { enumerable: true, get: function () { return users_1.useUpdateUser; } });
132
130
  // -- follows
133
131
  var follows_1 = require("./hooks/relationships/follows");
134
- Object.defineProperty(exports, "useFetchFollow", { enumerable: true, get: function () { return follows_1.useFetchFollow; } });
135
- Object.defineProperty(exports, "useFollowUser", { enumerable: true, get: function () { return follows_1.useFollowUser; } });
136
- Object.defineProperty(exports, "useUnfollowUser", { enumerable: true, get: function () { return follows_1.useUnfollowUser; } });
132
+ Object.defineProperty(exports, "useFetchFollowStatus", { enumerable: true, get: function () { return follows_1.useFetchFollowStatus; } });
133
+ Object.defineProperty(exports, "useFetchFollowers", { enumerable: true, get: function () { return follows_1.useFetchFollowers; } });
134
+ Object.defineProperty(exports, "useFetchFollowersByUserId", { enumerable: true, get: function () { return follows_1.useFetchFollowersByUserId; } });
135
+ Object.defineProperty(exports, "useFetchFollowersCount", { enumerable: true, get: function () { return follows_1.useFetchFollowersCount; } });
136
+ Object.defineProperty(exports, "useFetchFollowersCountByUserId", { enumerable: true, get: function () { return follows_1.useFetchFollowersCountByUserId; } });
137
+ Object.defineProperty(exports, "useFetchFollowing", { enumerable: true, get: function () { return follows_1.useFetchFollowing; } });
138
+ Object.defineProperty(exports, "useFetchFollowingByUserId", { enumerable: true, get: function () { return follows_1.useFetchFollowingByUserId; } });
139
+ Object.defineProperty(exports, "useFetchFollowingCount", { enumerable: true, get: function () { return follows_1.useFetchFollowingCount; } });
140
+ Object.defineProperty(exports, "useFetchFollowingCountByUserId", { enumerable: true, get: function () { return follows_1.useFetchFollowingCountByUserId; } });
137
141
  Object.defineProperty(exports, "useFollowManager", { enumerable: true, get: function () { return follows_1.useFollowManager; } });
142
+ Object.defineProperty(exports, "useFollowUser", { enumerable: true, get: function () { return follows_1.useFollowUser; } });
143
+ Object.defineProperty(exports, "useUnfollowByFollowId", { enumerable: true, get: function () { return follows_1.useUnfollowByFollowId; } });
144
+ Object.defineProperty(exports, "useUnfollowUserByUserId", { enumerable: true, get: function () { return follows_1.useUnfollowUserByUserId; } });
145
+ // -- connections
146
+ var connections_1 = require("./hooks/relationships/connections");
147
+ Object.defineProperty(exports, "useRequestConnection", { enumerable: true, get: function () { return connections_1.useRequestConnection; } });
148
+ Object.defineProperty(exports, "useAcceptConnection", { enumerable: true, get: function () { return connections_1.useAcceptConnection; } });
149
+ Object.defineProperty(exports, "useDeclineConnection", { enumerable: true, get: function () { return connections_1.useDeclineConnection; } });
150
+ Object.defineProperty(exports, "useRemoveConnection", { enumerable: true, get: function () { return connections_1.useRemoveConnection; } });
151
+ Object.defineProperty(exports, "useFetchConnections", { enumerable: true, get: function () { return connections_1.useFetchConnections; } });
152
+ Object.defineProperty(exports, "useFetchConnectionStatus", { enumerable: true, get: function () { return connections_1.useFetchConnectionStatus; } });
153
+ Object.defineProperty(exports, "useRemoveConnectionByUserId", { enumerable: true, get: function () { return connections_1.useRemoveConnectionByUserId; } });
154
+ Object.defineProperty(exports, "useFetchConnectionsCount", { enumerable: true, get: function () { return connections_1.useFetchConnectionsCount; } });
155
+ Object.defineProperty(exports, "useFetchSentPendingConnections", { enumerable: true, get: function () { return connections_1.useFetchSentPendingConnections; } });
156
+ Object.defineProperty(exports, "useFetchReceivedPendingConnections", { enumerable: true, get: function () { return connections_1.useFetchReceivedPendingConnections; } });
157
+ Object.defineProperty(exports, "useFetchConnectionsByUserId", { enumerable: true, get: function () { return connections_1.useFetchConnectionsByUserId; } });
158
+ Object.defineProperty(exports, "useFetchConnectionsCountByUserId", { enumerable: true, get: function () { return connections_1.useFetchConnectionsCountByUserId; } });
159
+ Object.defineProperty(exports, "useConnectionManager", { enumerable: true, get: function () { return connections_1.useConnectionManager; } });
138
160
  // -- reports
139
161
  var reports_1 = require("./hooks/reports");
140
162
  Object.defineProperty(exports, "useCreateReport", { enumerable: true, get: function () { return reports_1.useCreateReport; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAAsB;AACtB,mDAAkD;AAAzC,0GAAA,WAAW,OAAA;AACpB,yDAAwD;AAA/C,gHAAA,cAAc,OAAA;AACvB,qEAAoE;AAA3D,0HAAA,mBAAmB,OAAA;AAC5B,qDAAoD;AAA3C,0GAAA,WAAW,OAAA;AACpB,+DAAyE;AAAhE,qIAAA,OAAO,OAAoB;AACpC,mCAKqB;AAJnB,oGAAA,aAAa,OAAA;AACb,mGAAA,YAAY,OAAA;AACZ,oGAAA,aAAa,OAAA;AACb,gGAAA,SAAS,OAAA;AAGX,YAAY;AACZ,2DAA0D;AAAjD,8GAAA,aAAa,OAAA;AAGtB,+CAA+C;AAC/C,qCAImB;AAHjB,0GAAA,eAAe,OAAA;AACf,yGAAA,cAAc,OAAA;AACd,iHAAA,sBAAsB,OAAA;AAGxB,cAAc;AACd,6CAA8D;AAArD,sGAAA,UAAU,OAAA;AAAE,0GAAA,cAAc,OAAA;AAEnC,YAAY;AACZ,yCAAmD;AAA1C,2GAAA,iBAAiB,OAAA;AAE1B,oBAAoB;AACpB,qCAA2D;AAAlD,+FAAA,OAAO,OAAA;AAEhB,oBAAoB;AACpB,qCAKsB;AAJpB,+FAAA,OAAO,OAAA;AACP,sGAAA,cAAc,OAAA;AAKhB,uBAAuB;AACvB,+DAKmC;AAJjC,wHAAA,mBAAmB,OAAA;AACnB,+HAAA,0BAA0B,OAAA;AAK5B,WAAW;AACX,uCAMuB;AALrB,iGAAA,QAAQ,OAAA;AACR,wGAAA,eAAe,OAAA;AACf,yGAAA,gBAAgB,OAAA;AAKlB,cA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8B,OAAA;AAC9B,2GAAA,gBAAgB,OAAA;AAChB,wGAAA,aAAa,OAAA;AACb,gHAAA,qBAAqB,OAAA;AACrB,kHAAA,uBAAuB,OAAA;AAGzB,iBAAiB;AACjB,iEAc2C;AAbzC,mHAAA,oBAAoB,OAAA;AACpB,kHAAA,mBAAmB,OAAA;AACnB,mHAAA,oBAAoB,OAAA;AACpB,kHAAA,mBAAmB,OAAA;AACnB,kHAAA,mBAAmB,OAAA;AACnB,uHAAA,wBAAwB,OAAA;AACxB,0HAAA,2BAA2B,OAAA;AAC3B,uHAAA,wBAAwB,OAAA;AACxB,6HAAA,8BAA8B,OAAA;AAC9B,iIAAA,kCAAkC,OAAA;AAClC,0HAAA,2BAA2B,OAAA;AAC3B,+HAAA,gCAAgC,OAAA;AAChC,mHAAA,oBAAoB,OAAA;AAGtB,aAAa;AACb,2CAAkD;AAAzC,0GAAA,eAAe,OAAA;AAExB,aAAa;AACb,uCAA+C;AAAtC,uGAAA,cAAc,OAAA;AAEvB,aAAa;AACb,2CAAgD;AAAvC,wGAAA,aAAa,OAAA;AAKtB,uFAAuE"}
@@ -1,4 +1,4 @@
1
- type AppNotificationType = "system" | "entity-comment" | "comment-reply" | "entity-mention" | "comment-mention" | "entity-upvote" | "comment-upvote" | "new-follow";
1
+ type AppNotificationType = "system" | "entity-comment" | "comment-reply" | "entity-mention" | "comment-mention" | "entity-upvote" | "comment-upvote" | "new-follow" | "connection-request" | "connection-accepted";
2
2
  interface BaseAppNotification {
3
3
  id: string;
4
4
  userId: string;
@@ -123,7 +123,29 @@ export interface NewFollowNotification extends BaseAppNotification {
123
123
  initiatorAvatar: string | null | undefined;
124
124
  };
125
125
  }
126
- export type UnifiedAppNotification = SystemNotification | EntityCommentNotification | CommentReplyNotification | EntityMentionNotification | CommentMentionNotification | EntityUpvoteNotification | CommentUpvoteNotification | NewFollowNotification;
126
+ export interface ConnectionRequestNotification extends BaseAppNotification {
127
+ type: "connection-request";
128
+ action: "open-profile";
129
+ metadata: {
130
+ connectionId: string;
131
+ initiatorId: string;
132
+ initiatorName: string | null | undefined;
133
+ initiatorUsername: string | null | undefined;
134
+ initiatorAvatar: string | null | undefined;
135
+ };
136
+ }
137
+ export interface ConnectionAcceptedNotification extends BaseAppNotification {
138
+ type: "connection-accepted";
139
+ action: "open-profile";
140
+ metadata: {
141
+ connectionId: string;
142
+ initiatorId: string;
143
+ initiatorName: string | null | undefined;
144
+ initiatorUsername: string | null | undefined;
145
+ initiatorAvatar: string | null | undefined;
146
+ };
147
+ }
148
+ export type UnifiedAppNotification = SystemNotification | EntityCommentNotification | CommentReplyNotification | EntityMentionNotification | CommentMentionNotification | EntityUpvoteNotification | CommentUpvoteNotification | NewFollowNotification | ConnectionRequestNotification | ConnectionAcceptedNotification;
127
149
  export type NotificationTemplate = {
128
150
  title?: string;
129
151
  content?: string;
@@ -136,6 +158,8 @@ export type NotificationTemplates = {
136
158
  entityUpvote: NotificationTemplate;
137
159
  commentUpvote: NotificationTemplate;
138
160
  newFollow: NotificationTemplate;
161
+ connectionRequest: NotificationTemplate;
162
+ connectionAccepted: NotificationTemplate;
139
163
  };
140
164
  export type PotentiallyPopulatedUnifiedAppNotification = UnifiedAppNotification & {
141
165
  title?: string;
@@ -0,0 +1,88 @@
1
+ import { User } from "./User";
2
+ export interface Connection {
3
+ id: string;
4
+ message?: string;
5
+ createdAt: string;
6
+ }
7
+ export interface EstablishedConnection {
8
+ id: string;
9
+ connectedUser: User;
10
+ connectedAt: string;
11
+ requestedAt: string;
12
+ }
13
+ export interface PendingConnection extends Connection {
14
+ user: User;
15
+ type: "received" | "sent";
16
+ }
17
+ export interface PaginationInfo {
18
+ currentPage: number;
19
+ totalPages: number;
20
+ totalCount: number;
21
+ hasNextPage: boolean;
22
+ hasPreviousPage: boolean;
23
+ limit: number;
24
+ }
25
+ export interface ConnectionsResponse {
26
+ connections: EstablishedConnection[];
27
+ pagination: PaginationInfo;
28
+ }
29
+ export interface PendingConnectionsResponse {
30
+ received: {
31
+ requests: PendingConnection[];
32
+ pagination: PaginationInfo;
33
+ };
34
+ sent: {
35
+ requests: PendingConnection[];
36
+ pagination: PaginationInfo;
37
+ };
38
+ }
39
+ export interface PendingConnectionListResponse {
40
+ requests: PendingConnection[];
41
+ pagination: PaginationInfo;
42
+ }
43
+ export interface ConnectionRequestParams {
44
+ userId: string;
45
+ message?: string;
46
+ }
47
+ export interface ConnectionActionResponse {
48
+ id: string;
49
+ status: string;
50
+ createdAt?: string;
51
+ respondedAt?: string;
52
+ }
53
+ export interface ConnectionWithdrawResponse {
54
+ message: string;
55
+ }
56
+ export interface ConnectionCountResponse {
57
+ count: number;
58
+ }
59
+ export interface RemoveConnectionByUserIdResponse {
60
+ id?: string;
61
+ status?: string;
62
+ respondedAt?: string;
63
+ message?: string;
64
+ action?: "withdraw" | "disconnect" | "decline";
65
+ }
66
+ export interface ConnectionStatusNone {
67
+ status: "none";
68
+ }
69
+ export interface ConnectionStatusPending {
70
+ status: "pending";
71
+ type: "sent" | "received";
72
+ connectionId: string;
73
+ createdAt: string;
74
+ }
75
+ export interface ConnectionStatusConnected {
76
+ status: "connected";
77
+ connectionId: string;
78
+ connectedAt: string;
79
+ requestedAt: string;
80
+ }
81
+ export interface ConnectionStatusDeclined {
82
+ status: "declined";
83
+ type: "sent" | "received";
84
+ connectionId: string;
85
+ respondedAt: string;
86
+ }
87
+ export type ConnectionStatusResponse = ConnectionStatusNone | ConnectionStatusPending | ConnectionStatusConnected | ConnectionStatusDeclined;
88
+ export type ConnectionStatus = "none" | "pending-sent" | "pending-received" | "connected" | "declined-sent" | "declined-received";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Connection.js.map