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

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 (205) hide show
  1. package/dist/cjs/hooks/relationships/connections/index.d.ts +13 -0
  2. package/dist/cjs/hooks/relationships/connections/index.js +33 -0
  3. package/dist/cjs/hooks/relationships/connections/index.js.map +1 -0
  4. package/dist/cjs/hooks/relationships/connections/useAcceptConnection.d.ts +5 -0
  5. package/dist/cjs/hooks/relationships/connections/useAcceptConnection.js +76 -0
  6. package/dist/cjs/hooks/relationships/connections/useAcceptConnection.js.map +1 -0
  7. package/dist/cjs/hooks/relationships/connections/useConnectionManager.d.ts +26 -0
  8. package/dist/cjs/hooks/relationships/connections/useConnectionManager.js +342 -0
  9. package/dist/cjs/hooks/relationships/connections/useConnectionManager.js.map +1 -0
  10. package/dist/cjs/hooks/relationships/connections/useDeclineConnection.d.ts +5 -0
  11. package/dist/cjs/hooks/relationships/connections/useDeclineConnection.js +76 -0
  12. package/dist/cjs/hooks/relationships/connections/useDeclineConnection.js.map +1 -0
  13. package/dist/cjs/hooks/relationships/connections/useFetchConnectionStatus.d.ts +5 -0
  14. package/dist/cjs/hooks/relationships/connections/useFetchConnectionStatus.js +79 -0
  15. package/dist/cjs/hooks/relationships/connections/useFetchConnectionStatus.js.map +1 -0
  16. package/dist/cjs/hooks/relationships/connections/useFetchConnections.d.ts +7 -0
  17. package/dist/cjs/hooks/relationships/connections/useFetchConnections.js +95 -0
  18. package/dist/cjs/hooks/relationships/connections/useFetchConnections.js.map +1 -0
  19. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsByUserId.d.ts +8 -0
  20. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsByUserId.js +75 -0
  21. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsByUserId.js.map +1 -0
  22. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCount.d.ts +3 -0
  23. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCount.js +72 -0
  24. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCount.js.map +1 -0
  25. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCountByUserId.d.ts +6 -0
  26. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCountByUserId.js +70 -0
  27. package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCountByUserId.js.map +1 -0
  28. package/dist/cjs/hooks/relationships/connections/useFetchReceivedPendingConnections.d.ts +7 -0
  29. package/dist/cjs/hooks/relationships/connections/useFetchReceivedPendingConnections.js +95 -0
  30. package/dist/cjs/hooks/relationships/connections/useFetchReceivedPendingConnections.js.map +1 -0
  31. package/dist/cjs/hooks/relationships/connections/useFetchSentPendingConnections.d.ts +7 -0
  32. package/dist/cjs/hooks/relationships/connections/useFetchSentPendingConnections.js +95 -0
  33. package/dist/cjs/hooks/relationships/connections/useFetchSentPendingConnections.js.map +1 -0
  34. package/dist/cjs/hooks/relationships/connections/useRemoveConnection.d.ts +5 -0
  35. package/dist/cjs/hooks/relationships/connections/useRemoveConnection.js +76 -0
  36. package/dist/cjs/hooks/relationships/connections/useRemoveConnection.js.map +1 -0
  37. package/dist/cjs/hooks/relationships/connections/useRemoveConnectionByUserId.d.ts +5 -0
  38. package/dist/cjs/hooks/relationships/connections/useRemoveConnectionByUserId.js +79 -0
  39. package/dist/cjs/hooks/relationships/connections/useRemoveConnectionByUserId.js.map +1 -0
  40. package/dist/cjs/hooks/relationships/connections/useRequestConnection.d.ts +3 -0
  41. package/dist/cjs/hooks/relationships/connections/useRequestConnection.js +71 -0
  42. package/dist/cjs/hooks/relationships/connections/useRequestConnection.js.map +1 -0
  43. package/dist/cjs/hooks/relationships/follows/index.d.ts +12 -3
  44. package/dist/cjs/hooks/relationships/follows/index.js +25 -7
  45. package/dist/cjs/hooks/relationships/follows/index.js.map +1 -1
  46. package/dist/cjs/hooks/relationships/follows/useFetchFollowStatus.d.ts +8 -0
  47. package/dist/cjs/hooks/relationships/follows/{useFetchFollow.js → useFetchFollowStatus.js} +5 -5
  48. package/dist/cjs/hooks/relationships/follows/useFetchFollowStatus.js.map +1 -0
  49. package/dist/cjs/hooks/relationships/follows/useFetchFollowers.d.ts +23 -0
  50. package/dist/cjs/hooks/relationships/follows/useFetchFollowers.js +91 -0
  51. package/dist/cjs/hooks/relationships/follows/useFetchFollowers.js.map +1 -0
  52. package/dist/cjs/hooks/relationships/follows/useFetchFollowersByUserId.d.ts +24 -0
  53. package/dist/cjs/hooks/relationships/follows/useFetchFollowersByUserId.js +70 -0
  54. package/dist/cjs/hooks/relationships/follows/useFetchFollowersByUserId.js.map +1 -0
  55. package/dist/cjs/hooks/relationships/follows/useFetchFollowersCount.d.ts +4 -0
  56. package/dist/cjs/hooks/relationships/follows/useFetchFollowersCount.js +72 -0
  57. package/dist/cjs/hooks/relationships/follows/useFetchFollowersCount.js.map +1 -0
  58. package/dist/cjs/hooks/relationships/follows/useFetchFollowersCountByUserId.d.ts +6 -0
  59. package/dist/cjs/hooks/{users/useFetchUserFollowersCount.js → relationships/follows/useFetchFollowersCountByUserId.js} +9 -10
  60. package/dist/cjs/hooks/relationships/follows/useFetchFollowersCountByUserId.js.map +1 -0
  61. package/dist/cjs/hooks/relationships/follows/useFetchFollowing.d.ts +23 -0
  62. package/dist/cjs/hooks/relationships/follows/useFetchFollowing.js +94 -0
  63. package/dist/cjs/hooks/relationships/follows/useFetchFollowing.js.map +1 -0
  64. package/dist/cjs/hooks/relationships/follows/useFetchFollowingByUserId.d.ts +24 -0
  65. package/dist/cjs/hooks/relationships/follows/useFetchFollowingByUserId.js +75 -0
  66. package/dist/cjs/hooks/relationships/follows/useFetchFollowingByUserId.js.map +1 -0
  67. package/dist/cjs/hooks/relationships/follows/useFetchFollowingCount.d.ts +4 -0
  68. package/dist/cjs/hooks/relationships/follows/useFetchFollowingCount.js +72 -0
  69. package/dist/cjs/hooks/relationships/follows/useFetchFollowingCount.js.map +1 -0
  70. package/dist/cjs/hooks/relationships/follows/useFetchFollowingCountByUserId.d.ts +6 -0
  71. package/dist/cjs/hooks/{users/useFetchUserFollowingCount.js → relationships/follows/useFetchFollowingCountByUserId.js} +9 -10
  72. package/dist/cjs/hooks/relationships/follows/useFetchFollowingCountByUserId.js.map +1 -0
  73. package/dist/cjs/hooks/relationships/follows/useFollowManager.js +8 -8
  74. package/dist/cjs/hooks/relationships/follows/useFollowManager.js.map +1 -1
  75. package/dist/cjs/hooks/relationships/follows/useUnfollowByFollowId.d.ts +4 -0
  76. package/dist/cjs/hooks/relationships/follows/useUnfollowByFollowId.js +78 -0
  77. package/dist/cjs/hooks/relationships/follows/useUnfollowByFollowId.js.map +1 -0
  78. package/dist/cjs/hooks/relationships/follows/useUnfollowUserByUserId.d.ts +4 -0
  79. package/dist/cjs/hooks/relationships/follows/{useUnfollowUser.js → useUnfollowUserByUserId.js} +5 -5
  80. package/dist/cjs/hooks/relationships/follows/useUnfollowUserByUserId.js.map +1 -0
  81. package/dist/cjs/hooks/users/index.d.ts +0 -2
  82. package/dist/cjs/hooks/users/index.js +1 -5
  83. package/dist/cjs/hooks/users/index.js.map +1 -1
  84. package/dist/cjs/hooks/users/useUpdateUser.d.ts +1 -2
  85. package/dist/cjs/hooks/users/useUpdateUser.js +7 -2
  86. package/dist/cjs/hooks/users/useUpdateUser.js.map +1 -1
  87. package/dist/cjs/index.d.ts +4 -2
  88. package/dist/cjs/index.js +28 -6
  89. package/dist/cjs/index.js.map +1 -1
  90. package/dist/cjs/interfaces/models/AppNotification.d.ts +26 -2
  91. package/dist/cjs/interfaces/models/Connection.d.ts +87 -0
  92. package/dist/cjs/interfaces/models/Connection.js +3 -0
  93. package/dist/cjs/interfaces/models/Connection.js.map +1 -0
  94. package/dist/cjs/interfaces/models/Follow.d.ts +2 -0
  95. package/dist/esm/hooks/relationships/connections/index.d.ts +13 -0
  96. package/dist/esm/hooks/relationships/connections/index.js +14 -0
  97. package/dist/esm/hooks/relationships/connections/index.js.map +1 -0
  98. package/dist/esm/hooks/relationships/connections/useAcceptConnection.d.ts +5 -0
  99. package/dist/esm/hooks/relationships/connections/useAcceptConnection.js +71 -0
  100. package/dist/esm/hooks/relationships/connections/useAcceptConnection.js.map +1 -0
  101. package/dist/esm/hooks/relationships/connections/useConnectionManager.d.ts +26 -0
  102. package/dist/esm/hooks/relationships/connections/useConnectionManager.js +337 -0
  103. package/dist/esm/hooks/relationships/connections/useConnectionManager.js.map +1 -0
  104. package/dist/esm/hooks/relationships/connections/useDeclineConnection.d.ts +5 -0
  105. package/dist/esm/hooks/relationships/connections/useDeclineConnection.js +71 -0
  106. package/dist/esm/hooks/relationships/connections/useDeclineConnection.js.map +1 -0
  107. package/dist/esm/hooks/relationships/connections/useFetchConnectionStatus.d.ts +5 -0
  108. package/dist/esm/hooks/relationships/connections/useFetchConnectionStatus.js +74 -0
  109. package/dist/esm/hooks/relationships/connections/useFetchConnectionStatus.js.map +1 -0
  110. package/dist/esm/hooks/relationships/connections/useFetchConnections.d.ts +7 -0
  111. package/dist/esm/hooks/relationships/connections/useFetchConnections.js +90 -0
  112. package/dist/esm/hooks/relationships/connections/useFetchConnections.js.map +1 -0
  113. package/dist/esm/hooks/relationships/connections/useFetchConnectionsByUserId.d.ts +8 -0
  114. package/dist/esm/hooks/relationships/connections/useFetchConnectionsByUserId.js +70 -0
  115. package/dist/esm/hooks/relationships/connections/useFetchConnectionsByUserId.js.map +1 -0
  116. package/dist/esm/hooks/relationships/connections/useFetchConnectionsCount.d.ts +3 -0
  117. package/dist/esm/hooks/relationships/connections/useFetchConnectionsCount.js +67 -0
  118. package/dist/esm/hooks/relationships/connections/useFetchConnectionsCount.js.map +1 -0
  119. package/dist/esm/hooks/relationships/connections/useFetchConnectionsCountByUserId.d.ts +6 -0
  120. package/dist/esm/hooks/relationships/connections/useFetchConnectionsCountByUserId.js +65 -0
  121. package/dist/esm/hooks/relationships/connections/useFetchConnectionsCountByUserId.js.map +1 -0
  122. package/dist/esm/hooks/relationships/connections/useFetchReceivedPendingConnections.d.ts +7 -0
  123. package/dist/esm/hooks/relationships/connections/useFetchReceivedPendingConnections.js +90 -0
  124. package/dist/esm/hooks/relationships/connections/useFetchReceivedPendingConnections.js.map +1 -0
  125. package/dist/esm/hooks/relationships/connections/useFetchSentPendingConnections.d.ts +7 -0
  126. package/dist/esm/hooks/relationships/connections/useFetchSentPendingConnections.js +90 -0
  127. package/dist/esm/hooks/relationships/connections/useFetchSentPendingConnections.js.map +1 -0
  128. package/dist/esm/hooks/relationships/connections/useRemoveConnection.d.ts +5 -0
  129. package/dist/esm/hooks/relationships/connections/useRemoveConnection.js +71 -0
  130. package/dist/esm/hooks/relationships/connections/useRemoveConnection.js.map +1 -0
  131. package/dist/esm/hooks/relationships/connections/useRemoveConnectionByUserId.d.ts +5 -0
  132. package/dist/esm/hooks/relationships/connections/useRemoveConnectionByUserId.js +74 -0
  133. package/dist/esm/hooks/relationships/connections/useRemoveConnectionByUserId.js.map +1 -0
  134. package/dist/esm/hooks/relationships/connections/useRequestConnection.d.ts +3 -0
  135. package/dist/esm/hooks/relationships/connections/useRequestConnection.js +66 -0
  136. package/dist/esm/hooks/relationships/connections/useRequestConnection.js.map +1 -0
  137. package/dist/esm/hooks/relationships/follows/index.d.ts +12 -3
  138. package/dist/esm/hooks/relationships/follows/index.js +12 -3
  139. package/dist/esm/hooks/relationships/follows/index.js.map +1 -1
  140. package/dist/esm/hooks/relationships/follows/useFetchFollowStatus.d.ts +8 -0
  141. package/dist/esm/hooks/relationships/follows/{useFetchFollow.js → useFetchFollowStatus.js} +5 -5
  142. package/dist/esm/hooks/relationships/follows/useFetchFollowStatus.js.map +1 -0
  143. package/dist/esm/hooks/relationships/follows/useFetchFollowers.d.ts +23 -0
  144. package/dist/esm/hooks/relationships/follows/useFetchFollowers.js +86 -0
  145. package/dist/esm/hooks/relationships/follows/useFetchFollowers.js.map +1 -0
  146. package/dist/esm/hooks/relationships/follows/useFetchFollowersByUserId.d.ts +24 -0
  147. package/dist/esm/hooks/relationships/follows/useFetchFollowersByUserId.js +65 -0
  148. package/dist/esm/hooks/relationships/follows/useFetchFollowersByUserId.js.map +1 -0
  149. package/dist/esm/hooks/relationships/follows/useFetchFollowersCount.d.ts +4 -0
  150. package/dist/esm/hooks/relationships/follows/useFetchFollowersCount.js +67 -0
  151. package/dist/esm/hooks/relationships/follows/useFetchFollowersCount.js.map +1 -0
  152. package/dist/esm/hooks/relationships/follows/useFetchFollowersCountByUserId.d.ts +6 -0
  153. package/dist/esm/hooks/{users/useFetchUserFollowersCount.js → relationships/follows/useFetchFollowersCountByUserId.js} +8 -9
  154. package/dist/esm/hooks/relationships/follows/useFetchFollowersCountByUserId.js.map +1 -0
  155. package/dist/esm/hooks/relationships/follows/useFetchFollowing.d.ts +23 -0
  156. package/dist/esm/hooks/relationships/follows/useFetchFollowing.js +89 -0
  157. package/dist/esm/hooks/relationships/follows/useFetchFollowing.js.map +1 -0
  158. package/dist/esm/hooks/relationships/follows/useFetchFollowingByUserId.d.ts +24 -0
  159. package/dist/esm/hooks/relationships/follows/useFetchFollowingByUserId.js +70 -0
  160. package/dist/esm/hooks/relationships/follows/useFetchFollowingByUserId.js.map +1 -0
  161. package/dist/esm/hooks/relationships/follows/useFetchFollowingCount.d.ts +4 -0
  162. package/dist/esm/hooks/relationships/follows/useFetchFollowingCount.js +67 -0
  163. package/dist/esm/hooks/relationships/follows/useFetchFollowingCount.js.map +1 -0
  164. package/dist/esm/hooks/relationships/follows/useFetchFollowingCountByUserId.d.ts +6 -0
  165. package/dist/esm/hooks/{users/useFetchUserFollowingCount.js → relationships/follows/useFetchFollowingCountByUserId.js} +8 -9
  166. package/dist/esm/hooks/relationships/follows/useFetchFollowingCountByUserId.js.map +1 -0
  167. package/dist/esm/hooks/relationships/follows/useFollowManager.js +8 -8
  168. package/dist/esm/hooks/relationships/follows/useFollowManager.js.map +1 -1
  169. package/dist/esm/hooks/relationships/follows/useUnfollowByFollowId.d.ts +4 -0
  170. package/dist/esm/hooks/relationships/follows/useUnfollowByFollowId.js +73 -0
  171. package/dist/esm/hooks/relationships/follows/useUnfollowByFollowId.js.map +1 -0
  172. package/dist/esm/hooks/relationships/follows/useUnfollowUserByUserId.d.ts +4 -0
  173. package/dist/esm/hooks/relationships/follows/{useUnfollowUser.js → useUnfollowUserByUserId.js} +5 -5
  174. package/dist/esm/hooks/relationships/follows/useUnfollowUserByUserId.js.map +1 -0
  175. package/dist/esm/hooks/users/index.d.ts +0 -2
  176. package/dist/esm/hooks/users/index.js +0 -2
  177. package/dist/esm/hooks/users/index.js.map +1 -1
  178. package/dist/esm/hooks/users/useUpdateUser.d.ts +1 -2
  179. package/dist/esm/hooks/users/useUpdateUser.js +7 -2
  180. package/dist/esm/hooks/users/useUpdateUser.js.map +1 -1
  181. package/dist/esm/index.d.ts +4 -2
  182. package/dist/esm/index.js +4 -2
  183. package/dist/esm/index.js.map +1 -1
  184. package/dist/esm/interfaces/models/AppNotification.d.ts +26 -2
  185. package/dist/esm/interfaces/models/Connection.d.ts +87 -0
  186. package/dist/esm/interfaces/models/Connection.js +2 -0
  187. package/dist/esm/interfaces/models/Connection.js.map +1 -0
  188. package/dist/esm/interfaces/models/Follow.d.ts +2 -0
  189. package/package.json +1 -1
  190. package/dist/cjs/hooks/relationships/follows/useFetchFollow.d.ts +0 -6
  191. package/dist/cjs/hooks/relationships/follows/useFetchFollow.js.map +0 -1
  192. package/dist/cjs/hooks/relationships/follows/useUnfollowUser.d.ts +0 -4
  193. package/dist/cjs/hooks/relationships/follows/useUnfollowUser.js.map +0 -1
  194. package/dist/cjs/hooks/users/useFetchUserFollowersCount.d.ts +0 -6
  195. package/dist/cjs/hooks/users/useFetchUserFollowersCount.js.map +0 -1
  196. package/dist/cjs/hooks/users/useFetchUserFollowingCount.d.ts +0 -6
  197. package/dist/cjs/hooks/users/useFetchUserFollowingCount.js.map +0 -1
  198. package/dist/esm/hooks/relationships/follows/useFetchFollow.d.ts +0 -6
  199. package/dist/esm/hooks/relationships/follows/useFetchFollow.js.map +0 -1
  200. package/dist/esm/hooks/relationships/follows/useUnfollowUser.d.ts +0 -4
  201. package/dist/esm/hooks/relationships/follows/useUnfollowUser.js.map +0 -1
  202. package/dist/esm/hooks/users/useFetchUserFollowersCount.d.ts +0 -6
  203. package/dist/esm/hooks/users/useFetchUserFollowersCount.js.map +0 -1
  204. package/dist/esm/hooks/users/useFetchUserFollowingCount.d.ts +0 -6
  205. package/dist/esm/hooks/users/useFetchUserFollowingCount.js.map +0 -1
@@ -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,CAAC,EAA7D,WAAW,QAAA,EAAE,cAAc,QAAkC,CAAC;IAC/D,IAAA,KAA4B,IAAA,gBAAQ,EAAC,IAAI,CAAC,EAAzC,SAAS,QAAA,EAAE,YAAY,QAAkB,CAAC;IAEjD,IAAM,UAAU,GAAG,IAAA,uBAAa,GAAE,CAAC;IACnC,IAAM,YAAY,GAAG,IAAA,yBAAe,GAAE,CAAC;IACvC,IAAM,WAAW,GAAG,IAAA,wBAAc,GAAE,CAAC;IAErC,IAAA,iBAAS,EAAC;QACR,IAAM,gBAAgB,GAAG;;;;;;wBAErB,YAAY,CAAC,IAAI,CAAC,CAAC;wBACJ,qBAAM,WAAW,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC,EAAA;;wBAAtC,MAAM,GAAG,SAA6B;wBAC5C,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;;;;wBA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K,IAAI,IAAI,SAAS,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,MAAK,MAAM;wBAAE,sBAAO;;;;yBAG/D,WAAW,EAAX,wBAAW;oBACb,qBAAM,oBAAoB,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC,EAAA;;oBAAtC,SAAsC,CAAC;oBACvC,cAAc,CAAC,KAAK,CAAC,CAAC;;wBAEtB,qBAAM,UAAU,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC,EAAA;;oBAA5B,SAA4B,CAAC;oBAC7B,cAAc,CAAC,IAAI,CAAC,CAAC;;;;;oBAGvB,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,OAAK,CAAC,CAAC;;;;;SAE3D,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAEvE,OAAO;QACL,WAAW,aAAA;QACX,SAAS,WAAA;QACT,YAAY,cAAA;KACb,CAAC;AACJ,CAAC;AAED,kBAAe,gBAAgB,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare function 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"}
@@ -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;;;;oBA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M,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,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C,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,87 @@
1
+ import { User } from "./User";
2
+ export interface Connection {
3
+ id: string;
4
+ message?: string;
5
+ createdAt: string;
6
+ }
7
+ export interface EstablishedConnection extends Connection {
8
+ connectedUser: User;
9
+ connectedAt: string;
10
+ requestedAt: string;
11
+ }
12
+ export interface PendingConnection extends Connection {
13
+ user: User;
14
+ type: "received" | "sent";
15
+ }
16
+ export interface PaginationInfo {
17
+ currentPage: number;
18
+ totalPages: number;
19
+ totalCount: number;
20
+ hasNextPage: boolean;
21
+ hasPreviousPage: boolean;
22
+ limit: number;
23
+ }
24
+ export interface ConnectionsResponse {
25
+ connections: EstablishedConnection[];
26
+ pagination: PaginationInfo;
27
+ }
28
+ export interface PendingConnectionsResponse {
29
+ received: {
30
+ requests: PendingConnection[];
31
+ pagination: PaginationInfo;
32
+ };
33
+ sent: {
34
+ requests: PendingConnection[];
35
+ pagination: PaginationInfo;
36
+ };
37
+ }
38
+ export interface PendingConnectionListResponse {
39
+ requests: PendingConnection[];
40
+ pagination: PaginationInfo;
41
+ }
42
+ export interface ConnectionRequestParams {
43
+ userId: string;
44
+ message?: string;
45
+ }
46
+ export interface ConnectionActionResponse {
47
+ id: string;
48
+ status: string;
49
+ createdAt?: string;
50
+ respondedAt?: string;
51
+ }
52
+ export interface ConnectionWithdrawResponse {
53
+ message: string;
54
+ }
55
+ export interface ConnectionCountResponse {
56
+ count: number;
57
+ }
58
+ export interface RemoveConnectionByUserIdResponse {
59
+ id?: string;
60
+ status?: string;
61
+ respondedAt?: string;
62
+ message?: string;
63
+ action?: "withdraw" | "disconnect" | "decline";
64
+ }
65
+ export interface ConnectionStatusNone {
66
+ status: "none";
67
+ }
68
+ export interface ConnectionStatusPending {
69
+ status: "pending";
70
+ type: "sent" | "received";
71
+ connectionId: string;
72
+ createdAt: string;
73
+ }
74
+ export interface ConnectionStatusConnected {
75
+ status: "connected";
76
+ connectionId: string;
77
+ connectedAt: string;
78
+ requestedAt: string;
79
+ }
80
+ export interface ConnectionStatusDeclined {
81
+ status: "declined";
82
+ type: "sent" | "received";
83
+ connectionId: string;
84
+ respondedAt: string;
85
+ }
86
+ export type ConnectionStatusResponse = ConnectionStatusNone | ConnectionStatusPending | ConnectionStatusConnected | ConnectionStatusDeclined;
87
+ 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Connection.js","sourceRoot":"","sources":["../../../../src/interfaces/models/Connection.ts"],"names":[],"mappings":""}
@@ -1,4 +1,6 @@
1
1
  export interface Follow {
2
+ id: string;
3
+ projectId: string;
2
4
  followerId: string;
3
5
  followedId: string;
4
6
  createdAt: Date;
@@ -0,0 +1,13 @@
1
+ export { default as useRequestConnection } from "./useRequestConnection";
2
+ export { default as useAcceptConnection } from "./useAcceptConnection";
3
+ export { default as useDeclineConnection } from "./useDeclineConnection";
4
+ export { default as useRemoveConnection } from "./useRemoveConnection";
5
+ export { default as useFetchConnections } from "./useFetchConnections";
6
+ export { default as useFetchConnectionStatus } from "./useFetchConnectionStatus";
7
+ export { default as useRemoveConnectionByUserId } from "./useRemoveConnectionByUserId";
8
+ export { default as useFetchConnectionsCount } from "./useFetchConnectionsCount";
9
+ export { default as useFetchSentPendingConnections } from "./useFetchSentPendingConnections";
10
+ export { default as useFetchReceivedPendingConnections } from "./useFetchReceivedPendingConnections";
11
+ export { default as useFetchConnectionsByUserId } from "./useFetchConnectionsByUserId";
12
+ export { default as useFetchConnectionsCountByUserId } from "./useFetchConnectionsCountByUserId";
13
+ export { default as useConnectionManager } from "./useConnectionManager";
@@ -0,0 +1,14 @@
1
+ export { default as useRequestConnection } from "./useRequestConnection";
2
+ export { default as useAcceptConnection } from "./useAcceptConnection";
3
+ export { default as useDeclineConnection } from "./useDeclineConnection";
4
+ export { default as useRemoveConnection } from "./useRemoveConnection";
5
+ export { default as useFetchConnections } from "./useFetchConnections";
6
+ export { default as useFetchConnectionStatus } from "./useFetchConnectionStatus";
7
+ export { default as useRemoveConnectionByUserId } from "./useRemoveConnectionByUserId";
8
+ export { default as useFetchConnectionsCount } from "./useFetchConnectionsCount";
9
+ export { default as useFetchSentPendingConnections } from "./useFetchSentPendingConnections";
10
+ export { default as useFetchReceivedPendingConnections } from "./useFetchReceivedPendingConnections";
11
+ export { default as useFetchConnectionsByUserId } from "./useFetchConnectionsByUserId";
12
+ export { default as useFetchConnectionsCountByUserId } from "./useFetchConnectionsCountByUserId";
13
+ export { default as useConnectionManager } from "./useConnectionManager";
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AACrG,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACjG,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ConnectionActionResponse } from "../../../interfaces/models/Connection";
2
+ declare function useAcceptConnection(): (props: {
3
+ connectionId: string;
4
+ }) => Promise<ConnectionActionResponse>;
5
+ export default useAcceptConnection;
@@ -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 useAcceptConnection() {
42
+ var _this = this;
43
+ var axios = useAxiosPrivate();
44
+ var projectId = useProject().projectId;
45
+ var user = useUser().user;
46
+ var acceptConnection = 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.put("/connections/".concat(connectionId, "/accept"), {}, { withCredentials: true })];
62
+ case 1:
63
+ response = _a.sent();
64
+ return [2 /*return*/, response.data];
65
+ }
66
+ });
67
+ }); }, [axios, projectId, user]);
68
+ return acceptConnection;
69
+ }
70
+ export default useAcceptConnection;
71
+ //# sourceMappingURL=useAcceptConnection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAcceptConnection.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useAcceptConnection.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,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,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,GAAG,CAC9B,uBAAgB,YAAY,YAAS,EACrC,EAAE,EACF,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAJK,QAAQ,GAAG,SAIhB;oBAED,sBAAO,QAAQ,CAAC,IAAgC,EAAC;;;SAClD,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,eAAe,mBAAmB,CAAC"}