@replyke/core 7.0.0-beta.66 → 7.0.0-beta.67
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.
- package/dist/cjs/hooks/reports/index.d.ts +1 -1
- package/dist/cjs/hooks/reports/index.js +3 -3
- package/dist/cjs/hooks/reports/index.js.map +1 -1
- package/dist/cjs/hooks/reports/useFetchModeratedReports.d.ts +48 -0
- package/dist/cjs/hooks/reports/{useFetchSpaceReports.js → useFetchModeratedReports.js} +19 -13
- package/dist/cjs/hooks/reports/useFetchModeratedReports.js.map +1 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/hooks/reports/index.d.ts +1 -1
- package/dist/esm/hooks/reports/index.js +1 -1
- package/dist/esm/hooks/reports/index.js.map +1 -1
- package/dist/esm/hooks/reports/useFetchModeratedReports.d.ts +48 -0
- package/dist/esm/hooks/reports/{useFetchSpaceReports.js → useFetchModeratedReports.js} +19 -13
- package/dist/esm/hooks/reports/useFetchModeratedReports.js.map +1 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/hooks/reports/useFetchSpaceReports.d.ts +0 -39
- package/dist/cjs/hooks/reports/useFetchSpaceReports.js.map +0 -1
- package/dist/esm/hooks/reports/useFetchSpaceReports.d.ts +0 -39
- package/dist/esm/hooks/reports/useFetchSpaceReports.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as useCreateReport } from "./useCreateReport";
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as useFetchModeratedReports } from "./useFetchModeratedReports";
|
|
3
3
|
export { default as useHandleSpaceEntityReport } from "./useHandleSpaceEntityReport";
|
|
4
4
|
export { default as useHandleSpaceCommentReport } from "./useHandleSpaceCommentReport";
|
|
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useHandleSpaceCommentReport = exports.useHandleSpaceEntityReport = exports.
|
|
6
|
+
exports.useHandleSpaceCommentReport = exports.useHandleSpaceEntityReport = exports.useFetchModeratedReports = 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
|
|
10
|
-
Object.defineProperty(exports, "
|
|
9
|
+
var useFetchModeratedReports_1 = require("./useFetchModeratedReports");
|
|
10
|
+
Object.defineProperty(exports, "useFetchModeratedReports", { enumerable: true, get: function () { return __importDefault(useFetchModeratedReports_1).default; } });
|
|
11
11
|
var useHandleSpaceEntityReport_1 = require("./useHandleSpaceEntityReport");
|
|
12
12
|
Object.defineProperty(exports, "useHandleSpaceEntityReport", { enumerable: true, get: function () { return __importDefault(useHandleSpaceEntityReport_1).default; } });
|
|
13
13
|
var useHandleSpaceCommentReport_1 = require("./useHandleSpaceCommentReport");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/reports/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/reports/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC,uEAAiF;AAAxE,qJAAA,OAAO,OAA4B;AAC5C,2EAAqF;AAA5E,yJAAA,OAAO,OAA8B;AAC9C,6EAAuF;AAA9E,2JAAA,OAAO,OAA+B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
2
|
+
interface FetchModeratedReportsParams {
|
|
3
|
+
spaceId?: string;
|
|
4
|
+
targetType?: "Comment" | "Entity";
|
|
5
|
+
sortBy?: "new" | "old";
|
|
6
|
+
page?: number;
|
|
7
|
+
limit?: number;
|
|
8
|
+
}
|
|
9
|
+
interface Report {
|
|
10
|
+
id: string;
|
|
11
|
+
projectId: string;
|
|
12
|
+
spaceId: string | null;
|
|
13
|
+
reporters: string[];
|
|
14
|
+
targetId: string;
|
|
15
|
+
targetType: "Comment" | "Entity";
|
|
16
|
+
reason: string;
|
|
17
|
+
details: string | null;
|
|
18
|
+
status: "Pending" | "On Hold" | "Escalated" | "Dismissed" | "Actioned";
|
|
19
|
+
actionTaken: string | null;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
deletedAt: Date | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Hook to fetch reports for spaces the user can moderate
|
|
26
|
+
*
|
|
27
|
+
* If spaceId is provided, returns reports for that specific space
|
|
28
|
+
* If spaceId is omitted, returns reports from ALL spaces the user moderates
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* const fetchModeratedReports = useFetchModeratedReports();
|
|
32
|
+
*
|
|
33
|
+
* // Fetch reports for a specific space
|
|
34
|
+
* const reports = await fetchModeratedReports({
|
|
35
|
+
* spaceId: "space-uuid",
|
|
36
|
+
* targetType: "Entity",
|
|
37
|
+
* page: 1,
|
|
38
|
+
* limit: 20
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* // Fetch reports from ALL spaces the user moderates
|
|
42
|
+
* const allReports = await fetchModeratedReports({
|
|
43
|
+
* page: 1,
|
|
44
|
+
* limit: 20
|
|
45
|
+
* });
|
|
46
|
+
*/
|
|
47
|
+
declare function useFetchModeratedReports(): ({ spaceId, targetType, sortBy, page, limit, }: FetchModeratedReportsParams) => Promise<PaginatedResponse<Report>>;
|
|
48
|
+
export default useFetchModeratedReports;
|
|
@@ -43,24 +43,33 @@ var react_1 = require("react");
|
|
|
43
43
|
var useProject_1 = __importDefault(require("../projects/useProject"));
|
|
44
44
|
var useAxiosPrivate_1 = __importDefault(require("../../config/useAxiosPrivate"));
|
|
45
45
|
/**
|
|
46
|
-
* Hook to fetch reports for
|
|
47
|
-
*
|
|
46
|
+
* Hook to fetch reports for spaces the user can moderate
|
|
47
|
+
*
|
|
48
|
+
* If spaceId is provided, returns reports for that specific space
|
|
49
|
+
* If spaceId is omitted, returns reports from ALL spaces the user moderates
|
|
48
50
|
*
|
|
49
51
|
* @example
|
|
50
|
-
* const
|
|
52
|
+
* const fetchModeratedReports = useFetchModeratedReports();
|
|
51
53
|
*
|
|
52
|
-
*
|
|
54
|
+
* // Fetch reports for a specific space
|
|
55
|
+
* const reports = await fetchModeratedReports({
|
|
53
56
|
* spaceId: "space-uuid",
|
|
54
57
|
* targetType: "Entity",
|
|
55
58
|
* page: 1,
|
|
56
59
|
* limit: 20
|
|
57
60
|
* });
|
|
61
|
+
*
|
|
62
|
+
* // Fetch reports from ALL spaces the user moderates
|
|
63
|
+
* const allReports = await fetchModeratedReports({
|
|
64
|
+
* page: 1,
|
|
65
|
+
* limit: 20
|
|
66
|
+
* });
|
|
58
67
|
*/
|
|
59
|
-
function
|
|
68
|
+
function useFetchModeratedReports() {
|
|
60
69
|
var _this = this;
|
|
61
70
|
var projectId = (0, useProject_1.default)().projectId;
|
|
62
71
|
var axios = (0, useAxiosPrivate_1.default)();
|
|
63
|
-
var
|
|
72
|
+
var fetchModeratedReports = (0, react_1.useCallback)(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
64
73
|
var response;
|
|
65
74
|
var spaceId = _b.spaceId, targetType = _b.targetType, sortBy = _b.sortBy, page = _b.page, limit = _b.limit;
|
|
66
75
|
return __generator(this, function (_c) {
|
|
@@ -69,17 +78,14 @@ function useFetchSpaceReports() {
|
|
|
69
78
|
if (!projectId) {
|
|
70
79
|
throw new Error("No projectId available.");
|
|
71
80
|
}
|
|
72
|
-
|
|
73
|
-
throw new Error("Please pass a spaceId");
|
|
74
|
-
}
|
|
75
|
-
return [4 /*yield*/, axios.get("/".concat(projectId, "/spaces/").concat(spaceId, "/reports"), { params: { targetType: targetType, sortBy: sortBy, page: page, limit: limit } })];
|
|
81
|
+
return [4 /*yield*/, axios.get("/".concat(projectId, "/reports/moderated"), { params: { spaceId: spaceId, targetType: targetType, sortBy: sortBy, page: page, limit: limit } })];
|
|
76
82
|
case 1:
|
|
77
83
|
response = _c.sent();
|
|
78
84
|
return [2 /*return*/, response.data];
|
|
79
85
|
}
|
|
80
86
|
});
|
|
81
87
|
}); }, [projectId, axios]);
|
|
82
|
-
return
|
|
88
|
+
return fetchModeratedReports;
|
|
83
89
|
}
|
|
84
|
-
exports.default =
|
|
85
|
-
//# sourceMappingURL=
|
|
90
|
+
exports.default = useFetchModeratedReports;
|
|
91
|
+
//# sourceMappingURL=useFetchModeratedReports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchModeratedReports.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useFetchModeratedReports.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,sEAAgD;AAChD,iFAA2D;AA2B3D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAS,wBAAwB;IAAjC,iBA2BC;IA1BS,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IACnC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEhC,IAAM,qBAAqB,GAAG,IAAA,mBAAW,EACvC,gEAAO,EAMuB;;YAL5B,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;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,uBAAoB,EACjC,EAAE,MAAM,EAAE,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,MAAM,QAAA,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE,EAAE,CACzD,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAI,EAAC;;;SACtB,EACD,CAAC,SAAS,EAAE,KAAK,CAAC,CACnB,CAAC;IAEF,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAED,kBAAe,wBAAwB,CAAC"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export { useFetchUser, useFetchUserByForeignId, useFetchUserByUsername, useCheck
|
|
|
24
24
|
export { useFetchFollowStatus, useFetchFollowers, useFetchFollowersByUserId, useFetchFollowersCount, useFetchFollowersCountByUserId, useFetchFollowing, useFetchFollowingByUserId, useFetchFollowingCount, useFetchFollowingCountByUserId, useFollowManager, useFollowUser, useUnfollowByFollowId, useUnfollowUserByUserId, } from "./hooks/relationships/follows";
|
|
25
25
|
export { useRequestConnection, useAcceptConnection, useDeclineConnection, useRemoveConnection, useFetchConnections, useFetchConnectionStatus, useRemoveConnectionByUserId, useFetchConnectionsCount, useFetchSentPendingConnections, useFetchReceivedPendingConnections, useFetchConnectionsByUserId, useFetchConnectionsCountByUserId, useConnectionManager, } from "./hooks/relationships/connections";
|
|
26
26
|
export { useCreateReport } from "./hooks/reports";
|
|
27
|
-
export {
|
|
27
|
+
export { useFetchModeratedReports } from "./hooks/reports";
|
|
28
28
|
export { useHandleSpaceEntityReport } from "./hooks/reports";
|
|
29
29
|
export { useHandleSpaceCommentReport } from "./hooks/reports";
|
|
30
30
|
export { useGetMetadata } from "./hooks/utils";
|
package/dist/cjs/index.js
CHANGED
|
@@ -38,7 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.useFetchSpaceBreadcrumb = exports.useFetchSpaceBySlug = exports.useFetchSpaceByShortId = exports.useFetchSpace = exports.useSpaceData = exports.useSpace = exports.useEntityListActions = exports.useEntityList = exports.useUpdateEntity = exports.useFetchManyEntitiesWrapper = exports.useIncrementEntityViews = exports.useFetchManyEntities = exports.useFetchEntityByShortId = exports.useFetchEntityByForeignId = exports.useFetchEntity = exports.useDeleteEntity = exports.useCreateEntity = exports.useEntityData = exports.useEntity = exports.useCollectionEntitiesWrapper = exports.useIsEntityInCollection = exports.useCollectionsActions = exports.useCollections = exports.useAppNotificationsActions = exports.useAppNotifications = exports.useUserActions = exports.useUser = exports.useAuth = exports.useSignTestingJwt = exports.useProjectData = exports.useProject = exports.replykeApi = exports.replykeMiddleware = exports.replykeApiReducer = exports.replykeReducers = exports.SpaceProvider = exports.CommentSectionProvider = exports.EntityProvider = exports.ReplykeIntegrationProvider = exports.ReplykeProvider = exports.reportReasons = exports.getEnvVar = exports.getApiBaseUrl = exports.isProduction = exports.isDevelopment = exports.getPublicFileUrl = exports.getUserName = exports.safeMergeStyleProps = exports.keywordHelpers = exports.handleError = void 0;
|
|
40
40
|
exports.useFetchFollowers = exports.useFetchFollowStatus = exports.useMentions = exports.useFetchUserSuggestions = exports.useCheckUsernameAvailability = exports.useFetchUserByUsername = exports.useFetchUserByForeignId = exports.useFetchUser = exports.useReactionToggle = exports.useRemoveReaction = exports.useAddReaction = exports.useFetchCommentReactionsWrapper = exports.useFetchEntityReactionsWrapper = exports.useFetchCommentReactions = exports.useFetchEntityReactions = exports.useFetchManyCommentsWrapper = exports.useEntityComments = exports.useDeleteComment = exports.useUpdateComment = exports.useReplies = exports.useFetchCommentByForeignId = exports.useFetchComment = exports.useFetchManyComments = exports.useCreateComment = exports.useCommentSectionData = exports.useCommentSection = exports.useSpaceListActions = exports.useSpaceList = exports.useReorderRules = exports.useFetchManyRules = exports.useFetchRule = exports.useDeleteRule = exports.useUpdateRule = exports.useCreateRule = exports.useSpacePermissions = exports.useRemoveMember = exports.useDeclineMember = exports.useApproveMember = exports.useUpdateMemberRole = exports.useFetchUserSpaces = exports.useFetchSpaceTeam = exports.useFetchSpaceMembers = exports.useLeaveSpace = exports.useJoinSpace = exports.useDeleteSpace = exports.useUpdateSpace = exports.useCreateSpace = exports.useCheckSlugAvailability = exports.useFetchManySpaces = exports.useFetchSpaceChildren = void 0;
|
|
41
|
-
exports.validateSortType = exports.validateMetadataPropertyName = exports.validateSortBy = exports.AppNotification = exports.useUploadImage = exports.useUploadFile = exports.useGetMetadata = exports.useHandleSpaceCommentReport = exports.useHandleSpaceEntityReport = exports.
|
|
41
|
+
exports.validateSortType = exports.validateMetadataPropertyName = exports.validateSortBy = exports.AppNotification = exports.useUploadImage = exports.useUploadFile = exports.useGetMetadata = exports.useHandleSpaceCommentReport = exports.useHandleSpaceEntityReport = exports.useFetchModeratedReports = exports.useCreateReport = exports.useConnectionManager = exports.useFetchConnectionsCountByUserId = exports.useFetchConnectionsByUserId = exports.useFetchReceivedPendingConnections = exports.useFetchSentPendingConnections = exports.useFetchConnectionsCount = exports.useRemoveConnectionByUserId = exports.useFetchConnectionStatus = exports.useFetchConnections = exports.useRemoveConnection = exports.useDeclineConnection = exports.useAcceptConnection = exports.useRequestConnection = exports.useUnfollowUserByUserId = exports.useUnfollowByFollowId = exports.useFollowUser = exports.useFollowManager = exports.useFetchFollowingCountByUserId = exports.useFetchFollowingCount = exports.useFetchFollowingByUserId = exports.useFetchFollowing = exports.useFetchFollowersCountByUserId = exports.useFetchFollowersCount = exports.useFetchFollowersByUserId = void 0;
|
|
42
42
|
// Helpers & Utilities
|
|
43
43
|
var handleError_1 = require("./utils/handleError");
|
|
44
44
|
Object.defineProperty(exports, "handleError", { enumerable: true, get: function () { return handleError_1.handleError; } });
|
|
@@ -211,7 +211,7 @@ Object.defineProperty(exports, "useConnectionManager", { enumerable: true, get:
|
|
|
211
211
|
var reports_1 = require("./hooks/reports");
|
|
212
212
|
Object.defineProperty(exports, "useCreateReport", { enumerable: true, get: function () { return reports_1.useCreateReport; } });
|
|
213
213
|
var reports_2 = require("./hooks/reports");
|
|
214
|
-
Object.defineProperty(exports, "
|
|
214
|
+
Object.defineProperty(exports, "useFetchModeratedReports", { enumerable: true, get: function () { return reports_2.useFetchModeratedReports; } });
|
|
215
215
|
var reports_3 = require("./hooks/reports");
|
|
216
216
|
Object.defineProperty(exports, "useHandleSpaceEntityReport", { enumerable: true, get: function () { return reports_3.useHandleSpaceEntityReport; } });
|
|
217
217
|
var reports_4 = require("./hooks/reports");
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAAsB;AACtB,mDAAkD;AAAzC,0GAAA,WAAW,OAAA;AACpB,yDAAwD;AAA/C,gHAAA,cAAc,OAAA;AACvB,qEAAoE;AAA3D,0HAAA,mBAAmB,OAAA;AAC5B,qDAAoD;AAA3C,0GAAA,WAAW,OAAA;AACpB,+DAAyE;AAAhE,qIAAA,OAAO,OAAoB;AACpC,mCAKqB;AAJnB,oGAAA,aAAa,OAAA;AACb,mGAAA,YAAY,OAAA;AACZ,oGAAA,aAAa,OAAA;AACb,gGAAA,SAAS,OAAA;AAGX,YAAY;AACZ,2DAA0D;AAAjD,8GAAA,aAAa,OAAA;AAGtB,+CAA+C;AAC/C,qCAMmB;AALjB,0GAAA,eAAe,OAAA;AACf,qHAAA,0BAA0B,OAAA;AAC1B,yGAAA,cAAc,OAAA;AACd,iHAAA,sBAAsB,OAAA;AACtB,wGAAA,aAAa,OAAA;AAGf,kEAAkE;AAClE,mDAM6B;AAL3B,8GAAA,eAAe,OAAA;AACf,gHAAA,iBAAiB,OAAA;AACjB,gHAAA,iBAAiB,OAAA;AACj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HAAA,oBAAoB,OAAA;AAGtB,aAAa;AACb,2CAAkD;AAAzC,0GAAA,eAAe,OAAA;AACxB,2CAA2D;AAAlD,mHAAA,wBAAwB,OAAA;AACjC,2CAA6D;AAApD,qHAAA,0BAA0B,OAAA;AACnC,2CAA8D;AAArD,sHAAA,2BAA2B,OAAA;AAEpC,aAAa;AACb,uCAA+C;AAAtC,uGAAA,cAAc,OAAA;AAEvB,aAAa;AACb,2CAAgE;AAAvD,wGAAA,aAAa,OAAA;AAAE,yGAAA,cAAc,OAAA;AAiBtC,uFAAuE;AAiEvE,gFAI8C;AAH5C,yHAAA,cAAc,OAAA;AACd,uIAAA,4BAA4B,OAAA;AAC5B,2HAAA,gBAAgB,OAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as useCreateReport } from "./useCreateReport";
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as useFetchModeratedReports } from "./useFetchModeratedReports";
|
|
3
3
|
export { default as useHandleSpaceEntityReport } from "./useHandleSpaceEntityReport";
|
|
4
4
|
export { default as useHandleSpaceCommentReport } from "./useHandleSpaceCommentReport";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as useCreateReport } from "./useCreateReport";
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as useFetchModeratedReports } from "./useFetchModeratedReports";
|
|
3
3
|
export { default as useHandleSpaceEntityReport } from "./useHandleSpaceEntityReport";
|
|
4
4
|
export { default as useHandleSpaceCommentReport } from "./useHandleSpaceCommentReport";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/reports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/reports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
2
|
+
interface FetchModeratedReportsParams {
|
|
3
|
+
spaceId?: string;
|
|
4
|
+
targetType?: "Comment" | "Entity";
|
|
5
|
+
sortBy?: "new" | "old";
|
|
6
|
+
page?: number;
|
|
7
|
+
limit?: number;
|
|
8
|
+
}
|
|
9
|
+
interface Report {
|
|
10
|
+
id: string;
|
|
11
|
+
projectId: string;
|
|
12
|
+
spaceId: string | null;
|
|
13
|
+
reporters: string[];
|
|
14
|
+
targetId: string;
|
|
15
|
+
targetType: "Comment" | "Entity";
|
|
16
|
+
reason: string;
|
|
17
|
+
details: string | null;
|
|
18
|
+
status: "Pending" | "On Hold" | "Escalated" | "Dismissed" | "Actioned";
|
|
19
|
+
actionTaken: string | null;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
deletedAt: Date | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Hook to fetch reports for spaces the user can moderate
|
|
26
|
+
*
|
|
27
|
+
* If spaceId is provided, returns reports for that specific space
|
|
28
|
+
* If spaceId is omitted, returns reports from ALL spaces the user moderates
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* const fetchModeratedReports = useFetchModeratedReports();
|
|
32
|
+
*
|
|
33
|
+
* // Fetch reports for a specific space
|
|
34
|
+
* const reports = await fetchModeratedReports({
|
|
35
|
+
* spaceId: "space-uuid",
|
|
36
|
+
* targetType: "Entity",
|
|
37
|
+
* page: 1,
|
|
38
|
+
* limit: 20
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* // Fetch reports from ALL spaces the user moderates
|
|
42
|
+
* const allReports = await fetchModeratedReports({
|
|
43
|
+
* page: 1,
|
|
44
|
+
* limit: 20
|
|
45
|
+
* });
|
|
46
|
+
*/
|
|
47
|
+
declare function useFetchModeratedReports(): ({ spaceId, targetType, sortBy, page, limit, }: FetchModeratedReportsParams) => Promise<PaginatedResponse<Report>>;
|
|
48
|
+
export default useFetchModeratedReports;
|
|
@@ -38,24 +38,33 @@ import { useCallback } from "react";
|
|
|
38
38
|
import useProject from "../projects/useProject";
|
|
39
39
|
import useAxiosPrivate from "../../config/useAxiosPrivate";
|
|
40
40
|
/**
|
|
41
|
-
* Hook to fetch reports for
|
|
42
|
-
*
|
|
41
|
+
* Hook to fetch reports for spaces the user can moderate
|
|
42
|
+
*
|
|
43
|
+
* If spaceId is provided, returns reports for that specific space
|
|
44
|
+
* If spaceId is omitted, returns reports from ALL spaces the user moderates
|
|
43
45
|
*
|
|
44
46
|
* @example
|
|
45
|
-
* const
|
|
47
|
+
* const fetchModeratedReports = useFetchModeratedReports();
|
|
46
48
|
*
|
|
47
|
-
*
|
|
49
|
+
* // Fetch reports for a specific space
|
|
50
|
+
* const reports = await fetchModeratedReports({
|
|
48
51
|
* spaceId: "space-uuid",
|
|
49
52
|
* targetType: "Entity",
|
|
50
53
|
* page: 1,
|
|
51
54
|
* limit: 20
|
|
52
55
|
* });
|
|
56
|
+
*
|
|
57
|
+
* // Fetch reports from ALL spaces the user moderates
|
|
58
|
+
* const allReports = await fetchModeratedReports({
|
|
59
|
+
* page: 1,
|
|
60
|
+
* limit: 20
|
|
61
|
+
* });
|
|
53
62
|
*/
|
|
54
|
-
function
|
|
63
|
+
function useFetchModeratedReports() {
|
|
55
64
|
var _this = this;
|
|
56
65
|
var projectId = useProject().projectId;
|
|
57
66
|
var axios = useAxiosPrivate();
|
|
58
|
-
var
|
|
67
|
+
var fetchModeratedReports = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
59
68
|
var response;
|
|
60
69
|
var spaceId = _b.spaceId, targetType = _b.targetType, sortBy = _b.sortBy, page = _b.page, limit = _b.limit;
|
|
61
70
|
return __generator(this, function (_c) {
|
|
@@ -64,17 +73,14 @@ function useFetchSpaceReports() {
|
|
|
64
73
|
if (!projectId) {
|
|
65
74
|
throw new Error("No projectId available.");
|
|
66
75
|
}
|
|
67
|
-
|
|
68
|
-
throw new Error("Please pass a spaceId");
|
|
69
|
-
}
|
|
70
|
-
return [4 /*yield*/, axios.get("/".concat(projectId, "/spaces/").concat(spaceId, "/reports"), { params: { targetType: targetType, sortBy: sortBy, page: page, limit: limit } })];
|
|
76
|
+
return [4 /*yield*/, axios.get("/".concat(projectId, "/reports/moderated"), { params: { spaceId: spaceId, targetType: targetType, sortBy: sortBy, page: page, limit: limit } })];
|
|
71
77
|
case 1:
|
|
72
78
|
response = _c.sent();
|
|
73
79
|
return [2 /*return*/, response.data];
|
|
74
80
|
}
|
|
75
81
|
});
|
|
76
82
|
}); }, [projectId, axios]);
|
|
77
|
-
return
|
|
83
|
+
return fetchModeratedReports;
|
|
78
84
|
}
|
|
79
|
-
export default
|
|
80
|
-
//# sourceMappingURL=
|
|
85
|
+
export default useFetchModeratedReports;
|
|
86
|
+
//# sourceMappingURL=useFetchModeratedReports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchModeratedReports.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useFetchModeratedReports.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AA2B3D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAS,wBAAwB;IAAjC,iBA2BC;IA1BS,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IACnC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,IAAM,qBAAqB,GAAG,WAAW,CACvC,gEAAO,EAMuB;;YAL5B,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;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,uBAAoB,EACjC,EAAE,MAAM,EAAE,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,MAAM,QAAA,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE,EAAE,CACzD,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAI,EAAC;;;SACtB,EACD,CAAC,SAAS,EAAE,KAAK,CAAC,CACnB,CAAC;IAEF,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAED,eAAe,wBAAwB,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export { useFetchUser, useFetchUserByForeignId, useFetchUserByUsername, useCheck
|
|
|
24
24
|
export { useFetchFollowStatus, useFetchFollowers, useFetchFollowersByUserId, useFetchFollowersCount, useFetchFollowersCountByUserId, useFetchFollowing, useFetchFollowingByUserId, useFetchFollowingCount, useFetchFollowingCountByUserId, useFollowManager, useFollowUser, useUnfollowByFollowId, useUnfollowUserByUserId, } from "./hooks/relationships/follows";
|
|
25
25
|
export { useRequestConnection, useAcceptConnection, useDeclineConnection, useRemoveConnection, useFetchConnections, useFetchConnectionStatus, useRemoveConnectionByUserId, useFetchConnectionsCount, useFetchSentPendingConnections, useFetchReceivedPendingConnections, useFetchConnectionsByUserId, useFetchConnectionsCountByUserId, useConnectionManager, } from "./hooks/relationships/connections";
|
|
26
26
|
export { useCreateReport } from "./hooks/reports";
|
|
27
|
-
export {
|
|
27
|
+
export { useFetchModeratedReports } from "./hooks/reports";
|
|
28
28
|
export { useHandleSpaceEntityReport } from "./hooks/reports";
|
|
29
29
|
export { useHandleSpaceCommentReport } from "./hooks/reports";
|
|
30
30
|
export { useGetMetadata } from "./hooks/utils";
|
package/dist/esm/index.js
CHANGED
|
@@ -45,7 +45,7 @@ export { useFetchFollowStatus, useFetchFollowers, useFetchFollowersByUserId, use
|
|
|
45
45
|
export { useRequestConnection, useAcceptConnection, useDeclineConnection, useRemoveConnection, useFetchConnections, useFetchConnectionStatus, useRemoveConnectionByUserId, useFetchConnectionsCount, useFetchSentPendingConnections, useFetchReceivedPendingConnections, useFetchConnectionsByUserId, useFetchConnectionsCountByUserId, useConnectionManager, } from "./hooks/relationships/connections";
|
|
46
46
|
// -- reports
|
|
47
47
|
export { useCreateReport } from "./hooks/reports";
|
|
48
|
-
export {
|
|
48
|
+
export { useFetchModeratedReports } from "./hooks/reports";
|
|
49
49
|
export { useHandleSpaceEntityReport } from "./hooks/reports";
|
|
50
50
|
export { useHandleSpaceCommentReport } from "./hooks/reports";
|
|
51
51
|
// -- general
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,aAAa,EACb,SAAS,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L,YAAY,EACZ,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,uBAAuB,EACvB,WAAW,GACZ,MAAM,eAAe,CAAC;AAEvB,aAAa;AACb,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,8BAA8B,EAC9B,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,+BAA+B,CAAC;AAEvC,iBAAiB;AACjB,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,EAC3B,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,gCAAgC,EAChC,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAE3C,aAAa;AACb,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE9D,aAAa;AACb,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,aAAa;AACb,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAiBhE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AAiEvE,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,gBAAgB,GACjB,MAAM,sCAAsC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
2
|
-
interface FetchSpaceReportsParams {
|
|
3
|
-
spaceId: string;
|
|
4
|
-
targetType?: "Comment" | "Entity";
|
|
5
|
-
sortBy?: "new" | "old";
|
|
6
|
-
page?: number;
|
|
7
|
-
limit?: number;
|
|
8
|
-
}
|
|
9
|
-
interface Report {
|
|
10
|
-
id: string;
|
|
11
|
-
projectId: string;
|
|
12
|
-
spaceId: string | null;
|
|
13
|
-
reporters: string[];
|
|
14
|
-
targetId: string;
|
|
15
|
-
targetType: "Comment" | "Entity";
|
|
16
|
-
reason: string;
|
|
17
|
-
details: string | null;
|
|
18
|
-
status: "Pending" | "On Hold" | "Escalated" | "Dismissed" | "Actioned";
|
|
19
|
-
actionTaken: string | null;
|
|
20
|
-
createdAt: Date;
|
|
21
|
-
updatedAt: Date;
|
|
22
|
-
deletedAt: Date | null;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Hook to fetch reports for a specific space
|
|
26
|
-
* Only accessible by space moderators/admins
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* const fetchSpaceReports = useFetchSpaceReports();
|
|
30
|
-
*
|
|
31
|
-
* const reports = await fetchSpaceReports({
|
|
32
|
-
* spaceId: "space-uuid",
|
|
33
|
-
* targetType: "Entity",
|
|
34
|
-
* page: 1,
|
|
35
|
-
* limit: 20
|
|
36
|
-
* });
|
|
37
|
-
*/
|
|
38
|
-
declare function useFetchSpaceReports(): ({ spaceId, targetType, sortBy, page, limit, }: FetchSpaceReportsParams) => Promise<PaginatedResponse<Report>>;
|
|
39
|
-
export default useFetchSpaceReports;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchSpaceReports.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useFetchSpaceReports.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,sEAAgD;AAChD,iFAA2D;AA2B3D;;;;;;;;;;;;;GAaG;AACH,SAAS,oBAAoB;IAA7B,iBA+BC;IA9BS,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;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,qBAAW,OAAO,aAAU,EACzC,EAAE,MAAM,EAAE,EAAE,UAAU,YAAA,EAAE,MAAM,QAAA,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE,EAAE,CAChD,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAI,EAAC;;;SACtB,EACD,CAAC,SAAS,EAAE,KAAK,CAAC,CACnB,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,kBAAe,oBAAoB,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
2
|
-
interface FetchSpaceReportsParams {
|
|
3
|
-
spaceId: string;
|
|
4
|
-
targetType?: "Comment" | "Entity";
|
|
5
|
-
sortBy?: "new" | "old";
|
|
6
|
-
page?: number;
|
|
7
|
-
limit?: number;
|
|
8
|
-
}
|
|
9
|
-
interface Report {
|
|
10
|
-
id: string;
|
|
11
|
-
projectId: string;
|
|
12
|
-
spaceId: string | null;
|
|
13
|
-
reporters: string[];
|
|
14
|
-
targetId: string;
|
|
15
|
-
targetType: "Comment" | "Entity";
|
|
16
|
-
reason: string;
|
|
17
|
-
details: string | null;
|
|
18
|
-
status: "Pending" | "On Hold" | "Escalated" | "Dismissed" | "Actioned";
|
|
19
|
-
actionTaken: string | null;
|
|
20
|
-
createdAt: Date;
|
|
21
|
-
updatedAt: Date;
|
|
22
|
-
deletedAt: Date | null;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Hook to fetch reports for a specific space
|
|
26
|
-
* Only accessible by space moderators/admins
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* const fetchSpaceReports = useFetchSpaceReports();
|
|
30
|
-
*
|
|
31
|
-
* const reports = await fetchSpaceReports({
|
|
32
|
-
* spaceId: "space-uuid",
|
|
33
|
-
* targetType: "Entity",
|
|
34
|
-
* page: 1,
|
|
35
|
-
* limit: 20
|
|
36
|
-
* });
|
|
37
|
-
*/
|
|
38
|
-
declare function useFetchSpaceReports(): ({ spaceId, targetType, sortBy, page, limit, }: FetchSpaceReportsParams) => Promise<PaginatedResponse<Report>>;
|
|
39
|
-
export default useFetchSpaceReports;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchSpaceReports.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useFetchSpaceReports.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AA2B3D;;;;;;;;;;;;;GAaG;AACH,SAAS,oBAAoB;IAA7B,iBA+BC;IA9BS,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IACnC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,IAAM,iBAAiB,GAAG,WAAW,CACnC,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;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,qBAAW,OAAO,aAAU,EACzC,EAAE,MAAM,EAAE,EAAE,UAAU,YAAA,EAAE,MAAM,QAAA,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE,EAAE,CAChD,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAI,EAAC;;;SACtB,EACD,CAAC,SAAS,EAAE,KAAK,CAAC,CACnB,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,eAAe,oBAAoB,CAAC"}
|