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.
Files changed (266) hide show
  1. package/README.md +45 -11
  2. package/admin/src/translations/en.json +1 -0
  3. package/admin/src/translations/fr.json +132 -1
  4. package/admin/src/translations/pt-BR.json +132 -0
  5. package/build/README.md +818 -0
  6. package/build/admin/src/components/ActionButton/styles.d.ts +2 -0
  7. package/build/admin/src/components/ActionButton/styles.js +17 -0
  8. package/build/admin/src/components/ConfirmationDialog/index.d.ts +26 -0
  9. package/build/admin/src/components/ConfirmationDialog/index.js +104 -0
  10. package/build/admin/src/components/DiscussionStatus/index.d.ts +9 -0
  11. package/build/admin/src/components/DiscussionStatus/index.js +38 -0
  12. package/build/admin/src/components/DiscussionThread/index.d.ts +16 -0
  13. package/build/admin/src/components/DiscussionThread/index.js +99 -0
  14. package/build/admin/src/components/DiscussionThreadItem/index.d.ts +9 -0
  15. package/build/admin/src/components/DiscussionThreadItem/index.js +72 -0
  16. package/build/admin/src/components/DiscussionThreadItem/styles.d.ts +4 -0
  17. package/build/admin/src/components/DiscussionThreadItem/styles.js +27 -0
  18. package/build/admin/src/components/DiscussionThreadItemActions/index.d.ts +19 -0
  19. package/build/admin/src/components/DiscussionThreadItemActions/index.js +414 -0
  20. package/build/admin/src/components/DiscussionThreadItemActions/styles.d.ts +2 -0
  21. package/build/admin/src/components/DiscussionThreadItemActions/styles.js +17 -0
  22. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +17 -0
  23. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +103 -0
  24. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +2 -0
  25. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.js +15 -0
  26. package/build/admin/src/components/DiscussionThreadItemFooter/index.d.ts +16 -0
  27. package/build/admin/src/components/DiscussionThreadItemFooter/index.js +73 -0
  28. package/build/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +3 -0
  29. package/build/admin/src/components/DiscussionThreadItemFooter/styles.js +25 -0
  30. package/build/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +30 -0
  31. package/build/admin/src/components/DiscussionThreadItemReviewAction/index.js +233 -0
  32. package/build/admin/src/components/FormSwitch/index.d.ts +11 -0
  33. package/build/admin/src/components/FormSwitch/index.js +39 -0
  34. package/build/admin/src/components/FormSwitch/styles.d.ts +2 -0
  35. package/build/admin/src/components/FormSwitch/styles.js +16 -0
  36. package/build/admin/src/components/IconButton/styles.d.ts +2 -0
  37. package/build/admin/src/components/IconButton/styles.js +27 -0
  38. package/build/admin/src/components/Initializer/index.d.ts +3 -0
  39. package/build/admin/src/components/Initializer/index.js +14 -0
  40. package/build/admin/src/components/LoadingIndicatorOverlay/index.d.ts +3 -0
  41. package/build/admin/src/components/LoadingIndicatorOverlay/index.js +18 -0
  42. package/build/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +3 -0
  43. package/build/admin/src/components/LoadingIndicatorOverlay/styles.js +32 -0
  44. package/build/admin/src/components/Nav/index.d.ts +7 -0
  45. package/build/admin/src/components/Nav/index.js +72 -0
  46. package/build/admin/src/components/PluginIcon/index.d.ts +3 -0
  47. package/build/admin/src/components/PluginIcon/index.js +13 -0
  48. package/build/admin/src/components/ReportsReviewModal/index.d.ts +21 -0
  49. package/build/admin/src/components/ReportsReviewModal/index.js +72 -0
  50. package/build/admin/src/components/ReportsReviewTable/index.d.ts +21 -0
  51. package/build/admin/src/components/ReportsReviewTable/index.js +321 -0
  52. package/build/admin/src/components/StatusBadge/index.d.ts +11 -0
  53. package/build/admin/src/components/StatusBadge/index.js +22 -0
  54. package/build/admin/src/components/StatusBadge/styles.d.ts +2 -0
  55. package/build/admin/src/components/StatusBadge/styles.js +25 -0
  56. package/build/admin/src/components/TableFilters/index.d.ts +10 -0
  57. package/build/admin/src/components/TableFilters/index.js +109 -0
  58. package/build/admin/src/components/TablePagination/index.d.ts +15 -0
  59. package/build/admin/src/components/TablePagination/index.js +45 -0
  60. package/build/admin/src/components/icons/comments.d.ts +9 -0
  61. package/build/admin/src/components/icons/comments.js +23 -0
  62. package/build/admin/src/components/icons/index.d.ts +6 -0
  63. package/build/admin/src/components/icons/index.js +21 -0
  64. package/build/admin/src/components/icons/lock.d.ts +11 -0
  65. package/build/admin/src/components/icons/lock.js +29 -0
  66. package/build/admin/src/components/icons/review.d.ts +11 -0
  67. package/build/admin/src/components/icons/review.js +31 -0
  68. package/build/admin/src/components/icons/unlock.d.ts +11 -0
  69. package/build/admin/src/components/icons/unlock.js +29 -0
  70. package/build/admin/src/hooks/useConfig.d.ts +8 -0
  71. package/build/admin/src/hooks/useConfig.js +52 -0
  72. package/build/admin/src/index.d.ts +7 -0
  73. package/build/admin/src/index.js +137 -0
  74. package/build/admin/src/pages/App/index.d.ts +4 -0
  75. package/build/admin/src/pages/App/index.js +90 -0
  76. package/build/admin/src/pages/App/reducer/actions.d.ts +8 -0
  77. package/build/admin/src/pages/App/reducer/actions.js +12 -0
  78. package/build/admin/src/pages/App/reducer/constants.d.ts +4 -0
  79. package/build/admin/src/pages/App/reducer/constants.js +7 -0
  80. package/build/admin/src/pages/App/reducer/index.d.ts +14 -0
  81. package/build/admin/src/pages/App/reducer/index.js +31 -0
  82. package/build/admin/src/pages/App/reducer/init.d.ts +3 -0
  83. package/build/admin/src/pages/App/reducer/init.js +9 -0
  84. package/build/admin/src/pages/App/reducer/selectors.d.ts +6 -0
  85. package/build/admin/src/pages/App/reducer/selectors.js +20 -0
  86. package/build/admin/src/pages/App/utils/api.d.ts +2 -0
  87. package/build/admin/src/pages/App/utils/api.js +16 -0
  88. package/build/admin/src/pages/ComingSoonPage/index.d.ts +3 -0
  89. package/build/admin/src/pages/ComingSoonPage/index.js +78 -0
  90. package/build/admin/src/pages/Details/components/DetailsEntity/index.d.ts +18 -0
  91. package/build/admin/src/pages/Details/components/DetailsEntity/index.js +132 -0
  92. package/build/admin/src/pages/Details/components/DetailsFilters/index.d.ts +12 -0
  93. package/build/admin/src/pages/Details/components/DetailsFilters/index.js +48 -0
  94. package/build/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +2 -0
  95. package/build/admin/src/pages/Details/components/DetailsFilters/styles.js +16 -0
  96. package/build/admin/src/pages/Details/index.d.ts +4 -0
  97. package/build/admin/src/pages/Details/index.js +216 -0
  98. package/build/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +20 -0
  99. package/build/admin/src/pages/Discover/components/DiscoverTableRow/index.js +344 -0
  100. package/build/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +2 -0
  101. package/build/admin/src/pages/Discover/components/DiscoverTableRow/styles.js +16 -0
  102. package/build/admin/src/pages/Discover/index.d.ts +4 -0
  103. package/build/admin/src/pages/Discover/index.js +332 -0
  104. package/build/admin/src/pages/Discover/utils/api.d.ts +2 -0
  105. package/build/admin/src/pages/Discover/utils/api.js +23 -0
  106. package/build/admin/src/pages/Discover/utils/filtersSchema.d.ts +11 -0
  107. package/build/admin/src/pages/Discover/utils/filtersSchema.js +11 -0
  108. package/build/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +2 -0
  109. package/build/admin/src/pages/Settings/components/RestartAlert/styles.js +16 -0
  110. package/build/admin/src/pages/Settings/index.d.ts +3 -0
  111. package/build/admin/src/pages/Settings/index.js +712 -0
  112. package/build/admin/src/pages/Settings/utils/api.d.ts +7 -0
  113. package/build/admin/src/pages/Settings/utils/api.js +80 -0
  114. package/build/admin/src/pages/utils/api.d.ts +12 -0
  115. package/build/admin/src/pages/utils/api.js +83 -0
  116. package/build/admin/src/permissions.d.ts +28 -0
  117. package/build/admin/src/permissions.js +65 -0
  118. package/build/admin/src/pluginId.d.ts +2 -0
  119. package/build/admin/src/pluginId.js +50 -0
  120. package/build/admin/src/reducers.d.ts +12 -0
  121. package/build/admin/src/reducers.js +14 -0
  122. package/build/admin/src/translations/en.json +132 -0
  123. package/build/admin/src/translations/fr.json +1 -0
  124. package/build/admin/src/translations/pt-BR.json +132 -0
  125. package/build/admin/src/utils/axiosInstance.d.ts +3 -0
  126. package/build/admin/src/utils/axiosInstance.js +37 -0
  127. package/build/admin/src/utils/constants.d.ts +25 -0
  128. package/build/admin/src/utils/constants.js +30 -0
  129. package/build/admin/src/utils/getApiUrl.d.ts +3 -0
  130. package/build/admin/src/utils/getApiUrl.js +6 -0
  131. package/build/admin/src/utils/getMessage.d.ts +4 -0
  132. package/build/admin/src/utils/getMessage.js +25 -0
  133. package/build/admin/src/utils/getRelatedGroups.d.ts +4 -0
  134. package/build/admin/src/utils/getRelatedGroups.js +6 -0
  135. package/build/admin/src/utils/getUrl.d.ts +3 -0
  136. package/build/admin/src/utils/getUrl.js +6 -0
  137. package/build/admin/src/utils/handleAPIError.d.ts +4 -0
  138. package/build/admin/src/utils/handleAPIError.js +20 -0
  139. package/build/admin/src/utils/index.d.ts +12 -0
  140. package/build/admin/src/utils/index.js +97 -0
  141. package/build/admin/src/utils/parseRegExp.d.ts +6 -0
  142. package/build/admin/src/utils/parseRegExp.js +11 -0
  143. package/build/admin/src/utils/renderEntryTitle.d.ts +4 -0
  144. package/build/admin/src/utils/renderEntryTitle.js +16 -0
  145. package/build/admin/src/utils/renderInitials.d.ts +3 -0
  146. package/build/admin/src/utils/renderInitials.js +11 -0
  147. package/build/admin/src/utils/resolveCommentStatus.d.ts +4 -0
  148. package/build/admin/src/utils/resolveCommentStatus.js +32 -0
  149. package/build/admin/src/utils/resolveCommentStatusColor.d.ts +4 -0
  150. package/build/admin/src/utils/resolveCommentStatusColor.js +22 -0
  151. package/build/content-types/comment.d.ts +91 -0
  152. package/build/content-types/comment.js +92 -0
  153. package/build/content-types/index.d.ts +143 -0
  154. package/build/content-types/index.js +18 -0
  155. package/build/content-types/report.d.ts +48 -0
  156. package/build/content-types/report.js +49 -0
  157. package/build/package.json +94 -0
  158. package/build/permissions.d.ts +18 -0
  159. package/build/permissions.js +18 -0
  160. package/build/server/bootstrap.d.ts +4 -0
  161. package/build/server/bootstrap.js +65 -0
  162. package/build/server/config/index.d.ts +4 -0
  163. package/build/server/config/index.js +19 -0
  164. package/build/server/controllers/admin.d.ts +4 -0
  165. package/build/server/controllers/admin.js +124 -0
  166. package/build/server/controllers/client.d.ts +4 -0
  167. package/build/server/controllers/client.js +111 -0
  168. package/build/server/controllers/index.d.ts +6 -0
  169. package/build/server/controllers/index.js +15 -0
  170. package/build/server/controllers/utils/functions.d.ts +7 -0
  171. package/build/server/controllers/utils/functions.js +24 -0
  172. package/build/server/controllers/utils/parsers.d.ts +15 -0
  173. package/build/server/controllers/utils/parsers.js +25 -0
  174. package/build/server/destroy.d.ts +3 -0
  175. package/build/server/destroy.js +3 -0
  176. package/build/server/graphql/index.d.ts +4 -0
  177. package/build/server/graphql/index.js +37 -0
  178. package/build/server/graphql/mutations/createAbuseReport.d.ts +11 -0
  179. package/build/server/graphql/mutations/createAbuseReport.js +27 -0
  180. package/build/server/graphql/mutations/createComment.d.ts +14 -0
  181. package/build/server/graphql/mutations/createComment.js +26 -0
  182. package/build/server/graphql/mutations/index.d.ts +4 -0
  183. package/build/server/graphql/mutations/index.js +28 -0
  184. package/build/server/graphql/mutations/removeComment.d.ts +11 -0
  185. package/build/server/graphql/mutations/removeComment.js +27 -0
  186. package/build/server/graphql/mutations/updateComment.d.ts +11 -0
  187. package/build/server/graphql/mutations/updateComment.js +27 -0
  188. package/build/server/graphql/queries/findAllFlat.d.ts +19 -0
  189. package/build/server/graphql/queries/findAllFlat.js +47 -0
  190. package/build/server/graphql/queries/findAllInHierarchy.d.ts +18 -0
  191. package/build/server/graphql/queries/findAllInHierarchy.js +38 -0
  192. package/build/server/graphql/queries/index.d.ts +4 -0
  193. package/build/server/graphql/queries/index.js +24 -0
  194. package/build/server/graphql/resolvers-config.d.ts +23 -0
  195. package/build/server/graphql/resolvers-config.js +13 -0
  196. package/build/server/graphql/types/comment-author.d.ts +4 -0
  197. package/build/server/graphql/types/comment-author.js +12 -0
  198. package/build/server/graphql/types/comment-nested.d.ts +4 -0
  199. package/build/server/graphql/types/comment-nested.js +19 -0
  200. package/build/server/graphql/types/comment.d.ts +4 -0
  201. package/build/server/graphql/types/comment.js +18 -0
  202. package/build/server/graphql/types/create-comment-author.d.ts +4 -0
  203. package/build/server/graphql/types/create-comment-author.js +12 -0
  204. package/build/server/graphql/types/create-comment.d.ts +4 -0
  205. package/build/server/graphql/types/create-comment.js +12 -0
  206. package/build/server/graphql/types/create-report.d.ts +4 -0
  207. package/build/server/graphql/types/create-report.js +12 -0
  208. package/build/server/graphql/types/id.d.ts +4 -0
  209. package/build/server/graphql/types/id.js +26 -0
  210. package/build/server/graphql/types/identify-comment-author.d.ts +4 -0
  211. package/build/server/graphql/types/identify-comment-author.js +9 -0
  212. package/build/server/graphql/types/index.d.ts +4 -0
  213. package/build/server/graphql/types/index.js +44 -0
  214. package/build/server/graphql/types/remove-comment.d.ts +4 -0
  215. package/build/server/graphql/types/remove-comment.js +11 -0
  216. package/build/server/graphql/types/report-reason.d.ts +4 -0
  217. package/build/server/graphql/types/report-reason.js +12 -0
  218. package/build/server/graphql/types/report.d.ts +4 -0
  219. package/build/server/graphql/types/report.js +14 -0
  220. package/build/server/graphql/types/response-find-all.d.ts +4 -0
  221. package/build/server/graphql/types/response-find-all.js +10 -0
  222. package/build/server/graphql/types/response-meta.d.ts +4 -0
  223. package/build/server/graphql/types/response-meta.js +9 -0
  224. package/build/server/graphql/types/response-pagination.d.ts +4 -0
  225. package/build/server/graphql/types/response-pagination.js +14 -0
  226. package/build/server/graphql/types/update-comment.d.ts +4 -0
  227. package/build/server/graphql/types/update-comment.js +12 -0
  228. package/build/server/index.d.ts +26 -0
  229. package/build/server/index.js +25 -0
  230. package/build/server/register.d.ts +3 -0
  231. package/build/server/register.js +3 -0
  232. package/build/server/routes/admin.d.ts +4 -0
  233. package/build/server/routes/admin.js +118 -0
  234. package/build/server/routes/client.d.ts +4 -0
  235. package/build/server/routes/client.js +54 -0
  236. package/build/server/routes/index.d.ts +11 -0
  237. package/build/server/routes/index.js +21 -0
  238. package/build/server/services/admin.d.ts +5 -0
  239. package/build/server/services/admin.js +296 -0
  240. package/build/server/services/client.d.ts +5 -0
  241. package/build/server/services/client.js +247 -0
  242. package/build/server/services/common.d.ts +5 -0
  243. package/build/server/services/common.js +266 -0
  244. package/build/server/services/graphql.d.ts +5 -0
  245. package/build/server/services/graphql.js +136 -0
  246. package/build/server/services/index.d.ts +8 -0
  247. package/build/server/services/index.js +16 -0
  248. package/build/server/services/utils/functions.d.ts +13 -0
  249. package/build/server/services/utils/functions.js +141 -0
  250. package/build/server/utils/constants.d.ts +9 -0
  251. package/build/server/utils/constants.js +23 -0
  252. package/build/server/utils/error.d.ts +23 -0
  253. package/build/server/utils/error.js +29 -0
  254. package/build/server/utils/functions.d.ts +14 -0
  255. package/build/server/utils/functions.js +50 -0
  256. package/build/strapi-admin.d.ts +3 -0
  257. package/build/strapi-admin.js +10 -0
  258. package/build/strapi-server.d.ts +177 -0
  259. package/build/strapi-server.js +46 -0
  260. package/build/tsconfig.tsbuildinfo +1 -0
  261. package/build/types/contentTypes.d.ts +46 -0
  262. package/build/types/contentTypes.js +3 -0
  263. package/package.json +3 -3
  264. package/server/controllers/client.js +0 -3
  265. package/server/graphql/queries/findAllFlat.js +6 -2
  266. 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,4 @@
1
+ import { StrapiContext } from "strapi-typed";
2
+ declare const _default: ({ strapi }: StrapiContext) => Promise<void>;
3
+ export = _default;
4
+ //# sourceMappingURL=bootstrap.d.ts.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,4 @@
1
+ import { StrapiConfig } from "../../types";
2
+ declare const config: StrapiConfig;
3
+ export default config;
4
+ //# sourceMappingURL=index.d.ts.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,4 @@
1
+ import { IControllerAdmin } from "../../types";
2
+ declare const controllers: IControllerAdmin;
3
+ export default controllers;
4
+ //# sourceMappingURL=admin.d.ts.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
@@ -0,0 +1,4 @@
1
+ import { IControllerClient } from "../../types";
2
+ declare const controllers: IControllerClient;
3
+ export default controllers;
4
+ //# sourceMappingURL=client.d.ts.map