strapi-plugin-comments 2.0.8 → 2.0.11
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/README.md +45 -11
- package/admin/src/translations/en.json +1 -0
- package/admin/src/translations/fr.json +132 -1
- package/admin/src/translations/pt-BR.json +132 -0
- package/build/README.md +818 -0
- package/build/admin/src/components/ActionButton/styles.d.ts +2 -0
- package/build/admin/src/components/ActionButton/styles.js +17 -0
- package/build/admin/src/components/ConfirmationDialog/index.d.ts +26 -0
- package/build/admin/src/components/ConfirmationDialog/index.js +104 -0
- package/build/admin/src/components/DiscussionStatus/index.d.ts +9 -0
- package/build/admin/src/components/DiscussionStatus/index.js +38 -0
- package/build/admin/src/components/DiscussionThread/index.d.ts +16 -0
- package/build/admin/src/components/DiscussionThread/index.js +99 -0
- package/build/admin/src/components/DiscussionThreadItem/index.d.ts +9 -0
- package/build/admin/src/components/DiscussionThreadItem/index.js +72 -0
- package/build/admin/src/components/DiscussionThreadItem/styles.d.ts +4 -0
- package/build/admin/src/components/DiscussionThreadItem/styles.js +27 -0
- package/build/admin/src/components/DiscussionThreadItemActions/index.d.ts +19 -0
- package/build/admin/src/components/DiscussionThreadItemActions/index.js +414 -0
- package/build/admin/src/components/DiscussionThreadItemActions/styles.d.ts +2 -0
- package/build/admin/src/components/DiscussionThreadItemActions/styles.js +17 -0
- package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +17 -0
- package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +103 -0
- package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +2 -0
- package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.js +15 -0
- package/build/admin/src/components/DiscussionThreadItemFooter/index.d.ts +16 -0
- package/build/admin/src/components/DiscussionThreadItemFooter/index.js +73 -0
- package/build/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +3 -0
- package/build/admin/src/components/DiscussionThreadItemFooter/styles.js +25 -0
- package/build/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +30 -0
- package/build/admin/src/components/DiscussionThreadItemReviewAction/index.js +233 -0
- package/build/admin/src/components/FormSwitch/index.d.ts +11 -0
- package/build/admin/src/components/FormSwitch/index.js +39 -0
- package/build/admin/src/components/FormSwitch/styles.d.ts +2 -0
- package/build/admin/src/components/FormSwitch/styles.js +16 -0
- package/build/admin/src/components/IconButton/styles.d.ts +2 -0
- package/build/admin/src/components/IconButton/styles.js +27 -0
- package/build/admin/src/components/Initializer/index.d.ts +3 -0
- package/build/admin/src/components/Initializer/index.js +14 -0
- package/build/admin/src/components/LoadingIndicatorOverlay/index.d.ts +3 -0
- package/build/admin/src/components/LoadingIndicatorOverlay/index.js +18 -0
- package/build/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +3 -0
- package/build/admin/src/components/LoadingIndicatorOverlay/styles.js +32 -0
- package/build/admin/src/components/Nav/index.d.ts +7 -0
- package/build/admin/src/components/Nav/index.js +72 -0
- package/build/admin/src/components/PluginIcon/index.d.ts +3 -0
- package/build/admin/src/components/PluginIcon/index.js +13 -0
- package/build/admin/src/components/ReportsReviewModal/index.d.ts +21 -0
- package/build/admin/src/components/ReportsReviewModal/index.js +72 -0
- package/build/admin/src/components/ReportsReviewTable/index.d.ts +21 -0
- package/build/admin/src/components/ReportsReviewTable/index.js +321 -0
- package/build/admin/src/components/StatusBadge/index.d.ts +11 -0
- package/build/admin/src/components/StatusBadge/index.js +22 -0
- package/build/admin/src/components/StatusBadge/styles.d.ts +2 -0
- package/build/admin/src/components/StatusBadge/styles.js +25 -0
- package/build/admin/src/components/TableFilters/index.d.ts +10 -0
- package/build/admin/src/components/TableFilters/index.js +109 -0
- package/build/admin/src/components/TablePagination/index.d.ts +15 -0
- package/build/admin/src/components/TablePagination/index.js +45 -0
- package/build/admin/src/components/icons/comments.d.ts +9 -0
- package/build/admin/src/components/icons/comments.js +23 -0
- package/build/admin/src/components/icons/index.d.ts +6 -0
- package/build/admin/src/components/icons/index.js +21 -0
- package/build/admin/src/components/icons/lock.d.ts +11 -0
- package/build/admin/src/components/icons/lock.js +29 -0
- package/build/admin/src/components/icons/review.d.ts +11 -0
- package/build/admin/src/components/icons/review.js +31 -0
- package/build/admin/src/components/icons/unlock.d.ts +11 -0
- package/build/admin/src/components/icons/unlock.js +29 -0
- package/build/admin/src/hooks/useConfig.d.ts +8 -0
- package/build/admin/src/hooks/useConfig.js +52 -0
- package/build/admin/src/index.d.ts +7 -0
- package/build/admin/src/index.js +137 -0
- package/build/admin/src/pages/App/index.d.ts +4 -0
- package/build/admin/src/pages/App/index.js +90 -0
- package/build/admin/src/pages/App/reducer/actions.d.ts +8 -0
- package/build/admin/src/pages/App/reducer/actions.js +12 -0
- package/build/admin/src/pages/App/reducer/constants.d.ts +4 -0
- package/build/admin/src/pages/App/reducer/constants.js +7 -0
- package/build/admin/src/pages/App/reducer/index.d.ts +14 -0
- package/build/admin/src/pages/App/reducer/index.js +31 -0
- package/build/admin/src/pages/App/reducer/init.d.ts +3 -0
- package/build/admin/src/pages/App/reducer/init.js +9 -0
- package/build/admin/src/pages/App/reducer/selectors.d.ts +6 -0
- package/build/admin/src/pages/App/reducer/selectors.js +20 -0
- package/build/admin/src/pages/App/utils/api.d.ts +2 -0
- package/build/admin/src/pages/App/utils/api.js +16 -0
- package/build/admin/src/pages/ComingSoonPage/index.d.ts +3 -0
- package/build/admin/src/pages/ComingSoonPage/index.js +78 -0
- package/build/admin/src/pages/Details/components/DetailsEntity/index.d.ts +18 -0
- package/build/admin/src/pages/Details/components/DetailsEntity/index.js +132 -0
- package/build/admin/src/pages/Details/components/DetailsFilters/index.d.ts +12 -0
- package/build/admin/src/pages/Details/components/DetailsFilters/index.js +48 -0
- package/build/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +2 -0
- package/build/admin/src/pages/Details/components/DetailsFilters/styles.js +16 -0
- package/build/admin/src/pages/Details/index.d.ts +4 -0
- package/build/admin/src/pages/Details/index.js +216 -0
- package/build/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +20 -0
- package/build/admin/src/pages/Discover/components/DiscoverTableRow/index.js +344 -0
- package/build/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +2 -0
- package/build/admin/src/pages/Discover/components/DiscoverTableRow/styles.js +16 -0
- package/build/admin/src/pages/Discover/index.d.ts +4 -0
- package/build/admin/src/pages/Discover/index.js +332 -0
- package/build/admin/src/pages/Discover/utils/api.d.ts +2 -0
- package/build/admin/src/pages/Discover/utils/api.js +23 -0
- package/build/admin/src/pages/Discover/utils/filtersSchema.d.ts +11 -0
- package/build/admin/src/pages/Discover/utils/filtersSchema.js +11 -0
- package/build/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +2 -0
- package/build/admin/src/pages/Settings/components/RestartAlert/styles.js +16 -0
- package/build/admin/src/pages/Settings/index.d.ts +3 -0
- package/build/admin/src/pages/Settings/index.js +712 -0
- package/build/admin/src/pages/Settings/utils/api.d.ts +7 -0
- package/build/admin/src/pages/Settings/utils/api.js +80 -0
- package/build/admin/src/pages/utils/api.d.ts +12 -0
- package/build/admin/src/pages/utils/api.js +83 -0
- package/build/admin/src/permissions.d.ts +28 -0
- package/build/admin/src/permissions.js +65 -0
- package/build/admin/src/pluginId.d.ts +2 -0
- package/build/admin/src/pluginId.js +50 -0
- package/build/admin/src/reducers.d.ts +12 -0
- package/build/admin/src/reducers.js +14 -0
- package/build/admin/src/translations/en.json +132 -0
- package/build/admin/src/translations/fr.json +1 -0
- package/build/admin/src/translations/pt-BR.json +132 -0
- package/build/admin/src/utils/axiosInstance.d.ts +3 -0
- package/build/admin/src/utils/axiosInstance.js +37 -0
- package/build/admin/src/utils/constants.d.ts +25 -0
- package/build/admin/src/utils/constants.js +30 -0
- package/build/admin/src/utils/getApiUrl.d.ts +3 -0
- package/build/admin/src/utils/getApiUrl.js +6 -0
- package/build/admin/src/utils/getMessage.d.ts +4 -0
- package/build/admin/src/utils/getMessage.js +25 -0
- package/build/admin/src/utils/getRelatedGroups.d.ts +4 -0
- package/build/admin/src/utils/getRelatedGroups.js +6 -0
- package/build/admin/src/utils/getUrl.d.ts +3 -0
- package/build/admin/src/utils/getUrl.js +6 -0
- package/build/admin/src/utils/handleAPIError.d.ts +4 -0
- package/build/admin/src/utils/handleAPIError.js +20 -0
- package/build/admin/src/utils/index.d.ts +12 -0
- package/build/admin/src/utils/index.js +97 -0
- package/build/admin/src/utils/parseRegExp.d.ts +6 -0
- package/build/admin/src/utils/parseRegExp.js +11 -0
- package/build/admin/src/utils/renderEntryTitle.d.ts +4 -0
- package/build/admin/src/utils/renderEntryTitle.js +16 -0
- package/build/admin/src/utils/renderInitials.d.ts +3 -0
- package/build/admin/src/utils/renderInitials.js +11 -0
- package/build/admin/src/utils/resolveCommentStatus.d.ts +4 -0
- package/build/admin/src/utils/resolveCommentStatus.js +32 -0
- package/build/admin/src/utils/resolveCommentStatusColor.d.ts +4 -0
- package/build/admin/src/utils/resolveCommentStatusColor.js +22 -0
- package/build/content-types/comment.d.ts +91 -0
- package/build/content-types/comment.js +92 -0
- package/build/content-types/index.d.ts +143 -0
- package/build/content-types/index.js +18 -0
- package/build/content-types/report.d.ts +48 -0
- package/build/content-types/report.js +49 -0
- package/build/package.json +94 -0
- package/build/permissions.d.ts +18 -0
- package/build/permissions.js +18 -0
- package/build/server/bootstrap.d.ts +4 -0
- package/build/server/bootstrap.js +65 -0
- package/build/server/config/index.d.ts +4 -0
- package/build/server/config/index.js +19 -0
- package/build/server/controllers/admin.d.ts +4 -0
- package/build/server/controllers/admin.js +124 -0
- package/build/server/controllers/client.d.ts +4 -0
- package/build/server/controllers/client.js +111 -0
- package/build/server/controllers/index.d.ts +6 -0
- package/build/server/controllers/index.js +15 -0
- package/build/server/controllers/utils/functions.d.ts +7 -0
- package/build/server/controllers/utils/functions.js +24 -0
- package/build/server/controllers/utils/parsers.d.ts +15 -0
- package/build/server/controllers/utils/parsers.js +25 -0
- package/build/server/destroy.d.ts +3 -0
- package/build/server/destroy.js +3 -0
- package/build/server/graphql/index.d.ts +4 -0
- package/build/server/graphql/index.js +37 -0
- package/build/server/graphql/mutations/createAbuseReport.d.ts +11 -0
- package/build/server/graphql/mutations/createAbuseReport.js +27 -0
- package/build/server/graphql/mutations/createComment.d.ts +14 -0
- package/build/server/graphql/mutations/createComment.js +26 -0
- package/build/server/graphql/mutations/index.d.ts +4 -0
- package/build/server/graphql/mutations/index.js +28 -0
- package/build/server/graphql/mutations/removeComment.d.ts +11 -0
- package/build/server/graphql/mutations/removeComment.js +27 -0
- package/build/server/graphql/mutations/updateComment.d.ts +11 -0
- package/build/server/graphql/mutations/updateComment.js +27 -0
- package/build/server/graphql/queries/findAllFlat.d.ts +19 -0
- package/build/server/graphql/queries/findAllFlat.js +47 -0
- package/build/server/graphql/queries/findAllInHierarchy.d.ts +18 -0
- package/build/server/graphql/queries/findAllInHierarchy.js +38 -0
- package/build/server/graphql/queries/index.d.ts +4 -0
- package/build/server/graphql/queries/index.js +24 -0
- package/build/server/graphql/resolvers-config.d.ts +23 -0
- package/build/server/graphql/resolvers-config.js +13 -0
- package/build/server/graphql/types/comment-author.d.ts +4 -0
- package/build/server/graphql/types/comment-author.js +12 -0
- package/build/server/graphql/types/comment-nested.d.ts +4 -0
- package/build/server/graphql/types/comment-nested.js +19 -0
- package/build/server/graphql/types/comment.d.ts +4 -0
- package/build/server/graphql/types/comment.js +18 -0
- package/build/server/graphql/types/create-comment-author.d.ts +4 -0
- package/build/server/graphql/types/create-comment-author.js +12 -0
- package/build/server/graphql/types/create-comment.d.ts +4 -0
- package/build/server/graphql/types/create-comment.js +12 -0
- package/build/server/graphql/types/create-report.d.ts +4 -0
- package/build/server/graphql/types/create-report.js +12 -0
- package/build/server/graphql/types/id.d.ts +4 -0
- package/build/server/graphql/types/id.js +26 -0
- package/build/server/graphql/types/identify-comment-author.d.ts +4 -0
- package/build/server/graphql/types/identify-comment-author.js +9 -0
- package/build/server/graphql/types/index.d.ts +4 -0
- package/build/server/graphql/types/index.js +44 -0
- package/build/server/graphql/types/remove-comment.d.ts +4 -0
- package/build/server/graphql/types/remove-comment.js +11 -0
- package/build/server/graphql/types/report-reason.d.ts +4 -0
- package/build/server/graphql/types/report-reason.js +12 -0
- package/build/server/graphql/types/report.d.ts +4 -0
- package/build/server/graphql/types/report.js +14 -0
- package/build/server/graphql/types/response-find-all.d.ts +4 -0
- package/build/server/graphql/types/response-find-all.js +10 -0
- package/build/server/graphql/types/response-meta.d.ts +4 -0
- package/build/server/graphql/types/response-meta.js +9 -0
- package/build/server/graphql/types/response-pagination.d.ts +4 -0
- package/build/server/graphql/types/response-pagination.js +14 -0
- package/build/server/graphql/types/update-comment.d.ts +4 -0
- package/build/server/graphql/types/update-comment.js +12 -0
- package/build/server/index.d.ts +26 -0
- package/build/server/index.js +25 -0
- package/build/server/register.d.ts +3 -0
- package/build/server/register.js +3 -0
- package/build/server/routes/admin.d.ts +4 -0
- package/build/server/routes/admin.js +118 -0
- package/build/server/routes/client.d.ts +4 -0
- package/build/server/routes/client.js +54 -0
- package/build/server/routes/index.d.ts +11 -0
- package/build/server/routes/index.js +21 -0
- package/build/server/services/admin.d.ts +5 -0
- package/build/server/services/admin.js +296 -0
- package/build/server/services/client.d.ts +5 -0
- package/build/server/services/client.js +247 -0
- package/build/server/services/common.d.ts +5 -0
- package/build/server/services/common.js +266 -0
- package/build/server/services/graphql.d.ts +5 -0
- package/build/server/services/graphql.js +136 -0
- package/build/server/services/index.d.ts +8 -0
- package/build/server/services/index.js +16 -0
- package/build/server/services/utils/functions.d.ts +13 -0
- package/build/server/services/utils/functions.js +141 -0
- package/build/server/utils/constants.d.ts +9 -0
- package/build/server/utils/constants.js +23 -0
- package/build/server/utils/error.d.ts +23 -0
- package/build/server/utils/error.js +29 -0
- package/build/server/utils/functions.d.ts +14 -0
- package/build/server/utils/functions.js +50 -0
- package/build/strapi-admin.d.ts +3 -0
- package/build/strapi-admin.js +10 -0
- package/build/strapi-server.d.ts +177 -0
- package/build/strapi-server.js +46 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/types/contentTypes.d.ts +46 -0
- package/build/types/contentTypes.js +3 -0
- package/package.json +3 -3
- package/server/controllers/client.js +0 -3
- package/server/graphql/queries/findAllFlat.js +6 -2
- package/server/services/common.js +2 -2
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
comment: {
|
|
3
|
+
schema: {
|
|
4
|
+
info: {
|
|
5
|
+
tableName: string;
|
|
6
|
+
singularName: string;
|
|
7
|
+
pluralName: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
description: string;
|
|
10
|
+
kind: string;
|
|
11
|
+
};
|
|
12
|
+
options: {
|
|
13
|
+
draftAndPublish: boolean;
|
|
14
|
+
};
|
|
15
|
+
pluginOptions: {
|
|
16
|
+
"content-manager": {
|
|
17
|
+
visible: boolean;
|
|
18
|
+
};
|
|
19
|
+
"content-type-builder": {
|
|
20
|
+
visible: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
attributes: {
|
|
24
|
+
content: {
|
|
25
|
+
type: string;
|
|
26
|
+
configurable: boolean;
|
|
27
|
+
required: boolean;
|
|
28
|
+
};
|
|
29
|
+
blocked: {
|
|
30
|
+
type: string;
|
|
31
|
+
default: boolean;
|
|
32
|
+
configurable: boolean;
|
|
33
|
+
};
|
|
34
|
+
blockedThread: {
|
|
35
|
+
type: string;
|
|
36
|
+
default: boolean;
|
|
37
|
+
configurable: boolean;
|
|
38
|
+
};
|
|
39
|
+
blockReason: {
|
|
40
|
+
type: string;
|
|
41
|
+
configurable: boolean;
|
|
42
|
+
};
|
|
43
|
+
authorUser: {
|
|
44
|
+
type: string;
|
|
45
|
+
relation: string;
|
|
46
|
+
target: string;
|
|
47
|
+
configurable: boolean;
|
|
48
|
+
};
|
|
49
|
+
authorId: {
|
|
50
|
+
type: string;
|
|
51
|
+
configurable: boolean;
|
|
52
|
+
};
|
|
53
|
+
authorName: {
|
|
54
|
+
type: string;
|
|
55
|
+
configurable: boolean;
|
|
56
|
+
};
|
|
57
|
+
authorEmail: {
|
|
58
|
+
type: string;
|
|
59
|
+
configurable: boolean;
|
|
60
|
+
};
|
|
61
|
+
authorAvatar: {
|
|
62
|
+
type: string;
|
|
63
|
+
configurable: boolean;
|
|
64
|
+
};
|
|
65
|
+
removed: {
|
|
66
|
+
type: string;
|
|
67
|
+
configurable: boolean;
|
|
68
|
+
};
|
|
69
|
+
approvalStatus: {
|
|
70
|
+
type: string;
|
|
71
|
+
configurable: boolean;
|
|
72
|
+
};
|
|
73
|
+
related: {
|
|
74
|
+
type: string;
|
|
75
|
+
configurable: boolean;
|
|
76
|
+
};
|
|
77
|
+
reports: {
|
|
78
|
+
type: string;
|
|
79
|
+
relation: string;
|
|
80
|
+
target: string;
|
|
81
|
+
mappedBy: string;
|
|
82
|
+
configurable: boolean;
|
|
83
|
+
};
|
|
84
|
+
threadOf: {
|
|
85
|
+
type: string;
|
|
86
|
+
relation: string;
|
|
87
|
+
target: string;
|
|
88
|
+
configurable: boolean;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
"comment-report": {
|
|
94
|
+
schema: {
|
|
95
|
+
info: {
|
|
96
|
+
tableName: string;
|
|
97
|
+
singularName: string;
|
|
98
|
+
pluralName: string;
|
|
99
|
+
displayName: string;
|
|
100
|
+
description: string;
|
|
101
|
+
kind: string;
|
|
102
|
+
};
|
|
103
|
+
options: {
|
|
104
|
+
draftAndPublish: boolean;
|
|
105
|
+
};
|
|
106
|
+
pluginOptions: {
|
|
107
|
+
"content-manager": {
|
|
108
|
+
visible: boolean;
|
|
109
|
+
};
|
|
110
|
+
"content-type-builder": {
|
|
111
|
+
visible: boolean;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
attributes: {
|
|
115
|
+
content: {
|
|
116
|
+
type: string;
|
|
117
|
+
configurable: boolean;
|
|
118
|
+
};
|
|
119
|
+
reason: {
|
|
120
|
+
type: string;
|
|
121
|
+
enum: string[];
|
|
122
|
+
default: string;
|
|
123
|
+
configurable: boolean;
|
|
124
|
+
required: boolean;
|
|
125
|
+
};
|
|
126
|
+
resolved: {
|
|
127
|
+
type: string;
|
|
128
|
+
default: boolean;
|
|
129
|
+
configurable: boolean;
|
|
130
|
+
};
|
|
131
|
+
related: {
|
|
132
|
+
type: string;
|
|
133
|
+
relation: string;
|
|
134
|
+
target: string;
|
|
135
|
+
inversedBy: string;
|
|
136
|
+
configurable: boolean;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
export default _default;
|
|
143
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault =
|
|
3
|
+
(this && this.__importDefault) ||
|
|
4
|
+
function (mod) {
|
|
5
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
const comment_1 = __importDefault(require("./comment"));
|
|
9
|
+
const report_1 = __importDefault(require("./report"));
|
|
10
|
+
exports.default = {
|
|
11
|
+
comment: {
|
|
12
|
+
schema: comment_1.default,
|
|
13
|
+
},
|
|
14
|
+
"comment-report": {
|
|
15
|
+
schema: report_1.default,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
info: {
|
|
3
|
+
tableName: string;
|
|
4
|
+
singularName: string;
|
|
5
|
+
pluralName: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
description: string;
|
|
8
|
+
kind: string;
|
|
9
|
+
};
|
|
10
|
+
options: {
|
|
11
|
+
draftAndPublish: boolean;
|
|
12
|
+
};
|
|
13
|
+
pluginOptions: {
|
|
14
|
+
"content-manager": {
|
|
15
|
+
visible: boolean;
|
|
16
|
+
};
|
|
17
|
+
"content-type-builder": {
|
|
18
|
+
visible: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
attributes: {
|
|
22
|
+
content: {
|
|
23
|
+
type: string;
|
|
24
|
+
configurable: boolean;
|
|
25
|
+
};
|
|
26
|
+
reason: {
|
|
27
|
+
type: string;
|
|
28
|
+
enum: string[];
|
|
29
|
+
default: string;
|
|
30
|
+
configurable: boolean;
|
|
31
|
+
required: boolean;
|
|
32
|
+
};
|
|
33
|
+
resolved: {
|
|
34
|
+
type: string;
|
|
35
|
+
default: boolean;
|
|
36
|
+
configurable: boolean;
|
|
37
|
+
};
|
|
38
|
+
related: {
|
|
39
|
+
type: string;
|
|
40
|
+
relation: string;
|
|
41
|
+
target: string;
|
|
42
|
+
inversedBy: string;
|
|
43
|
+
configurable: boolean;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|
|
48
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
info: {
|
|
5
|
+
tableName: "plugin-comments-reports",
|
|
6
|
+
singularName: "comment-report",
|
|
7
|
+
pluralName: "comment-reports",
|
|
8
|
+
displayName: "Reports",
|
|
9
|
+
description: "Reports content type",
|
|
10
|
+
kind: "collectionType",
|
|
11
|
+
},
|
|
12
|
+
options: {
|
|
13
|
+
draftAndPublish: false,
|
|
14
|
+
},
|
|
15
|
+
pluginOptions: {
|
|
16
|
+
"content-manager": {
|
|
17
|
+
visible: false,
|
|
18
|
+
},
|
|
19
|
+
"content-type-builder": {
|
|
20
|
+
visible: false,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
attributes: {
|
|
24
|
+
content: {
|
|
25
|
+
type: "text",
|
|
26
|
+
configurable: false,
|
|
27
|
+
},
|
|
28
|
+
reason: {
|
|
29
|
+
type: "enumeration",
|
|
30
|
+
enum: ["BAD_LANGUAGE", "DISCRIMINATION", "OTHER"],
|
|
31
|
+
default: "OTHER",
|
|
32
|
+
configurable: false,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
resolved: {
|
|
36
|
+
type: "boolean",
|
|
37
|
+
default: false,
|
|
38
|
+
configurable: false,
|
|
39
|
+
},
|
|
40
|
+
related: {
|
|
41
|
+
type: "relation",
|
|
42
|
+
relation: "manyToOne",
|
|
43
|
+
target: "plugin::comments.comment",
|
|
44
|
+
inversedBy: "reports",
|
|
45
|
+
configurable: false,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "strapi-plugin-comments",
|
|
3
|
+
"version": "2.1.0-beta.1",
|
|
4
|
+
"description": "Strapi - Comments plugin",
|
|
5
|
+
"strapi": {
|
|
6
|
+
"name": "comments",
|
|
7
|
+
"displayName": "Comments",
|
|
8
|
+
"description": "Powerful Strapi based comments moderation tool for you and your users",
|
|
9
|
+
"kind": "plugin"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"prepare": "husky install",
|
|
13
|
+
"publish:latest": "cd build && npm publish --tag latest",
|
|
14
|
+
"prepublish:latest": "npm run clean && npm run build && node build/setup-package.js",
|
|
15
|
+
"build": "tsc && yarn copy-translations",
|
|
16
|
+
"build:dev": "yarn run build && cp ./package.json ./build",
|
|
17
|
+
"copy-translations": "copyfiles admin/src/translations/*.json build/",
|
|
18
|
+
"clean": "rm -rf build",
|
|
19
|
+
"develop": "nodemon --exec \"yarn build:dev\"",
|
|
20
|
+
"test:unit": "jest --verbose --coverage",
|
|
21
|
+
"lint": "prettier --check .",
|
|
22
|
+
"format": "prettier --write ."
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/VirtusLab-Open-Source/strapi-plugin-comments"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@strapi/plugin-graphql": "^4.1.6",
|
|
30
|
+
"@strapi/utils": "^4.1.6",
|
|
31
|
+
"bad-words": "^3.0.4"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/bad-words": "^3.0.1",
|
|
35
|
+
"@types/jest": "^27.4.1",
|
|
36
|
+
"codecov": "^3.7.2",
|
|
37
|
+
"copyfiles": "^2.4.1",
|
|
38
|
+
"husky": "7.0.4",
|
|
39
|
+
"jest": "^27.5.1",
|
|
40
|
+
"jest-cli": "^27.5.1",
|
|
41
|
+
"jest-styled-components": "^7.0.8",
|
|
42
|
+
"koa": "2.13.3",
|
|
43
|
+
"nodemon": "^2.0.15",
|
|
44
|
+
"prettier": "^2.6.0",
|
|
45
|
+
"rimraf": "^3.0.2",
|
|
46
|
+
"ts-jest": "^27.1.3",
|
|
47
|
+
"ts-node": "^10.7.0",
|
|
48
|
+
"strapi-typed": "^1.0.5",
|
|
49
|
+
"typescript": "^4.5.5"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"@strapi/strapi": "4.x"
|
|
53
|
+
},
|
|
54
|
+
"nodemonConfig": {
|
|
55
|
+
"ignore": [
|
|
56
|
+
"./build/**/*",
|
|
57
|
+
"./__mocks__/*",
|
|
58
|
+
"./**/__tests__/*"
|
|
59
|
+
],
|
|
60
|
+
"ext": "js,json,ts"
|
|
61
|
+
},
|
|
62
|
+
"husky": {
|
|
63
|
+
"hooks": {
|
|
64
|
+
"pre-commit": "yarn format && yarn test:unit"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"author": {
|
|
68
|
+
"name": "VirtusLab",
|
|
69
|
+
"email": "strapi@virtuslab.com",
|
|
70
|
+
"url": "https://virtuslab.com"
|
|
71
|
+
},
|
|
72
|
+
"maintainers": [
|
|
73
|
+
{
|
|
74
|
+
"name": "VirtusLab // Mateusz Ziarko",
|
|
75
|
+
"email": "mziarko@virtuslab.com",
|
|
76
|
+
"url": "https://virtuslab.com"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "VirtusLab // Maksymilian Pamuła",
|
|
80
|
+
"email": "mpamula@virtuslab.com",
|
|
81
|
+
"url": "https://virtuslab.com"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"engines": {
|
|
85
|
+
"node": ">=14.x.x <=17.x.x",
|
|
86
|
+
"npm": ">=7.x.x"
|
|
87
|
+
},
|
|
88
|
+
"keywords": [
|
|
89
|
+
"strapi",
|
|
90
|
+
"plugin",
|
|
91
|
+
"comments"
|
|
92
|
+
],
|
|
93
|
+
"license": "MIT"
|
|
94
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ToBeFixed } from "./types/common";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
render: (uid: ToBeFixed) => string;
|
|
4
|
+
comments: {
|
|
5
|
+
read: string;
|
|
6
|
+
moderate: string;
|
|
7
|
+
};
|
|
8
|
+
reports: {
|
|
9
|
+
read: string;
|
|
10
|
+
action: string;
|
|
11
|
+
};
|
|
12
|
+
settings: {
|
|
13
|
+
read: string;
|
|
14
|
+
change: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
render: (uid) => `plugin::comments.${uid}`,
|
|
5
|
+
comments: {
|
|
6
|
+
read: "read",
|
|
7
|
+
moderate: "moderate",
|
|
8
|
+
},
|
|
9
|
+
reports: {
|
|
10
|
+
read: "reports.read",
|
|
11
|
+
action: "reports.action",
|
|
12
|
+
},
|
|
13
|
+
settings: {
|
|
14
|
+
read: "settings.read",
|
|
15
|
+
change: "settings.change",
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=permissions.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault =
|
|
3
|
+
(this && this.__importDefault) ||
|
|
4
|
+
function (mod) {
|
|
5
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
6
|
+
};
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
8
|
+
const permissions_1 = __importDefault(require("./../permissions"));
|
|
9
|
+
const functions_1 = require("./utils/functions");
|
|
10
|
+
module.exports = async ({ strapi }) => {
|
|
11
|
+
if (strapi.plugin("graphql")) {
|
|
12
|
+
const config = await (0, functions_1.getPluginService)(
|
|
13
|
+
"common"
|
|
14
|
+
).getConfig();
|
|
15
|
+
const { enabledCollections } = config;
|
|
16
|
+
if (!(0, lodash_1.isEmpty)(enabledCollections)) {
|
|
17
|
+
await require("./graphql")({ strapi, config });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (Object.keys(strapi.plugins).indexOf("users-permissions") === -1) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
"In order to make the comments plugin work the users-permissions plugin is required"
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
const actions = [
|
|
26
|
+
{
|
|
27
|
+
section: "plugins",
|
|
28
|
+
displayName: "Comments: Read",
|
|
29
|
+
uid: permissions_1.default.comments.read,
|
|
30
|
+
pluginName: "comments",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
section: "plugins",
|
|
34
|
+
displayName: "Comments: Moderate",
|
|
35
|
+
uid: permissions_1.default.comments.moderate,
|
|
36
|
+
pluginName: "comments",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
section: "plugins",
|
|
40
|
+
displayName: "Reports: Read",
|
|
41
|
+
uid: permissions_1.default.reports.read,
|
|
42
|
+
pluginName: "comments",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
section: "plugins",
|
|
46
|
+
displayName: "Reports: Moderate",
|
|
47
|
+
uid: permissions_1.default.reports.action,
|
|
48
|
+
pluginName: "comments",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
section: "plugins",
|
|
52
|
+
displayName: "Settings: Read",
|
|
53
|
+
uid: permissions_1.default.settings.read,
|
|
54
|
+
pluginName: "comments",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
section: "plugins",
|
|
58
|
+
displayName: "Settings: Change",
|
|
59
|
+
uid: permissions_1.default.settings.change,
|
|
60
|
+
pluginName: "comments",
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
await strapi.admin.services.permission.actionProvider.registerMany(actions);
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config = {
|
|
4
|
+
default: {
|
|
5
|
+
enabledCollections: [],
|
|
6
|
+
moderatorRoles: [],
|
|
7
|
+
approvalFlow: [],
|
|
8
|
+
entryLabel: {
|
|
9
|
+
"*": ["Title", "title", "Name", "name", "Subject", "subject"],
|
|
10
|
+
},
|
|
11
|
+
reportReasons: {
|
|
12
|
+
BAD_LANGUAGE: "BAD_LANGUAGE",
|
|
13
|
+
DISCRIMINATION: "DISCRIMINATION",
|
|
14
|
+
OTHER: "OTHER",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
exports.default = config;
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const functions_1 = require("./../utils/functions");
|
|
4
|
+
const functions_2 = require("./utils/functions");
|
|
5
|
+
const controllers = {
|
|
6
|
+
getService(name = "admin") {
|
|
7
|
+
return (0, functions_1.getPluginService)(name);
|
|
8
|
+
},
|
|
9
|
+
async config(ctx) {
|
|
10
|
+
try {
|
|
11
|
+
return await this.getService().config();
|
|
12
|
+
} catch (e) {
|
|
13
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
async settingsConfig(ctx) {
|
|
17
|
+
try {
|
|
18
|
+
return this.getService().config(true);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
async settingsUpdateConfig(ctx) {
|
|
24
|
+
try {
|
|
25
|
+
const {
|
|
26
|
+
request: { body },
|
|
27
|
+
} = ctx;
|
|
28
|
+
(0, functions_1.assertNotEmpty)(body);
|
|
29
|
+
return this.getService().updateConfig(body);
|
|
30
|
+
} catch (e) {
|
|
31
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
async settingsRestoreConfig(ctx) {
|
|
35
|
+
try {
|
|
36
|
+
return this.getService().restoreConfig();
|
|
37
|
+
} catch (e) {
|
|
38
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
async settingsRestart(ctx) {
|
|
42
|
+
try {
|
|
43
|
+
await this.getService().restart();
|
|
44
|
+
return ctx.send({ status: 200 });
|
|
45
|
+
} catch (e) {
|
|
46
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
async findAll(ctx) {
|
|
50
|
+
return this.getService().findAll(ctx.query);
|
|
51
|
+
},
|
|
52
|
+
async findOne(ctx) {
|
|
53
|
+
const { params = {}, query } = ctx;
|
|
54
|
+
const { id } = (0, functions_2.parseParams)(params);
|
|
55
|
+
try {
|
|
56
|
+
return await this.getService().findOneAndThread(id, query);
|
|
57
|
+
} catch (e) {
|
|
58
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
async blockComment(ctx) {
|
|
62
|
+
const { params = {} } = ctx;
|
|
63
|
+
const { id } = (0, functions_2.parseParams)(params);
|
|
64
|
+
try {
|
|
65
|
+
return await this.getService().blockComment(id, true);
|
|
66
|
+
} catch (e) {
|
|
67
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
async unblockComment(ctx) {
|
|
71
|
+
const { params = {} } = ctx;
|
|
72
|
+
const { id } = (0, functions_2.parseParams)(params);
|
|
73
|
+
try {
|
|
74
|
+
return await this.getService().blockComment(id, false);
|
|
75
|
+
} catch (e) {
|
|
76
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
async blockCommentThread(ctx) {
|
|
80
|
+
const { params = {} } = ctx;
|
|
81
|
+
const { id } = (0, functions_2.parseParams)(params);
|
|
82
|
+
try {
|
|
83
|
+
return await this.getService().blockCommentThread(id, true);
|
|
84
|
+
} catch (e) {
|
|
85
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
async unblockCommentThread(ctx) {
|
|
89
|
+
const { params = {} } = ctx;
|
|
90
|
+
const { id } = (0, functions_2.parseParams)(params);
|
|
91
|
+
try {
|
|
92
|
+
return await this.getService().blockCommentThread(id, false);
|
|
93
|
+
} catch (e) {
|
|
94
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
async resolveAbuseReport(ctx) {
|
|
98
|
+
const { params = {} } = ctx;
|
|
99
|
+
const { id: commentId, reportId } = (0, functions_2.parseParams)(params);
|
|
100
|
+
try {
|
|
101
|
+
return await this.getService().resolveAbuseReport(reportId, commentId);
|
|
102
|
+
} catch (e) {
|
|
103
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
async approveComment(ctx) {
|
|
107
|
+
const { id } = (0, functions_2.parseParams)(ctx.params || {});
|
|
108
|
+
try {
|
|
109
|
+
return await this.getService().approveComment(id);
|
|
110
|
+
} catch (e) {
|
|
111
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
async rejectComment(ctx) {
|
|
115
|
+
const { id } = (0, functions_2.parseParams)(ctx.params || {});
|
|
116
|
+
try {
|
|
117
|
+
return await this.getService().rejectComment(id);
|
|
118
|
+
} catch (e) {
|
|
119
|
+
throw (0, functions_2.throwError)(ctx, e);
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
exports.default = controllers;
|
|
124
|
+
//# sourceMappingURL=admin.js.map
|