@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
@@ -0,0 +1,95 @@
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
39
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
40
+ if (ar || !(i in from)) {
41
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
42
+ ar[i] = from[i];
43
+ }
44
+ }
45
+ return to.concat(ar || Array.prototype.slice.call(from));
46
+ };
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ var react_1 = require("react");
52
+ var useAxiosPrivate_1 = __importDefault(require("../../../config/useAxiosPrivate"));
53
+ var useProject_1 = __importDefault(require("../../projects/useProject"));
54
+ var user_1 = require("../../user");
55
+ function useFetchSentPendingConnections() {
56
+ var _this = this;
57
+ var axios = (0, useAxiosPrivate_1.default)();
58
+ var projectId = (0, useProject_1.default)().projectId;
59
+ var user = (0, user_1.useUser)().user;
60
+ var fetchSentPendingConnections = (0, react_1.useCallback)(function () {
61
+ var args_1 = [];
62
+ for (var _i = 0; _i < arguments.length; _i++) {
63
+ args_1[_i] = arguments[_i];
64
+ }
65
+ return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (props) {
66
+ var _a, page, _b, limit, response;
67
+ if (props === void 0) { props = {}; }
68
+ return __generator(this, function (_c) {
69
+ switch (_c.label) {
70
+ case 0:
71
+ _a = props.page, page = _a === void 0 ? 1 : _a, _b = props.limit, limit = _b === void 0 ? 20 : _b;
72
+ if (!projectId) {
73
+ throw new Error("No project specified");
74
+ }
75
+ if (!user) {
76
+ throw new Error("No user is logged in");
77
+ }
78
+ return [4 /*yield*/, axios.get("/connections/pending/sent", {
79
+ params: {
80
+ page: page,
81
+ limit: limit,
82
+ },
83
+ withCredentials: true,
84
+ })];
85
+ case 1:
86
+ response = _c.sent();
87
+ return [2 /*return*/, response.data];
88
+ }
89
+ });
90
+ });
91
+ }, [axios, projectId, user]);
92
+ return fetchSentPendingConnections;
93
+ }
94
+ exports.default = useFetchSentPendingConnections;
95
+ //# sourceMappingURL=useFetchSentPendingConnections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchSentPendingConnections.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useFetchSentPendingConnections.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,yEAAmD;AACnD,mCAAqC;AAQrC,SAAS,8BAA8B;IAAvC,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,2BAA2B,GAAG,IAAA,mBAAW,EAC7C;;;;;mFACE,KAA6C;;YAA7C,sBAAA,EAAA,UAA6C;;;;wBAErC,KAAyB,KAAK,KAAtB,EAAR,IAAI,mBAAG,CAAC,KAAA,EAAE,KAAe,KAAK,MAAV,EAAV,KAAK,mBAAG,EAAE,KAAA,CAAW;wBACvC,IAAI,CAAC,SAAS,EAAE,CAAC;4BACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;wBAC1C,CAAC;wBAED,IAAI,CAAC,IAAI,EAAE,CAAC;4BACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;wBAC1C,CAAC;wBAEgB,qBAAM,KAAK,CAAC,GAAG,CAAC,2BAA2B,EAAE;gCAC5D,MAAM,EAAE;oCACN,IAAI,MAAA;oCACJ,KAAK,OAAA;iCACN;gCACD,eAAe,EAAE,IAAI;6BACtB,CAAC,EAAA;;wBANI,QAAQ,GAAG,SAMf;wBAEF,sBAAO,QAAQ,CAAC,IAAqC,EAAC;;;;KACvD,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,2BAA2B,CAAC;AACrC,CAAC;AAED,kBAAe,8BAA8B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ConnectionWithdrawResponse } from "../../../interfaces/models/Connection";
2
+ declare function useRemoveConnection(): (props: {
3
+ connectionId: string;
4
+ }) => Promise<ConnectionWithdrawResponse>;
5
+ export default useRemoveConnection;
@@ -0,0 +1,76 @@
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 useRemoveConnection() {
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 removeConnection = (0, react_1.useCallback)(function (props) { return __awaiter(_this, void 0, void 0, function () {
52
+ var connectionId, response;
53
+ return __generator(this, function (_a) {
54
+ switch (_a.label) {
55
+ case 0:
56
+ connectionId = props.connectionId;
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 (!connectionId) {
64
+ throw new Error("No connection ID was provided");
65
+ }
66
+ return [4 /*yield*/, axios.delete("/connections/".concat(connectionId), { withCredentials: true })];
67
+ case 1:
68
+ response = _a.sent();
69
+ return [2 /*return*/, response.data];
70
+ }
71
+ });
72
+ }); }, [axios, projectId, user]);
73
+ return removeConnection;
74
+ }
75
+ exports.default = useRemoveConnection;
76
+ //# sourceMappingURL=useRemoveConnection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRemoveConnection.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useRemoveConnection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,yEAAmD;AACnD,mCAAqC;AAGrC,SAAS,mBAAmB;IAA5B,iBA+BC;IA9BC,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,gBAAgB,GAAG,IAAA,mBAAW,EAClC,UAAO,KAA+B;;;;;oBAC5B,YAAY,GAAK,KAAK,aAAV,CAAW;oBAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,YAAY,EAAE,CAAC;wBAClB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;oBACnD,CAAC;oBAEgB,qBAAM,KAAK,CAAC,MAAM,CACjC,uBAAgB,YAAY,CAAE,EAC9B,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAkC,EAAC;;;SACpD,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,kBAAe,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { RemoveConnectionByUserIdResponse } from "../../../interfaces/models/Connection";
2
+ declare function useRemoveConnectionByUserId(): (props: {
3
+ userId: string;
4
+ }) => Promise<RemoveConnectionByUserIdResponse>;
5
+ export default useRemoveConnectionByUserId;
@@ -0,0 +1,79 @@
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 useRemoveConnectionByUserId() {
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 removeConnectionByUserId = (0, react_1.useCallback)(function (props) { return __awaiter(_this, void 0, void 0, function () {
52
+ var userId, response;
53
+ return __generator(this, function (_a) {
54
+ switch (_a.label) {
55
+ case 0:
56
+ userId = props.userId;
57
+ if (!projectId) {
58
+ throw new Error("No project specified");
59
+ }
60
+ if (!user) {
61
+ throw new Error("No user is logged in");
62
+ }
63
+ if (!userId) {
64
+ throw new Error("No user ID was provided");
65
+ }
66
+ if (userId === user.id) {
67
+ throw new Error("Cannot disconnect from yourself");
68
+ }
69
+ return [4 /*yield*/, axios.delete("/users/".concat(userId, "/connection"), { withCredentials: true })];
70
+ case 1:
71
+ response = _a.sent();
72
+ return [2 /*return*/, response.data];
73
+ }
74
+ });
75
+ }); }, [axios, projectId, user]);
76
+ return removeConnectionByUserId;
77
+ }
78
+ exports.default = useRemoveConnectionByUserId;
79
+ //# sourceMappingURL=useRemoveConnectionByUserId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRemoveConnectionByUserId.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useRemoveConnectionByUserId.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,yEAAmD;AACnD,mCAAqC;AAGrC,SAAS,2BAA2B;IAApC,iBAmCC;IAlCC,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,wBAAwB,GAAG,IAAA,mBAAW,EAC1C,UAAO,KAAyB;;;;;oBACtB,MAAM,GAAK,KAAK,OAAV,CAAW;oBACzB,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,MAAM,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;wBACvB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;oBACrD,CAAC;oBAEgB,qBAAM,KAAK,CAAC,MAAM,CACjC,iBAAU,MAAM,gBAAa,EAC7B,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAwC,EAAC;;;SAC1D,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAED,kBAAe,2BAA2B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ConnectionRequestParams, ConnectionActionResponse } from "../../../interfaces/models/Connection";
2
+ declare function useRequestConnection(): (props: ConnectionRequestParams) => Promise<ConnectionActionResponse>;
3
+ export default useRequestConnection;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ var react_1 = require("react");
43
+ var useAxiosPrivate_1 = __importDefault(require("../../../config/useAxiosPrivate"));
44
+ var useProject_1 = __importDefault(require("../../projects/useProject"));
45
+ function useRequestConnection() {
46
+ var _this = this;
47
+ var axios = (0, useAxiosPrivate_1.default)();
48
+ var projectId = (0, useProject_1.default)().projectId;
49
+ var requestConnection = (0, react_1.useCallback)(function (props) { return __awaiter(_this, void 0, void 0, function () {
50
+ var userId, message, response;
51
+ return __generator(this, function (_a) {
52
+ switch (_a.label) {
53
+ case 0:
54
+ userId = props.userId, message = props.message;
55
+ if (!projectId) {
56
+ throw new Error("No project specified");
57
+ }
58
+ if (!userId) {
59
+ throw new Error("No user ID was provided");
60
+ }
61
+ return [4 /*yield*/, axios.post("/users/".concat(userId, "/connection"), { message: message }, { withCredentials: true })];
62
+ case 1:
63
+ response = _a.sent();
64
+ return [2 /*return*/, response.data];
65
+ }
66
+ });
67
+ }); }, [axios, projectId]);
68
+ return requestConnection;
69
+ }
70
+ exports.default = useRequestConnection;
71
+ //# sourceMappingURL=useRequestConnection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRequestConnection.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useRequestConnection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,yEAAmD;AAGnD,SAAS,oBAAoB;IAA7B,iBA2BC;IA1BC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IACxB,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAEnC,IAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,UAAO,KAA8B;;;;;oBAC3B,MAAM,GAAc,KAAK,OAAnB,EAAE,OAAO,GAAK,KAAK,QAAV,CAAW;oBAClC,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,IAAI,CAC/B,iBAAU,MAAM,gBAAa,EAC7B,EAAE,OAAO,SAAA,EAAE,EACX,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAJK,QAAQ,GAAG,SAIhB;oBAED,sBAAO,QAAQ,CAAC,IAAgC,EAAC;;;SAClD,EACD,CAAC,KAAK,EAAE,SAAS,CAAC,CACnB,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,kBAAe,oBAAoB,CAAC"}
@@ -1,4 +1,13 @@
1
- export { default as useFetchFollow } from "./useFetchFollow";
2
- export { default as useFollowUser } from "./useFollowUser";
3
- export { default as useUnfollowUser } from "./useUnfollowUser";
1
+ export { default as useFetchFollowStatus } from "./useFetchFollowStatus";
2
+ export { default as useFetchFollowers } from "./useFetchFollowers";
3
+ export { default as useFetchFollowersByUserId } from "./useFetchFollowersByUserId";
4
+ export { default as useFetchFollowersCount } from "./useFetchFollowersCount";
5
+ export { default as useFetchFollowersCountByUserId } from "./useFetchFollowersCountByUserId";
6
+ export { default as useFetchFollowing } from "./useFetchFollowing";
7
+ export { default as useFetchFollowingByUserId } from "./useFetchFollowingByUserId";
8
+ export { default as useFetchFollowingCount } from "./useFetchFollowingCount";
9
+ export { default as useFetchFollowingCountByUserId } from "./useFetchFollowingCountByUserId";
4
10
  export { default as useFollowManager } from "./useFollowManager";
11
+ export { default as useFollowUser } from "./useFollowUser";
12
+ export { default as useUnfollowByFollowId } from "./useUnfollowByFollowId";
13
+ export { default as useUnfollowUserByUserId } from "./useUnfollowUserByUserId";
@@ -3,13 +3,31 @@ 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.useFollowManager = exports.useUnfollowUser = exports.useFollowUser = exports.useFetchFollow = void 0;
7
- var useFetchFollow_1 = require("./useFetchFollow");
8
- Object.defineProperty(exports, "useFetchFollow", { enumerable: true, get: function () { return __importDefault(useFetchFollow_1).default; } });
9
- var useFollowUser_1 = require("./useFollowUser");
10
- Object.defineProperty(exports, "useFollowUser", { enumerable: true, get: function () { return __importDefault(useFollowUser_1).default; } });
11
- var useUnfollowUser_1 = require("./useUnfollowUser");
12
- Object.defineProperty(exports, "useUnfollowUser", { enumerable: true, get: function () { return __importDefault(useUnfollowUser_1).default; } });
6
+ 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 = void 0;
7
+ var useFetchFollowStatus_1 = require("./useFetchFollowStatus");
8
+ Object.defineProperty(exports, "useFetchFollowStatus", { enumerable: true, get: function () { return __importDefault(useFetchFollowStatus_1).default; } });
9
+ var useFetchFollowers_1 = require("./useFetchFollowers");
10
+ Object.defineProperty(exports, "useFetchFollowers", { enumerable: true, get: function () { return __importDefault(useFetchFollowers_1).default; } });
11
+ var useFetchFollowersByUserId_1 = require("./useFetchFollowersByUserId");
12
+ Object.defineProperty(exports, "useFetchFollowersByUserId", { enumerable: true, get: function () { return __importDefault(useFetchFollowersByUserId_1).default; } });
13
+ var useFetchFollowersCount_1 = require("./useFetchFollowersCount");
14
+ Object.defineProperty(exports, "useFetchFollowersCount", { enumerable: true, get: function () { return __importDefault(useFetchFollowersCount_1).default; } });
15
+ var useFetchFollowersCountByUserId_1 = require("./useFetchFollowersCountByUserId");
16
+ Object.defineProperty(exports, "useFetchFollowersCountByUserId", { enumerable: true, get: function () { return __importDefault(useFetchFollowersCountByUserId_1).default; } });
17
+ var useFetchFollowing_1 = require("./useFetchFollowing");
18
+ Object.defineProperty(exports, "useFetchFollowing", { enumerable: true, get: function () { return __importDefault(useFetchFollowing_1).default; } });
19
+ var useFetchFollowingByUserId_1 = require("./useFetchFollowingByUserId");
20
+ Object.defineProperty(exports, "useFetchFollowingByUserId", { enumerable: true, get: function () { return __importDefault(useFetchFollowingByUserId_1).default; } });
21
+ var useFetchFollowingCount_1 = require("./useFetchFollowingCount");
22
+ Object.defineProperty(exports, "useFetchFollowingCount", { enumerable: true, get: function () { return __importDefault(useFetchFollowingCount_1).default; } });
23
+ var useFetchFollowingCountByUserId_1 = require("./useFetchFollowingCountByUserId");
24
+ Object.defineProperty(exports, "useFetchFollowingCountByUserId", { enumerable: true, get: function () { return __importDefault(useFetchFollowingCountByUserId_1).default; } });
13
25
  var useFollowManager_1 = require("./useFollowManager");
14
26
  Object.defineProperty(exports, "useFollowManager", { enumerable: true, get: function () { return __importDefault(useFollowManager_1).default; } });
27
+ var useFollowUser_1 = require("./useFollowUser");
28
+ Object.defineProperty(exports, "useFollowUser", { enumerable: true, get: function () { return __importDefault(useFollowUser_1).default; } });
29
+ var useUnfollowByFollowId_1 = require("./useUnfollowByFollowId");
30
+ Object.defineProperty(exports, "useUnfollowByFollowId", { enumerable: true, get: function () { return __importDefault(useUnfollowByFollowId_1).default; } });
31
+ var useUnfollowUserByUserId_1 = require("./useUnfollowUserByUserId");
32
+ Object.defineProperty(exports, "useUnfollowUserByUserId", { enumerable: true, get: function () { return __importDefault(useUnfollowUserByUserId_1).default; } });
15
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/index.ts"],"names":[],"mappings":";;;;;;AAAA,mDAA6D;AAApD,iIAAA,OAAO,OAAkB;AAClC,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB;AACjC,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC,uDAAiE;AAAxD,qIAAA,OAAO,OAAoB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/index.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAyE;AAAhE,6IAAA,OAAO,OAAwB;AACxC,yDAAmE;AAA1D,uIAAA,OAAO,OAAqB;AACrC,yEAAmF;AAA1E,uJAAA,OAAO,OAA6B;AAC7C,mEAA6E;AAApE,iJAAA,OAAO,OAA0B;AAC1C,mFAA6F;AAApF,iKAAA,OAAO,OAAkC;AAClD,yDAAmE;AAA1D,uIAAA,OAAO,OAAqB;AACrC,yEAAmF;AAA1E,uJAAA,OAAO,OAA6B;AAC7C,mEAA6E;AAApE,iJAAA,OAAO,OAA0B;AAC1C,mFAA6F;AAApF,iKAAA,OAAO,OAAkC;AAClD,uDAAiE;AAAxD,qIAAA,OAAO,OAAoB;AACpC,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB;AACjC,iEAA2E;AAAlE,+IAAA,OAAO,OAAyB;AACzC,qEAA+E;AAAtE,mJAAA,OAAO,OAA2B"}
@@ -0,0 +1,8 @@
1
+ declare function useFetchFollowStatus(): (props: {
2
+ userId: string;
3
+ }) => Promise<{
4
+ isFollowing: boolean;
5
+ followId?: string;
6
+ followedAt?: string;
7
+ }>;
8
+ export default useFetchFollowStatus;
@@ -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 useFetchFollow() {
46
+ function useFetchFollowStatus() {
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 fetchFollow = (0, react_1.useCallback)(function (props) { return __awaiter(_this, void 0, void 0, function () {
51
+ var fetchFollowStatus = (0, react_1.useCallback)(function (props) { return __awaiter(_this, void 0, void 0, function () {
52
52
  var userId, response;
53
53
  return __generator(this, function (_a) {
54
54
  switch (_a.label) {
@@ -75,7 +75,7 @@ function useFetchFollow() {
75
75
  }
76
76
  });
77
77
  }); }, [axios, projectId, user]);
78
- return fetchFollow;
78
+ return fetchFollowStatus;
79
79
  }
80
- exports.default = useFetchFollow;
81
- //# sourceMappingURL=useFetchFollow.js.map
80
+ exports.default = useFetchFollowStatus;
81
+ //# sourceMappingURL=useFetchFollowStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchFollowStatus.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/useFetchFollowStatus.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,yEAAmD;AACnD,mCAAqC;AAErC,SAAS,oBAAoB;IAA7B,iBAqCC;IApCC,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,iBAAiB,GAAG,IAAA,mBAAW,EACnC,UAAO,KAAyB;;;;;oBACtB,MAAM,GAAK,KAAK,OAAV,CAAW;oBACzB,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,MAAM,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;wBACvB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;oBACnD,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAAC,WAAI,SAAS,oBAAU,MAAM,YAAS,EAAE;4BACvE,eAAe,EAAE,IAAI;yBACtB,CAAC,EAAA;;oBAFI,QAAQ,GAAG,SAEf;oBACF,sBAAO,QAAQ,CAAC,IAIf,EAAC;;;SACH,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,kBAAe,oBAAoB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { User } from "../../../interfaces/models/User";
2
+ export interface FollowerWithFollowInfo {
3
+ followId: string;
4
+ user: User;
5
+ followedAt: string;
6
+ }
7
+ export interface FollowersResponse {
8
+ followers: FollowerWithFollowInfo[];
9
+ pagination: {
10
+ currentPage: number;
11
+ totalPages: number;
12
+ totalCount: number;
13
+ hasNextPage: boolean;
14
+ hasPreviousPage: boolean;
15
+ limit: number;
16
+ };
17
+ }
18
+ export interface FetchFollowersParams {
19
+ page?: number;
20
+ limit?: number;
21
+ }
22
+ declare function useFetchFollowers(): ({ page, limit }?: FetchFollowersParams) => Promise<FollowersResponse>;
23
+ export default useFetchFollowers;
@@ -0,0 +1,91 @@
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
39
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
40
+ if (ar || !(i in from)) {
41
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
42
+ ar[i] = from[i];
43
+ }
44
+ }
45
+ return to.concat(ar || Array.prototype.slice.call(from));
46
+ };
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ var react_1 = require("react");
52
+ var useAxiosPrivate_1 = __importDefault(require("../../../config/useAxiosPrivate"));
53
+ var useProject_1 = __importDefault(require("../../projects/useProject"));
54
+ var user_1 = require("../../user");
55
+ function useFetchFollowers() {
56
+ var _this = this;
57
+ var axios = (0, useAxiosPrivate_1.default)();
58
+ var projectId = (0, useProject_1.default)().projectId;
59
+ var user = (0, user_1.useUser)().user;
60
+ var fetchFollowers = (0, react_1.useCallback)(function () {
61
+ var args_1 = [];
62
+ for (var _i = 0; _i < arguments.length; _i++) {
63
+ args_1[_i] = arguments[_i];
64
+ }
65
+ return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (_a) {
66
+ var response;
67
+ var _b = _a === void 0 ? {} : _a, _c = _b.page, page = _c === void 0 ? 1 : _c, _d = _b.limit, limit = _d === void 0 ? 20 : _d;
68
+ return __generator(this, function (_e) {
69
+ switch (_e.label) {
70
+ case 0:
71
+ if (!projectId) {
72
+ throw new Error("No projectId available.");
73
+ }
74
+ if (!user) {
75
+ throw new Error("No user is logged in.");
76
+ }
77
+ return [4 /*yield*/, axios.get("/".concat(projectId, "/follows/followers"), {
78
+ params: { page: page, limit: limit },
79
+ withCredentials: true,
80
+ })];
81
+ case 1:
82
+ response = _e.sent();
83
+ return [2 /*return*/, response.data];
84
+ }
85
+ });
86
+ });
87
+ }, [axios, projectId, user]);
88
+ return fetchFollowers;
89
+ }
90
+ exports.default = useFetchFollowers;
91
+ //# sourceMappingURL=useFetchFollowers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchFollowers.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/useFetchFollowers.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,oFAA8D;AAC9D,yEAAmD;AACnD,mCAAqC;AA0BrC,SAAS,iBAAiB;IAA1B,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,cAAc,GAAG,IAAA,mBAAW,EAChC;;;;;mFAAO,EAAmD;;gBAAnD,qBAAiD,EAAE,KAAA,EAAjD,YAAQ,EAAR,IAAI,mBAAG,CAAC,KAAA,EAAE,aAAU,EAAV,KAAK,mBAAG,EAAE,KAAA;;;;wBAC3B,IAAI,CAAC,SAAS,EAAE,CAAC;4BACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;wBAC7C,CAAC;wBAED,IAAI,CAAC,IAAI,EAAE,CAAC;4BACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;wBAC3C,CAAC;wBAEgB,qBAAM,KAAK,CAAC,GAAG,CAAC,WAAI,SAAS,uBAAoB,EAAE;gCAClE,MAAM,EAAE,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE;gCACvB,eAAe,EAAE,IAAI;6BACtB,CAAC,EAAA;;wBAHI,QAAQ,GAAG,SAGf;wBAEF,sBAAO,QAAQ,CAAC,IAAyB,EAAC;;;;KAC3C,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { User } from "../../../interfaces/models/User";
2
+ export interface FollowerWithFollowInfo {
3
+ followId: string;
4
+ user: User;
5
+ followedAt: string;
6
+ }
7
+ export interface FollowersResponse {
8
+ followers: FollowerWithFollowInfo[];
9
+ pagination: {
10
+ currentPage: number;
11
+ totalPages: number;
12
+ totalCount: number;
13
+ hasNextPage: boolean;
14
+ hasPreviousPage: boolean;
15
+ limit: number;
16
+ };
17
+ }
18
+ export interface FetchFollowersByUserIdParams {
19
+ userId: string;
20
+ page?: number;
21
+ limit?: number;
22
+ }
23
+ declare function useFetchFollowersByUserId(): ({ userId, page, limit }: FetchFollowersByUserIdParams) => Promise<FollowersResponse>;
24
+ export default useFetchFollowersByUserId;