@replyke/core 6.1.1-beta.0 → 6.2.0-beta.0

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 (259) hide show
  1. package/dist/cjs/context/index.d.ts +1 -0
  2. package/dist/cjs/context/index.js +3 -1
  3. package/dist/cjs/context/index.js.map +1 -1
  4. package/dist/cjs/context/space-context.d.ts +9 -0
  5. package/dist/cjs/context/space-context.js +35 -0
  6. package/dist/cjs/context/space-context.js.map +1 -0
  7. package/dist/cjs/hooks/crypto/useSignTestingJwt.d.ts +1 -2
  8. package/dist/cjs/hooks/crypto/useSignTestingJwt.js +17 -10
  9. package/dist/cjs/hooks/crypto/useSignTestingJwt.js.map +1 -1
  10. package/dist/cjs/hooks/projects/useProjectData.js +1 -1
  11. package/dist/cjs/hooks/projects/useProjectData.js.map +1 -1
  12. package/dist/cjs/hooks/reports/index.d.ts +3 -0
  13. package/dist/cjs/hooks/reports/index.js +7 -1
  14. package/dist/cjs/hooks/reports/index.js.map +1 -1
  15. package/dist/cjs/hooks/reports/useFetchSpaceReports.d.ts +38 -0
  16. package/dist/cjs/hooks/reports/useFetchSpaceReports.js +96 -0
  17. package/dist/cjs/hooks/reports/useFetchSpaceReports.js.map +1 -0
  18. package/dist/cjs/hooks/reports/useHandleSpaceCommentReport.d.ts +30 -0
  19. package/dist/cjs/hooks/reports/useHandleSpaceCommentReport.js +92 -0
  20. package/dist/cjs/hooks/reports/useHandleSpaceCommentReport.js.map +1 -0
  21. package/dist/cjs/hooks/reports/useHandleSpaceEntityReport.d.ts +32 -0
  22. package/dist/cjs/hooks/reports/useHandleSpaceEntityReport.js +94 -0
  23. package/dist/cjs/hooks/reports/useHandleSpaceEntityReport.js.map +1 -0
  24. package/dist/cjs/hooks/space-lists/index.d.ts +3 -0
  25. package/dist/cjs/hooks/space-lists/index.js +11 -0
  26. package/dist/cjs/hooks/space-lists/index.js.map +1 -0
  27. package/dist/cjs/hooks/space-lists/useSpaceList.d.ts +36 -0
  28. package/dist/cjs/hooks/space-lists/useSpaceList.js +293 -0
  29. package/dist/cjs/hooks/space-lists/useSpaceList.js.map +1 -0
  30. package/dist/cjs/hooks/space-lists/useSpaceListActions.d.ts +33 -0
  31. package/dist/cjs/hooks/space-lists/useSpaceListActions.js +210 -0
  32. package/dist/cjs/hooks/space-lists/useSpaceListActions.js.map +1 -0
  33. package/dist/cjs/hooks/spaces/index.d.ts +22 -0
  34. package/dist/cjs/hooks/spaces/index.js +51 -0
  35. package/dist/cjs/hooks/spaces/index.js.map +1 -0
  36. package/dist/cjs/hooks/spaces/useApproveMember.d.ts +7 -0
  37. package/dist/cjs/hooks/spaces/useApproveMember.js +71 -0
  38. package/dist/cjs/hooks/spaces/useApproveMember.js.map +1 -0
  39. package/dist/cjs/hooks/spaces/useCreateSpace.d.ts +15 -0
  40. package/dist/cjs/hooks/spaces/useCreateSpace.js +70 -0
  41. package/dist/cjs/hooks/spaces/useCreateSpace.js.map +1 -0
  42. package/dist/cjs/hooks/spaces/useDeclineMember.d.ts +7 -0
  43. package/dist/cjs/hooks/spaces/useDeclineMember.js +71 -0
  44. package/dist/cjs/hooks/spaces/useDeclineMember.js.map +1 -0
  45. package/dist/cjs/hooks/spaces/useDeleteSpace.d.ts +5 -0
  46. package/dist/cjs/hooks/spaces/useDeleteSpace.js +71 -0
  47. package/dist/cjs/hooks/spaces/useDeleteSpace.js.map +1 -0
  48. package/dist/cjs/hooks/spaces/useFetchMySpaces.d.ts +8 -0
  49. package/dist/cjs/hooks/spaces/useFetchMySpaces.js +85 -0
  50. package/dist/cjs/hooks/spaces/useFetchMySpaces.js.map +1 -0
  51. package/dist/cjs/hooks/spaces/useFetchSpace.d.ts +5 -0
  52. package/dist/cjs/hooks/spaces/useFetchSpace.js +71 -0
  53. package/dist/cjs/hooks/spaces/useFetchSpace.js.map +1 -0
  54. package/dist/cjs/hooks/spaces/useFetchSpaceBreadcrumb.d.ts +5 -0
  55. package/dist/cjs/hooks/spaces/useFetchSpaceBreadcrumb.js +71 -0
  56. package/dist/cjs/hooks/spaces/useFetchSpaceBreadcrumb.js.map +1 -0
  57. package/dist/cjs/hooks/spaces/useFetchSpaceByShortId.d.ts +5 -0
  58. package/dist/cjs/hooks/spaces/useFetchSpaceByShortId.js +71 -0
  59. package/dist/cjs/hooks/spaces/useFetchSpaceByShortId.js.map +1 -0
  60. package/dist/cjs/hooks/spaces/useFetchSpaceBySlug.d.ts +5 -0
  61. package/dist/cjs/hooks/spaces/useFetchSpaceBySlug.js +71 -0
  62. package/dist/cjs/hooks/spaces/useFetchSpaceBySlug.js.map +1 -0
  63. package/dist/cjs/hooks/spaces/useFetchSpaceChildren.d.ts +8 -0
  64. package/dist/cjs/hooks/spaces/useFetchSpaceChildren.js +70 -0
  65. package/dist/cjs/hooks/spaces/useFetchSpaceChildren.js.map +1 -0
  66. package/dist/cjs/hooks/spaces/useFetchSpaceMembers.d.ts +10 -0
  67. package/dist/cjs/hooks/spaces/useFetchSpaceMembers.js +82 -0
  68. package/dist/cjs/hooks/spaces/useFetchSpaceMembers.js.map +1 -0
  69. package/dist/cjs/hooks/spaces/useJoinSpace.d.ts +5 -0
  70. package/dist/cjs/hooks/spaces/useJoinSpace.js +71 -0
  71. package/dist/cjs/hooks/spaces/useJoinSpace.js.map +1 -0
  72. package/dist/cjs/hooks/spaces/useLeaveSpace.d.ts +5 -0
  73. package/dist/cjs/hooks/spaces/useLeaveSpace.js +71 -0
  74. package/dist/cjs/hooks/spaces/useLeaveSpace.js.map +1 -0
  75. package/dist/cjs/hooks/spaces/useRemoveMember.d.ts +9 -0
  76. package/dist/cjs/hooks/spaces/useRemoveMember.js +71 -0
  77. package/dist/cjs/hooks/spaces/useRemoveMember.js.map +1 -0
  78. package/dist/cjs/hooks/spaces/useSpace.d.ts +3 -0
  79. package/dist/cjs/hooks/spaces/useSpace.js +13 -0
  80. package/dist/cjs/hooks/spaces/useSpace.js.map +1 -0
  81. package/dist/cjs/hooks/spaces/useSpaceData.d.ts +32 -0
  82. package/dist/cjs/hooks/spaces/useSpaceData.js +358 -0
  83. package/dist/cjs/hooks/spaces/useSpaceData.js.map +1 -0
  84. package/dist/cjs/hooks/spaces/useSpacePermissions.d.ts +18 -0
  85. package/dist/cjs/hooks/spaces/useSpacePermissions.js +53 -0
  86. package/dist/cjs/hooks/spaces/useSpacePermissions.js.map +1 -0
  87. package/dist/cjs/hooks/spaces/useUpdateMemberRole.d.ts +9 -0
  88. package/dist/cjs/hooks/spaces/useUpdateMemberRole.js +71 -0
  89. package/dist/cjs/hooks/spaces/useUpdateMemberRole.js.map +1 -0
  90. package/dist/cjs/hooks/spaces/useUpdateSpace.d.ts +17 -0
  91. package/dist/cjs/hooks/spaces/useUpdateSpace.js +71 -0
  92. package/dist/cjs/hooks/spaces/useUpdateSpace.js.map +1 -0
  93. package/dist/cjs/index.d.ts +10 -1
  94. package/dist/cjs/index.js +35 -2
  95. package/dist/cjs/index.js.map +1 -1
  96. package/dist/cjs/interfaces/SpaceBreadcrumb.d.ts +5 -0
  97. package/dist/cjs/interfaces/SpaceBreadcrumb.js +3 -0
  98. package/dist/cjs/interfaces/SpaceBreadcrumb.js.map +1 -0
  99. package/dist/cjs/interfaces/SpaceListSortByOptions.d.ts +7 -0
  100. package/dist/cjs/interfaces/SpaceListSortByOptions.js +3 -0
  101. package/dist/cjs/interfaces/SpaceListSortByOptions.js.map +1 -0
  102. package/dist/cjs/interfaces/models/Space.d.ts +122 -0
  103. package/dist/cjs/interfaces/models/Space.js +3 -0
  104. package/dist/cjs/interfaces/models/Space.js.map +1 -0
  105. package/dist/cjs/interfaces/models/SpaceMember.d.ts +27 -0
  106. package/dist/cjs/interfaces/models/SpaceMember.js +3 -0
  107. package/dist/cjs/interfaces/models/SpaceMember.js.map +1 -0
  108. package/dist/cjs/interfaces/models/User.d.ts +1 -1
  109. package/dist/cjs/store/api/appNotificationsApi.d.ts +741 -221
  110. package/dist/cjs/store/api/baseApi.d.ts +1 -1
  111. package/dist/cjs/store/api/baseApi.js +2 -0
  112. package/dist/cjs/store/api/baseApi.js.map +1 -1
  113. package/dist/cjs/store/api/entityListsApi.d.ts +387 -127
  114. package/dist/cjs/store/api/listsApi.d.ts +786 -266
  115. package/dist/cjs/store/api/spacesApi.d.ts +10750 -0
  116. package/dist/cjs/store/api/spacesApi.js +501 -0
  117. package/dist/cjs/store/api/spacesApi.js.map +1 -0
  118. package/dist/cjs/store/api/userApi.d.ts +3 -3
  119. package/dist/cjs/store/index.d.ts +4 -2
  120. package/dist/cjs/store/rootReducer.d.ts +4 -2
  121. package/dist/cjs/store/rootReducer.js +2 -0
  122. package/dist/cjs/store/rootReducer.js.map +1 -1
  123. package/dist/cjs/store/slices/appNotificationsSlice.d.ts +2365 -11
  124. package/dist/cjs/store/slices/entityListsSlice.d.ts +1608 -12
  125. package/dist/cjs/store/slices/listsSlice.d.ts +1414 -14
  126. package/dist/cjs/store/slices/spaceListsSlice.d.ts +850 -0
  127. package/dist/cjs/store/slices/spaceListsSlice.js +226 -0
  128. package/dist/cjs/store/slices/spaceListsSlice.js.map +1 -0
  129. package/dist/cjs/store/slices/userSlice.d.ts +248 -8
  130. package/dist/esm/context/index.d.ts +1 -0
  131. package/dist/esm/context/index.js +1 -0
  132. package/dist/esm/context/index.js.map +1 -1
  133. package/dist/esm/context/space-context.d.ts +9 -0
  134. package/dist/esm/context/space-context.js +28 -0
  135. package/dist/esm/context/space-context.js.map +1 -0
  136. package/dist/esm/hooks/crypto/useSignTestingJwt.d.ts +1 -2
  137. package/dist/esm/hooks/crypto/useSignTestingJwt.js +17 -10
  138. package/dist/esm/hooks/crypto/useSignTestingJwt.js.map +1 -1
  139. package/dist/esm/hooks/projects/useProjectData.js +1 -1
  140. package/dist/esm/hooks/projects/useProjectData.js.map +1 -1
  141. package/dist/esm/hooks/reports/index.d.ts +3 -0
  142. package/dist/esm/hooks/reports/index.js +3 -0
  143. package/dist/esm/hooks/reports/index.js.map +1 -1
  144. package/dist/esm/hooks/reports/useFetchSpaceReports.d.ts +38 -0
  145. package/dist/esm/hooks/reports/useFetchSpaceReports.js +91 -0
  146. package/dist/esm/hooks/reports/useFetchSpaceReports.js.map +1 -0
  147. package/dist/esm/hooks/reports/useHandleSpaceCommentReport.d.ts +30 -0
  148. package/dist/esm/hooks/reports/useHandleSpaceCommentReport.js +87 -0
  149. package/dist/esm/hooks/reports/useHandleSpaceCommentReport.js.map +1 -0
  150. package/dist/esm/hooks/reports/useHandleSpaceEntityReport.d.ts +32 -0
  151. package/dist/esm/hooks/reports/useHandleSpaceEntityReport.js +89 -0
  152. package/dist/esm/hooks/reports/useHandleSpaceEntityReport.js.map +1 -0
  153. package/dist/esm/hooks/space-lists/index.d.ts +3 -0
  154. package/dist/esm/hooks/space-lists/index.js +3 -0
  155. package/dist/esm/hooks/space-lists/index.js.map +1 -0
  156. package/dist/esm/hooks/space-lists/useSpaceList.d.ts +36 -0
  157. package/dist/esm/hooks/space-lists/useSpaceList.js +288 -0
  158. package/dist/esm/hooks/space-lists/useSpaceList.js.map +1 -0
  159. package/dist/esm/hooks/space-lists/useSpaceListActions.d.ts +33 -0
  160. package/dist/esm/hooks/space-lists/useSpaceListActions.js +204 -0
  161. package/dist/esm/hooks/space-lists/useSpaceListActions.js.map +1 -0
  162. package/dist/esm/hooks/spaces/index.d.ts +22 -0
  163. package/dist/esm/hooks/spaces/index.js +26 -0
  164. package/dist/esm/hooks/spaces/index.js.map +1 -0
  165. package/dist/esm/hooks/spaces/useApproveMember.d.ts +7 -0
  166. package/dist/esm/hooks/spaces/useApproveMember.js +66 -0
  167. package/dist/esm/hooks/spaces/useApproveMember.js.map +1 -0
  168. package/dist/esm/hooks/spaces/useCreateSpace.d.ts +15 -0
  169. package/dist/esm/hooks/spaces/useCreateSpace.js +65 -0
  170. package/dist/esm/hooks/spaces/useCreateSpace.js.map +1 -0
  171. package/dist/esm/hooks/spaces/useDeclineMember.d.ts +7 -0
  172. package/dist/esm/hooks/spaces/useDeclineMember.js +66 -0
  173. package/dist/esm/hooks/spaces/useDeclineMember.js.map +1 -0
  174. package/dist/esm/hooks/spaces/useDeleteSpace.d.ts +5 -0
  175. package/dist/esm/hooks/spaces/useDeleteSpace.js +66 -0
  176. package/dist/esm/hooks/spaces/useDeleteSpace.js.map +1 -0
  177. package/dist/esm/hooks/spaces/useFetchMySpaces.d.ts +8 -0
  178. package/dist/esm/hooks/spaces/useFetchMySpaces.js +80 -0
  179. package/dist/esm/hooks/spaces/useFetchMySpaces.js.map +1 -0
  180. package/dist/esm/hooks/spaces/useFetchSpace.d.ts +5 -0
  181. package/dist/esm/hooks/spaces/useFetchSpace.js +66 -0
  182. package/dist/esm/hooks/spaces/useFetchSpace.js.map +1 -0
  183. package/dist/esm/hooks/spaces/useFetchSpaceBreadcrumb.d.ts +5 -0
  184. package/dist/esm/hooks/spaces/useFetchSpaceBreadcrumb.js +66 -0
  185. package/dist/esm/hooks/spaces/useFetchSpaceBreadcrumb.js.map +1 -0
  186. package/dist/esm/hooks/spaces/useFetchSpaceByShortId.d.ts +5 -0
  187. package/dist/esm/hooks/spaces/useFetchSpaceByShortId.js +66 -0
  188. package/dist/esm/hooks/spaces/useFetchSpaceByShortId.js.map +1 -0
  189. package/dist/esm/hooks/spaces/useFetchSpaceBySlug.d.ts +5 -0
  190. package/dist/esm/hooks/spaces/useFetchSpaceBySlug.js +66 -0
  191. package/dist/esm/hooks/spaces/useFetchSpaceBySlug.js.map +1 -0
  192. package/dist/esm/hooks/spaces/useFetchSpaceChildren.d.ts +8 -0
  193. package/dist/esm/hooks/spaces/useFetchSpaceChildren.js +65 -0
  194. package/dist/esm/hooks/spaces/useFetchSpaceChildren.js.map +1 -0
  195. package/dist/esm/hooks/spaces/useFetchSpaceMembers.d.ts +10 -0
  196. package/dist/esm/hooks/spaces/useFetchSpaceMembers.js +77 -0
  197. package/dist/esm/hooks/spaces/useFetchSpaceMembers.js.map +1 -0
  198. package/dist/esm/hooks/spaces/useJoinSpace.d.ts +5 -0
  199. package/dist/esm/hooks/spaces/useJoinSpace.js +66 -0
  200. package/dist/esm/hooks/spaces/useJoinSpace.js.map +1 -0
  201. package/dist/esm/hooks/spaces/useLeaveSpace.d.ts +5 -0
  202. package/dist/esm/hooks/spaces/useLeaveSpace.js +66 -0
  203. package/dist/esm/hooks/spaces/useLeaveSpace.js.map +1 -0
  204. package/dist/esm/hooks/spaces/useRemoveMember.d.ts +9 -0
  205. package/dist/esm/hooks/spaces/useRemoveMember.js +66 -0
  206. package/dist/esm/hooks/spaces/useRemoveMember.js.map +1 -0
  207. package/dist/esm/hooks/spaces/useSpace.d.ts +3 -0
  208. package/dist/esm/hooks/spaces/useSpace.js +11 -0
  209. package/dist/esm/hooks/spaces/useSpace.js.map +1 -0
  210. package/dist/esm/hooks/spaces/useSpaceData.d.ts +32 -0
  211. package/dist/esm/hooks/spaces/useSpaceData.js +353 -0
  212. package/dist/esm/hooks/spaces/useSpaceData.js.map +1 -0
  213. package/dist/esm/hooks/spaces/useSpacePermissions.d.ts +18 -0
  214. package/dist/esm/hooks/spaces/useSpacePermissions.js +51 -0
  215. package/dist/esm/hooks/spaces/useSpacePermissions.js.map +1 -0
  216. package/dist/esm/hooks/spaces/useUpdateMemberRole.d.ts +9 -0
  217. package/dist/esm/hooks/spaces/useUpdateMemberRole.js +66 -0
  218. package/dist/esm/hooks/spaces/useUpdateMemberRole.js.map +1 -0
  219. package/dist/esm/hooks/spaces/useUpdateSpace.d.ts +17 -0
  220. package/dist/esm/hooks/spaces/useUpdateSpace.js +66 -0
  221. package/dist/esm/hooks/spaces/useUpdateSpace.js.map +1 -0
  222. package/dist/esm/index.d.ts +10 -1
  223. package/dist/esm/index.js +8 -1
  224. package/dist/esm/index.js.map +1 -1
  225. package/dist/esm/interfaces/SpaceBreadcrumb.d.ts +5 -0
  226. package/dist/esm/interfaces/SpaceBreadcrumb.js +2 -0
  227. package/dist/esm/interfaces/SpaceBreadcrumb.js.map +1 -0
  228. package/dist/esm/interfaces/SpaceListSortByOptions.d.ts +7 -0
  229. package/dist/esm/interfaces/SpaceListSortByOptions.js +2 -0
  230. package/dist/esm/interfaces/SpaceListSortByOptions.js.map +1 -0
  231. package/dist/esm/interfaces/models/Space.d.ts +122 -0
  232. package/dist/esm/interfaces/models/Space.js +2 -0
  233. package/dist/esm/interfaces/models/Space.js.map +1 -0
  234. package/dist/esm/interfaces/models/SpaceMember.d.ts +27 -0
  235. package/dist/esm/interfaces/models/SpaceMember.js +2 -0
  236. package/dist/esm/interfaces/models/SpaceMember.js.map +1 -0
  237. package/dist/esm/interfaces/models/User.d.ts +1 -1
  238. package/dist/esm/store/api/appNotificationsApi.d.ts +741 -221
  239. package/dist/esm/store/api/baseApi.d.ts +1 -1
  240. package/dist/esm/store/api/baseApi.js +2 -0
  241. package/dist/esm/store/api/baseApi.js.map +1 -1
  242. package/dist/esm/store/api/entityListsApi.d.ts +387 -127
  243. package/dist/esm/store/api/listsApi.d.ts +786 -266
  244. package/dist/esm/store/api/spacesApi.d.ts +10750 -0
  245. package/dist/esm/store/api/spacesApi.js +498 -0
  246. package/dist/esm/store/api/spacesApi.js.map +1 -0
  247. package/dist/esm/store/api/userApi.d.ts +3 -3
  248. package/dist/esm/store/index.d.ts +4 -2
  249. package/dist/esm/store/rootReducer.d.ts +4 -2
  250. package/dist/esm/store/rootReducer.js +2 -0
  251. package/dist/esm/store/rootReducer.js.map +1 -1
  252. package/dist/esm/store/slices/appNotificationsSlice.d.ts +2365 -11
  253. package/dist/esm/store/slices/entityListsSlice.d.ts +1608 -12
  254. package/dist/esm/store/slices/listsSlice.d.ts +1414 -14
  255. package/dist/esm/store/slices/spaceListsSlice.d.ts +850 -0
  256. package/dist/esm/store/slices/spaceListsSlice.js +223 -0
  257. package/dist/esm/store/slices/spaceListsSlice.js.map +1 -0
  258. package/dist/esm/store/slices/userSlice.d.ts +248 -8
  259. package/package.json +1 -1
@@ -2,3 +2,4 @@ export { ReplykeProvider } from "./replyke-context";
2
2
  export { ReplykeStoreProvider } from "./replyke-store-context";
3
3
  export { EntityProvider } from "./entity-context";
4
4
  export { CommentSectionProvider } from "./comment-section-context";
5
+ export { SpaceProvider } from "./space-context";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommentSectionProvider = exports.EntityProvider = exports.ReplykeStoreProvider = exports.ReplykeProvider = void 0;
3
+ exports.SpaceProvider = exports.CommentSectionProvider = exports.EntityProvider = exports.ReplykeStoreProvider = exports.ReplykeProvider = void 0;
4
4
  var replyke_context_1 = require("./replyke-context");
5
5
  Object.defineProperty(exports, "ReplykeProvider", { enumerable: true, get: function () { return replyke_context_1.ReplykeProvider; } });
6
6
  var replyke_store_context_1 = require("./replyke-store-context");
@@ -9,4 +9,6 @@ var entity_context_1 = require("./entity-context");
9
9
  Object.defineProperty(exports, "EntityProvider", { enumerable: true, get: function () { return entity_context_1.EntityProvider; } });
10
10
  var comment_section_context_1 = require("./comment-section-context");
11
11
  Object.defineProperty(exports, "CommentSectionProvider", { enumerable: true, get: function () { return comment_section_context_1.CommentSectionProvider; } });
12
+ var space_context_1 = require("./space-context");
13
+ Object.defineProperty(exports, "SpaceProvider", { enumerable: true, get: function () { return space_context_1.SpaceProvider; } });
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/context/index.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,iEAA+D;AAAtD,6HAAA,oBAAoB,OAAA;AAC7B,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,qEAAmE;AAA1D,iIAAA,sBAAsB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/context/index.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,iEAA+D;AAAtD,6HAAA,oBAAoB,OAAA;AAC7B,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,qEAAmE;AAA1D,iIAAA,sBAAsB,OAAA;AAC/B,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { UseSpaceDataProps, UseSpaceDataValues } from "../hooks/spaces/useSpaceData";
3
+ export interface SpaceContextProps extends UseSpaceDataProps {
4
+ children: React.ReactNode;
5
+ }
6
+ export interface SpaceContextValues extends UseSpaceDataValues {
7
+ }
8
+ export declare const SpaceContext: React.Context<Partial<SpaceContextValues>>;
9
+ export declare const SpaceProvider: React.FC<SpaceContextProps>;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.SpaceProvider = exports.SpaceContext = void 0;
18
+ var jsx_runtime_1 = require("react/jsx-runtime");
19
+ var react_1 = require("react");
20
+ var useSpaceData_1 = __importDefault(require("../hooks/spaces/useSpaceData"));
21
+ exports.SpaceContext = (0, react_1.createContext)({});
22
+ var SpaceProvider = function (_a) {
23
+ var _b;
24
+ var children = _a.children, restOfProps = __rest(_a, ["children"]);
25
+ var data = (0, useSpaceData_1.default)(restOfProps);
26
+ if (!restOfProps.spaceId &&
27
+ !restOfProps.shortId &&
28
+ !restOfProps.slug &&
29
+ !((_b = restOfProps.space) === null || _b === void 0 ? void 0 : _b.id)) {
30
+ return null;
31
+ }
32
+ return (0, jsx_runtime_1.jsx)(exports.SpaceContext.Provider, { value: data, children: children });
33
+ };
34
+ exports.SpaceProvider = SpaceProvider;
35
+ //# sourceMappingURL=space-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"space-context.js","sourceRoot":"","sources":["../../../src/context/space-context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,+BAA6C;AAC7C,8EAGsC;AAOzB,QAAA,YAAY,GAAG,IAAA,qBAAa,EAA8B,EAAE,CAAC,CAAC;AAEpE,IAAM,aAAa,GAAgC,UAAC,EAGvC;;IAFlB,IAAA,QAAQ,cAAA,EACL,WAAW,cAF2C,YAG1D,CADe;IAEd,IAAM,IAAI,GAAG,IAAA,sBAAY,EAAC,WAAW,CAAC,CAAC;IAEvC,IACE,CAAC,WAAW,CAAC,OAAO;QACpB,CAAC,WAAW,CAAC,OAAO;QACpB,CAAC,WAAW,CAAC,IAAI;QACjB,CAAC,CAAA,MAAA,WAAW,CAAC,KAAK,0CAAE,EAAE,CAAA,EACtB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,uBAAC,oBAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,YAAG,QAAQ,GAAyB,CAAC;AAChF,CAAC,CAAC;AAhBW,QAAA,aAAa,iBAgBxB"}
@@ -1,5 +1,4 @@
1
- declare function useSignTestingJwt(): ({ projectId, privateKey, payload, }: {
2
- projectId: string;
1
+ declare function useSignTestingJwt(): ({ privateKey, payload, }: {
3
2
  privateKey: string;
4
3
  payload: Record<string, any>;
5
4
  }) => Promise<string | undefined>;
@@ -41,30 +41,37 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  var axios_1 = __importDefault(require("axios"));
43
43
  var handleError_1 = require("../../utils/handleError");
44
+ var projects_1 = require("../projects");
45
+ var WARNING = "\n WARNING: You are using a testing function to generate JWTs in your client application.\n This is NOT secure and should ONLY be used for initial development and testing purposes.\n\n In production:\n - NEVER expose your secret key in client-side code.\n - Refer to the documentation at https://docs.replyke.com to implement JWT signing on your backend.\n - Rotate your secret key periodically, especially after moving from testing to production.\n\n Failure to follow these practices can lead to security vulnerabilities.\n ";
44
46
  function useSignTestingJwt() {
45
47
  var _this = this;
46
48
  var signTestingJwt = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
47
- var response, err_1;
48
- var projectId = _b.projectId, privateKey = _b.privateKey, payload = _b.payload;
49
+ var projectId, response, err_1;
50
+ var privateKey = _b.privateKey, payload = _b.payload;
49
51
  return __generator(this, function (_c) {
50
52
  switch (_c.label) {
51
53
  case 0:
52
- _c.trys.push([0, 2, , 3]);
54
+ projectId = (0, projects_1.useProject)().projectId;
55
+ _c.label = 1;
56
+ case 1:
57
+ _c.trys.push([1, 3, , 4]);
58
+ if (!projectId) {
59
+ throw new Error("No project specified");
60
+ }
53
61
  // Warn developers about the security risks
54
- console.warn("\n WARNING: You are using a testing function to generate JWTs in your client application.\n This is NOT secure and should ONLY be used for initial development and testing purposes.\n\n In production:\n - NEVER expose your secret key in client-side code.\n - Refer to the documentation at https://docs.replyke.com to implement JWT signing on your backend.\n - Rotate your secret key periodically, especially after moving from testing to production.\n\n Failure to follow these practices can lead to security vulnerabilities.\n ");
55
- return [4 /*yield*/, axios_1.default.post("https://api.replyke.com/internal/crypto/sign-testing-jwt", {
56
- projectId: projectId,
62
+ console.warn(WARNING);
63
+ return [4 /*yield*/, axios_1.default.post("/".concat(projectId, "/crypto/sign-testing-jwt"), {
57
64
  privateKey: privateKey,
58
65
  payload: payload,
59
66
  })];
60
- case 1:
67
+ case 2:
61
68
  response = _c.sent();
62
69
  return [2 /*return*/, response.data];
63
- case 2:
70
+ case 3:
64
71
  err_1 = _c.sent();
65
72
  (0, handleError_1.handleError)(err_1, "Failed to sign testing jwt: ");
66
- return [3 /*break*/, 3];
67
- case 3: return [2 /*return*/];
73
+ return [3 /*break*/, 4];
74
+ case 4: return [2 /*return*/];
68
75
  }
69
76
  });
70
77
  }); };
@@ -1 +1 @@
1
- {"version":3,"file":"useSignTestingJwt.js","sourceRoot":"","sources":["../../../../src/hooks/crypto/useSignTestingJwt.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,uDAAsD;AAEtD,SAAS,iBAAiB;IAA1B,iBAwCC;IAvCC,IAAM,cAAc,GAAG,gEAAO,EAQ7B;;YAPC,SAAS,eAAA,EACT,UAAU,gBAAA,EACV,OAAO,aAAA;;;;;oBAOL,2CAA2C;oBAC3C,OAAO,CAAC,IAAI,CAAC,siBAUhB,CAAC,CAAC;oBAEkB,qBAAM,eAAK,CAAC,IAAI,CAC/B,0DAA0D,EAC1D;4BACE,SAAS,WAAA;4BACT,UAAU,YAAA;4BACV,OAAO,SAAA;yBACR,CACF,EAAA;;oBAPK,QAAQ,GAAG,SAOhB;oBAED,sBAAO,QAAQ,CAAC,IAAc,EAAC;;;oBAE/B,IAAA,yBAAW,EAAC,KAAG,EAAE,8BAA8B,CAAC,CAAC;;;;;SAEpD,CAAC;IAEF,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"useSignTestingJwt.js","sourceRoot":"","sources":["../../../../src/hooks/crypto/useSignTestingJwt.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,uDAAsD;AACtD,wCAAyC;AAEzC,IAAM,OAAO,GAAG,siBAUb,CAAC;AAEJ,SAAS,iBAAiB;IAA1B,iBAgCC;IA/BC,IAAM,cAAc,GAAG,gEAAO,EAM7B;;YALC,UAAU,gBAAA,EACV,OAAO,aAAA;;;;oBAKC,SAAS,GAAK,IAAA,qBAAU,GAAE,UAAjB,CAAkB;;;;oBAGjC,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,2CAA2C;oBAC3C,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACL,qBAAM,eAAK,CAAC,IAAI,CAC/B,WAAI,SAAS,6BAA0B,EACvC;4BACE,UAAU,YAAA;4BACV,OAAO,SAAA;yBACR,CACF,EAAA;;oBANK,QAAQ,GAAG,SAMhB;oBAED,sBAAO,QAAQ,CAAC,IAAc,EAAC;;;oBAE/B,IAAA,yBAAW,EAAC,KAAG,EAAE,8BAA8B,CAAC,CAAC;;;;;SAEpD,CAAC;IAEF,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
@@ -55,7 +55,7 @@ function useProjectData(_a) {
55
55
  switch (_a.label) {
56
56
  case 0:
57
57
  _a.trys.push([0, 2, , 3]);
58
- return [4 /*yield*/, axios_1.default.get("https://api.replyke.com/internal/projects/".concat(projectId, "/lean"))];
58
+ return [4 /*yield*/, axios_1.default.get("/".concat(projectId, "/projects/lean"))];
59
59
  case 1:
60
60
  response = _a.sent();
61
61
  fetchedProject = response.data;
@@ -1 +1 @@
1
- {"version":3,"file":"useProjectData.js","sourceRoot":"","sources":["../../../../src/hooks/projects/useProjectData.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4C;AAE5C,uDAAsD;AACtD,6DAAuC;AAUvC,SAAS,cAAc,CAAC,EAEF;IAFtB,iBAyBC;QAxBC,SAAS,eAAA;IAEH,IAAA,KAAwB,IAAA,gBAAQ,EAAiB,IAAI,CAAC,EAArD,OAAO,QAAA,EAAE,UAAU,QAAkC,CAAC;IAE7D,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAE5D,IAAA,iBAAS,EAAC;QACR,IAAM,kBAAkB,GAAG;;;;;;wBAEN,qBAAM,eAAK,CAAC,GAAG,CAC9B,oDAA6C,SAAS,UAAO,CAC9D,EAAA;;wBAFK,QAAQ,GAAG,SAEhB;wBAEK,cAAc,GAAG,QAAQ,CAAC,IAAe,CAAC;wBAChD,UAAU,CAAC,cAAc,CAAC,CAAC;;;;wBAE3B,IAAA,yBAAW,EAAC,KAAG,EAAE,yBAAyB,CAAC,CAAC;;;;;aAE/C,CAAC;QAEF,IAAI,SAAS;YAAE,kBAAkB,EAAE,CAAC;IACtC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,EAAE,SAAS,WAAA,EAAE,OAAO,SAAA,EAAE,CAAC;AAChC,CAAC;AAED,kBAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"useProjectData.js","sourceRoot":"","sources":["../../../../src/hooks/projects/useProjectData.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4C;AAE5C,uDAAsD;AACtD,6DAAuC;AAUvC,SAAS,cAAc,CAAC,EAEF;IAFtB,iBAuBC;QAtBC,SAAS,eAAA;IAEH,IAAA,KAAwB,IAAA,gBAAQ,EAAiB,IAAI,CAAC,EAArD,OAAO,QAAA,EAAE,UAAU,QAAkC,CAAC;IAE7D,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAE5D,IAAA,iBAAS,EAAC;QACR,IAAM,kBAAkB,GAAG;;;;;;wBAEN,qBAAM,eAAK,CAAC,GAAG,CAAC,WAAI,SAAS,mBAAgB,CAAC,EAAA;;wBAAzD,QAAQ,GAAG,SAA8C;wBAEzD,cAAc,GAAG,QAAQ,CAAC,IAAe,CAAC;wBAChD,UAAU,CAAC,cAAc,CAAC,CAAC;;;;wBAE3B,IAAA,yBAAW,EAAC,KAAG,EAAE,yBAAyB,CAAC,CAAC;;;;;aAE/C,CAAC;QAEF,IAAI,SAAS;YAAE,kBAAkB,EAAE,CAAC;IACtC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,EAAE,SAAS,WAAA,EAAE,OAAO,SAAA,EAAE,CAAC;AAChC,CAAC;AAED,kBAAe,cAAc,CAAC"}
@@ -1 +1,4 @@
1
1
  export { default as useCreateReport } from "./useCreateReport";
2
+ export { default as useFetchSpaceReports } from "./useFetchSpaceReports";
3
+ export { default as useHandleSpaceEntityReport } from "./useHandleSpaceEntityReport";
4
+ export { default as useHandleSpaceCommentReport } from "./useHandleSpaceCommentReport";
@@ -3,7 +3,13 @@ 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.useCreateReport = void 0;
6
+ exports.useHandleSpaceCommentReport = exports.useHandleSpaceEntityReport = exports.useFetchSpaceReports = exports.useCreateReport = void 0;
7
7
  var useCreateReport_1 = require("./useCreateReport");
8
8
  Object.defineProperty(exports, "useCreateReport", { enumerable: true, get: function () { return __importDefault(useCreateReport_1).default; } });
9
+ var useFetchSpaceReports_1 = require("./useFetchSpaceReports");
10
+ Object.defineProperty(exports, "useFetchSpaceReports", { enumerable: true, get: function () { return __importDefault(useFetchSpaceReports_1).default; } });
11
+ var useHandleSpaceEntityReport_1 = require("./useHandleSpaceEntityReport");
12
+ Object.defineProperty(exports, "useHandleSpaceEntityReport", { enumerable: true, get: function () { return __importDefault(useHandleSpaceEntityReport_1).default; } });
13
+ var useHandleSpaceCommentReport_1 = require("./useHandleSpaceCommentReport");
14
+ Object.defineProperty(exports, "useHandleSpaceCommentReport", { enumerable: true, get: function () { return __importDefault(useHandleSpaceCommentReport_1).default; } });
9
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/reports/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/reports/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC,+DAAyE;AAAhE,6IAAA,OAAO,OAAwB;AACxC,2EAAqF;AAA5E,yJAAA,OAAO,OAA8B;AAC9C,6EAAuF;AAA9E,2JAAA,OAAO,OAA+B"}
@@ -0,0 +1,38 @@
1
+ interface FetchSpaceReportsParams {
2
+ spaceId: string;
3
+ targetType?: "Comment" | "Entity";
4
+ sortBy?: "new" | "old";
5
+ page?: number;
6
+ limit?: number;
7
+ }
8
+ interface Report {
9
+ id: string;
10
+ projectId: string;
11
+ spaceId: string | null;
12
+ reporters: string[];
13
+ targetId: string;
14
+ targetType: "Comment" | "Entity";
15
+ reason: string;
16
+ details: string | null;
17
+ status: "Pending" | "On Hold" | "Escalated" | "Dismissed" | "Actioned";
18
+ actionTaken: string | null;
19
+ createdAt: Date;
20
+ updatedAt: Date;
21
+ deletedAt: Date | null;
22
+ }
23
+ /**
24
+ * Hook to fetch reports for a specific space
25
+ * Only accessible by space moderators/admins
26
+ *
27
+ * @example
28
+ * const fetchSpaceReports = useFetchSpaceReports();
29
+ *
30
+ * const reports = await fetchSpaceReports({
31
+ * spaceId: "space-uuid",
32
+ * targetType: "Entity",
33
+ * page: 1,
34
+ * limit: 20
35
+ * });
36
+ */
37
+ declare function useFetchSpaceReports(): ({ spaceId, targetType, sortBy, page, limit, }: FetchSpaceReportsParams) => Promise<Report[]>;
38
+ export default useFetchSpaceReports;
@@ -0,0 +1,96 @@
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 useProject_1 = __importDefault(require("../projects/useProject"));
44
+ var useAxiosPrivate_1 = __importDefault(require("../../config/useAxiosPrivate"));
45
+ /**
46
+ * Hook to fetch reports for a specific space
47
+ * Only accessible by space moderators/admins
48
+ *
49
+ * @example
50
+ * const fetchSpaceReports = useFetchSpaceReports();
51
+ *
52
+ * const reports = await fetchSpaceReports({
53
+ * spaceId: "space-uuid",
54
+ * targetType: "Entity",
55
+ * page: 1,
56
+ * limit: 20
57
+ * });
58
+ */
59
+ function useFetchSpaceReports() {
60
+ var _this = this;
61
+ var projectId = (0, useProject_1.default)().projectId;
62
+ var axios = (0, useAxiosPrivate_1.default)();
63
+ var fetchSpaceReports = (0, react_1.useCallback)(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
64
+ var queryParams, queryString, url, response;
65
+ var spaceId = _b.spaceId, targetType = _b.targetType, sortBy = _b.sortBy, page = _b.page, limit = _b.limit;
66
+ return __generator(this, function (_c) {
67
+ switch (_c.label) {
68
+ case 0:
69
+ if (!projectId) {
70
+ throw new Error("No projectId available.");
71
+ }
72
+ if (!spaceId) {
73
+ throw new Error("Please pass a spaceId");
74
+ }
75
+ queryParams = new URLSearchParams();
76
+ if (targetType)
77
+ queryParams.append("targetType", targetType);
78
+ if (sortBy)
79
+ queryParams.append("sortBy", sortBy);
80
+ if (page !== undefined)
81
+ queryParams.append("page", page.toString());
82
+ if (limit !== undefined)
83
+ queryParams.append("limit", limit.toString());
84
+ queryString = queryParams.toString();
85
+ url = "/".concat(projectId, "/spaces/").concat(spaceId, "/reports").concat(queryString ? "?".concat(queryString) : "");
86
+ return [4 /*yield*/, axios.get(url)];
87
+ case 1:
88
+ response = _c.sent();
89
+ return [2 /*return*/, response.data];
90
+ }
91
+ });
92
+ }); }, [projectId, axios]);
93
+ return fetchSpaceReports;
94
+ }
95
+ exports.default = useFetchSpaceReports;
96
+ //# sourceMappingURL=useFetchSpaceReports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchSpaceReports.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useFetchSpaceReports.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,sEAAgD;AAChD,iFAA2D;AA0B3D;;;;;;;;;;;;;GAaG;AACH,SAAS,oBAAoB;IAA7B,iBAuCC;IAtCS,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IACnC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEhC,IAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,gEAAO,EAMmB;;YALxB,OAAO,aAAA,EACP,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,KAAK,WAAA;;;;oBAEL,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,CAAC,OAAO,EAAE,CAAC;wBACb,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;oBAC3C,CAAC;oBAEK,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;oBAC1C,IAAI,UAAU;wBAAE,WAAW,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;oBAC7D,IAAI,MAAM;wBAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;oBACjD,IAAI,IAAI,KAAK,SAAS;wBAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;oBACpE,IAAI,KAAK,KAAK,SAAS;wBAAE,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;oBAEjE,WAAW,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;oBACrC,GAAG,GAAG,WAAI,SAAS,qBAAW,OAAO,qBACzC,WAAW,CAAC,CAAC,CAAC,WAAI,WAAW,CAAE,CAAC,CAAC,CAAC,EAAE,CACpC,CAAC;oBAEc,qBAAM,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAA;;oBAA/B,QAAQ,GAAG,SAAoB;oBAErC,sBAAO,QAAQ,CAAC,IAAgB,EAAC;;;SAClC,EACD,CAAC,SAAS,EAAE,KAAK,CAAC,CACnB,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,kBAAe,oBAAoB,CAAC"}
@@ -0,0 +1,30 @@
1
+ interface HandleSpaceCommentReportParams {
2
+ spaceId: string;
3
+ reportId: string;
4
+ commentId: string;
5
+ actions: Array<"delete-comment" | "ban-user" | "dismiss">;
6
+ summary: string;
7
+ userId?: string;
8
+ reason?: string;
9
+ }
10
+ interface HandleReportResponse {
11
+ message: string;
12
+ code: string;
13
+ }
14
+ /**
15
+ * Hook to handle comment reports at the space level
16
+ * Space moderators can: delete comment, ban user from space, dismiss
17
+ *
18
+ * @example
19
+ * const handleSpaceCommentReport = useHandleSpaceCommentReport();
20
+ *
21
+ * await handleSpaceCommentReport({
22
+ * spaceId: "space-uuid",
23
+ * reportId: "report-uuid",
24
+ * commentId: "comment-uuid",
25
+ * actions: ["delete-comment"],
26
+ * summary: "Removed inappropriate comment"
27
+ * });
28
+ */
29
+ declare function useHandleSpaceCommentReport(): ({ spaceId, reportId, commentId, actions, summary, userId, reason, }: HandleSpaceCommentReportParams) => Promise<HandleReportResponse>;
30
+ export default useHandleSpaceCommentReport;
@@ -0,0 +1,92 @@
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 useProject_1 = __importDefault(require("../projects/useProject"));
44
+ var useAxiosPrivate_1 = __importDefault(require("../../config/useAxiosPrivate"));
45
+ /**
46
+ * Hook to handle comment reports at the space level
47
+ * Space moderators can: delete comment, ban user from space, dismiss
48
+ *
49
+ * @example
50
+ * const handleSpaceCommentReport = useHandleSpaceCommentReport();
51
+ *
52
+ * await handleSpaceCommentReport({
53
+ * spaceId: "space-uuid",
54
+ * reportId: "report-uuid",
55
+ * commentId: "comment-uuid",
56
+ * actions: ["delete-comment"],
57
+ * summary: "Removed inappropriate comment"
58
+ * });
59
+ */
60
+ function useHandleSpaceCommentReport() {
61
+ var _this = this;
62
+ var projectId = (0, useProject_1.default)().projectId;
63
+ var axios = (0, useAxiosPrivate_1.default)();
64
+ var handleSpaceCommentReport = (0, react_1.useCallback)(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
65
+ var response;
66
+ var spaceId = _b.spaceId, reportId = _b.reportId, commentId = _b.commentId, actions = _b.actions, summary = _b.summary, userId = _b.userId, reason = _b.reason;
67
+ return __generator(this, function (_c) {
68
+ switch (_c.label) {
69
+ case 0:
70
+ if (!projectId) {
71
+ throw new Error("No projectId available.");
72
+ }
73
+ if (!spaceId || !reportId) {
74
+ throw new Error("spaceId and reportId are required");
75
+ }
76
+ return [4 /*yield*/, axios.patch("/".concat(projectId, "/spaces/").concat(spaceId, "/reports/comment/").concat(reportId), {
77
+ commentId: commentId,
78
+ actions: actions,
79
+ summary: summary,
80
+ userId: userId,
81
+ reason: reason,
82
+ })];
83
+ case 1:
84
+ response = _c.sent();
85
+ return [2 /*return*/, response.data];
86
+ }
87
+ });
88
+ }); }, [projectId, axios]);
89
+ return handleSpaceCommentReport;
90
+ }
91
+ exports.default = useHandleSpaceCommentReport;
92
+ //# sourceMappingURL=useHandleSpaceCommentReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHandleSpaceCommentReport.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useHandleSpaceCommentReport.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,sEAAgD;AAChD,iFAA2D;AAiB3D;;;;;;;;;;;;;;GAcG;AACH,SAAS,2BAA2B;IAApC,iBAuCC;IAtCS,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IACnC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEhC,IAAM,wBAAwB,GAAG,IAAA,mBAAW,EAC1C,gEAAO,EAQ0B;;YAP/B,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,OAAO,aAAA,EACP,OAAO,aAAA,EACP,MAAM,YAAA,EACN,MAAM,YAAA;;;;oBAEN,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;wBAC1B,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;oBACvD,CAAC;oBAEgB,qBAAM,KAAK,CAAC,KAAK,CAChC,WAAI,SAAS,qBAAW,OAAO,8BAAoB,QAAQ,CAAE,EAC7D;4BACE,SAAS,WAAA;4BACT,OAAO,SAAA;4BACP,OAAO,SAAA;4BACP,MAAM,QAAA;4BACN,MAAM,QAAA;yBACP,CACF,EAAA;;oBATK,QAAQ,GAAG,SAShB;oBAED,sBAAO,QAAQ,CAAC,IAA4B,EAAC;;;SAC9C,EACD,CAAC,SAAS,EAAE,KAAK,CAAC,CACnB,CAAC;IAEF,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAED,kBAAe,2BAA2B,CAAC"}
@@ -0,0 +1,32 @@
1
+ interface HandleSpaceEntityReportParams {
2
+ spaceId: string;
3
+ reportId: string;
4
+ entityId: string;
5
+ actions: Array<"delete-entity" | "ban-user" | "dismiss">;
6
+ summary: string;
7
+ userId?: string;
8
+ reason?: string;
9
+ }
10
+ interface HandleReportResponse {
11
+ message: string;
12
+ code: string;
13
+ }
14
+ /**
15
+ * Hook to handle entity reports at the space level
16
+ * Space moderators can: delete entity, ban user from space, dismiss
17
+ *
18
+ * @example
19
+ * const handleSpaceEntityReport = useHandleSpaceEntityReport();
20
+ *
21
+ * await handleSpaceEntityReport({
22
+ * spaceId: "space-uuid",
23
+ * reportId: "report-uuid",
24
+ * entityId: "entity-uuid",
25
+ * actions: ["delete-entity", "ban-user"],
26
+ * summary: "Removed spam content and banned user",
27
+ * userId: "user-uuid",
28
+ * reason: "Spamming"
29
+ * });
30
+ */
31
+ declare function useHandleSpaceEntityReport(): ({ spaceId, reportId, entityId, actions, summary, userId, reason, }: HandleSpaceEntityReportParams) => Promise<HandleReportResponse>;
32
+ export default useHandleSpaceEntityReport;
@@ -0,0 +1,94 @@
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 useProject_1 = __importDefault(require("../projects/useProject"));
44
+ var useAxiosPrivate_1 = __importDefault(require("../../config/useAxiosPrivate"));
45
+ /**
46
+ * Hook to handle entity reports at the space level
47
+ * Space moderators can: delete entity, ban user from space, dismiss
48
+ *
49
+ * @example
50
+ * const handleSpaceEntityReport = useHandleSpaceEntityReport();
51
+ *
52
+ * await handleSpaceEntityReport({
53
+ * spaceId: "space-uuid",
54
+ * reportId: "report-uuid",
55
+ * entityId: "entity-uuid",
56
+ * actions: ["delete-entity", "ban-user"],
57
+ * summary: "Removed spam content and banned user",
58
+ * userId: "user-uuid",
59
+ * reason: "Spamming"
60
+ * });
61
+ */
62
+ function useHandleSpaceEntityReport() {
63
+ var _this = this;
64
+ var projectId = (0, useProject_1.default)().projectId;
65
+ var axios = (0, useAxiosPrivate_1.default)();
66
+ var handleSpaceEntityReport = (0, react_1.useCallback)(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
67
+ var response;
68
+ var spaceId = _b.spaceId, reportId = _b.reportId, entityId = _b.entityId, actions = _b.actions, summary = _b.summary, userId = _b.userId, reason = _b.reason;
69
+ return __generator(this, function (_c) {
70
+ switch (_c.label) {
71
+ case 0:
72
+ if (!projectId) {
73
+ throw new Error("No projectId available.");
74
+ }
75
+ if (!spaceId || !reportId) {
76
+ throw new Error("spaceId and reportId are required");
77
+ }
78
+ return [4 /*yield*/, axios.patch("/".concat(projectId, "/spaces/").concat(spaceId, "/reports/entity/").concat(reportId), {
79
+ entityId: entityId,
80
+ actions: actions,
81
+ summary: summary,
82
+ userId: userId,
83
+ reason: reason,
84
+ })];
85
+ case 1:
86
+ response = _c.sent();
87
+ return [2 /*return*/, response.data];
88
+ }
89
+ });
90
+ }); }, [projectId, axios]);
91
+ return handleSpaceEntityReport;
92
+ }
93
+ exports.default = useHandleSpaceEntityReport;
94
+ //# sourceMappingURL=useHandleSpaceEntityReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHandleSpaceEntityReport.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useHandleSpaceEntityReport.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,sEAAgD;AAChD,iFAA2D;AAiB3D;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,0BAA0B;IAAnC,iBAuCC;IAtCS,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IACnC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEhC,IAAM,uBAAuB,GAAG,IAAA,mBAAW,EACzC,gEAAO,EAQyB;;YAP9B,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,OAAO,aAAA,EACP,MAAM,YAAA,EACN,MAAM,YAAA;;;;oBAEN,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;wBAC1B,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;oBACvD,CAAC;oBAEgB,qBAAM,KAAK,CAAC,KAAK,CAChC,WAAI,SAAS,qBAAW,OAAO,6BAAmB,QAAQ,CAAE,EAC5D;4BACE,QAAQ,UAAA;4BACR,OAAO,SAAA;4BACP,OAAO,SAAA;4BACP,MAAM,QAAA;4BACN,MAAM,QAAA;yBACP,CACF,EAAA;;oBATK,QAAQ,GAAG,SAShB;oBAED,sBAAO,QAAQ,CAAC,IAA4B,EAAC;;;SAC9C,EACD,CAAC,SAAS,EAAE,KAAK,CAAC,CACnB,CAAC;IAEF,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAED,kBAAe,0BAA0B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as useSpaceList } from "./useSpaceList";
2
+ export type { UseSpaceListProps, UseSpaceListValues } from "./useSpaceList";
3
+ export { default as useSpaceListActions } from "./useSpaceListActions";
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.useSpaceListActions = exports.useSpaceList = void 0;
7
+ var useSpaceList_1 = require("./useSpaceList");
8
+ Object.defineProperty(exports, "useSpaceList", { enumerable: true, get: function () { return __importDefault(useSpaceList_1).default; } });
9
+ var useSpaceListActions_1 = require("./useSpaceListActions");
10
+ Object.defineProperty(exports, "useSpaceListActions", { enumerable: true, get: function () { return __importDefault(useSpaceListActions_1).default; } });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/space-lists/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAGhC,6DAAuE;AAA9D,2IAAA,OAAO,OAAuB"}